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.

HTTP
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

Shell
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

workspace_id

string

Yes

Current workspace ID.

file

file

Yes

Skill package in .zip format. The maximum compressed package size is 50 MiB, and the total size after decompression is maximum 100 MiB. Maximum 500 entries, maximum single file 10 MiB.

Successful response

JSON
{
  "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

code

integer

0 on success.

data

object

The result of this request.

data.name

string

Name.

data.description

string

Description

data.category

string

classification.

data.archive_digest

string

Skill pack summary.

data.tags

array or null

label.

data.instruction

object

An empty object is returned when the skill command has no subfields.

data.instruction.body

string

Instruction text. Can be omitted if empty or not set.

data.instruction.variables_schema

object

JSON Schema of directive variables. Can be omitted if empty or not set.

data.files

array

Skill file metadata.

data.files[].file_path

string

Relative file path within the skill package. Can be omitted if empty or not set.

data.files[].file_kind

string

File category. Preferable manifest, reference, asset, script, other. Can be omitted if empty or not set.

data.files[].media_type

string

File media type. Can be omitted if empty or not set.

data.files[].sha256

string

SHA-256 digest of the file contents. Can be omitted if empty or not set.

data.files[].size_bytes

integer

File size in bytes. Can be omitted if empty or not set.

data.warnings

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.

JSON
{
  "code": 2,
  "message": "<错误信息>",
  "details": {
    "reason": "SKILL_PACKAGE_INVALID_ZIP"
  }
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Common reasons: The ZIP format, directory structure, SKILL.md, frontmatter or path does not meet the requirements. Recommended Action: Correct the skill package according to details.reason and try again.

413

8(RESOURCE_EXHAUSTED)

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.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

Last updated on