optimize-ruleslisted
Install: claude install-skill reghis86/context-forge
## What This Does
Performs a full token audit of all rules in `core/rules/`. Specifically:
1. **Token cost estimation** — estimates token count per rule file using `wc -c` as a proxy
(1 token ≈ 4 bytes). Sums total always-on budget.
2. **Duplication detection** — uses `rg` to find paragraphs or constraint phrases that appear
in 2+ rule files.
3. **Activation mode suggestions** — identifies `mode: always` rules used in fewer than 80%
of sessions and suggests downgrading to `mode: intelligent`.
4. **Budget report** — total always-on token budget vs ≤6k target.
5. **Quality score** — run `core/scripts/tools/quality-score.sh` (Tier 1) for a deterministic
composite score per rule and skill. It uses the full-denominator model: every defined
dimension counts toward the denominator, so a missing few-shot / validation-gate / `<example>`
caps the score honestly (reported as `4/7`, never hidden by renormalization). Surface any
file below 1.00 with its `missing` dimensions.
## Quality Score (Tier 1)
```bash
bash core/scripts/tools/quality-score.sh # TSV: kind, file, score, passed, total, missing
```
Dimensions — rules (7): SYSTEM CONSTRAINTS section, hard-constraint density (≥5), no soft
language in constraints, few-shot example, validation gate, YAML pair, within token budget.
Skills (6): frontmatter `name`, `description`, purpose section, Constraints section, `<example>`,
within budget. A run ends with an `average` line across all files.
**Replicat