Check skill pack¶
Verify and preview the skill ZIP package to be imported without creating the skill or saving the file. Passing the check only means that the package conforms to the import format, and the import interface still needs to be called to create the skill.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/import/inspect
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare the personal access token, target workspace ID, and local skill package file that can access the target workspace.
Path parameters¶
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/import/inspect" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-F "file=@./skill-package.zip"
The compressed package must contain only one SKILL.md. Files can be located in the root directory of the archive, or in a single top-level directory.
The YAML frontmatter for SKILL.md must contain name and description. The body must contain non-empty instructions.
Submit the file using multipart/form-data. curl -F in the example will set the request header, do not add Content-Type: application/json.
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
|
file |
Yes |
Skill package in |
Successful response¶
{
"code": 0,
"data": {
"name": "摘要技能",
"description": "总结输入内容。",
"category": "文本处理",
"tags": [
"摘要"
],
"instruction": {
"body": "总结用户提供的内容。"
},
"files": [
{
"file_path": "SKILL.md",
"file_kind": "manifest",
"media_type": "text/markdown",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size_bytes": 512
}
],
"warnings": null,
"archive_digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
The result of this request. |
|
string |
Name. |
|
string |
Description |
|
string |
classification. |
|
string |
Skill pack summary. |
|
array or null |
label. |
|
object |
An empty object is returned when the skill command has no subfields. |
|
string |
Instruction text. Can be omitted if empty or not set. |
|
object |
JSON Schema of directive variables. Can be omitted if empty or not set. |
|
array |
Skill file metadata. |
|
string |
Relative file path within the skill package. Can be omitted if empty or not set. |
|
string |
File category. Preferable |
|
string |
File media type. Can be omitted if empty or not set. |
|
string |
SHA-256 digest of the file contents. Can be omitted if empty or not set. |
|
integer |
File size in bytes. Can be omitted if empty or not set. |
|
array or null |
Non-blocking warning. |
Error response¶
When processing skill packages, insufficient permissions or unavailable dependencies will also return HTTP 400, code=2, and return SKILL_PACKAGE_INVALID. Authentication failures use a separate authentication error format.
{
"code": 2,
"message": "<错误信息>",
"details": {
"reason": "SKILL_PACKAGE_INVALID_ZIP"
}
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The ZIP format, directory structure, |
|
|
Common reasons: The compressed package exceeds 50 MiB, or the total size after decompression exceeds 100 MiB. Recommended Action: Reduce the size of the package or remove unnecessary files. |
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |