
Affaan MustafaandTatsuya Shimomoto
8511d84042
feat(skills): add rules-distill skill (rebased #561) (#678)
* feat(skills): add rules-distill — extract cross-cutting principles from skills into rules
Applies the skill-stocktake pattern to rules maintenance:
scan skills → extract shared principles → propose rule changes.
Key design decisions:
- Deterministic collection (scan scripts) + LLM judgment (cross-read & verdict)
- 6 verdict types: Append, Revise, New Section, New File, Already Covered, Too Specific
- Anti-abstraction safeguard: 2+ skills evidence, actionable behavior test, violation risk
- Rules full text passed to LLM (no grep pre-filter) for accurate matching
- Never modifies rules automatically — always requires user approval
* fix(skills): address review feedback for rules-distill
Fixes raised by CodeRabbit, Greptile, and cubic:
- Add Prerequisites section documenting skill-stocktake dependency
- Add fallback command when skill-stocktake is not installed
- Fix shell quoting: add IFS= and -r to while-read loops
- Replace hardcoded paths with env var placeholders ($CLAUDE_RULES_DIR, $SKILL_STOCKTAKE_DIR)
- Add json language identifier to code blocks
- Add "How It Works" parent heading for Phase 1/2/3
- Add "Example" section with end-to-end run output
- Add revision.reason/before/after fields to output schema for Revise verdict
- Document timestamp format (date -u +%Y-%m-%dT%H:%M:%SZ)
- Document candidate-id format (kebab-case from principle)
- Use concrete examples in results.json schema
* fix(skills): remove skill-stocktake dependency, add self-contained scripts
Address P1 review feedback:
- Add scan-skills.sh and scan-rules.sh directly in rules-distill/scripts/
(no external dependency on skill-stocktake)
- Remove Prerequisites section (no longer needed)
- Add cross-batch merge step to prevent 2+ skills requirement
from being silently broken across batch boundaries
- Fix nested triple-backtick fences (use quadruple backticks)
- Remove head -100 cap (silent truncation)
- Rename "When to Activate" → "When to Use" (ECC standard)
- Remove unnecessary env var placeholders (SKILL.md is a prompt, not a script)
* fix: update skill/command counts in README.md and AGENTS.md
rules-distill added 1 skill + 1 command:
- skills: 108 → 109
- commands: 57 → 58
Updates all count references to pass CI catalog validation.
* fix(skills): address Servitor review feedback for rules-distill
1. Rename SKILL_STOCKTAKE_* env vars to RULES_DISTILL_* for consistency
2. Remove unnecessary observation counting (use_7d/use_30d) from scan-skills.sh
3. Fix header comment: scan.sh → scan-skills.sh
4. Use jq for JSON construction in scan-rules.sh to properly escape
headings containing special characters (", \)
* fix(skills): address CodeRabbit review — portability and scan scope
1. scan-rules.sh: use jq for error JSON output (proper escaping)
2. scan-rules.sh: replace GNU-only sort -z with portable sort (BSD compat)
3. scan-rules.sh: fix pipefail crash on files without H2 headings
4. scan-skills.sh: scan only SKILL.md files (skip learned/*.md and
auxiliary docs that lack frontmatter)
5. scan-skills.sh: add portable get_mtime helper (GNU stat/date
fallback to BSD stat/date)
* fix: sync catalog counts with filesystem (27 agents, 114 skills, 59 commands)
---------
Co-authored-by: Tatsuya Shimomoto <shimo4228@gmail.com>
2026-03-20 01:44:55 -07:00
..
2026-03-20 00:20:18 -07:00
2026-03-04 14:48:06 -08:00
2026-03-04 14:48:06 -08:00
2026-03-04 14:48:06 -08:00
2026-03-16 13:35:31 -07:00
2026-03-10 20:53:39 -07:00
2026-02-23 19:00:57 +03:00
2026-03-20 00:20:25 -07:00
2026-02-27 05:50:23 -08:00
2026-03-04 14:48:06 -08:00
2026-02-23 19:00:57 +03:00
2026-03-10 19:23:00 -07:00
2026-03-16 14:03:40 -07:00
2026-03-10 21:13:55 -07:00
2026-03-12 14:49:05 -07:00
2026-03-16 13:35:50 -07:00
2026-02-23 19:00:57 +03:00
2026-03-20 00:20:20 -07:00
2026-02-23 19:00:57 +03:00
2026-03-10 20:53:39 -07:00
2026-03-16 13:35:23 -07:00
2026-02-27 05:50:23 -08:00
2026-02-23 19:00:57 +03:00
2026-03-20 00:20:23 -07:00
2026-03-04 14:48:06 -08:00
2026-03-04 14:48:06 -08:00
2026-03-20 00:16:42 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-03 12:32:35 -08:00
2026-03-14 12:55:25 -07:00
2026-03-10 21:07:36 -07:00
2026-03-16 13:35:44 -07:00
2026-02-23 19:00:57 +03:00
2026-03-12 14:49:05 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-12 15:34:05 -07:00
2026-02-23 19:00:57 +03:00
2026-03-16 14:03:40 -07:00
2026-02-23 19:00:57 +03:00
2026-03-10 21:07:36 -07:00
2026-03-04 14:48:06 -08:00
2026-03-04 14:48:06 -08:00
2026-03-14 12:55:25 -07:00
2026-03-14 12:55:25 -07:00
2026-02-24 14:39:25 +09:00
2026-02-23 19:00:57 +03:00
2026-03-03 12:32:35 -08:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-10 21:13:55 -07:00
2026-02-27 05:50:23 -08:00
2026-02-27 05:50:23 -08:00
2026-03-09 22:49:43 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-10 20:53:39 -07:00
2026-03-10 21:25:52 -07:00
2026-03-10 21:25:52 -07:00
2026-03-10 21:25:52 -07:00
2026-03-12 23:53:23 -07:00
2026-03-16 13:35:23 -07:00
2026-03-16 13:35:23 -07:00
2026-03-16 13:35:23 -07:00
2026-03-16 13:35:23 -07:00
2026-02-24 14:39:25 +09:00
2026-03-10 21:07:36 -07:00
2026-02-27 05:50:23 -08:00
2026-03-16 13:35:11 -07:00
2026-03-04 14:48:06 -08:00
2026-03-16 14:03:40 -07:00
2026-02-25 07:20:42 -08:00
2026-03-10 20:42:54 -07:00
2026-03-10 20:42:54 -07:00
2026-03-10 20:42:54 -07:00
2026-03-04 14:48:06 -08:00
2026-03-03 12:32:35 -08:00
2026-03-10 21:07:36 -07:00
2026-02-23 19:00:57 +03:00
2026-03-12 23:40:02 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-19 20:49:34 -07:00
2026-03-10 21:07:36 -07:00
2026-03-04 14:48:06 -08:00
2026-02-23 19:00:57 +03:00
2026-03-10 21:13:55 -07:00
2026-03-20 01:44:55 -07:00
2026-03-20 00:29:17 -07:00
2026-03-16 13:34:25 -07:00
2026-02-28 10:06:43 -08:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-10 20:15:38 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-12 14:49:05 -07:00
2026-02-23 19:00:57 +03:00
2026-02-24 14:39:25 +09:00
2026-02-23 19:00:57 +03:00
2026-02-17 17:04:31 +02:00
2026-02-23 19:00:57 +03:00
2026-03-16 13:35:38 -07:00
2026-02-23 19:00:57 +03:00
2026-03-12 14:49:05 -07:00
2026-03-12 23:52:46 -07:00
2026-02-20 16:25:23 +08:00
2026-03-12 15:07:57 -07:00