Repo context
Portable skill for building progressive repo context packs for code agents
npx -y skills add chokwinlee/repo-context --skill repo-contextAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Build and maintain a repo-local progressive context pack for large, legacy, or weakly documented codebases, especially when plain file discovery may miss relevant paths behind `.gitignore`. Use when an agent needs a repo map, hotspot analysis, module/file briefs, legacy-service onboarding, or better context discipline before non-trivial multi-file work and refactors.
SKILL.md
3.7 KB, as published. Nobody here has run it
Repo Context
Create .repo-context/ before deep code reads in repositories that are large, stale, or structurally unclear. Prefer the generated context pack over loading many implementation files at once.
Context location precedence is strict:
--outREPO_CONTEXT_OUT<repo>/.repo-context/
Do not infer or reuse any legacy fallback directory.
Gitignore Caveat
Bare rg, rg --files, and many host file pickers respect .gitignore. That is the wrong default when important implementation files live in generated, vendored, or otherwise gitignored paths.
- For repo-wide discovery, prefer
repo_context.pyas the source of truth instead of ad hoc file listing. - If you must inspect raw files before the context pack exists, use
rg -uuor an equivalent no-ignore mode, not barerg. - The main repo-context scan intentionally looks past root
.gitignorefor context inputs, while project-local analyzer auto-discovery underrepo-context/analyzers/still honors ignored paths.
Workflow
- Bootstrap if the repo does not have
.repo-context/. - Run
checkbefore relying on an existing pack. - Run
refreshafter meaningful repo edits or whencheckreports drift. - Run
task-scopewith the user task before opening large files. - Read
index.md, thenrepo-map.md, then only the relevant module and hotspot briefs.
Commands
python3 scripts/repo_context.py bootstrap --root /path/to/repo
python3 scripts/repo_context.py refresh --root /path/to/repo
python3 scripts/repo_context.py check --root /path/to/repo --fail-on-stale
python3 scripts/repo_context.py task-scope --root /path/to/repo --query "add png export to editor"
python3 scripts/repo_context.py bootstrap --root /path/to/repo --out .agent-context/repo-context
python3 scripts/post_edit_refresh.py --root /path/to/repo --file /path/to/edited-file
Hook Automation
- If the host supports post-edit command hooks, wire
scripts/post_edit_refresh.pyto every code write. - Prefer post-edit hooks over Git hooks when you need refreshes after each modification, not only at commit time.
post_edit_refresh.pymay run after every edit because rendering already avoids rewriting unchanged artifacts.
Operating Rules
- Always prefer context-pack generation to ad hoc whole-repo reading.
- Never rely on bare
rgorrg --filesfor repo inventory; they usually hide.gitignored paths. - When the host supports hooks, attach
post_edit_refresh.pyto edit/write events so the pack stays fresh automatically. - Treat
index.mdandrepo-map.mdas the default entrypoint for orientation. - Read hotspot briefs before opening large implementation files.
- Keep writes isolated to
.repo-context/by default; use--outwhen the target project already has a better artifact or memory directory. - Use
refreshafter major refactors, codegen, or broad search-and-replace edits. - Use
rg -uufor one-off raw searches when you need files that normal repo discovery would hide.
References
- Context pack contract and read order:
references/context-pack-spec.md - Architecture split and extension model:
references/architecture.md - Scanning rules and hotspot heuristics:
references/scanning-heuristics.md - First-pass workflow for old services:
references/legacy-onboarding.md - Drift, refresh, and CI policy:
references/maintenance-policy.md