repomix-pack
Skill2 starsChanged 9 days agoMITView on GitHub
Packs the entire codebase (or selected folders) into a single token-efficient file using repomix, so other skills can analyze the whole repo without re-reading individual files. Use when the task requires whole-codebase context: full security audits, cross-cutting refactors, architecture review, project-wide code review, or first-time onboarding to an unfamiliar repo. Auto-runs once per session at first invocation of agent-master.
- Installs packages
In this repository14 other files it gives its agents.
- agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/agent-master.mdcCursor rule
- .cursor/rules/codereview.mdcCursor rule
- .cursor/rules/devops.mdcCursor rule
- .cursor/rules/repomix-pack.mdcCursor rule
- .cursor/rules/security-audit.mdcCursor rule
- .cursor/rules/task-viewer.mdcCursor rule
- agent-masterSkill
- codereviewSkill
- devopsSkill
- security-auditSkill
- task-viewerSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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 21
Do NOT use for:
- Very specific: line 36
If repomix is missing and npm is unavailable, abort and tell the user: "Install Node + repomix: npm install -g repomix".
- Very specific: line 47
If a .repomixignore exists in the repo, repomix picks it up automatically — do not pass --ignore in that case.
- Very specific: line 61
Before re-packing, check if .agentmaster/codebase.xml is fresh enough:
- Distinctive: line 102
Does NOT analyze the code — that's the calling skill's job
- Very specific: line 103
Does NOT call other skills directly — it returns control to AgentMaster
- Very specific: line 104
Does NOT replace smart-explore for targeted lookups
- Distinctive: line 105
Does NOT pack on every invocation — uses staleness check
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Repomix Pack — Whole-Codebase Snapshot
You are the repomix bridge skill. Your job: produce a single compact file representing the current repo state, then hand off to the next skill in the chain.
ARGUMENTS: {{ARGUMENTS}}
When to Use
Invoke this skill when ANY of these signal words appear:
- "entire codebase", "whole repo", "across the project", "all files"
- "full audit", "full security scan", "architecture review"
- "onboard me to this repo", "understand this codebase"
- "refactor X across the codebase", "find all usages of"
- Whenever
security-auditorcodereviewis invoked on the repo as a whole (not a diff)
Do NOT use for:
- Single-file tasks (Read the file directly)
- Diff-based code review (use
codereviewon the diff) - Targeted exploration (use
smart-exploreinstead — AST-based, cheaper)
Preflight Check
# 1. Confirm repomix is installed
which repomix || npm install -g repomix
# 2. Confirm we're in a git repo (repomix works best with one)
git rev-parse --show-toplevel 2>/dev/null || echo "WARN: not a git repo"If repomix is missing and npm is unavailable, abort and tell the user: "Install Node + repomix: npm install -g repomix".
Default Pack Command
# Pack to a stable path under the repo's .agentmaster/ dir
mkdir -p .agentmaster
repomix --style xml -o .agentmaster/codebase.xml \
--ignore "**/node_modules/**,**/dist/**,**/build/**,**/.next/**,**/coverage/**,**/*.lock,**/*.log,**/.agentmaster/**,**/.git/**"If a .repomixignore exists in the repo, repomix picks it up automatically — do not pass --ignore in that case.
Argument Handling
| ARGUMENTS pattern | Action |
| empty | Pack the whole repo with default ignores (above) |
include <glob> | repomix --include "<glob>" -o .agentmaster/codebase.xml --style xml |
remote <url> | repomix --remote <url> --style xml -o .agentmaster/codebase.xml |
refresh | Delete .agentmaster/codebase.xml first, then re-pack |
stdout | Run repomix --stdout --style xml and stream directly into the next skill |
Staleness Rule
Before re-packing, check if .agentmaster/codebase.xml is fresh enough:
# Skip re-pack if file exists AND newer than the most recently modified source file
if [ -f .agentmaster/codebase.xml ]; then
newest=$(git ls-files | xargs -I{} stat -c '%Y' {} 2>/dev/null | sort -n | tail -1)
packed=$(stat -c '%Y' .agentmaster/codebase.xml 2>/dev/null)
if [ "$packed" -ge "$newest" ]; then
echo "Pack is fresh, skipping."
exit 0
fi
fiUser can force a re-pack with /agent-master repomix refresh.
Output
After packing, announce:
Repomix snapshot ready
━━━━━━━━━━━━━━━━━━━━━
File: .agentmaster/codebase.xml
Size: <bytes>
Files: <count from repomix summary>
Tokens: <estimate from repomix summary>Then hand off to the calling skill (security-audit, codereview, etc.). The calling skill should read .agentmaster/codebase.xml as its input rather than re-reading individual files.
.gitignore Hygiene
On first run in a repo, append .agentmaster/ to .gitignore if not already present:
grep -qxF '.agentmaster/' .gitignore 2>/dev/null || echo '.agentmaster/' >> .gitignoreWhat This Skill Does NOT Do
- Does NOT analyze the code — that's the calling skill's job
- Does NOT call other skills directly — it returns control to AgentMaster
- Does NOT replace
smart-explorefor targeted lookups - Does NOT pack on every invocation — uses staleness check
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.

