Repair Skill
/heal-skillUpdate a skill’s SKILL.md file and related files based on fixes discovered during execution.
--- description: Updateskill documentation by applying corrections discovered during execution, with approvalworkflow argument-hint: [optional: specific issue to fix] allowed-tools: [Read, Edit, Bash(ls:), Bash(git:)] --- <objective> Update askill ’sSKILL.md and related files based on corrections discovered during execution. Analyze the conversation to detect whichskill is running, reflect on what went wrong, propose specific fixes, get user approval, then apply changes with an optional commit. </objective > <context> Skill detection: !ls -1 ./skills/*/SKILL.md | head -5 </context > <quickstart > <workflow > 1. **Detect theskill ** from the conversation context (invocation messages, recentSKILL.md references) 2. **Reflect** on what went wrong and how you discovered the fix 3. **Present** proposed changes with before/after diffs 4. **Get approval** before making any edits 5. **Apply** changes and optionally commit </workflow > </quickstart > <process> <step1 name="detectskill "> Identify theskill from the conversation context: - Look forskill invocation messages - Check whichSKILL.md was recently referenced - Examine the current task context Set:SKILL_NAME=[skill-name] andSKILL_DIR=./skills/$SKILL_NAME If unclear, ask the user. </step1 > <step2 name="reflectionandanalysis "> Focus on $ARGUMENTS if provided; otherwise, analyze the broader context. Determine: - What was wrong: Quote specific sections fromSKILL.md that are incorrect - Discovery method: Context7, error messages, trial and error, documentation lookup - Root cause: OutdatedAPI , incorrect parameters, wrong endpoint, missing context - Scope of impact: Single section or multiple? Are related files affected? - Proposed fix: Which files, which sections, and before/after changes for each </step2 > <step3 name="scanaffectedfiles "> ``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:** ### Change 1: SKILL.md - [Section name] **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? 1. Yes, apply and commit all changes 2. Apply but don't commit (let me review first) 3. Revise the changes (I'll provide feedback) 4. Cancel (don't make changes) Choose (1-4): `` Wait for the user’s response. Do not proceed without approval. </step5 > <step6 name="applychanges "> Only after approval (option 1 or 2): 1. Use the Edit tool to make corrections across all files 2. Read back the modified sections to verify 3. If option 1, commit with a structured message showing what was corrected 4. Confirm completion with a file list </step6 > </process > <successcriteria > - Skill correctly detected from the conversation context - All incorrect sections identified with before/after examples - User approved changes before application - All edits applied acrossSKILL.md and related files - Changes verified by reading them back - Commit created if the user chose option 1 - Completion confirmed with a file list </successcriteria > <verification> Before completing: - Read back each modified section to confirm that changes were applied - Ensure cross-file consistency (examples atSKILL.md match the references/) - Verify that a Git commit was created if option 1 was selected - Check that no unintended files were modified </verification >