reasoning-codebase-review
Skill1 starsChanged 3 months agoMITView on GitHub
Run a read-only, multi-perspective audit of an existing codebase using independent investigators and red/blue challenge. Use for broad architecture and risk pressure tests; not for a single narrow defect.
In this repository10 other files it gives its agents.
- adversarial-reviewSkill
- checkpoint-walkthroughSkill
- context-prunerSkill
- decision-reconSkill
- deep-planSkill
- evidence-retrospectiveSkill
- harvest-agent-branchesSkill
- idea-forgeSkill
- steward-brownfieldSkill
- trace-data-provenanceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 18 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Do not ask agents to reveal private chain-of-thought.
- Distinctive: line 18
Use Deep for high-consequence or highly coupled systems, not merely large repositories.
- Distinctive: line 22
Keep the review read-only.
- Distinctive: line 24
Read repository instructions before assigning work.
- Distinctive: line 25
Use repository evidence as the source of truth.
- Distinctive: line 27
Never call a sampled review "clean." Report inspected and uninspected surfaces.
- Distinctive: line 28
If the user also asks for fixes, finish and present the review first.
- Distinctive: line 32
Read references/reasoning-methods.md before selecting or assigning methods.
- Distinctive: line 33
Read references/agent-briefs.md immediately before spawning investigators or challengers.
- Distinctive: line 57
test layout, CI checks, and observability.
- Distinctive: line 62
Run shared baseline checks once at the coordinator level and pass their exact results to reviewers.
- Distinctive: line 77
Add at most two catalog methods when the evidence map exposes a specific need.
- Distinctive: line 95
Do not give investigators the parent's suspicions or another investigator's findings.
- Distinctive: line 101
Wait for the full wave before synthesis.
- Distinctive: line 103
If a reviewer exceeds its budget or drifts outside scope, request an immediate bounded return once.
- Distinctive: line 109
After the investigator wave is complete, give a fresh red reviewer and a fresh blue reviewer the same candidate packet and evidence map.
- Distinctive: line 118
If a challenger fails, continue but mark every affected claim as incompletely challenged.
- Distinctive: line 152
If no findings survive, say that no findings survived within the inspected scope.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Reasoning Codebase Review
Pressure-test a codebase through independent reasoning lenses, then challenge the resulting claims before accepting them. Treat explicit invocation as authority to spawn read-only subagents for this review only.
Do not ask agents to reveal private chain-of-thought. Ask for observable claims, questions tested, repository evidence, counterevidence, and conclusions.
Execution profiles
- Fast: one bounded investigator and a coordinator verification pass.
- Standard: two independent concern clusters plus one challenge pass.
- Deep: the full investigator wave, separate red and blue challengers, and explicit residual-risk accounting.
Use Deep for high-consequence or highly coupled systems, not merely large repositories.
Operating contract
- Keep the review read-only. No reviewer edits product code, tests, configuration, or documentation.
- Preserve dirty work and distinguish current changes from the baseline under review.
- Read repository instructions before assigning work. Pass every applicable instruction to each reviewer.
- Use repository evidence as the source of truth. A method generates hypotheses; it never proves them.
- Execute project code only when provenance is trusted and the repository's normal verification is safe. Otherwise remain source-only and record that limitation.
- Never call a sampled review "clean." Report inspected and uninspected surfaces.
- If the user also asks for fixes, finish and present the review first. Treat implementation as a separate phase with separately bounded authority.
Load the references
- Read references/reasoning-methods.md before selecting or assigning methods.
- Read references/agent-briefs.md immediately before spawning investigators or challengers.
1. Pin the review target
Resolve and record:
- repository root, current revision, branch, and working-tree state;
- target: whole codebase, subsystem, branch, diff, or explicit paths;
- comparison point when the request concerns a change;
- intended behavior from authoritative specifications, tests, schemas, and public contracts;
- repository instructions, normal checks, and any execution constraints.
Default a bare request to the current checkout as a whole-codebase architecture and risk review. If the repository is too large for exhaustive reading, choose a risk-based sample and name the sampling rule before delegation. Ask only when the target or authority cannot be resolved safely.
2. Build a shared evidence map
Orient once so independent agents do not each rediscover the entire repository. Inspect:
- runtime and build entry points;
- module and dependency boundaries;
- state, storage, queues, caches, and migrations;
- authentication, authorization, secrets, and other trust boundaries;
- external APIs and irreversible side effects;
- central domain types and invariants;
- test layout, CI checks, and observability;
- recent or concentrated churn when history is relevant.
Turn this into a compact context package: target, baseline, repository rules, system map, high-risk anchors, known unknowns, and commands already run. Include facts and paths, not preliminary findings. Keep a coverage ledger of surfaces assigned, inspected, skipped, or blocked.
Run shared baseline checks once at the coordinator level and pass their exact results to reviewers. Do not pay for multiple full-suite runs unless a reviewer needs a distinct targeted reproduction.
3. Select and cluster methods
Honor every method named by the user. For a general run, use these eight:
- Pre-mortem analysis
- First principles
- Inversion
- Red team versus blue team
- Socratic questioning
- Constraint removal
- Stakeholder mapping
- Analogical reasoning
Add at most two catalog methods when the evidence map exposes a specific need. Do not inflate the review by running every available method.
Cluster the default investigator wave as follows, adjusting to the codebase:
- Failure analyst: pre-mortem, inversion, and constraint removal.
- Ground-truth analyst: first principles and Socratic questioning.
- Systems analyst: stakeholder mapping and analogical reasoning.
Red-team versus blue-team is the challenge wave, not another independent memo.
4. Run the independent investigator wave
Spawn up to three investigators concurrently, bounded by available slots. Give each the same context package, a distinct method cluster, the relevant high-risk anchors, and the investigator contract from references/agent-briefs.md.
Give every investigator an explicit evidence budget and finish condition. For a target of a few files, default to no more than 12 supporting paths, three targeted commands, five candidate findings, three falsified hypotheses, and one verification pass. Scale the budget explicitly for a larger subsystem; never leave it open-ended.
Protect independence:
- Do not give investigators the parent's suspicions or another investigator's findings.
- Let each inspect outside its anchor paths when following a concrete dependency or caller.
- Require exact file and line references, checked scope, counterevidence sought, and confidence.
- Require agents to return candidate findings and falsified hypotheses, not fixes or prose tours.
- Cap each brief to one concern cluster; split a very large subsystem rather than broadening a brief.
Wait for the full wave before synthesis. A failed, timed-out, or empty investigator is a coverage gap, not a clean pass. If subagents are unavailable, run the clusters sequentially and disclose that the perspectives were not independent.
If a reviewer exceeds its budget or drifts outside scope, request an immediate bounded return once. If it still does not return, interrupt it and mark its methods and surfaces incomplete; do not stall the whole review.
5. Run the red/blue challenge wave
Normalize candidate findings into claims with stable IDs. Merge only candidates that make the same claim and require the same action; preserve corroborating methods and locations.
After the investigator wave is complete, give a fresh red reviewer and a fresh blue reviewer the same candidate packet and evidence map. Run them concurrently when possible:
- Red: try to falsify claimed safety, find reachable failure paths, and strengthen the best case that each candidate matters.
- Blue: try to falsify each candidate by finding guards, callers, tests, operational controls, or explicit intent that already handles it.
Neither reviewer inherits the parent verdict. Both must cite repository evidence. New red-team findings enter as candidates and must face the same blue challenge; unsupported reassurance from blue is discarded.
Challenge only the normalized candidates and their directly relevant paths. Cap each challenger to one compact entry per claim and one pass. If only one slot is available, run blue and red sequentially without giving either the other's output.
If a challenger fails, continue but mark every affected claim as incompletely challenged. Do not silently simulate the missing side as an independent agent.
6. Judge every surviving claim
The parent is the judge. For each candidate:
- Reopen the cited code and enough surrounding context to establish reachability.
- Inspect relevant callers, guards, tests, schemas, and specifications.
- Compare investigator evidence with red and blue counterevidence.
- Classify the claim as accepted, qualified, unresolved, or rejected.
- Assign risk only from demonstrated impact and reachability; ignore labels supplied by subagents.
An accepted finding requires:
- an exact location or concrete architectural boundary;
- a trigger or violated invariant;
- evidence that the path is reachable or the assumption is load-bearing;
- a concrete consequence for a named stakeholder;
- the counterevidence checked;
- the smallest next check or mitigation direction.
Reject speculative, duplicate, purely stylistic, or already-handled claims. Keep genuine disagreement visible instead of forcing consensus.
7. Report the bounded result
Lead with the result, not the ceremony. Use this structure:
- Executive verdict — the two or three system-level conclusions and whether urgent action is warranted.
- Accepted findings — ordered by demonstrated risk; include location, methods, trigger, evidence, stakeholder consequence, counterevidence, and next action.
- Disagreement ledger — qualified or unresolved claims where red and blue evidence materially differ.
- Methods and coverage — which agents and methods ran, paths inspected, commands executed, and any reviewer failures.
- Residual risk — uninspected surfaces, unsafe-to-run checks, missing specifications, and assumptions the repository could not resolve.
- Rejected themes — counts and a compact summary of notable false positives; do not dump noise.
If no findings survive, say that no findings survived within the inspected scope. Never generalize beyond the coverage ledger.
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.

