heal-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Update a skill's SKILL.md and related files based on corrections discovered during execution.
Analyze the conversation to detect which skill is running, reflect on what went wrong, propose specific fixes, get user approval, then apply changes with optional commit.
</objective>
<context>
Skill detection: !`ls -1 ./skills/*/SKILL.md | head -5`
</context>
<quick_start>
<workflow>
- Detect skill from conversation context (invocation messages, recent SKILL.md references)
- Reflect on what went wrong and how you discovered the fix
- Present proposed changes with before/after diffs
- Get approval before making any edits
- Apply changes and optionally commit </workflow>
</quick_start>
<process>
<step_1 name="detect_skill">
Identify the skill from conversation context:
- Look for skill invocation messages
- Check which SKILL.md was recently referenced
- Examine current task context
Set: and
SKILL_NAME=[skill-name]SKILL_DIR=./skills/$SKILL_NAMEIf unclear, ask the user.
</step_1>
<step_2 name="reflection_and_analysis">
Focus on $ARGUMENTS if provided, otherwise analyze broader context.
Determine:
- What was wrong: Quote specific sections from SKILL.md that are incorrect
- Discovery method: Context7, error messages, trial and error, documentation lookup
- Root cause: Outdated API, incorrect parameters, wrong endpoint, missing context
- Scope of impact: Single section or multiple? Related files affected?
- Proposed fix: Which files, which sections, before/after for each </step_2>
<step_3 name="scan_affected_files">
bash
ls -la $SKILL_DIR/
ls -la $SKILL_DIR/references/ 2>/dev/null
ls -la $SKILL_DIR/scripts/ 2>/dev/null</step_3>
<step_4 name="present_proposed_changes">
Present changes in this format:
**Skill being healed:** [skill-name]
**Issue discovered:** [1-2 sentence summary]
**Root cause:** [brief explanation]
**Files to be modified:**
- [ ] SKILL.md
- [ ] references/[file].md
- [ ] scripts/[file].py
**Proposed changes:**<objective>
根据执行过程中发现的问题,更新技能的SKILL.md及相关文件。
分析对话以检测当前运行的技能,反思问题所在,提出具体修复方案,获得用户批准后,应用更改并可选择提交版本。
</objective>
<context>
技能检测:!`ls -1 ./skills/*/SKILL.md | head -5`
</context>
<quick_start>
<workflow>
- 检测技能:从对话上下文(调用消息、最近的SKILL.md引用)中识别技能
- 反思:明确问题所在以及发现修复方案的过程
- 展示:通过前后差异对比呈现拟议的更改
- 获取批准:在进行任何编辑前获得用户许可
- 应用更改:实施修改并可选择提交版本 </workflow>
</quick_start>
<process>
<step_1 name="detect_skill">
从对话上下文中识别技能:
- 查找技能调用消息
- 检查最近引用的SKILL.md文件
- 查看当前任务上下文
设置: 和
SKILL_NAME=[skill-name]SKILL_DIR=./skills/$SKILL_NAME若无法确定,请询问用户。
</step_1>
<step_2 name="reflection_and_analysis">
如果提供了$ARGUMENTS,则重点分析该参数;否则分析更广泛的上下文。
确定以下内容:
- 问题所在:引用SKILL.md中存在错误的具体章节
- 发现方式:Context7、错误消息、反复试验、查阅文档
- 根本原因:过时的API、错误的参数、错误的端点、缺失的上下文
- 影响范围:单个章节还是多个章节?是否影响相关文件?
- 拟议修复方案:需要修改哪些文件、哪些章节,每个修改的前后对比内容 </step_2>
<step_3 name="scan_affected_files">
bash
ls -la $SKILL_DIR/
ls -la $SKILL_DIR/references/ 2>/dev/null
ls -la $SKILL_DIR/scripts/ 2>/dev/null</step_3>
<step_4 name="present_proposed_changes">
按照以下格式呈现更改:
**待修复的技能:** [skill-name]
**发现的问题:** [1-2句话总结]
**根本原因:** [简要说明]
**待修改文件:**
- [ ] SKILL.md
- [ ] references/[file].md
- [ ] scripts/[file].py
**拟议的更改:**Change 1: SKILL.md - [Section name]
更改1:SKILL.md - [章节名称]
Location: Line [X] in SKILL.md
Current (incorrect):
[exact text from current file]Corrected:
[new text]Reason: [why this fixes the issue]
[repeat for each change across all files]
Impact assessment:
- Affects: [authentication/API endpoints/parameters/examples/etc.]
Verification:
These changes will prevent: [specific error that prompted this]
</step_4>
<step_5 name="request_approval">Should I apply these changes?
- Yes, apply and commit all changes
- Apply but don't commit (let me review first)
- Revise the changes (I'll provide feedback)
- Cancel (don't make changes)
Choose (1-4):
**Wait for user response. Do not proceed without approval.**
</step_5>
<step_6 name="apply_changes">
Only after approval (option 1 or 2):
1. Use Edit tool for each correction across all files
2. Read back modified sections to verify
3. If option 1, commit with structured message showing what was healed
4. Confirm completion with file list
</step_6>
</process>
<success_criteria>
- Skill correctly detected from conversation context
- All incorrect sections identified with before/after
- User approved changes before application
- All edits applied across SKILL.md and related files
- Changes verified by reading back
- Commit created if user chose option 1
- Completion confirmed with file list
</success_criteria>
<verification>
Before completing:
- Read back each modified section to confirm changes applied
- Ensure cross-file consistency (SKILL.md examples match references/)
- Verify git commit created if option 1 was selected
- Check no unintended files were modified
</verification>位置: SKILL.md的第[X]行
当前(错误内容):
[当前文件中的准确文本]修正后:
[新文本]原因: [该修改解决问题的原因]
[对所有文件中的每个修改重复上述格式]
影响评估:
- 影响范围:[身份验证/API端点/参数/示例等]
验证:
这些更改将避免:[引发此次修复的具体错误]
</step_4>
<step_5 name="request_approval">是否应用这些更改?
- 是,应用并提交所有更改
- 应用但不提交(我先审核)
- 修改更改方案(我将提供反馈)
- 取消(不进行任何更改)
请选择(1-4):
**等待用户回复。未获得批准前请勿继续。**
</step_5>
<step_6 name="apply_changes">
仅在获得批准(选项1或2)后执行:
1. 使用编辑工具对所有文件进行相应修正
2. 重读修改后的章节以验证正确性
3. 如果选择选项1,使用结构化提交信息记录修复内容
4. 通过文件列表确认修改完成
</step_6>
</process>
<success_criteria>
- 从对话上下文中正确检测到技能
- 所有错误章节均已识别并提供前后对比
- 应用更改前已获得用户批准
- 所有编辑已应用于SKILL.md及相关文件
- 通过重读验证了更改内容
- 若用户选择选项1,已创建提交记录
- 通过文件列表确认修改完成
</success_criteria>
<verification>
完成前:
- 重读每个修改后的章节以确认更改已正确应用
- 确保跨文件一致性(SKILL.md中的示例与references/中的内容匹配)
- 若选择选项1,验证Git提交已创建
- 检查是否有非预期的文件被修改
</verification>