diagnose-loop
Skill6 starsChanged 3 months agoMITView on GitHub
Diagnose reproducible failures with hypothesis-driven fixes and bounded retries.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- analyze-miniSkill
- bug-captureSkill
- build-oneSkill
- ceremony-budgetSkill
- checklist-miniSkill
- constitution-liteSkill
- context-checkSkill
- eco-modeSkill
- falsify-specSkill
- grill-with-docs-liteSkill
- handoffSkill
- lean-modeSkill
- mini-specSkill
- operator-profileSkill
- scope-freezeSkill
- ship-miniSkill
- teach-backSkill
- test-miniSkill
- thin-planSkill
- tool-noise-guardSkill
- verify-contractSkill
- workspace-checkpointSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use when a command fails, behavior is wrong, a test regresses, or output does not match the spec.
- Distinctive: line 31
Add a regression check if possible.
- Very specific: line 36
Stop at acceptance, either budget limit, an unresolved interruption, or a scope/permission/evaluator change.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Diagnose Loop
Purpose
Debug failures systematically.
When to use
Use when a command fails, behavior is wrong, a test regresses, or output does not match the spec.
Inputs
- Failure report
- Exact command or reproduction case
- Recent changes
- Logs, traces, or output
Workflow
- Freeze feature work.
- Reproduce the failure.
- Identify the exact failing command or case.
- List hypotheses.
- Instrument minimally.
- Name one active hypothesis and the observation that would falsify it; apply the smallest fix that tests it.
- Add a regression check if possible.
- Rerun the original failing command.
- Rerun relevant verification. An improved signal is not completion; the original failure and compatibility checks must pass.
- Before a second repair attempt, count the initial attempt and define the retry contract: fixed input/evaluator identities, acceptance threshold, total attempt limit, consecutive no-progress limit, revert rule, ledger location, and review trigger. If incomplete, stop with
REVIEW_REQUIRED; the initial bounded diagnosis does not require a separate loop artifact. - Record each started attempt, including failed commands and interrupted attempts: hypothesis, artifact state, evidence, outcome, and consumed budget. Change the next hypothesis only when the evidence supports it. Unchanged or worse results and tool errors consume the no-progress budget; improvement does not reset the total budget.
- Stop at acceptance, either budget limit, an unresolved interruption, or a scope/permission/evaluator change. Preserve the best known state and the failed attempt's evidence; revert only edits owned by this attempt, never unrelated user work. Reconcile uncertain external effects before retrying.
- On resume, carry forward the same loop identity, ledger, input/evaluator identities, consumed budget, and stop reason. A fresh session or subtask does not grant new attempts. Renew a spent budget or change the evaluator only through an explicit contract revision; preserve the prior ledger.
Outputs
- Root-cause note
- Smallest fix
- Regression check when possible
- Rerun results
- For repeated repairs: compact attempt ledger, remaining budget, and stop reason
Stop conditions
- The original failure is fixed and verified.
- The failure cannot be reproduced.
- The next step requires a product or data decision.
- Retry limits are reached, evidence is stale, or an interrupted attempt has unresolved effects.
Anti-patterns
- Repeating the same failed fix without a new falsifiable hypothesis.
- Weakening tests, changing the evaluator, or resetting counters to make progress appear green.
- Randomly editing files before reproducing the bug.
- Fixing symptoms without naming the failing case.
- Adding noisy instrumentation and leaving it behind.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

