name: skill-meta description: 交互式系统构建器。为/meta命令调用,以创建.claude/系统更改的任务。 allowed-tools: Task, Bash, Edit, Read, Write
原始上下文(现在由子代理加载):
- .claude/docs/guides/component-selection.md
- .claude/docs/guides/creating-commands.md
- .claude/docs/guides/creating-skills.md
- .claude/docs/guides/creating-agents.md
原始工具(现在由子代理使用):
- Read, Write, Edit, Glob, Grep, Bash(git, jq, mkdir), AskUserQuestion
元技能
薄包装器,将系统构建委托给meta-builder-agent子代理。此技能处理/meta的所有三种模式:交互式访谈、提示分析和系统分析。
重要:此技能实现了技能内部后飞行模式。在子代理返回后,此技能处理所有后飞行操作(如果创建了任务则进行git提交),然后返回。这消除了技能返回和协调器之间的“继续”提示问题。
上下文参考
参考(不要急切加载):
- 路径:
.claude/context/core/formats/return-metadata-file.md- 元数据文件模式 - 路径:
.claude/context/core/patterns/postflight-control.md- 标记文件协议 - 路径:
.claude/context/core/patterns/file-metadata-exchange.md- 文件I/O辅助函数
注意:此技能是一个带有内部后飞行的薄包装器。上下文由委托代理加载。
触发条件
此技能在以下情况下激活:
- 调用/meta命令(带任何参数)
- 用户请求系统构建或为.claude/更改创建任务
- 请求系统分析(–analyze标志)
执行
1. 输入验证
从参数验证和分类模式:
模式检测逻辑:
# 解析参数
args="$ARGUMENTS"
# 确定模式
if [ -z "$args" ]; then
mode="interactive"
elif [ "$args" = "--analyze" ]; then
mode="analyze"
else
mode="prompt"
prompt="$args"
fi
不需要任务编号验证 - /meta创建新任务,而不是操作现有任务。
2. 上下文准备
准备委托上下文:
{
"session_id": "sess_{timestamp}_{random}",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "meta", "skill-meta"],
"timeout": 7200,
"mode": "interactive|prompt|analyze",
"prompt": "{user prompt if mode=prompt, null otherwise}"
}
3. 调用子代理
关键:您必须使用Task工具来生成子代理。
此技能前段中的agent字段指定目标:meta-builder-agent
所需工具调用:
Tool: Task (NOT Skill)
Parameters:
- subagent_type: "meta-builder-agent"
- prompt: [Include mode, prompt if provided, delegation_context]
- description: "Execute meta building in {mode} mode"
不要使用Skill(meta-builder-agent) - 这将失败。
代理位于.claude/agents/,而不是.claude/skills/。
Skill工具只能从.claude/skills/调用技能。
子代理将:
- 根据模式按需加载组件指南
- 执行模式特定工作流:
- 交互式:使用AskUserQuestion运行7阶段访谈
- 提示:分析请求并提出任务分解
- 分析:清点现有组件并提供建议
- 为非分析模式创建任务条目(TODO.md、state.json、任务目录)
- 返回标准化JSON结果
4. 返回验证
验证返回匹配subagent-return.md模式:
- 状态为之一:completed, partial, failed, blocked
- 摘要非空且<100个令牌
- 存在工件数组(用于交互式/提示模式的任务目录)
- 元数据包含session_id、agent_type、委托信息
5. 返回传播
将验证后的结果返回给调用者,无需修改。
返回格式
见.claude/context/core/formats/subagent-return.md获取完整规范。
预期返回:交互模式(任务已创建)
{
"status": "tasks_created",
"summary": "为命令创建工作流创建了3个任务:研究、实施和测试阶段。",
"artifacts": [
{
"type": "task",
"path": "specs/430_create_export_command/",
"summary": "新命令的任务目录"
},
{
"type": "task",
"path": "specs/431_export_command_tests/",
"summary": "测试的任务目录"
}
],
"metadata": {
"session_id": "sess_1736700000_abc123",
"agent_type": "meta-builder-agent",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "meta", "meta-builder-agent"],
"mode": "interactive",
"tasks_created": 2
},
"next_steps": "运行/research 430以开始第一个任务的研究"
}
预期返回:分析模式(只读)
{
"status": "analyzed",
"summary": "系统分析完成。找到9个命令、9个技能、6个代理和15个活动任务。",
"artifacts": [],
"metadata": {
"session_id": "sess_1736700000_xyz789",
"agent_type": "meta-builder-agent",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "meta", "meta-builder-agent"],
"mode": "analyze",
"component_counts": {
"commands": 9,
"skills": 9,
"agents": 6,
"active_tasks": 15
}
},
"next_steps": "查看分析并在需要时运行/meta创建任务"
}
预期返回:用户取消
{
"status": "cancelled",
"summary": "用户在确认阶段取消了任务创建。未创建任务。",
"artifacts": [],
"metadata": {
"session_id": "sess_1736700000_def456",
"agent_type": "meta-builder-agent",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "meta", "meta-builder-agent"],
"mode": "interactive",
"cancelled": true
},
"next_steps": "准备好时再次运行/meta创建任务"
}
错误处理
输入验证错误
如果参数格式错误,立即返回失败状态。
子代理错误
直接传递子代理的错误返回。
用户取消
当用户在确认阶段显式取消时,返回完成状态(非失败)。
超时
如果子代理超时(交互式会话默认7200秒),返回部分状态。