investigate-codebase
Skill9 starsChanged 3 months agoMITView on GitHub
Build an evidence-backed working model of an existing codebase. Use when you must orient in a large or unfamiliar repository; explain architecture or a subsystem; trace a request, runtime, control, or data flow for a concrete question or bug; analyze a branch, commit, diff, or pull request for behavioral impact and blast radius; or assess AI-generated or changed code against requirements, contracts, invariants, tests, and runtime evidence. Default to read-only investigation. Do not trigger only because a coding task touches an existing repository; use when understanding or verification is the requested outcome or a substantial prerequisite.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- crissmoldovan/agent-skillstheir own version, first seen Oct 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- crissmoldovan/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 15 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Read all applicable repository and agent instruction files before inspecting implementation, including nested per-directory files under …
- Distinctive: line 28
Default to read-only investigation.
- Distinctive: line 35
Treat README files, architecture documents, comments, and PR descriptions as intent evidence that must be reconciled with implementation …
- Distinctive: line 37
Start narrow. Expand scope only when a dependency, contract, contradiction, or unresolved hypothesis requires it.
- Very specific: line 39
Prefer version-control history, manifests, exact symbol references, fast repository-wide text search (rg, grep, or the equivalent available …
- Very specific: line 44
Use whatever file-reading, search, and command-execution capabilities the host environment provides.
- Distinctive: line 47
Ask before checks that may use production credentials, access external systems, mutate durable state, incur meaningful cost, or take …
- Distinctive: line 49
Never equate passing tests, high coverage, or clean static analysis with proof of complete correctness.
- Distinctive: line 96
If no independent oracle exists, state which consistency claims can be assessed and which intent claims cannot be established.
- Distinctive: line 109
Follow the smallest path that can answer the question:
- Very specific: line 131
Prefer revision + file + symbol.
- Distinctive: line 138
Search for contradictory call sites, tests, schemas, configuration, history, and runtime behavior.
- Distinctive: line 140
Consider empty and boundary inputs, permissions, ordering, retries, idempotency, concurrency, partial failure, compatibility, migration, …
- Distinctive: line 143
Ask which unchanged behavior must remain invariant, not only what changed.
- Distinctive: line 156
Prefer focused checks tied to a hypothesis over an untargeted full suite.
- Distinctive: line 188
Use a diagram only when it materially clarifies at least three boundaries, branches, or state transitions.
- Distinctive: line 196
Do not output an uncalibrated correctness percentage.
- Distinctive: line 205
every material claim has evidence or is explicitly marked unknown.
- Distinctive: line 209
Do not continue exploring merely to appear exhaustive.
≈ “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
Investigate Codebase
Objective
Build the minimum sufficient, falsifiable model needed to answer the user's question. Prefer a thin vertical slice over an exhaustive repository summary. Optimize for human understanding and verification, not the amount of code read.
Operating contract
- Read all applicable repository and agent instruction files before inspecting
implementation, including nested per-directory files under whichever convention
the repository uses (for example
AGENTS.md,CLAUDE.md, orCONTRIBUTING.md). - Default to read-only investigation. Do not edit files, install dependencies, switch branches, reset state, or alter durable resources unless the user requested that action.
- Preserve unrelated and dirty worktree changes. Separate committed changes from local modifications before drawing conclusions.
- Record the repository revision. For change analysis, resolve and record the exact base and head revisions rather than silently guessing.
- Treat README files, architecture documents, comments, and PR descriptions as intent evidence that must be reconciled with implementation and behavior.
- Start narrow. Expand scope only when a dependency, contract, contradiction, or unresolved hypothesis requires it.
- Prefer version-control history, manifests, exact symbol references, fast
repository-wide text search (
rg,grep, or the equivalent available in the environment), language-native tooling, tests, and runtime observation. Use semantic or embedding search only to locate candidate code, never as behavioral proof. - Use whatever file-reading, search, and command-execution capabilities the host
environment provides. If a capability required by a check is unavailable, record
the check as
UNKNOWNwith the reason rather than substituting a weaker claim. - Ask before checks that may use production credentials, access external systems, mutate durable state, incur meaningful cost, or take substantial time.
- Never equate passing tests, high coverage, or clean static analysis with proof of complete correctness.
Select the investigation
Choose one primary mode and read its guide completely:
ORIENT: Map a large or unfamiliar repository. Read orient-large-codebase.md.TRACE: Explain a concrete runtime, control, or data flow. Read trace-runtime-flow.md.IMPACT: Analyze a PR, branch, commit, or diff. Read analyze-pr-impact.md.VERIFY: Assess generated or changed code. Read verify-generated-code.md.
Combine modes only when necessary, such as IMPACT + VERIFY. Read only the
guides required for the selected modes.
Choose a depth:
scan: Find landmarks and a likely path; keep uncertainty explicit.working: Produce an evidence-backed explanation and focused checks. Use by default.audit: Broaden risk and verification coverage when explicitly requested or warranted by the change's consequences.
State the selected mode, depth, scope, revision, assumptions, and important environment limits in the result.
Investigation loop
1. Anchor the target
- Identify the repository root, applicable instructions, working-tree state, revision, build system, and relevant runtime configuration.
- For a PR or branch, resolve the actual comparison base from PR metadata or the merge base. Keep unrelated local changes out of the comparison.
- Exclude generated, vendored, fixture, snapshot, lockfile, and formatting noise from semantic analysis unless one of them changes behavior or contracts.
2. Frame falsifiable questions
- Rewrite the request as observable questions: given which input and preconditions, what output, state change, side effect, or failure should occur?
- Identify available correctness oracles: explicit requirements, acceptance criteria, public contracts, schemas, stable prior behavior, domain invariants, reference implementations, or production observations.
- If no independent oracle exists, state which consistency claims can be assessed and which intent claims cannot be established.
3. Build the minimum map
- Locate only the relevant manifests, boundaries, entry points, public contracts, configuration, persistence, external effects, and tests.
- Describe components by runtime or domain responsibility rather than by directory.
- Mark dynamic dispatch, dependency injection, reflection, generated code, plugins, queues, and callbacks as unresolved edges until supported by evidence.
4. Trace a thin vertical slice
Follow the smallest path that can answer the question:
input boundary -> parsing/auth -> orchestration -> domain decisions -> state or external effect -> output/error/telemetry
Track control flow, data-shape changes, state ownership, feature flags, async boundaries, retries, serialization, errors, and observable side effects when relevant.
5. Maintain an evidence ledger
For each material claim, record:
| Claim | Evidence status | Revision + path/symbol or command | Result or limitation |
Use these labels:
SOURCE: Directly supported by implementation, configuration, schema, or diff.RUNTIME: Observed through an executed command, test, log, trace, or reproducer.INFERRED: Reasoned from evidence but not directly observed.UNKNOWN: Missing code, environment, specification, oracle, or access.CONTRADICTED: A counterexample or conflicting source disproves the claim.
Prefer revision + file + symbol; use line numbers as secondary anchors because
they drift. Include exact commands and outcomes for runtime evidence. Never label a
statically inferred call path as an observed runtime trace.
6. Challenge the model
- Turn the model into predictions that could be false.
- Search for contradictory call sites, tests, schemas, configuration, history, and runtime behavior.
- Consider empty and boundary inputs, permissions, ordering, retries, idempotency, concurrency, partial failure, compatibility, migration, rollback, and external boundary behavior according to risk.
- Ask which unchanged behavior must remain invariant, not only what changed.
7. Verify economically
Choose the cheapest check capable of falsifying each important claim:
- Source, type, schema, and configuration inspection
- Typecheck, lint, compile, or static analysis
- Focused unit or component test
- Integration or end-to-end path
- Base/head differential, property, metamorphic, adversarial, or mutation check
- Runtime trace or production-like observation
Prefer focused checks tied to a hypothesis over an untargeted full suite. Distinguish pre-existing failures, regressions, flaky outcomes, skipped checks, timeouts, and environment mismatches. Do not hide checks that could not run.
8. Synthesize for human use
Answer the question before presenting supporting detail. Use progressive disclosure:
30 seconds: Direct answer, primary path, and largest uncertainty.5 minutes: Minimal model, contracts or invariants, behavior delta, and risks.Audit: Evidence ledger, commands, results, contradictions, and unknowns.
Limit the first map to roughly five to seven meaningful components and one to three representative flows. Provide a five-to-twelve-file reading route in causal or dependency order, with one reason per file. If the user is learning, finish with two or three prediction questions that test whether the model transfers.
Report contract
Return the sections relevant to the selected mode:
- Direct answer
- Scope, mode, depth, revision, and base/head when applicable
- Minimal architecture or execution-flow model
- Contracts and invariants
- Evidence ledger
- Behavioral impact or correctness matrix
- Risks, contradictions, assumptions, and unknowns
- Recommended reading route
- Smallest next verification steps
- Prediction questions when learning is part of the goal
Use a diagram only when it materially clarifies at least three boundaries, branches, or state transitions. Do not produce a full repository tree as a substitute for a model.
Phrase correctness conclusions conditionally, for example:
At revision X in environment Y, evidence supports behavior Z for scenarios A and B. Scenario C and external dependency D remain unverified.
Do not output an uncalibrated correctness percentage.
Completion criteria
Stop when:
- the target question has a supported answer;
- the relevant entry, decisions, state ownership, side effects, and failure path are accounted for to the requested depth;
- every material claim has evidence or is explicitly marked unknown;
- verification results and limitations are reproducible; and
- further exploration is unlikely to change the answer materially.
Do not continue exploring merely to appear exhaustive.
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.

