codex-break-looplisted
Install: claude install-skill yinanli1917-cloud/searching-apple-notes
# Break Loop
After fixing a bug, systematically analyze what went wrong and write the lesson into durable specs. The analysis is worthless if it stays in chat.
## Process
### 1. Classify Root Cause
Identify which category this bug falls into:
| Category | Description | Example |
|----------|-------------|---------|
| **Missing Spec** | No documented rule prevented this | "Nothing said the cache must invalidate on logout" |
| **Cross-Layer Contract** | Two layers disagreed on a contract | "View assumed sync, but ViewModel is async" |
| **Change Propagation** | A change in A broke B because the link was undocumented | "Renamed enum case, 3 switch statements missed" |
| **Test Gap** | The scenario was untested and could have been caught | "No test for empty-array edge case" |
| **Implicit Assumption** | Code assumed something that was never guaranteed | "Assumed array was sorted, but API doesn't guarantee order" |
### 2. Analyze Why Prior Approach Failed
If this bug persisted through multiple fix attempts:
- What did each attempt get wrong?
- What assumption did they share that was incorrect?
- What would have caught the real issue on the first try?
### 3. Identify Prevention Mechanism
What durable change prevents this CLASS of bug (not just this instance)?
- A spec rule? (Add to `.codex/spec/project/`)
- A code contract? (Add assertion/guard)
- A test pattern? (Add to test suite)
- An architectural boundary? (Document in spec)
### 4. Write to Specs
Find the most rel