Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/wei6bin/skills/codebase-context-buildernpx skills add wei6bin/skills --skill codebase-context-buildergit clone --depth 1 https://github.com/wei6bin/skillsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00061 | $0.01515 |
| Opus 5 | $0.00030 | $0.00758 |
| Sonnet 5 | $0.00012 | $0.00303 |
| Haiku 4.5 | $0.00006 | $0.00152 |
Grade A, and why
codebase-context-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codebase Context Builder
Scope: Context file generation only — no user story analysis, no task breakdown.
Called automatically by user-story-workflow when docs/project_context/ is absent or empty.
Can be invoked directly to onboard a new repo.
When to Invoke
user-story-workflowdetermines context is missing → chains here- User says: "build project context", "analyse this codebase", "set up project context"
- Fresh repo with no
CLAUDE.mdor empty one from/init
Phase 1 — Stack Detection
Read whatever exists from this list:
package.json / package-lock.json
*.csproj, *.sln
pyproject.toml, requirements.txt, setup.py
pom.xml, build.gradle
Dockerfile, docker-compose.yml
azure-pipelines.yml, .github/workflows/*.yml
CLAUDE.md, AGENTS.md, README.md
Extract:
- Primary language(s) and frameworks
- Build/test/run scripts
- Key dependencies (UI lib, ORM, test framework, state management)
- Deployment target
Phase 2 — Structure Scan
# Map source directory 2–3 levels deep (skip noise)
find . -maxdepth 3 -type d \
| grep -v node_modules | grep -v .git | grep -v bin \
| grep -v obj | grep -v __pycache__ | grep -v dist
Identify:
- Feature modules / bounded contexts (folders under
src/features/,src/modules/, etc.) - Shared / common code
- API / endpoint layer
- Service / business logic layer
- Data / repository layer
- Test layout (co-located vs separate
tests/)
Phase 3 — Pattern Sampling
Sample 2–3 files per layer to extract conventions. Use Glob then Read:
# UI/Component layer
src/**/components/*.tsx OR src/**/*Controller.cs OR app/**/views/*.py
# API endpoint / handler
grep -rl "endpoint\|controller\|router\|Endpoint\|Controller" src/ --include="*.ts" --include="*.cs" --include="*.py" | head -3
# Service / business logic
grep -rl "Service\|Handler\|UseCase" src/ --include="*.cs" --include="*.py" --include="*.ts" | head -3
# Repository / data access
grep -rl "Repository\|DbContext\|session\|Session" src/ --include="*.cs" --include="*.py" | head -3
# Domain models / DTOs
grep -rl "interface\|type.*=\|public class\|public record\|dataclass\|BaseModel" src/ --include="*.ts" --include="*.cs" --include="*.py" | grep -i "model\|entity\|dto\|types" | head -5
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 175 lines · 61 tokens per session scan A 73310e1ef291
codebase-context-builder is a skill published in the GitHub repository wei6bin/skills (2 stars, last pushed 9d ago), licensed MIT. It adds 61 tokens to every session and 1,515 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…