Skip to content
Skills Library
Programming · Analysis

recurring-bug-root-cause

/recurring-bug-root-cause

Use when fixing a bug in a scope that already received 2+ similar fixes recently, when a second bug of the same class appears elsewhere, or when noticing "this bug again" / "encore ce bug" / repeated fix commits on the same area. Use BEFORE writing the Nth one-line fix.

Licence
MIT
Last repository change
22.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/detect-recurring-fixes.ts

What it does and when to use it

Use when fixing a bug in a scope that already received 2+ similar fixes recently, when a second bug of the same class appears elsewhere, or when noticing "this bug again" / "encore ce bug" / repeated fix commits on the same area. Use BEFORE writing the Nth one-line fix.

Triggers from the description

this bug againencore ce bug
Original author description

Use when fixing a bug in a scope that already received 2+ similar fixes recently, when a second bug of the same class appears elsewhere, or when noticing "this bug again" / "encore ce bug" / repeated fix commits on the same area. Use BEFORE writing the Nth one-line fix.

How it works

  1. This skill vs. others
  2. Principle
  3. The trap (observed in baseline)
  4. Tooling
  5. Context to gather (before acting)
  6. Steps
  7. Traps & rationalizations
  8. Guardrails
  9. Exit condition
Original SKILL.md headings · 80 lines, 815 words
SKILL.md preview
---
name: recurring-bug-root-cause
description: Use when fixing a bug in a scope that already received 2+ similar fixes recently, when a second bug of the same class appears elsewhere, or when noticing "this bug again" / "encore ce bug" / repeated fix commits on the same area. Use BEFORE writing the Nth one-line fix.
version: 1.0.2
metadata:
  last-reviewed: 2026-08-08
  category: bug
---

# Root-causing a recurring bug

> If the current repo has a dedicated anti-recurrence skill or process, it wins.

## This skill vs. others

- **This skill** when: 2+ similar recent fixes on the same scope, or a 2nd bug of the same class elsewhere, or "this bug again"
- **`bug-ticket-root-cause`** if: first observed bug, an isolated case to document (not yet a class)
- **`superpowers:systematic-debugging`** if: a single bug to diagnose, with no repetition pattern

## Principle

3+ fixes on the same scope in ~2 weeks = trial-and-error debugging: you are patching **symptoms** of one shared cause. **A bug class is hunted with tooling, not with a reminder** - a documentation rule does not protect the existing code and does not survive inattention.

## The trap (observed in baseline)

Under pressure, the reflex is: ship the one-line fix, promise yourself "I'll create the root-cause ticket later"… and never do it. **The urgent fix may ship first, but the session does not end until the spike leaves a trace** (ticket created, or spike done immediately). "I'll keep it in mind" does not count.

## Tooling

- Test procedure: `scripts/detect-recurring-fixes.test.ts` - deterministic behavioral test of the script (positive + negative fixture). Run `npx tsx scripts/detect-recurring-fixes.test.ts` from the canonical repo after any change to the script (also picked up by `npm test`). Not distributed to target repos.

- `scripts/detect-recurring-fixes.ts [--window 14] [--threshold 3] [repoDir]` - detects scopes at the threshold from the git log (conventional commits); exit 1 on recurrence → usable as a CI check
- `templates/postmortem-recidive.md` - short postmortem template with a hypothesis table

## Context to gather (before acting)

- The list of the N fixes on the scope: `scripts/detect-recurring-fixes.ts` then `git log`/`git blame` on the files involved
- Guard tooling already in place (custom lint, hooks, CI checks) and why it did not catch the class
- The project's lint/test/build commands (`package.json` / `Cargo.toml` / CI config) - that is where the blocking guardrail lives
- The repo tracker for one ticket per action not shipped within the fix

## Steps

### 1. Map the class, not the symptom
- Detection: `scripts/detect-recurring-fixes.ts`, then list the N fixes on the scope
- Key question: **what common property links these fixes?** (same implicit contract violated, same missing guardrail, same environment divergence)

### 2. Spike hypotheses - each confirmed or refuted
- 2–4 root-cause hypotheses, each tested against the facts with evidence
- Always include: "existing tooling should have caught it - why didn't it?" and "this is an isolated slip of attention" (usually refuted by the 2nd occurrence)
- A postmortem with no refuted hypothesis = narrative, not a spike

### 3. TOOLED guardrail (not documentation)
- Choose the most mechanical **blocking** mechanism: compiler option, custom lint rule, integration test on the class, pre-commit hook, CI check
- The guardrail must **sweep the existing code** (each error raised = a latent bug or an annotated exception) - a rule that only applies to future code leaves the bombs in place
- Never a non-deterministic guardrail (worse than nothing)

### 4. Class regression tests
- One test per fixed occurrence **and** a test/check covering the whole class

### 5. Trace
- Short postmortem (timeline, root cause, tested hypotheses, actions) with a real ticket per action not shipped within the fix

## Traps & rationalizations

| Excuse | Reality |
|--------|---------|
| "I ship the fix and create the root-cause ticket later" | "Later" never comes. The session does not end without the spike's trace (ticket created or spike done). |
| "It's just an isolated slip" | A hypothesis to refute, not to assume - usually false by the 2nd occurrence. |
| "I'll add a note/rule to CLAUDE.md, that's enough" | A documentation rule does not sweep the existing code and does not survive inattention. Blocking guardrail or nothing. |
| "The guardrail only applies to new code" | The bombs stay in place. It must sweep the existing code: each error raised = a latent bug or an annotated exception. |
| "I'll keep it in mind" | Memory ≠ trace. Postmortem or a real ticket. |

## Guardrails

- **Never** fix the Nth symptom and declare the recurrence handled
- **Never** end the session without a trace of the spike (ticket or postmortem)
- **Never** mix the urgent fix and the root-cause refactor in the same commit

## Exit condition

- [ ] Class named (property common to the N fixes), not just the Nth symptom
- [ ] 2–4 hypotheses spiked, at least one refuted with evidence
- [ ] "Existing tooling should have caught it - why didn't it?" answered
- [ ] **Blocking, deterministic** guardrail added, sweeping the existing code (check output pasted)
- [ ] One test per fixed occurrence + a test/check covering the class
- [ ] Trace delivered: postmortem + a real ticket per deferred action
Files in this package (3)
  • SKILL.md 5 KB
  • scripts/detect-recurring-fixes.ts 2 KB
  • templates/postmortem-recidive.md 1 KB

Versions

The database has no other skills named recurring-bug-root-cause.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 9485c0a6407c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95rc-diagnose
    Diagnoses a bug or behavior to root cause, then fixes and verifies. Use for any failure. Do not use to review a diff (rc-code-review).
  • 90triage
    Triage a bug report. Reproduces the bug, diagnoses the root cause, verifies whether the behavior is intentional, and attempts a fix. Use when asked to "triage issue #1234", "triage this bug", or similar.
  • 100hatch3r-bug-fix
    Step-by-step bug fix workflow. Diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs, working on bug report issues, or when the user mentions a bug.
  • 100awesome-bug-fix
    Fixes a bug through a runnable reproduction and its root cause. Use for errors, crashes, failing tests or builds, flaky behavior, or repeated failed fixes.
  • 100sp-debugging
    Use when a bug needs root-cause diagnosis and a written fix plan before implementation.
  • 100fix-bug
    Reproduce the bug, find the root cause, fix it there, and verify against the repro with prove-it-works. Use for any defect report; not for a direct fix in Normal mode when no repro-first loop is needed, and not for a performance regression (use tune-perf).

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.