agentleFS
jovd83jovd83/codebase-context/SKILL.md

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
  1. Distinctive:

    Use the lightest memory boundary that fits the task.

    line 109
  2. Distinctive:

    Do not silently promote runtime observations into persistent memory.

    line 115
  3. Distinctive:

    Follow this sequence unless the user requests a narrower slice.

    line 119
  4. Very specific:

    Use fast file discovery and avoid generated or irrelevant directories such as .git, node_modules, dist, build, coverage, .next, target, and …

    line 124
  5. Distinctive:

    Call out large blind spots, generated code, missing tests, mixed conventions, or areas that require deeper investigation.

    line 134
  6. Very specific:

    Use the template in assets/context-bundle-template.md.

    line 136
  7. Very specific:

    When skill-dispatcher is selecting this skill, codebase-context should usually be chosen when:

    line 140
  8. Very specific:

    If the task requires both analysis and implementation, this skill is best used as the first step in a SEQUENCE, followed by the downstream …

    line 153
  9. Distinctive:

    When this skill is invoked from a dispatcher-led workflow, consume inputs in this shape when available:

    line 157
  10. Very specific:

    Use Unknown or Not found when evidence is missing.

    line 194
  11. Distinctive:

    Prefer approximate language over false precision.

    line 195
  12. Distinctive:

    Keep the bundle concise enough to be usable as handoff context.

    line 196
  13. Distinctive:

    If the user requests a saved artifact, write the bundle to a local markdown file and optionally validate it with:

    line 198
  14. Distinctive:

    Never include secrets, tokens, or credential values in the output.

    line 217
  15. Distinctive:

    Do not claim test coverage percentages unless they are directly supported by repository evidence or a coverage artifact.

    line 218
  16. Distinctive:

    Do not over-scan large repos.

    line 219
  17. Distinctive:

    Do not confuse generated code, vendored code, or build outputs with primary source unless the task specifically requires them.

    line 220
  18. Distinctive:

    Do not collapse facts and interpretations into a single claim when uncertainty matters.

    line 221
  19. Distinctive:

    Use this as the default response skeleton.

    line 235
  20. Distinctive:

    Read this for monorepos, large repos, mixed-language repos, or ambiguous entry points.

    line 237
  21. Distinctive:

    Read this when you need stricter guidance on confidence, evidence, and section quality.

    line 239
  22. Distinctive:

    Use these prompts to regression-test the skill's triggering and output quality.

    line 243
  23. Distinctive:

    Use these packaged repository fixtures for end-to-end regression testing.

    line 245
  24. Distinctive:

    Read this when you need to understand or extend the deterministic scoring harness.

    line 247
  25. Distinctive:

    Read this for the repository's human-facing explanation of dispatcher alignment, CI, fixtures, and maintenance expectations.

    line 249
  26. Distinctive:

    Use this only when a bundle has been written to disk and needs a quick structural check.

    line 251
  27. Distinctive:

    Use this to score one generated bundle against one fixture.

    line 253
  28. Distinctive:

    Use this to run the full fixture benchmark suite across packaged examples.

    line 255

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.sh on 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.

  1. 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.
  2. 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.
  3. Detect ecosystem signals. Inspect manifests, lockfiles, CI config, test config, and top-level docs to identify language, framework, build system, and operational conventions.
  4. Map structure and entry points. Identify the main code areas, likely bootstrap files, public interfaces, routes, commands, jobs, or service boundaries.
  5. Estimate test shape carefully. Locate test suites, frameworks, and obvious source-to-test relationships. Report uncertainty instead of inventing precision.
  6. Sample conventions. Inspect representative files to capture naming, layering, dependency direction, and common patterns.
  7. Surface risks and unknowns. Call out large blind spots, generated code, missing tests, mixed conventions, or areas that require deeper investigation.
  8. Deliver the context bundle. Use the template in assets/context-bundle-template.md. If the repo is unusual or large, consult references/analysis-playbook.md and references/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_context or codebase_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 intent
  • current_artifact_type: repo_path, workspace_context, or routing_request
  • target_artifact_type: repo_context, codebase_context_bundle, or structural_summary
  • allowed_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 step
  • current_artifact_type: usually repo_path, workspace_context, or routing_request
  • target_artifact_type: usually repo_context, codebase_context_bundle, or structural_summary
  • repo_context: any existing stack evidence, routing notes, or prior context bundle fragments
  • constraints: delivery boundaries such as read-only, artifact-only, stay concise, or focus on tests
  • preferred_stack: the repository-native stack when already known
  • allowed_write_risk: expected to be low for normal analysis work

Return a result that is easy for a dispatcher or downstream skill to consume:

  • deliverable: markdown context bundle or structural summary
  • artifact_type: repo_context, codebase_context_bundle, or structural_summary
  • confidence: overall confidence level for the artifact
  • recommended_next_step: the next human or skill action that would reduce risk fastest
  • follow_on_skill_type: optional hint such as execution, feedback, or analysis when the next phase is obvious

Output Contract

Produce a markdown context bundle with these sections, in this order:

  1. # Codebase Context: <project-name>
  2. ## Executive Summary
  3. ## Tech Stack
  4. ## Structure
  5. ## Entry Points
  6. ## Dependencies
  7. ## Test Coverage
  8. ## Conventions
  9. ## Risks and Unknowns
  10. ## Recommended Next Steps

Within the bundle:

  • Mark confidence where it materially matters: High, Medium, or Low.
  • Distinguish observed facts from inference.
  • Use Unknown or Not found when 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.md

Quality 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.md Use this as the default response skeleton.
  • references/analysis-playbook.md Read this for monorepos, large repos, mixed-language repos, or ambiguous entry points.
  • references/output-contract.md Read this when you need stricter guidance on confidence, evidence, and section quality.
  • examples/sample-context-bundle.md Review this when you need a model example of the final artifact.
  • evals/evals.json Use 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.md Read this when you need to understand or extend the deterministic scoring harness.
  • README.md Read this for the repository's human-facing explanation of dispatcher alignment, CI, fixtures, and maintenance expectations.
  • scripts/validate_context_bundle.py Use this only when a bundle has been written to disk and needs a quick structural check.
  • scripts/score_context_bundle.py Use this to score one generated bundle against one fixture.
  • scripts/run_fixture_benchmark.py Use this to run the full fixture benchmark suite across packaged examples.

Download now (ZIP)

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. homarr-labs/homarr★ 5.3ksame name
    2. kingxiaozhe/cm-workflow★ 97same name
    3. airowe/codebase-context-skill★ 9same name
    4. gootf/software-agent-sop★ 2same name
    5. 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.