agentleFS
tmdytmdy/CodeDeck/.claude/skills/trellis-break-loop/SKILL.md

trellis-break-loop

Skill2 starsChanged 26 days agoMITView on GitHub

Deep bug analysis to break the fix-forget-repeat cycle. Analyzes root cause category, why fixes failed, prevention mechanisms, and captures knowledge into specs. Use after fixing a bug to prevent the same class of bugs.

21 other projects use a version of this, 5 of them edited; 2 new projects in the last 4 weeks, against 1 the 4 before.

Adopted by

Rising: 2 new projects took it in the last 4 weeks, 2× the 4 weeks before.thin data

Week of Sep 13: 1 new projectWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 1 new projectWeek of Oct 25: 0 new projectsWeek of Nov 1: 1 new project
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 3 in all, so this is a hint, not a trend.

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 4 are common, 5 are distinctive, and 5 are very specific to this project.

  • 4

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    When debug is complete, use this for deep analysis to break the "fix bug -> forget -> repeat" cycle.

    line 8
  2. Common:

    If you tried multiple fixes before succeeding, analyze each failure:

    line 30
  3. Distinctive:

    When multiple root causes are plausible and evidence is incomplete, update your beliefs proportionally to new evidence rather than clinging …

    line 116
  4. Distinctive:

    Before investigating, state what you believe and why:

    line 120
  5. Distinctive:

    Document what you found — be specific about reliability:

    line 132
  6. Distinctive:

    Don't gather more of the same.

    line 149
  7. Distinctive:

    Never express binary certainty when evidence is incomplete.

    line 162
  8. Common:

    IMPORTANT: After completing the analysis above, you MUST immediately:

    line 176
  9. Common:

    Update spec/guides: - Don't just list TODOs, actually update the relevant files:

    line 178
  10. Very specific:

    If it's a cross-platform issue → update cross-platform-thinking-guide.md

    line 179
  11. Very specific:

    If it's a cross-layer issue → update cross-layer-thinking-guide.md

    line 180
  12. Very specific:

    If it's a code reuse issue → update code-reuse-thinking-guide.md

    line 181
  13. Very specific:

    If it's domain-specific → update backend/*.md or frontend/*.md

    line 182
  14. Very specific:

    Sync templates: - After updating .trellis/spec/, sync to src/templates/markdown/spec/

    line 184

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Break the Loop - Deep Bug Analysis

When debug is complete, use this for deep analysis to break the "fix bug -> forget -> repeat" cycle.


Analysis Framework

Analyze the bug you just fixed from these 5 dimensions:

1. Root Cause Category

Which category does this bug belong to?

CategoryCharacteristicsExample
A. Missing SpecNo documentation on how to do itNew feature without checklist
B. Cross-Layer ContractInterface between layers unclearAPI returns different format than expected
C. Change Propagation FailureChanged one place, missed othersChanged function signature, missed call sites
D. Test Coverage GapUnit test passes, integration failsWorks alone, breaks when combined
E. Implicit AssumptionCode relies on undocumented assumptionTimestamp seconds vs milliseconds

2. Why Fixes Failed (if applicable)

If you tried multiple fixes before succeeding, analyze each failure:

  • Surface Fix: Fixed symptom, not root cause
  • Incomplete Scope: Found root cause, didn't cover all cases
  • Tool Limitation: grep missed it, type check wasn't strict
  • Mental Model: Kept looking in same layer, didn't think cross-layer

3. Prevention Mechanisms

What mechanisms would prevent this from happening again?

TypeDescriptionExample
DocumentationWrite it down so people knowUpdate thinking guide
ArchitectureMake the error impossible structurallyType-safe wrappers
Compile-timeStrict type checking, no escape hatchesSignature change causes compile error
RuntimeMonitoring, alerts, scansDetect orphan entities
Test CoverageE2E tests, integration testsVerify full flow
Code ReviewChecklist, PR template"Did you check X?"

4. Systematic Expansion

What broader problems does this bug reveal?

  • Similar Issues: Where else might this problem exist?
  • Design Flaw: Is there a fundamental architecture issue?
  • Process Flaw: Is there a development process improvement?
  • Knowledge Gap: Is the team missing some understanding?

5. Knowledge Capture

Solidify insights into the system:

  • Update .trellis/spec/guides/ thinking guides
  • Update relevant .trellis/spec/ docs
  • Create issue record (if applicable)
  • Create feature ticket for root fix
  • Update check guidelines if needed

Output Format

Please output analysis in this format:

## Bug Analysis: [Short Description]

### 1. Root Cause Category
- **Category**: [A/B/C/D/E] - [Category Name]
- **Specific Cause**: [Detailed description]

### 2. Why Fixes Failed (if applicable)
1. [First attempt]: [Why it failed]
2. [Second attempt]: [Why it failed]
...

### 3. Prevention Mechanisms
| Priority | Mechanism | Specific Action | Status |
|----------|-----------|-----------------|--------|
| P0 | ... | ... | TODO/DONE |

### 4. Systematic Expansion
- **Similar Issues**: [List places with similar problems]
- **Design Improvement**: [Architecture-level suggestions]
- **Process Improvement**: [Development process suggestions]

### 5. Knowledge Capture
- [ ] [Documents to update / tickets to create]

Core Philosophy

The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.

Three levels of insight:

  1. Tactical: How to fix THIS bug
  2. Strategic: How to prevent THIS CLASS of bugs
  3. Philosophical: How to expand thinking patterns

30 minutes of analysis saves 30 hours of future debugging.

Thinking Framework: Bayesian Reasoning

When multiple root causes are plausible and evidence is incomplete, update your beliefs proportionally to new evidence rather than clinging to initial assumptions.

Step 1: Establish Priors

Before investigating, state what you believe and why:

HypothesisPriorReasoning
H1: [cause A]40%Most common for this pattern
H2: [cause B]30%Plausible given environment
H3: [other]30%Catch-all

Priors must sum to 100%. If you can't assign probabilities, investigate first.

Step 2: Observe Evidence

Document what you found — be specific about reliability:

  • What exactly did you observe?
  • How reliable? (test output > log message > user report > hunch)
  • Could multiple hypotheses explain this?

Step 3: Update Beliefs

For each hypothesis, ask: How likely is this evidence if this hypothesis were true?

Direction of update matters more than calculation:

  • Evidence strongly predicted by H1 → H1 probability increases
  • Evidence contradicts H2 → H2 probability decreases
  • Evidence equally likely under all → no update

Step 4: Seek Discriminating Evidence

Don't gather more of the same. Find evidence that differs strongly between top hypotheses.

If H1 and H3 are close: "What would I see if H1 is true but not if H3 is true?" Then check for that.

Step 5: State Confidence

ConfidenceAction
90%+Proceed with fix, monitor
70-90%Proceed, add fallback check
50-70%Test hypothesis before committing
<50%Need more evidence, don't guess

Never express binary certainty when evidence is incomplete. Use "most likely", "plausible but unlikely", "worth investigating".

Common Fallacies

FallacyExampleCorrection
Base rate neglect"Test failed → code is broken"How often do tests fail for other reasons?
Confirmation bias"Must be a race condition, let me find race evidence"Actively seek evidence AGAINST your top hypothesis
Anchoring"Last time it was caching, probably caching again"Establish priors from current context, not yesterday's bug

After Analysis: Immediate Actions

IMPORTANT: After completing the analysis above, you MUST immediately:

  1. Update spec/guides - Don't just list TODOs, actually update the relevant files:
    • If it's a cross-platform issue → update cross-platform-thinking-guide.md
    • If it's a cross-layer issue → update cross-layer-thinking-guide.md
    • If it's a code reuse issue → update code-reuse-thinking-guide.md
    • If it's domain-specific → update backend/*.md or frontend/*.md
  2. Sync templates - After updating .trellis/spec/, sync to src/templates/markdown/spec/
  3. Commit the spec updates - This is the primary output, not just the analysis text

The analysis is worthless if it stays in chat. The value is in the updated specs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.