agentleFS
sentasitysentasity/cadence/skills/c-find-bugs/SKILL.md

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.

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
  1. Very specific:

    Read target (or the manifest of files in the target).

    line 51
  2. Very specific:

    After the report, ask via AskUserQuestion whether to enter fix mode.

    line 98
  3. Distinctive:

    Wait for explicit user confirmation.

    line 126

≈ “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.

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

/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

FormTargetToken cost
/c-find-bugs <design-folder>Design — logical defects in proposed systemMedium
/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. baselineMedium
/c-find-bugs <file-path>One file's sourceLight
/c-find-bugs --repoWhole repoHeavy — 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):

CategoryExamples
CorrectnessOff-by-one, null-deref, wrong comparison operator, swapped arguments.
Logic errorsConditions that can never be true, dead code paths, infinite loops, missing return statements.
Resource handlingLeaked file handles, missing connection close, unclosed transactions.
ConcurrencyRace conditions, missing locks, double-checked locking bugs.
Error handlingSwallowed exceptions, generic except catches, missing error propagation.
SecuritySQL injection, command injection, hardcoded credentials, missing auth checks.
API misuseWrong library calls, deprecated APIs, missing required parameters.
Time / datedatetime.utcnow() (deprecated), naive datetime comparisons, timezone leaks.

On doc targets (design / plan):

CategoryExamples
Logical bugs in proposed flowRace conditions described in design, ordering violations, missing failure modes.
Plan execution bugsTasks referencing functions defined nowhere; tests that test the wrong thing; commits before tests pass.
Dependency errorsTask 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 mismatchesTask 3 says clearLayers(), Task 7 says clearFullLayers() — same function, different name.
Impossible steps"Run make foo" when no foo target in Makefile.

Dispatch model

  1. 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.
  2. Estimate token cost. On --repo, confirm before proceeding.
  3. Fan out sub-agents — one per defect category enabled in config (via Task).
  4. Each sub-agent reports defects with file:line citations, severity, one-line fix direction.
  5. 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) the question opens 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's description gives 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 --repo scope 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 create template, 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.

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, *.json fixtures.
  • Print estimated token count before run.
  • Wait for explicit user confirmation.
  • Optional --quiet skips 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).

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.