The Agent Skills Directory
npx skills add https://smithery.ai/skills/epieczko/command-define验证并注册命令清单文件(YAML),以将新的斜杠命令集成到 Betty 中。
command.define 技能充当 Betty 命令的“编译器”。它确保命令清单满足所有模式要求,然后用新命令更新命令注册表(/registry/commands.json)。
此技能是 Betty 第 1 层(命令)基础设施的一部分,使开发人员能够创建面向用户的斜杠命令,这些命令可以委托给代理、工作流或技能。
python skills/command.define/command_define.py <path_to_command.yaml>
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| manifest_path | string | 是 | 要验证和注册的命令清单 YAML 的路径 |
模式验证 – 检查必填字段(name、version、description、execution)是否存在且格式正确(例如,名称必须以 / 开头)。
参数验证 – 验证清单中的每个参数是否具有 name、type 和 description,并验证执行目标(代理/技能/工作流)是否实际存在于系统中。
注册表更新 – 成功后,将命令条目添加到 /registry/commands.json,状态为 active。
/ 开头,例如 /api-design)0.1.0)execution 字段必须包含:
skill、agent 或 workflow 之一/registry/skills.json 中/registry/agents.json 中/workflows/{target}.yamlname(必需):参数名称type(必需):参数类型(string、number、boolean 等)required(可选):参数是否必需description(可选):参数描述default(可选):默认值draft 或 active,默认为 draft){
"ok": true,
"status": "registered",
"errors": [],
"path": "commands/hello.yaml",
"details": {
"valid": true,
"status": "registered",
"registry_updated": true,
"manifest": {
"name": "/hello",
"version": "0.1.0",
"description": "Prints Hello World",
"execution": {
"type": "skill",
"target": "test.hello"
}
}
}
}
{
"ok": false,
"status": "failed",
"errors": [
"Skill 'test.hello' not found in skill registry"
],
"path": "commands/hello.yaml",
"details": {
"valid": false,
"errors": [
"Skill 'test.hello' not found in skill registry"
],
"path": "commands/hello.yaml"
}
}
# commands/api-design.yaml
name: /api-design
version: 0.1.0
description: "Design a new API following enterprise guidelines"
parameters:
- name: service_name
type: string
required: true
description: "Name of the service/API"
- name: spec_type
type: string
required: false
default: openapi
description: "Type of API specification (openapi or asyncapi)"
execution:
type: agent
target: api.designer
status: active
tags: [api, design, enterprise]
$ python skills/command.define/command_define.py commands/api-design.yaml
{
"ok": true,
"status": "registered",
"errors": [],
"path": "commands/api-design.yaml",
"details": {
"valid": true,
"status": "registered",
"registry_updated": true
}
}
如果目标代理不存在:
$ python skills/command.define/command_define.py commands/hello.yaml
{
"ok": false,
"status": "failed",
"errors": [
"Agent 'api.designer' not found in agent registry"
],
"path": "commands/hello.yaml"
}
命令可以作为工作流的一部分进行验证:
# workflows/register_command.yaml
steps:
- skill: command.define
args:
- "commands/my-command.yaml"
required: true
在编辑命令时自动验证命令:
# Create a hook that validates command manifests on save
python skills/hook.define/hook_define.py \
--event on_file_save \
--pattern "commands/**/*.yaml" \
--command "python skills/command.define/command_define.py" \
--blocking true
| 错误 | 原因 | 解决方案 |
|---|---|---|
| "Missing required fields: name" | 命令清单缺少 name 字段 | 添加以 / 开头的 name 字段 |
| "Invalid name: Command name must start with /" | 名称未以 / 开头 | 将名称更新为以 / 开头(例如 /api-design) |
| "Skill 'X' not found in skill registry" | 引用的技能不存在 | 首先使用 skill.define 注册该技能,或修正目标名称 |
/registry/commands.json – 使用新的或修改的命令条目进行更新/registry/skills.json) – 用于验证技能目标/registry/agents.json) – 用于验证代理目标/workflows/*.yaml) – 用于验证工作流目标活跃 – 此技能已准备就绪,可在生产环境中使用,并已积极用于 Betty 的命令基础设施中。
每周安装次数
–
来源
首次出现
–
Validates and registers command manifest files (YAML) to integrate new slash commands into Betty.
The command.define skill acts as the "compiler" for Betty Commands. It ensures a command manifest meets all schema requirements and then updates the Command Registry (/registry/commands.json) with the new command.
This skill is part of Betty's Layer 1 (Commands) infrastructure, enabling developers to create user-facing slash commands that delegate to agents, workflows, or skills.
python skills/command.define/command_define.py <path_to_command.yaml>
| Argument | Type | Required | Description |
|---|---|---|---|
| manifest_path | string | Yes | Path to the command manifest YAML to validate and register |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| "Agent 'X' not found in agent registry" | 引用的代理不存在 | 首先使用 agent.define 注册该代理,或修正目标名称 |
| "Workflow file not found" | 引用的工作流文件不存在 | 在 /workflows/{target}.yaml 处创建工作流文件 |
| "execution.type is required" | 缺少执行类型 | 添加值为 skill、agent 或 workflow 的 execution.type 字段 |
Schema Validation – Checks that required fields (name, version, description, execution) are present and correctly formatted (e.g., name must start with /).
Parameter Verification – Verifies each parameter in the manifest has name, type, and description, and that the execution target (agent/skill/workflow) actually exists in the system.
Registry Update – On success, adds the command entry to /registry/commands.json with status active.
/, e.g., /api-design)0.1.0)The execution field must contain:
skill, agent, or workflow/registry/skills.json/registry/agents.json/workflows/{target}.yamlname (required): Parameter nametype (required): Parameter type (string, number, boolean, etc.)required (optional): Whether parameter is requireddescription (optional): Parameter descriptiondefault (optional): Default valuedraft or active, defaults to draft){
"ok": true,
"status": "registered",
"errors": [],
"path": "commands/hello.yaml",
"details": {
"valid": true,
"status": "registered",
"registry_updated": true,
"manifest": {
"name": "/hello",
"version": "0.1.0",
"description": "Prints Hello World",
"execution": {
"type": "skill",
"target": "test.hello"
}
}
}
}
{
"ok": false,
"status": "failed",
"errors": [
"Skill 'test.hello' not found in skill registry"
],
"path": "commands/hello.yaml",
"details": {
"valid": false,
"errors": [
"Skill 'test.hello' not found in skill registry"
],
"path": "commands/hello.yaml"
}
}
# commands/api-design.yaml
name: /api-design
version: 0.1.0
description: "Design a new API following enterprise guidelines"
parameters:
- name: service_name
type: string
required: true
description: "Name of the service/API"
- name: spec_type
type: string
required: false
default: openapi
description: "Type of API specification (openapi or asyncapi)"
execution:
type: agent
target: api.designer
status: active
tags: [api, design, enterprise]
$ python skills/command.define/command_define.py commands/api-design.yaml
{
"ok": true,
"status": "registered",
"errors": [],
"path": "commands/api-design.yaml",
"details": {
"valid": true,
"status": "registered",
"registry_updated": true
}
}
If the target agent doesn't exist:
$ python skills/command.define/command_define.py commands/hello.yaml
{
"ok": false,
"status": "failed",
"errors": [
"Agent 'api.designer' not found in agent registry"
],
"path": "commands/hello.yaml"
}
Commands can be validated as part of a workflow:
# workflows/register_command.yaml
steps:
- skill: command.define
args:
- "commands/my-command.yaml"
required: true
Validate commands automatically when they're edited:
# Create a hook that validates command manifests on save
python skills/hook.define/hook_define.py \
--event on_file_save \
--pattern "commands/**/*.yaml" \
--command "python skills/command.define/command_define.py" \
--blocking true
| Error | Cause | Solution |
|---|---|---|
| "Missing required fields: name" | Command manifest missing name field | Add name field with value starting with / |
| "Invalid name: Command name must start with /" | Name doesn't start with / | Update name to start with / (e.g., /api-design) |
| "Skill 'X' not found in skill registry" | Referenced skill doesn't exist | Register the skill first using skill.define or fix the target name |
| "Agent 'X' not found in agent registry" | Referenced agent doesn't exist | Register the agent first using agent.define or fix the target name |
| "Workflow file not found" | Referenced workflow file doesn't exist | Create the workflow file at /workflows/{target}.yaml |
| "execution.type is required" | Missing execution type | Add execution.type field with value skill, agent, or workflow |
/registry/commands.json – updated with new or modified command entry/registry/skills.json) – for validating skill targets/registry/agents.json) – for validating agent targets/workflows/*.yaml) – for validating workflow targetsActive – This skill is production-ready and actively used in Betty's command infrastructure.
Weekly Installs
–
Source
First Seen
–
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装