plan-codebase-analysis
Skill0 starsChanged 11 days agoMITView on GitHub
Orient in an unfamiliar repository and trace a behaviour end to end (entry points, call paths, data flow, git history, tests as spec, conventions) with confidence-labelled findings. Use before broad or cross-module changes, when asked how X works or where Y is handled, or when a bug spans several files. Not for designing new systems (use `plan-architecture`).
- Reads credentials
In this repository33 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- global/CLAUDE.mdCLAUDE.md
- build-backendSkill
- build-commitsSkill
- build-containersSkill
- build-databaseSkill
- build-design-systemSkill
- build-frontendSkill
- build-iacSkill
- build-project-setupSkill
- core-documentationSkill
- core-prompt-engineeringSkill
- core-token-efficiencySkill
- create-marketing-copySkill
- create-seo-contentSkill
- operate-incidentSkill
- operate-observabilitySkill
- plan-architectureSkill
- plan-campaignSkill
- plan-test-strategySkill
- plan-threat-modelSkill
- review-pull-requestSkill
- review-seoSkill
- review-ui-uxSkill
- secure-code-reviewSkill
- secure-repo-governanceSkill
- secure-supply-chainSkill
- ship-ci-cdSkill
- ship-github-actionsSkill
- ship-readinessSkill
- ship-releaseSkill
- test-performanceSkill
- test-validationSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 18
Locate the anchor: Search in this order and stop at the first solid hit:
- Very specific: line 23
Read references/search-recipes.md when the stack is unfamiliar or the first two searches miss.
- Distinctive: line 33
Read the smallest slice that answers the question: search, then targeted line ranges.
- Distinctive: line 42
When several implementations match (interfaces, plugins, per-tenant variants, old and new copies in a monorepo), find which one the entry …
- Very specific: line 43
Prefer a cheap, side-effect-free check (run one narrow test, a --help, a dry-run) over reasoning about behaviour.
- Distinctive: line 49
Read-only. Do not edit, format, install dependencies, run migrations, or start anything that writes to shared resources without asking.
- Very specific: line 50
Do not print secrets found in .env, config or history.
- Very specific: line 51
Do not check out branches or stash the user's changes to look around.
≈ “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
Codebase Analysis
Build a verified, minimal map of the code that matters for the task, read-only, before anyone edits.
Procedure
- Frame the question. Restate the target as something observable: a route, command, job, UI action, error message or data field. Note what a full answer must explain (entry, decision points, side effects, outputs).
- Orient in under 10 tool calls.
git status,git branch --show-current,git log --oneline -15(state and recent intent).- Instruction files:
CLAUDE.md,AGENTS.md,.claude/rules/,CONTRIBUTING.md,docs/adr/. - Manifests give stack and scripts:
package.json,pyproject.toml,go.mod,pom.xml/build.gradle,*.csproj,Cargo.toml,Gemfile,composer.json. Workspace files (pnpm-workspace.yaml,go.work,nx.json,turbo.json, Cargo[workspace]) mean a monorepo: find the owning package first. - Entry points and wiring:
main/index/app/serverfiles, route registration, DI container,DockerfileCMD/ENTRYPOINT, CI build/test steps,Procfile, deployment manifests. - Tree to depth 2, excluding
node_modules,vendor,dist,build,.venv,targetand generated code.
- Locate the anchor. Search in this order and stop at the first solid hit:
- Exact user-visible strings (error text, log message, UI label, i18n key) - most unique.
- Route path or CLI command name.
- Symbol name, then its definition and references (LSP or
ctagsif available, else word-boundary search\bname\b). - Config key, env var, DB table or column name.
Read
references/search-recipes.mdwhen the stack is unfamiliar or the first two searches miss.
- Trace the call path. From the anchor follow callers up to the entry point and callees down to side effects (DB, queue, HTTP, file, cache, email). Record each hop as
file:line - function - what it decides or changes. Stop a branch when it leaves the question's scope or enters a third-party library. - Trace the data. For the key entity find where it is defined (schema/model), validated, transformed, persisted, read back and serialised. Note every place the shape or units change.
- Read the tests as spec. Find tests that exercise the path (search for the function, route or fixture). They show intended behaviour, edge cases and how to run that slice. Missing tests are a finding.
- Use history for "why".
git log -S'<string>' --oneline(when a string appeared or vanished),git log -L :<func>:<file>(one function's history),git blame -w -C -L a,b <file>thengit show <sha>for the message and linked issue. Do this before calling odd code a bug. - Extract conventions the change must follow: layering, naming, error handling, DI, logging, validation library, test style and location, file placement. Cite one exemplar file for each.
- Check what changes the path at runtime: env vars, feature flags, per-environment config, build tags, tenant settings.
- Report with the Output template. Stop there unless implementation was requested.
Rules
- Read the smallest slice that answers the question: search, then targeted line ranges. Never read lockfiles, minified bundles, snapshots or generated code unless they are the subject.
- Folder names are hypotheses. Confirm architecture from imports, registration code and runtime config.
- Label every claim:
Label Meaning Verified Read the code or ran it; cite file:lineInferred Follows from verified facts plus a convention; say which Unverified Plausible, not checked; say what would confirm it - Dynamic dispatch hides callers (DI, reflection, decorators, event buses, string-keyed handlers, ORM hooks, middleware, signals). Search for the registration key or event name, not only the symbol.
- When several implementations match (interfaces, plugins, per-tenant variants, old and new copies in a monorepo), find which one the entry point actually wires for the case in question.
- Prefer a cheap, side-effect-free check (run one narrow test, a
--help, a dry-run) over reasoning about behaviour. - Delegate wide fan-out searches (many naming variants or packages) to a search subagent when available; keep the conclusions, not file dumps.
- Note dead code, TODO/FIXME/HACK near the path and skipped tests: they are risks for the change.
- Time-box: if the anchor is not found after ~6 searches, report what was tried and ask for a hint (URL, screenshot, log line) instead of reading more files.
Safety gates
- Read-only. Do not edit, format, install dependencies, run migrations, or start anything that writes to shared resources without asking.
- Do not print secrets found in
.env, config or history; reference the file and key name only. - Do not check out branches or stash the user's changes to look around; use
git show <ref>:<path>instead.
Output
## Question
<one line>
## Answer (short)
<2-4 lines>
## Map
Entry: <file:line> <route/command/job>
Path:
1. <file:line> <function> - <what it does or decides>
2. ...
Side effects: <tables / queues / external calls / files>
Data shape changes: <where and how>
Runtime switches: <flags, env vars, config>
## Conventions to follow
- <convention> - exemplar <file>
## Tests
- Covering: <test files, command to run them>
- Gaps: <untested branches>
## Risks and unknowns
- [Inferred|Unverified] <item> - <how to confirm>
## Recommended next step
<smallest change, or the question that blocks it>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.

