oliverweissl/context-garden / skills/weeder
weeder
VerifiedMeasure and reduce a Skill's token footprint (always-loaded description + on-trigger SKILL.md body) without regressing routing accuracy or losing instructions. Use when a SKILL.md feels oversized, repeats rules, or has a vague description that might mis-route.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 32 B |
| SKILL.md | skill md | 3.1 KB |
| agents/weeder.md | markdown | 1.2 KB |
| bin/weederexecutable | script | 292 B |
| references/classification.md | markdown | 4.9 KB |
| references/llm-assist.md | markdown | 2.1 KB |
| references/routing-heuristic.md | markdown | 4.1 KB |
| scripts/cg_mode.py | script | 5.4 KB |
| scripts/we_apply_suggestion.py | script | 5.7 KB |
| scripts/we_audit.py | script | 5.6 KB |
| scripts/we_config.py | script | 2.5 KB |
| scripts/we_constraints.py | script | 5.1 KB |
| scripts/we_dupes.py | script | 6.1 KB |
| scripts/we_filler.py | script | 4.9 KB |
| scripts/we_optimize.py | script | 4.3 KB |
| scripts/we_parse.py | script | 5.0 KB |
| scripts/we_routing.py | script | 4.5 KB |
| scripts/we_suggest.py | script | 3.8 KB |
| scripts/we_text.py | script | 2.1 KB |
| scripts/we_tokens.py | script | 4.1 KB |
| scripts/weeder.pyexecutable | script | 12.0 KB |
| tests/fixtures/answer_lot.json | config | 875 B |
| tests/fixtures/filler_sentences.json | config | 2.6 KB |
| tests/fixtures/routing_examples.json | config | 489 B |
| tests/smoke_test.shexecutable | script | 14.3 KB |
SKILL.md
View on GitHub---
name: weeder
description: Measure and reduce a Skill's token footprint (always-loaded description + on-trigger SKILL.md body) without regressing routing accuracy or losing instructions. Use when a SKILL.md feels oversized, repeats rules, or has a vague description that might mis-route.
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/bin/weeder *), Bash("${CLAUDE_SKILL_DIR}/bin/weeder" *)
---
# weeder
!`"${CLAUDE_SKILL_DIR}/bin/weeder" mode --banner`
Agents that do not expand the line above (e.g. Codex): run
`<this-skill-dir>/bin/weeder mode --banner` first and follow it.
The description loads every session; the SKILL.md body loads on every
trigger. **Never optimize on token count alone**: a shorter SKILL.md that
routes worse or drops an instruction is a regression. Every step below
produces before/after evidence. Run all commands as
`python3 <this-skill-dir>/scripts/weeder.py <cmd>`.
1. **Audit:** `audit <skill_dir>`. Token counts per section (description
vs. body, chars/4 estimates unless calibrated), duplicate rules, filler,
movable background/examples. Read all of it; `optimize` acts on only part.
2. **Mechanical pass:** `optimize <skill_dir> --out <skill_dir>-optimized`.
Moves background/examples sections into `references/` with a pointer.
Lossless and reversible, so it's safe to always apply; it does not touch
the description or duplicates.
3. **Judgment pass, in the `-optimized` copy:** shorten the description
(keep concrete trigger nouns/verbs), state each duplicated rule once
where the workflow needs it, cut only instructions that are genuinely
obvious to a capable agent; don't cut something just because it's short. Optional structured help: `suggest <skill_dir> --assist slight --json`,
then `apply-suggestion <skill_dir> --answer <answer.json> --out <skill_dir>-optimized`
(see `references/llm-assist.md`; an assisted answer gets no free pass).
4. **Routing:** `test-routing <skill_dir> --examples <examples.json> [--competing <other_skill_dir> ...]`
on both original and copy. `examples.json` = `{"positive": [...],
"negative": [...], "ambiguous": [{"prompt":, "expected": "trigger"|"no_trigger"|"either"}]}`;
if none exists, write 5-10 real triggers, a few unrelated prompts and
borderline cases. Always pass sibling skills as `--competing`.
Limits of this lexical proxy: `references/routing-heuristic.md`.
5. **Function:** `test-function <skill_dir> <skill_dir>-optimized` checks
every never/must/do-not sentence survives (in SKILL.md or a reference).
A MISSING constraint is a hard blocker, not a warning.
6. **Report:** `diff <skill_dir> <skill_dir>-optimized --examples <examples.json> --competing ...`.
7. **Accept only if** routing accuracy after >= before (minus a small
tolerance: a couple of points of a lexical proxy is noise) AND
constraint preservation is 100%. Otherwise do another pass in step 3;
don't lower the bar to make a bad result pass.
With the plugin, prefer delegating the whole workflow to the `weeder`
agent (it preloads this skill and returns only the report) so the audit
output stays out of your context.
Classification rules and why step 3 isn't automated:
`references/classification.md`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |