token-rules-primer
Installation
SKILL.md
Token Rules Primer
The full rule set is generated from claude-sustain/rules/spec.json. Apply these in priority order:
Iron Rules (override detailed rules when in conflict)
- Iron-1 — User intent first. If the user says 「逐個 / 仔細 / 全部 / 不要省略 / 都要確認 / thoroughly / each / all / every」, or the task is security-related, take the original path. No templating, batching, parallelization, or sampling.
- Iron-2 — Subagent prompts must include a word cap and an escape clause. Caps: pure-check ≤ 200 / structural inventory ≤ 800 / deep analysis or code review ≤ 2000. Escape clause: "But if you find anomalies or significant issues, report them in full regardless of the cap."
- Iron-3 — Repeated regex edits use perl + git diff. From the second identical edit onward, switch to
perl -i -pe 's|old|new|g' files...and verify withgit diff. - Habit — Template before bulk. When planning N similar tasks, ask "what's the largest common factor?" If templatable, validate one sample first.
Detailed rules
- R1 (File reading): never read full files blindly; use offset/limit; check if content is already in context; >200 lines → read only the relevant block; use AST-level navigation for structure.
- R2 (Searching): Grep
files_with_matchesfirst → read matched sections only; tighthead_limit; always use glob/type filters. - R3 (Subagents): delegate exploration; use Explore agent; haiku for simple lookups; trust but verify (subagent reports may hallucinate from filenames).
- R4 (Responses): concise, no preambles, no lengthy explanations unless asked.
- R5 (General): don't re-search what's in context; batch parallel tool calls; prefer Edit over Write; prefer Glob/Grep over shell.