codebase-context
Skill0 starsChanged 7 months agoMITView on GitHub
Analyze a repository before engineering work begins and produce a concise context bundle covering structure, entry points, dependencies, tests, conventions, and likely risk areas. Use when the user asks for a codebase overview, wants a Phase 0 understanding pass, or when another skill would benefit from a grounded map of an unfamiliar project before implementation, review, or refactoring.
We split this skill into the rules it gives an agent
28 rules. 0 are common, 23 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
23
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 109
Use the lightest memory boundary that fits the task.
- Distinctive: line 115
Do not silently promote runtime observations into persistent memory.
- Distinctive: line 119
Follow this sequence unless the user requests a narrower slice.
- Very specific: line 124
Use fast file discovery and avoid generated or irrelevant directories such as .git, node_modules, dist, build, coverage, .next, target, and …
- Distinctive: line 134
Call out large blind spots, generated code, missing tests, mixed conventions, or areas that require deeper investigation.
- Very specific: line 136
Use the template in assets/context-bundle-template.md.
- Very specific: line 140
When skill-dispatcher is selecting this skill, codebase-context should usually be chosen when:
- Very specific: line 153
If the task requires both analysis and implementation, this skill is best used as the first step in a SEQUENCE, followed by the downstream …
- Distinctive: line 157
When this skill is invoked from a dispatcher-led workflow, consume inputs in this shape when available:
- Very specific: line 194
Use Unknown or Not found when evidence is missing.
- Distinctive: line 195
Prefer approximate language over false precision.
- Distinctive: line 196
Keep the bundle concise enough to be usable as handoff context.
- Distinctive: line 198
If the user requests a saved artifact, write the bundle to a local markdown file and optionally validate it with:
- Distinctive: line 217
Never include secrets, tokens, or credential values in the output.
- Distinctive: line 218
Do not claim test coverage percentages unless they are directly supported by repository evidence or a coverage artifact.
- Distinctive: line 219
Do not over-scan large repos.
- Distinctive: line 220
Do not confuse generated code, vendored code, or build outputs with primary source unless the task specifically requires them.
- Distinctive: line 221
Do not collapse facts and interpretations into a single claim when uncertainty matters.
- Distinctive: line 235
Use this as the default response skeleton.
- Distinctive: line 237
Read this for monorepos, large repos, mixed-language repos, or ambiguous entry points.
- Distinctive: line 239
Read this when you need stricter guidance on confidence, evidence, and section quality.
- Distinctive: line 243
Use these prompts to regression-test the skill's triggering and output quality.
- Distinctive: line 245
Use these packaged repository fixtures for end-to-end regression testing.
- Distinctive: line 247
Read this when you need to understand or extend the deterministic scoring harness.
- Distinctive: line 249
Read this for the repository's human-facing explanation of dispatcher alignment, CI, fixtures, and maintenance expectations.
- Distinctive: line 251
Use this only when a bundle has been written to disk and needs a quick structural check.
- Distinctive: line 253
Use this to score one generated bundle against one fixture.
- Distinctive: line 255
Use this to run the full fixture benchmark suite across packaged examples.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codebase Context
Build a reliable mental model of a repository before deeper engineering work begins.
This skill is a read-first, structure-first analysis pass. Its job is to reduce blind edits, uncover likely ownership boundaries, and hand downstream work a context bundle that separates observed facts from reasonable inference.
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Telemetry & Logging
[!IMPORTANT] All usage of this skill must be logged via the Skill Dispatcher to ensure audit logs and wallboard analytics are accurate:
./log-dispatch.cmd --skill <skill_name> --intent <intent> --reason <reason>(or./log-dispatch.shon Linux)
Use This Skill When
- The user asks for a repository overview, architecture summary, or onboarding pass.
- A coding task is high risk and should start with a grounded understanding of the repo.
- Another skill needs a quick but credible map of entry points, dependencies, tests, and conventions before implementation.
- The codebase is unfamiliar, legacy, large, or polyglot enough that guessing would be risky.
Do Not Use This Skill For
- Implementing features, fixing bugs, or writing tests as the main task.
- Replacing deep file-by-file investigation when a narrow debugging question already points to a specific module.
- Performing security review beyond basic secret avoidance and risk flagging.
- Inventing architecture that is not supported by repository evidence.
Memory Model
Use the lightest memory boundary that fits the task.
- Runtime memory: Keep the current repository model in working memory for the active task or thread.
- Project-local memory: Only persist the context bundle to a file when the user asks for a saved artifact or when a downstream workflow clearly benefits from a local handoff document.
- Shared memory: Out of scope for this skill. If cross-agent or cross-project memory is needed, hand off to a dedicated shared-memory mechanism instead of embedding it here.
Do not silently promote runtime observations into persistent memory. Persist only information that is stable, useful, and appropriately scoped.
Workflow
Follow this sequence unless the user requests a narrower slice.
- Establish scope. Clarify the repository root, the user's goal, and whether the output should stay in-chat or be written to a project file.
- Scan efficiently.
Use fast file discovery and avoid generated or irrelevant directories such as
.git,node_modules,dist,build,coverage,.next,target, and virtual environments. - Detect ecosystem signals. Inspect manifests, lockfiles, CI config, test config, and top-level docs to identify language, framework, build system, and operational conventions.
- Map structure and entry points. Identify the main code areas, likely bootstrap files, public interfaces, routes, commands, jobs, or service boundaries.
- Estimate test shape carefully. Locate test suites, frameworks, and obvious source-to-test relationships. Report uncertainty instead of inventing precision.
- Sample conventions. Inspect representative files to capture naming, layering, dependency direction, and common patterns.
- Surface risks and unknowns. Call out large blind spots, generated code, missing tests, mixed conventions, or areas that require deeper investigation.
- Deliver the context bundle.
Use the template in
assets/context-bundle-template.md. If the repo is unusual or large, consultreferences/analysis-playbook.mdandreferences/output-contract.md.
Dispatcher Fit
When skill-dispatcher is selecting this skill, codebase-context should usually be chosen when:
- the current step is a read-only Phase 0 repository understanding pass
- the next skill would benefit from a
repo_contextorcodebase_context_bundle - the user task is high risk enough that acting before understanding the codebase would be unsafe
Typical dispatcher fit:
intent:index_codebase,prepare_engineering_context,summarize_repository_architecture, or another Phase 0 repository-analysis intentcurrent_artifact_type:repo_path,workspace_context, orrouting_requesttarget_artifact_type:repo_context,codebase_context_bundle, orstructural_summaryallowed_write_risk:low
If the task requires both analysis and implementation, this skill is best used as the first step in a SEQUENCE, followed by the downstream execution skill.
Handoff Contract
When this skill is invoked from a dispatcher-led workflow, consume inputs in this shape when available:
intent: normalized routing intent for the current analysis stepcurrent_artifact_type: usuallyrepo_path,workspace_context, orrouting_requesttarget_artifact_type: usuallyrepo_context,codebase_context_bundle, orstructural_summaryrepo_context: any existing stack evidence, routing notes, or prior context bundle fragmentsconstraints: delivery boundaries such asread-only,artifact-only,stay concise, orfocus on testspreferred_stack: the repository-native stack when already knownallowed_write_risk: expected to belowfor normal analysis work
Return a result that is easy for a dispatcher or downstream skill to consume:
deliverable: markdown context bundle or structural summaryartifact_type:repo_context,codebase_context_bundle, orstructural_summaryconfidence: overall confidence level for the artifactrecommended_next_step: the next human or skill action that would reduce risk fastestfollow_on_skill_type: optional hint such asexecution,feedback, oranalysiswhen the next phase is obvious
Output Contract
Produce a markdown context bundle with these sections, in this order:
# Codebase Context: <project-name>## Executive Summary## Tech Stack## Structure## Entry Points## Dependencies## Test Coverage## Conventions## Risks and Unknowns## Recommended Next Steps
Within the bundle:
- Mark confidence where it materially matters:
High,Medium, orLow. - Distinguish observed facts from inference.
- Use
UnknownorNot foundwhen evidence is missing. - Prefer approximate language over false precision.
- Keep the bundle concise enough to be usable as handoff context.
If the user requests a saved artifact, write the bundle to a local markdown file and optionally validate it with:
python scripts/validate_context_bundle.py path/to/context-bundle.mdQuality Bar
A strong context bundle should:
- Tell a downstream engineer where to start reading.
- Show the likely architecture without pretending certainty where none exists.
- Highlight risky or weakly understood areas early.
- Preserve the repository's own terminology and conventions.
- Be immediately reusable in a later implementation or review task.
Guardrails
- Stay read-only unless the user explicitly asks for the bundle to be saved or updated in the repository.
- Never include secrets, tokens, or credential values in the output.
- Do not claim test coverage percentages unless they are directly supported by repository evidence or a coverage artifact.
- Do not over-scan large repos. Sample representative directories and say what was sampled.
- Do not confuse generated code, vendored code, or build outputs with primary source unless the task specifically requires them.
- Do not collapse facts and interpretations into a single claim when uncertainty matters.
Escalation Rules
Pause and say so when:
- The repository root is ambiguous.
- The repo is so large that a representative sample may miss critical architecture.
- The user appears to want implementation, debugging, or security review rather than a Phase 0 analysis pass.
- The context bundle would be materially stronger if saved as a file for later reuse.
Bundled Resources
assets/context-bundle-template.mdUse this as the default response skeleton.references/analysis-playbook.mdRead this for monorepos, large repos, mixed-language repos, or ambiguous entry points.references/output-contract.mdRead this when you need stricter guidance on confidence, evidence, and section quality.examples/sample-context-bundle.mdReview this when you need a model example of the final artifact.evals/evals.jsonUse these prompts to regression-test the skill's triggering and output quality.fixtures/Use these packaged repository fixtures for end-to-end regression testing.benchmarks/README.mdRead this when you need to understand or extend the deterministic scoring harness.README.mdRead this for the repository's human-facing explanation of dispatcher alignment, CI, fixtures, and maintenance expectations.scripts/validate_context_bundle.pyUse this only when a bundle has been written to disk and needs a quick structural check.scripts/score_context_bundle.pyUse this to score one generated bundle against one fixture.scripts/run_fixture_benchmark.pyUse this to run the full fixture benchmark suite across packaged examples.
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- homarr-labs/homarr★ 5.3ksame name
- kingxiaozhe/cm-workflow★ 97same name
- airowe/codebase-context-skill★ 9same name
- gootf/software-agent-sop★ 2same name
- mrge-io/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.
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.

