Skip to content

dvy1987/agent-loom / .agents/skills/compress-skill

compress-skill

Verified

Compress an oversized SKILL.md to under 200 lines without losing effectiveness. Load when a skill exceeds 200 lines, when AGENTS.md triggers compression after a skill edit, or when the user asks to compress, shrink, slim down, or optimize a skill. Also triggers on "this skill is too long", "reduce skill size", "make this skill shorter". Applies to all skills including meta skills — the 200-line rule has no exceptions. Preserves hard gates, gotchas, output format, routing triggers, and at least one example. When genuinely CORE content cannot be compressed away, invokes split-skill instead of degrading the skill.

FileKindSize
SKILL.mdskill md9.0 KB
references/compression-theory.mdmarkdown2.2 KB
references/examples.mdmarkdown2.8 KB

references/examples.md

View on GitHub
# Compress Skill — Full Worked Examples

Skill: `compress-skill` | Enriched from SKILL.md (improve-skills pass, SKIP_RESEARCH).

## Example 1 — Documented workflow

**Input:** Compress .agents/skills/prd-writing/SKILL.md — it's 354 lines

**Output:**
```
prd-writing: 354 lines

Classification:
- CORE: hard gates, gotchas — 12 lines — stay
- WORKFLOW: 9 steps — stay, compress prose — 45 lines
- FORMAT: 3 schemas — stay, remove surrounding explanation — 60 lines
- EXAMPLE: 2 examples — keep shorter inline, move second to references/examples.md
- BACKGROUND: "Why PRDs matter", tips section — move to references/background.md
- DUPLICATE: quality standards repeats workflow — delete

Split gate: BACKGROUND moved, remaining = 117 lines — under 200, no split needed.

Regression check: all 5 criteria passed ✓
Result: 354 → 115 lines (67% reduction)
```

## Example 2 — Step-by-step execution

**Input:** "Run `compress-skill` on [concrete task]"

**Agent actions:**
1. Measure
2. Classify Every Block
3. Split Decision Gate
4. Apply Compression Transforms
5. Regression Check
6. Validate and Commit

**Impact Report shape:**
```
Compression complete: [skill-name]
Lines: [before] → [after] ([N]% reduction)
Moved to references/: [list of files created]
Regression check: [all 5 passed / N failed — restored]
agentskills validate: ✓
Files modified: SKILL.md[, references/background.md, references/examples.md]
```

## Example 3 — Anti-skip (rationalization defense)

**Input:** Agent tries to skip a gate

| Excuse | Reality |
|---|---|
| "Split is safer" | Split when capability is separable; compress when it's one workflow. |
| "Line count doesn't matter" | Loaders and routers choke on bloated skills. |
| "Can't lose any words" | Relocate examples to L3 — never delete them. |
| "Compress secure-* skills" | Security skills are split-only — compression removes threat rows. |

## Example 4 — Gotcha application

**Input:** Task hits a non-obvious edge case

**Apply:**
- **`secure-*` skills are uncompressable.** Threshold is 180 lines and the only allowed action is `split-skill`. Compression silently removes threat coverage.
- **Description compression loses triggers silently.** Always test the compressed description against ≥3 sample prompts that activated the original — phrasing changes that drop a trigger word kill routing.
- **"Move to references/" without a load trigger is invisible.** Every referenced file MUST be referenced from SKILL.md with a specific load condition, or the agent will never read it.
- **Imperative one-liners ≠ removing context.** Compressing "Ask at least 2 clarifying questions before writing the spec" to "Ask questions" loses the gate. Preserve numbers, thresholds, and MUST/NEVER verbs.

---

See `SKILL.md` for hard rules and verification checklist.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall