defect-hunting
Skill5 starsChanged 9 days agoMITView on GitHub
On an app-dev-team project, use when reviewing code, auditing an app, writing a guard rule or test, or certifying a threshold/constant. Used by code-reviewer, qa-engineer, verification-engineer, red-team-agent and /app-audit.
In this repository25 other files it gives its agents.
- accessibility-gateSkill
- agent-isolationSkill
- architecture-builderSkill
- board-doctorSkill
- brownfield-onboardingSkill
- business-modelSkill
- content-designSkill
- context-preflightSkill
- database-migrationSkill
- dependency-policySkill
- design-systemSkill
- house-conventionsSkill
- ic-workflowSkill
- intent-traceSkill
- localisationSkill
- mutation-testingSkill
- parallel-orchestratorSkill
- performance-reviewSkill
- prd-builderSkill
- requirements-intakeSkill
- role-activationSkill
- runtime-gateSkill
- spec-criticSkill
- sprint-plannerSkill
- team-protocolSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Before approving or making any change that touches persisted or user-visible state:
- Distinctive: line 56
If you cannot enumerate them, say so — do not approve on the strength of the path you read.
- Very specific: line 65
Tells: before you improvise your own.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Defect hunting
Verify the thing that has to be true, not the thing you changed.
Filtering the list is not filtering the parser. Matching the token is not matching the value. Mutating the file is not confirming the mutation landed.
This file is §1, which every caller needs. The other sections are in references/ — read the one
the situation names, and only that one.
| § | Read it when | File |
| 1b | a diff adds a function, component, type, constant or route — prove it has a real caller and its required co-changes (test file, migration, route registration, (de)serialization) exist | references/1b-reachability.md |
| 2 | a change adds or edits a threshold, bound, formula, table or rate with a clinical, financial or safety claim — execute it across its range against reference data, never certify by reading | references/2-execute-constants.md |
| 3, 3b | you write, review or certify a guard rule, lint rule, CI grep, baseline, or a new/changed test — prove it can fail (mutation applied, fixture reproduces the real condition, red then green) | references/3-rules-and-tests-that-cannot-fail.md (authoring a shell guard: also references/writing-guard-rules.md) |
| 4 | you own a findings register, an audit, or a sweep — stable IDs, never-blank status, two independent searches for "not found" | references/4-findings.md |
| 4b | a change touches a value a user supplies, sees or is told — follow the user's value across the boundary: name the read line and the write line, run the round trip with a distinguishable value (1999-01-02, not today; 73, not 0), measure on-device what the spec quantifies, and reintroduce the defect to watch the regression test fail | references/round-trip.md |
| 5 | always, on a review or audit — run every Tell in ${CLAUDE_PLUGIN_ROOT}/knowledge/failure-corpus.md and cite the class ID (FC-004); a class that recurs after its rule shipped is the most valuable output in the system | below |
| — | attaching a checklist to a code-reviewer or audit verdict | references/review-checklist.md |
1. Audit the data's entry points, not the screens
A review organised by screen structurally cannot find the expensive defects: the audited surface
is correct and the bug is in the second path to the same data — usually another file, often
another module. The validated add form beside an edit path that validates nothing; the reader beside
a writer that destroys data; the picker's success branch beside a cancel branch that wipes the
existing photo; the purchase flow beside the still-loading entitlement state that paywalls a paying
customer; sync's happy path beside its RECONCILE_FAILED branch.
The question that does the work
"What is the second way this value gets written?"
And its siblings: what is the second way it gets read? What happens on cancel? On failure? On restore? On import? On sync? On each remaining enum case?
Procedure
Before approving or making any change that touches persisted or user-visible state:
- Name the data the change touches — the field, the row, the preference, the entitlement.
- Enumerate every writer.
grepthe field name across the whole repo, not the module — preferast-grepwhere the language has one, because text search false-negatives on a renamed reference or a match inside a comment or string. Create, edit, import, sync, restore, migration, reset-to-default, and every failure branch. - Enumerate every reader, same way.
- Show the invariant holding on each one. A validation that one producer applies and another walks around is not a validation.
- If you cannot enumerate them, say so — do not approve on the strength of the path you read.
A one-line fix at the shared choke point beats a guard in every caller, and it is also the lazier fix. Patching only the path the ticket names leaves every sibling caller broken.
5. Use the prior — ${CLAUDE_PLUGIN_ROOT}/knowledge/failure-corpus.md
The rules here are general. The corpus is what this codebase has actually produced — one class
per defect shape, each with dated instances and the rule that now claims to catch it. Run its
Tells before you improvise your own. Two obligations: cite the class ID in any finding it
produced, and treat a class that recurs after its Rule shipped date as proof the rule does not
work — team-doctor fails on it and /app-learn's failure pass feeds it. The corpus is downstream
of this skill, not a replacement: §1–§4 are how you find a defect nobody has named yet.
Anything you did not check is stated as unchecked in the verdict. An unstated gap reads as a cleared one.
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.

