c-find-bugs
Skill1 starsChanged 3 months agoMITView on GitHub
Use when the user wants concrete defects found in a design, plan, branch, file, or the whole repo.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs-siteSkill
- c-auditSkill
- c-brainstormSkill
- c-checkSkill
- c-designSkill
- c-executeSkill
- c-explainSkill
- c-planSkill
- c-validateSkill
- c-worktreeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Read target (or the manifest of files in the target).
- Very specific: line 98
After the report, ask via AskUserQuestion whether to enter fix mode.
- Distinctive: line 126
Wait for explicit user confirmation.
≈ “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
/c-find-bugs
You hunt concrete, fixable defects. Each defect comes with a citation, severity, and a direction for fixing — not a vague "this seems off."
Invocation forms
| Form | Target | Token cost |
/c-find-bugs <design-folder> | Design — logical defects in proposed system | Medium |
/c-find-bugs <plan-folder> | Plan — execution bugs (missing deps, type mismatches, impossible steps) | Medium |
/c-find-bugs <branch-name> | Code changes on a branch vs. baseline | Medium |
/c-find-bugs <file-path> | One file's source | Light |
/c-find-bugs --repo | Whole repo | Heavy — confirms before starting |
Default scope when no target is given: the current branch's changes since it diverged from main (or config.find_bugs.default_baseline), i.e. git diff <baseline>...HEAD with three dots. A two-dot or bare git diff <baseline> also shows work that landed on the baseline after the branch point, as if the branch had deleted it. If on main itself, ask for explicit target.
Token-cost warning: --repo prints estimated scope (file count, approximate token count) and waits for explicit user confirmation. Other scopes start without confirmation.
What it checks
On code targets (branch / file / repo):
| Category | Examples |
| Correctness | Off-by-one, null-deref, wrong comparison operator, swapped arguments. |
| Logic errors | Conditions that can never be true, dead code paths, infinite loops, missing return statements. |
| Resource handling | Leaked file handles, missing connection close, unclosed transactions. |
| Concurrency | Race conditions, missing locks, double-checked locking bugs. |
| Error handling | Swallowed exceptions, generic except catches, missing error propagation. |
| Security | SQL injection, command injection, hardcoded credentials, missing auth checks. |
| API misuse | Wrong library calls, deprecated APIs, missing required parameters. |
| Time / date | datetime.utcnow() (deprecated), naive datetime comparisons, timezone leaks. |
On doc targets (design / plan):
| Category | Examples |
| Logical bugs in proposed flow | Race conditions described in design, ordering violations, missing failure modes. |
| Plan execution bugs | Tasks referencing functions defined nowhere; tests that test the wrong thing; commits before tests pass. |
| Dependency errors | Task B uses Task A's Touches: files or symbols but lists no Depends: [A] edge (parallel-execution hazard); a Depends: cycle; a task Reads: a file no task Touches: or that doesn't exist. |
| Type / signature mismatches | Task 3 says clearLayers(), Task 7 says clearFullLayers() — same function, different name. |
| Impossible steps | "Run make foo" when no foo target in Makefile. |
Dispatch model
- Read target (or the manifest of files in the target). When the target is a Cadence design or plan, read it via
skills/_shared/storage-resolution.md(read_artifact); code targets (branch / file /--repo), the diff scoping, and the vendored/generated exclusion logic are unchanged and never call resolution. - Estimate token cost. On
--repo, confirm before proceeding. - Fan out sub-agents — one per defect category enabled in config (via
Task). - Each sub-agent reports defects with file:line citations, severity, one-line fix direction.
- Merge, dedupe, prioritize.
Severity tiers
- Critical — bug will cause incorrect behavior or data loss in production.
- High — bug surfaces in common cases or violates a stated invariant.
- Medium — bug surfaces in edge cases or less-traveled code paths.
- Low — code smell or style issue, but the code works.
Output: citation-first report
Same shape as /c-check and /c-audit.
# /c-find-bugs: <target>
# Estimated tokens: <N>
<one-paragraph plain-English summary of overall code/doc health,
written for a non-code-reader>
## Critical
- `<file>:<line>` — <description>. Fix: <direction>.
## High
- `<file>:<line>` — <description>. Fix: <direction>.
## Medium
- ...
## Low
- ...
## What's working
- <one-line note on robust patterns observed>
## Recommended next action
<one specific sentence>"What's working" mandatory — same calibration rule as /c-check.
Interactive finding application (optional follow-up)
After the report, ask via AskUserQuestion whether to enter fix mode. Default is report-only.
Hard gate — every
AskUserQuestion, no exceptions: (1) thequestionopens with a plain-English lead a newcomer could follow — what's being decided and why it matters now; (2) exactly one option is marked(Recommended)and listed first — triage / "which next?" menus included ("your call" is a non-answer); (3) each option'sdescriptiongives the one-sentence trade-off. Full spec:skills/_shared/ask-user-question.md.
Per-defect questions must additionally include a rolling progress line (Defect 14/17 — 8 fixed, 5 skipped so far) and a plain-English TL;DR of what's wrong and why it matters; the bare <file>:<line> cite is not enough context by question 14.
Entry question (single AskUserQuestion):
- "Enter fix mode to walk defects one at a time?"
- Fix mode (critical + high only) (Recommended when ≥1 critical or high) — walk only Critical and High severities.
- Fix mode (all) — walk every severity, including Low.
- No, leave the report as-is (Recommended when only Low/Medium) — exit; user handles defects manually later.
Per-defect question (only in fix mode), for each defect in severity order. Question text leads with the progress line + plain-English TL;DR; the <file>:<line> cite anchors back to the report for users who want detail.
- Options:
- Fix now (Recommended for code targets at file scope when the fix is unambiguous) — apply the suggested fix inline. NOT available for
--reposcope without explicit per-file confirmation (too many implicit edits in one batch). - Track — print the defect in a format ready to paste into an issue tracker (
gh issue createtemplate, Linear body, etc.); skill moves on. - Mark as decided — record that the user accepts this as not-a-bug; future runs against the same target can be told to ignore it.
- Skip — leave as-is; no record.
- Fix now (Recommended for code targets at file scope when the fix is unambiguous) — apply the suggested fix inline. NOT available for
Repo-scope discipline
When --repo:
- Excludes vendor/generated/build paths via
config.find_bugs.exclude(defaults:node_modules,dist,build,__pycache__,target,.next,vendor). - Limits to source files only — no
*.lock,*.snap,*.jsonfixtures. - Print estimated token count before run.
- Wait for explicit user confirmation.
- Optional
--quietskips the confirmation prompt (use with care).
What /c-find-bugs doesn't do
- Doesn't write or modify code, plans, or designs.
- Doesn't fix the bugs it finds.
- Doesn't audit plan completion (that's
/c-audit). - Doesn't review for substance/quality (that's
/c-check). - Doesn't validate deployed behavior (that's
/c-validate). - Doesn't deduplicate against an issue tracker or memory — every run is fresh.
References
- Shared question/option formatting:
skills/_shared/ask-user-question.md. - Sister diagnostic:
/c-check(substance/quality vs. this skill's concrete-defects framing).
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.

