skills/diagnose-review-fix-orchestrator/SKILL.md
End-to-end pipeline for uncertain bugs: diagnose root cause, review the fix, then verify and harden. Chains parallel-diagnosis → two-pass-review → fix-loop.
npx skillsauth add preetamnath/agent-skills diagnose-review-fix-orchestratorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
An orchestration protocol that chains three skills into a single pipeline: find the root cause, write the fix, review it, and harden it. The human stays in the loop at every stage transition.
Four stages. Every stage transition requires human approval via AskUserQuestion with structured options and a recommended choice. Never auto-proceed.
Load the parallel-diagnosis skill. Pass it the problem statement and relevant file paths.
Receive: DiagnosisOutput with status, root_cause, confidence, agreement, affected_files, fix_direction.
Checkpoint: Present diagnosis to the human. Check status first, then evaluate confidence and agreement.
status is "not_a_bug" → report findings and stop. No fix needed.status is "inconclusive" → stop or gather more context before proceeding.status is "diagnosed": evaluate confidence and agreement to decide next steps.
confidence: "low" or human disagrees → stop or re-run with more context.confidence: "medium" + agreement: "escalated" warrants more caution than "medium" + "converged" — surface the disagreement context to the human.No sub-skill — the parent LLM writes the fix directly.
Using the diagnosis output (root_cause, affected_files, fix_direction), read the affected files and make the code changes. This is a normal coding task.
Checkpoint: Show the changes to the human. Proceed on approval.
Load the two-pass-review skill. Pass it:
Receive: ReviewOutput with findings (P0–P3, confirmed/demoted/rejected).
Checkpoint: Present review findings to the human.
Load the fix-loop skill. Pass it:
root_cause + fix_direction) and the review criteria from Stage 3fix-loop will attempt fixes (max 2 per finding) and verify each one.
Receive: fix-loop output with per-finding results: resolved in Round 1, resolved in Round 2, or escalated with attempt history.
Checkpoint: Present final state to the human.
Before applying any shortcut, confirm with the user via the AskUserQuestion tool. Present the detected condition and the proposed skip as a structured option alongside "Run all stages".
| Condition | Action | |---|---| | Root cause already known | Skip Stage 1, start at Stage 2 | | Fix is trivial after diagnosis | Skip Stages 3–4 — apply directly after human confirms the fix is trivial | | Review finds no P0/P1 issues | Skip Stage 4, recommend shipping | | Human says stop at any checkpoint | Present what you have and halt |
DiagnosisOutput, ReviewOutput, Finding schema v1).Present a final summary to the human:
development
Judge whether a candidate fact earns a durable-doc line: keep only what a future agent would get the wrong answer without; cut anything derivable from code, setup, breadcrumb, or a restated default. TRIGGER when: user asks 'does this belong in CLAUDE.md / a rule / the docs', 'is this worth keeping/writing down', 'should this be a comment'; vetting or pruning a fact before it's filed or shaped.
testing
Audit one instruction file by composing the durable-instruction lenses over it — vet-fact (WORTH: does each fact earn a line?), place-fact (PLACE: is it in the right home?), tighten-instruction (SHAPE: tighten the line). Pick the subset the file needs: shape-only, worth+shape, or worth+place+shape. A misplaced fact can be relocated to its right home on your approval, or deferred for a durable-docs-update batch. TRIGGER when: user wants a skill file or durable doc (CLAUDE.md, a rule, ARCHITECTURE.md) audited for what to keep, where it belongs, and how it reads; user says 'refine/audit this file', 'prune and tighten this doc', 'what here is worth keeping'. For shape-only tightening, tighten-file is the leaner sibling.
development
Route a kept fact to its durable home by delivery trigger and most-local-wins — across in-file comment, nested CLAUDE.md, path-scoped rule, root CLAUDE.md, ARCHITECTURE.md, or a skill. TRIGGER when: user asks 'where should this go', 'which file/rule/home does this belong in', 'is this in the right place', 'should this be a pointer'; placing or re-homing a fact already judged worth keeping.
development
Sequence a locked spec into dependency-ordered, wave-grouped tasks. TRIGGER when: user says 'build the plan' or 'sequence this'; a spec needs slicing into parallel-safe waves.