agentleFS
Surya8991Surya8991/AgentMaster/skills/repomix-pack/SKILL.md

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

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

    Do NOT use for:

    line 21
  2. Very specific:

    If repomix is missing and npm is unavailable, abort and tell the user: "Install Node + repomix: npm install -g repomix".

    line 36
  3. Very specific:

    If a .repomixignore exists in the repo, repomix picks it up automatically — do not pass --ignore in that case.

    line 47
  4. Very specific:

    Before re-packing, check if .agentmaster/codebase.xml is fresh enough:

    line 61
  5. Distinctive:

    Does NOT analyze the code — that's the calling skill's job

    line 102
  6. Very specific:

    Does NOT call other skills directly — it returns control to AgentMaster

    line 103
  7. Very specific:

    Does NOT replace smart-explore for targeted lookups

    line 104
  8. Distinctive:

    Does NOT pack on every invocation — uses staleness check

    line 105

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

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

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-audit or codereview is 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 codereview on the diff)
  • Targeted exploration (use smart-explore instead — 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 patternAction
emptyPack 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
refreshDelete .agentmaster/codebase.xml first, then re-pack
stdoutRun 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
fi

User 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/' >> .gitignore

What 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-explore for targeted lookups
  • Does NOT pack on every invocation — uses staleness check

Download now (ZIP)

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.