rune-kit/rune/fix
Claude Code and agent skill by rune-kit/rune
- community
Checking that the SKILL.md file is still in the repository.
Apply code changes and fixes. Use when the change to make is already known: implementing code to pass written tests, applying a diagnosed bug fix, or addressing review findings. Writes the implementation and verifies it with tests. Core action hub in the development mesh; runs debug first when the cause is still unclear.
Install
npx vskill@latest install rune-kit/rune/fixSKILL.md
The same SKILL.md was published earlier as rune-kit/rune/fix.
fix
Purpose
Apply code changes. Fix receives a plan, debug finding, or review finding and writes the actual code. It does NOT investigate root causes — that is rune:debug's job. Fix is the action hub: locate, change, verify, report.
<HARD-GATE> Never change test files to make tests pass unless the tests themselves are provably wrong (wrong expected value, wrong test setup, testing a removed API). The rule: fix the CODE, not the TESTS. The test-integrity hook (preflight on Edit/Write, sentinel on git commit) will BLOCK assertion removal, new skips, changed expected literals, and any edit under tests/char/** or tests/holdout/**. Do not work around it. If a human has approved the test change, retry with RUNE_TEST_CHANGE_APPROVED="<reason>" or a Test-Change-Approved: <reason> commit trailer — see test-integrity-gate. If unsure whether the test is wrong or the implementation is wrong → call rune:debug to investigate. </HARD-GATE>
Triggers
- Called by
cookPhase 4 IMPLEMENT — write code to pass tests - Called by
debugwhen root cause found and fix is ready - Called by
reviewwhen bugs found during review /rune fix <issue>— manual fix application- Auto-trigger: after successful debug diagnosis
Calls (outbound)
debug(L2): when root cause unclear before fixing — need diagnosis firsttest(L2): verify fix with tests after applying changesreview(L2): self-review for complex or risky fixesverification(L3): validate fix doesn't break existing functionalitydocs-seeker(L3): check correct API usage before applying changeshallucination-guard(L3): verify imports after code changesscout(L2): find related code before applying changesneural-memory(L3): after fix verified — capture fix pattern (cause → solution)adversary(L2): onagent.stuckafter 2+ failed attempts — oracle-mode dispatches stateless second-model pass to break confirmation-bias loop
Called By (inbound)
cook(L1): Phase 4 IMPLEMENT — apply code changesdebug(L2): root cause found, ready to apply fixreview(L2): bug found during review, needs fixingsurgeon(L2): apply refactoring changesreview-intake(L2): apply fixes identified during structured review intakegraft(L2): apply integration fixes for grafted codescaffold(L1): apply fixes during project scaffolding
Cross-Hub Connections
fix↔debug— bidirectional: debug diagnoses → fix applies, fix can't determine cause → debug investigatesfix→test— after applying fix, run tests to verifyfix←review— review finds bug → fix applies correctionfix→review— complex fix requests self-review
Execution
Step 1: Understand
Read and fully understand the fix request before touching any file.
- Read the incoming request: debug report, plan spec, or review finding
- Identify what is broken or missing and what the expected behavior should be
- If the request is ambiguous or root cause is unclear → call
rune:debugbefore proceeding - Note the scope: single function, single file, or multi-file change
Step 1b: Recovery Policy Matrix
Before locating code, classify the incoming error/task into a recovery category to determine the right fix strategy. This prevents wasting effort on the wrong approach.
| Error Type | Recovery Action | Strategy | |
|---|---|---|---|
INPUT_REQUIRED — missing user input, ambiguous spec | PROMPT_USER | Return NEEDS_CONTEXT with specific questions. Do NOT guess. | |
INPUT_INVALID — wrong format, type mismatch, encoding | AUTO_FIX | Fix at validation layer. Add schema validation (Zod/Pydantic) if missing. | |
TIMEOUT — operation exceeded time limit | RETRY with adjustment | Increase timeout, add retry with exponential backoff, or chunk the operation. | |
POLICY_BLOCKED — security gate, lint rule, contract violation | ABORT | Do NOT work around the policy. Report to caller with the specific rule that blocked. | |
PERMISSION_DENIED — auth failure, file access, API scope | PROMPT_USER | Cannot fix permissions programmatically. Report exact permission needed. | |
DEPENDENCY_ERROR — missing package, version conflict, broken dep | AUTO_FIX | Install missing dep, resolve version conflict, or suggest alternative package. | |
LOGIC_ERROR — wrong output, incorrect calculation, bad algorithm | INVESTIGATE | Do NOT auto-fix. Call rune:debug — logic errors need root cause analysis. | |
ENVIRONMENT_ERROR — wrong Node/Python version, missing system dep | PROMPT_USER | Report exact version/tool needed. Agent cannot change system environment. |
Decision flow:
- Read the incoming diagnosis/error
- Classify into one of the 8 error types above
- Apply the recovery action — this determines whether to proceed (AUTO_FIX, RETRY), ask (PROMPT_USER), stop (ABORT), or re-diagnose (INVESTIGATE)
- Announce: "Recovery policy: {error_type} → {action}"
Why: Without a recovery matrix, fix attempts the same strategy (read → change → test) for every error type. A POLICY_BLOCKED error doesn't need code reading — it needs the policy reported. An INPUT_REQUIRED error doesn't need debugging — it needs a question asked. Matching strategy to error type eliminates wasted cycles.
Step 2: Locate
Find the exact files and lines to change.
- Use
rune:scoutto locate the relevant files, functions, and surrounding code - Use
Readto examine the specific file:line identified in the debug report or plan - Use
Globto find related files: types, tests, config that may also need updating - Map all touch points before writing a single line of code
Step 3: Change
Apply the minimal set of changes needed.
- Use
Editfor targeted modifications to existing files - Use
Writeonly when creating a genuinely new file is required - Follow project conventions: naming, immutability patterns, error handling style
- Keep changes minimal — fix the stated problem, do not refactor unrelated code (YAGNI)
- Never use
anyin TypeScript; never use bareexcept:in Python - If a new import is needed → note it for Step 5 hallucination-guard check
Step 4: Verify
Confirm the change works and nothing is broken.
- Use
Bashto run the relevant tests: the specific failing test first, then the full suite - If tests fail after the fix:
- Investigate with
rune:debug(max 3 debug loops before escalating) - Do NOT change test files to make tests pass — fix the implementation code
- If project has a type-check command, run it via
Bash - If project has a lint command, run it via
Bash
Step 4.5: Quality Decay Check (Self-Regulation)
When fix is called repeatedly (e.g., by cook Phase 4, or iterative fix loops), track a WTF-likelihood score — the probability that continued fixing is making things worse.
Compute every 3 fix attempts (or when called 5+ times in a single cook session):
| Signal | Score Adjustment | |
|---|---|---|
| A fix was reverted (any test that passed now fails) | +15% | |
| Fix touched >3 files (blast radius expanding) | +5% per extra file beyond 3 | |
| 15+ fixes already applied in this session | +1% per fix beyond 15 | |
| All remaining issues are LOW severity | +10% | |
| Fix touched files outside the original diagnosis scope | +20% | |
| Consecutive fixes without running tests between them | +10% |
Thresholds:
- >20% WTF-likelihood: STOP fixing. Report current state to cook/user with: "Quality decay detected — continued fixes risk introducing more bugs than they resolve. {N} fixes applied, {score}% risk. Recommend: commit current progress, re-assess remaining issues."
- Hard cap: 30 fixes per session — regardless of score. After 30, STOP and report.
- 2+ consecutive fixes on the same file all failed: emit
agent.stucksignal.scoutzoom-out mode (structural pivot) andadversaryoracle-mode (semantic pivot via stateless second-model dispatch) both listen and fire in parallel. Iforacle.responsearrives with confidence=high, apply its recommended edit (still routes through normal validation gates).
Reset conditions: WTF-likelihood resets to 0% when:
- User explicitly says "continue fixing"
- A full test suite run shows zero regressions
- Scope is narrowed to a single file
Step 5: Post-Fix Hardening (Defense-in-Depth)
After the fix works, make the bug structurally impossible — not just "fixed this time."
Single validation at one point can be bypassed by different code paths, refactoring, or mocks. Add validation at EVERY layer data passes through:
| Layer | Purpose | Example | |
|---|---|---|---|
| Entry Point | Reject invalid input at API boundary | Validate params not empty/exists/correct type | |
| Business Logic | Ensure data makes sense for this operation | Check preconditions specific to this function | |
| Environment Guard | Prevent dangerous ops in specific contexts | In tests: refuse writes outside tmpdir | |
| Debug Instrumentation | Capture context for forensics if bug recurs | Log stack trace + key values before risky ops |
Apply this when: the bug was caused by invalid data flowing through multiple layers. Skip for trivial one-liner fixes.
Step 5b: Preserve Debug Instrumentation
If rune:debug left #region agent-debug markers in the code:
- During fix: DO NOT remove these markers — they capture the investigation trail
- After fix verified (tests pass, lint pass): scan for
#region agent-debugmarkers - Remove markers and their contents in a final cleanup pass ONLY after full verification
- If the fix is partial or tests still fail → KEEP all markers for the next debug cycle
Why: Premature cleanup of debug instrumentation erases failure history. If the bug recurs after cleanup, the next debug session starts from zero. Keeping markers until verification means downstream skills can see what was already investigated.
Step 6: Self-Review
Verify correctness of the changes just made.
- Call
rune:hallucination-guardto verify all imports introduced or modified are real and correctly named - Call
rune:docs-seekerif any external API, library method, or SDK call was added or changed - For complex or risky fixes (auth, data mutation, async logic): call
rune:reviewfor a full quality check
Step 6b: Capture Fix Pattern
Call neural-memory (Capture Mode) to save the fix pattern: what broke, why, and how it was fixed. Priority 7 for recurring bugs.
Step 7: Report
Produce a structured summary of all changes made.
- List every file modified and a one-line description of what changed
- Include verification results (tests, types, lint)
- Note any follow-up work if the fix is partial or has known limitations
Constraints
- MUST NOT change test files to make tests pass — fix the CODE, not the TESTS
- MUST have a diagnosis (from debug or clear error) before applying fixes
- MUST run tests after each fix attempt — never batch multiple untested changes
- MUST NOT exceed 3 fix attempts — if 3 fixes fail, re-diagnose via rune:debug (which will classify: wrong approach → brainstorm rescue, wrong design → plan redesign)
- MUST follow project conventions found by scout — don't invent new patterns
- MUST NOT add unplanned features while fixing — fix only what was diagnosed
- MUST track fix attempt number — this feeds debug's 3-Fix Escalation classification
- MUST preserve
#region agent-debugmarkers until fix is fully verified — cleanup only after tests pass
Scope Gate
| Change Type | Action | |
|---|---|---|
| Bug fix (diagnosed cause) | Fix it | |
| Security fix (found during fix) | Fix it + flag to sentinel | |
| Blocking issue (can't complete fix without) | Fix it + document in report | |
| Unrelated improvement | STOP — create separate task | |
| Architectural change | STOP — escalate to cook/plan |
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/fix/SKILL.md
Popularity
- Repository stars
- 82
- Repository forks
- 23
- Repository npm downloads, 7 days
- 739
- 7-day trend score
- 39
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 1 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rune-kit/rune/fix)