Install
openclaw skills install @cengcengcai-creator/agent-instruction-slimmingReduce an agent instruction file (AGENTS.md, system prompt, rule file) without losing coverage: lever order (remove first, move second, reformat third, rewrite last), verbatim-subset edits with pointer lines, joint marker accounting, and tiering by frequency and reversibility. Use when a rule file has grown too large, when rules are being ignored, or before adding more rules. Tool-agnostic; includes marker counting and subset checking scripts.
openclaw skills install @cengcengcai-creator/agent-instruction-slimmingInstruction files fail by accretion. The failure is not that a file is long; it is that each added rule makes every existing rule less likely to be followed. This skill reduces the rule surface while keeping coverage measurable.
Developed through agent operation and corrected against real failures, not hand-authored as a prompt template.
Use for
Do not use for
Required: the instruction file, and the ability to run a local script.
Optional: an event log or probe harness for behaviour comparison; a linter for cross-references.
Known limits:
Apply in this order. Stop when the file is small enough for its job; do not continue for its own sake.
| Lever | Evidence strength | Action |
|---|---|---|
| 1. Remove | strongest — clause count is the dominant variable | delete dead, duplicated, and superseded clauses |
| 2. Move | medium — reduces always-on load | relocate infrequent procedures to a skill or reference, leave a pointer |
| 3. Reformat | weak — presentation changes do not reliably improve adherence | do not do it for its own sake |
| 4. Rewrite | negative — rewording hides coverage loss | forbidden when producing a subset edition |
Completion criterion: before editing, state which lever you are applying and the clause count before/after.
When relocating content, cut whole blocks and leave a pointer line. Do not paraphrase, merge sentences, or add emphasis.
Reason: a rewritten file can show more conditional markers than the original while covering less. The count then proves nothing.
Allowed changes to the kept text: none. Allowed new content: pointer lines and separators only.
Completion criterion: every non-pointer line in the slim file exists verbatim in the original. Verify with scripts/subset_check.py.
Because a true subset moves markers with the moved blocks, a slim file alone will always look worse. Use two numbers together:
slim markers <= original markers — if it increased, the text was rewritten.slim markers + moved markers >= original markers — coverage was preserved, not deleted.Report both, plus per-section counts so the difference can be attributed.
Completion criterion: both inequalities shown with numbers; any section that dropped is named and explained.
Decide placement by three properties: frequency, reversibility, mechanizability.
| Tier | Test | Placement |
|---|---|---|
| 0 | mechanizable | script, tool policy, exit gate — the file only says “run X” |
| 1 | irreversible + frequent | inline, at the top, never moved |
| 2 | frequent + judgement | one line inline |
| 3 | infrequent procedure | skill file; inline keeps a trigger + pointer |
| 4 | evidence, numbers, history | notes; inline keeps the rule sentence |
Two hard constraints on moving:
Completion criterion: every moved section has a trigger phrase and a pointer to a file that exists.
wc -m may equal bytes under a C locale; character counts need an explicit decoder. Never mix a line count from one version with a character count from another.scripts/cond_count.py A.md B.md — same pattern set, both versions.scripts/subset_check.py A.md B.md — non-pointer lines missing from the original, plus pointer line count.