agentleFS
sarveshtalelesarveshtalele/devcrew/.claude/skills/compact-docs/SKILL.md

compact-docs

Skill1 starsChanged 3 months agoMITView on GitHub

Shrink the project's markdown documents so every future session costs less. Use when CLAUDE.md drifts past ~200 lines, when agents start ignoring rules, or after a sprint of accumulated edits.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not delete a security, compliance, or authorship rule to save tokens.

    line 42
  2. Very specific:

    Do not compress Changelog.md, ADRs, or the evidence log — they are records, not instructions, and they are never auto-loaded.

    line 43
  3. Distinctive:

    Do not "compress" by moving text into a file that gets imported anyway.

    line 44

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

Compact: $ARGUMENTS (default: CLAUDE.md, AGENTS.md, and the four root documents)

Why. CLAUDE.md is loaded on every single turn. A line that earns nothing costs tokens forever. And a bloated instruction file causes the important rules to be ignored, so bloat is a correctness problem, not just a cost one.

Procedure

  1. Measure first.

    wc -l CLAUDE.md AGENTS.md Project-Context.md Project-Plan.md Project-Management.md Design.md
  2. Apply the deletion test to every line. Would removing this cause an agent to make a mistake? If not, delete it. Specifically cut:
    • Anything the model already does correctly without being told ("write clean code", "handle errors").
    • Standard language conventions — PEP 8 and Airbnb style do not need restating.
    • Anything a hook already enforces deterministically. A rule duplicated by secret-guard is dead weight; the hook cannot be ignored and the sentence can.
    • Long rationale. Keep the rule, move the reasoning to an ADR.
    • File-by-file descriptions of the codebase — that is what .devcrew/project-facts.json and reading the code are for.
    • Anything that has changed twice this month. Volatile facts belong in the trackers, not in instructions.
  3. Convert, don't just delete. A rule that keeps being violated should become a hook. A rule that is only relevant sometimes should become a skill. Both remove it from every-turn context.
  4. Compress what survives. Tables over prose. Fragments over sentences. One line per rule.
  5. Verify behavior did not change. Re-read the diff and name, for each deleted line, why its absence is safe. If you cannot, put it back.
  6. Record the before/after line counts in Changelog.md.

Targets

FileCeilingWhy
CLAUDE.md / AGENTS.md~200 linesloaded every turn
Agent definitions~60 linesloaded on every invocation of that agent
Project-Context.md~250 linesread on demand, but read often
Skills~80 linesloaded when invoked

Do not

  • Do not delete a security, compliance, or authorship rule to save tokens. Those are the ones worth paying for.
  • Do not compress Changelog.md, ADRs, or the evidence log — they are records, not instructions, and they are never auto-loaded.
  • Do not "compress" by moving text into a file that gets imported anyway. That is the same tokens with extra steps.

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.