Files
playbook/cangjie-skill/schemas/registry-entry-v2.schema.json
T
2026-08-31 05:00:46 +08:00

79 lines
2.8 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cangjie-skill.org/schemas/registry-entry-v2.schema.json",
"title": "Cangjie Skill Registry Entry v2",
"description": "支持 single / pack 输出模式的新契约(方案 §11.5、ADR-004)。skill_count 是兼容别名,必须等于 entrypoint_count(由校验脚本检查)。",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"slug",
"name",
"summary",
"source_type",
"source_url",
"output_mode",
"skill_count",
"entrypoint_count",
"capability_count",
"domains",
"language",
"status",
"quality",
"use_cases"
],
"properties": {
"schema_version": { "const": 2 },
"slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
"name": { "type": "string", "minLength": 2, "maxLength": 80 },
"summary": { "type": "string", "minLength": 10, "maxLength": 240 },
"source_type": { "enum": ["github", "bundled"] },
"source_url": { "type": "string", "format": "uri", "pattern": "^https://github\\.com/" },
"skill_path": { "type": "string", "pattern": "^[^/].*" },
"output_mode": { "enum": ["single", "pack", "legacy-pack"] },
"skill_count": { "type": "integer", "minimum": 1 },
"entrypoint_count": { "type": "integer", "minimum": 1, "description": "宿主可发现入口数;single 恒为 1" },
"capability_count": { "type": "integer", "minimum": 1, "description": "经验证的能力总数,允许大于入口数" },
"router_entrypoint": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "description": "pack 模式的来源路由入口 slug" },
"domains": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 2, "maxLength": 30 }
},
"language": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "enum": ["zh-CN", "en", "ja"] }
},
"status": { "enum": ["active", "experimental", "archived"] },
"quality": { "enum": ["verified", "community", "experimental"] },
"featured": { "type": "boolean", "default": false },
"use_cases": {
"type": "array",
"minItems": 1,
"maxItems": 6,
"items": { "type": "string", "minLength": 4, "maxLength": 100 }
},
"install": {
"type": "object",
"additionalProperties": false,
"properties": {
"clone": { "type": "string", "minLength": 8 },
"copy": { "type": "string", "minLength": 8 }
}
}
},
"allOf": [
{
"if": { "properties": { "output_mode": { "const": "single" } } },
"then": { "properties": { "entrypoint_count": { "const": 1 } } }
},
{
"if": { "properties": { "output_mode": { "const": "pack" } } },
"then": { "required": ["router_entrypoint"] }
}
]
}