Agent Skills: Fix

Use when the user says "fix", "make it pass", or "apply the findings", or hands a verifier failure or bug description.

UncategorizedID: OutlineDriven/odin-claude-plugin/fix

Install this agent skill to your local

pnpm dlx add-skill https://github.com/OutlineDriven/odin-claude-plugin/tree/HEAD/skills/fix

Skill Files

Browse the full folder contents for fix.

Download Skill

Loading file tree…

skills/fix/SKILL.md

Skill Metadata

Name
fix
Description
Use when the user says "fix", "make it pass", or "apply the findings", or hands a verifier failure or bug description.

Fix

Failure-driven iterative repair. Detect → Prioritize → Fix ONE thing → Commit → Verify → Keep/Revert → Repeat.

When to Apply / NOT

Apply: user says "fix", "make it pass", "apply findings"; input is a verifier failure, findings file, or bug description.

NOT apply:

  • CI/PR workflows with no local context → use gh-fix-ci
  • PR review comments → use resolve-pr-feedback
  • Merge conflicts
  • Analysis-only tasks → use resolve or debug
  • Planned change without a failure driver → use proceed

Detected Mode Acknowledgement [LOAD-BEARING]

First output line before ANY edit:

detected: <mode> — target=TARGET guard=GUARD scope=SCOPE cap=20

Mode values: gh-route, findings, verifier-failure, bug-spec. Full classifier: references/classifier.md.

Input Classifier

First-match wins. Full detail: references/classifier.md.

| Priority | Mode | Minimum condition | |----------|------|-------------------| | 1 | gh-route | GH-flavored input + open PR + gh auth status clean | | 2 | findings | Path to */findings.md, */review/*.md, or structured findings text | | 3 | verifier-failure | Raw verifier stdout (FAILED, error TS, --- FAIL, etc.) | | 4 | bug-spec | Natural-language description, catch-all fallback |

Auto-Detect Gate

Auto-infer: target verifier, scope glob, guard command, iteration cap (default 20).

Trigger AskUserQuestion (single-select per axis, NEVER multiSelect) when:

  • MIXED_MODE: findings artifact AND verifier-failure output both present
  • GH_PARTIAL: GH-flavored input but no open PR, or gh auth status fails
  • LANG_UNKNOWN: verifier-failure detected but verifier undetectable
  • SCOPE_AMBIGUOUS: bug-spec with no module, file, or component reference

Iterative Loop

Full spec: references/loop.md. Key rules:

  • One fix per iteration. Apply fix → stage checkpoint commit → run verifiers → KEEP on green, revert with git revert HEAD --no-edit on red. A commit is kept only when the guard passes.
  • Decide matrix:
    • delta > 0 + guard ok → KEEP
    • delta > 0 + guard fail → REWORK (max 2 reworks per item; 4th attempt → SKIP)
    • delta ≤ 0DISCARD. Revert immediately
    • 3 total skips → HALT with summary
  • Revert: always git revert HEAD --no-edit. Never reset --hard.
  • Cap: 20 iterations default. Print progress every 5 iterations.
  • Refuse loop on protected branches (main, master, release/*).
  • Override: iterations: N or --iterations N in invocation.

Verifier Detection

Repo-native first (use fd --max-depth 2 to locate):

  1. Justfilejust test (guard: just check)
  2. Makefilemake test (guard: make check)
  3. package.jsonnpm test (guard: tsc --noEmit && eslint .)
  4. dune-projectdune build @runtest (guard: dune build)

Language fallbacks:

  • Python: pytest + ruff check . && mypy .
  • TypeScript: vitest run + tsc --noEmit && eslint .
  • Rust: cargo test + cargo clippy -- -D warnings
  • Go: go test ./... + golangci-lint run
  • OCaml: dune build @runtest + dune build

Full matrix: references/verifiers.md.

GH Auto-Route

When open PR + gh auth status clean + GH-flavored input:

| Sub-target | Trigger language | |------------|-----------------| | gh-fix-ci | "CI", "Actions", "workflow", "checks", Actions run URL | | resolve-pr-feedback | "reviewer said", "address comment", "PR feedback", "requested changes" |

Both sets of language → fire AMBIGUOUS_GH_ROUTE (single-select: gh-fix-ci vs resolve-pr-feedback). Partial match → GH_PARTIAL ambiguity flag.

Hand-off & Integration

  • debug upstream: unclear root cause. Debug findings become the fix target.
  • test-driven partner: failing test ↔ green flip; delegate RED→GREEN cycle.
  • proceed complement: planned change without failure → proceed; failure-driven → fix.
  • resolve / review as findings sources: their output paths feed findings mode.

Failure Modes

  • No verifier output: emit warning, raise LANG_UNKNOWN.
  • 3 strikes on one item: SKIP, add to blocked.md, recommend debug.
  • Guard ambiguous: AskUserQuestion for guard command.
  • Protected branch: REFUSE with message before entering loop.

Anti-Patterns

  • Never @ts-ignore / # type: ignore / // eslint-disable to silence errors.
  • Never delete tests to make them pass.
  • ONE fix per iteration. No "while I'm here" changes.
  • Recursion guard: --mode <X> bypasses classifier entirely; gh-fix-ci re-entering as fix --mode verifier-failure cannot loop back into gh-fix-ci.

Constitutional Rules

  • Evidence before claims: run verifiers, read output, then state result.
  • Compress-first: reduce coupling before behavior change.
  • Atomic commits: one concern per commit; guard must pass before a loop commit is kept (KEEP in decide matrix = tests-pass gate).
  • Never skip the guard.
  • Full specs: references/loop.md, references/classifier.md, references/verifiers.md.