ECC/commands
Affaan Mustafa 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
..
aside.md feat: add /aside command (#407) 2026-03-12 23:52:46 -07:00
build-fix.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
checkpoint.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
claw.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
code-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
context-budget.md feat(commands): add /context-budget optimizer command (#554) 2026-03-20 00:20:23 -07:00
cpp-build.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
cpp-review.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
cpp-test.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
devfleet.md Add Claude DevFleet multi-agent orchestration skill (#505) 2026-03-16 13:35:50 -07:00
docs.md feat(commands): add /docs; feat(mcp-configs): document Context7 (#530) 2026-03-16 13:35:05 -07:00
e2e.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
eval.md feat: package as Claude Code plugin with marketplace distribution 2026-01-22 04:16:49 -08:00
evolve.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
go-build.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
go-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
go-test.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
gradle-build.md feat: add Kotlin, Android, and KMP rules, agent, skills, and command 2026-03-10 20:53:39 -07:00
harness-audit.md fix(harness-audit): make scoring deterministic with scripted rubric (#524) 2026-03-16 13:34:30 -07:00
instinct-export.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
instinct-import.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
instinct-status.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
kotlin-build.md fix: align kotlin diagnostics and heading hierarchy 2026-03-12 23:53:23 -07:00
kotlin-review.md feat: add kotlin commands and skill pack 2026-03-10 21:25:52 -07:00
kotlin-test.md feat: add kotlin commands and skill pack 2026-03-10 21:25:52 -07:00
learn-eval.md docs: clarify learn-eval verdict flow 2026-03-10 20:14:19 -07:00
learn.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
loop-start.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
loop-status.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
model-route.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
multi-backend.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-execute.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-frontend.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-plan.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-workflow.md feat: add orchestration workflows and harness skills 2026-03-12 14:49:05 -07:00
orchestrate.md fix: refresh orchestration follow-up after #414 (#430) 2026-03-16 14:29:28 -07:00
plan.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
pm2.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
projects.md fix: resolve CI failures on main — lint, hooks validator, and test alignment 2026-03-02 22:15:46 -08:00
promote.md fix: resolve CI failures on main — lint, hooks validator, and test alignment 2026-03-02 22:15:46 -08:00
prompt-optimize.md feat(skills): add prompt-optimizer skill and /prompt-optimize command (#418) 2026-03-12 23:40:02 -07:00
python-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
quality-gate.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
refactor-clean.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
resume-session.md docs: align session commands with session manager 2026-03-10 20:24:15 -07:00
rules-distill.md feat(skills): add rules-distill skill (rebased #561) (#678) 2026-03-20 01:44:55 -07:00
rust-build.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
rust-review.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
rust-test.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
save-session.md docs: align session commands with session manager 2026-03-10 20:24:15 -07:00
sessions.md fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691) 2026-03-20 01:38:15 -07:00
setup-pm.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
skill-create.md feat: add skill-create and continuous-learning-v2 commands 2026-01-27 04:01:06 -08:00
skill-health.md fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691) 2026-03-20 01:38:15 -07:00
tdd.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
test-coverage.md docs: enhance 5 thin commands and add Rust API example 2026-02-12 15:38:27 -08:00
update-codemaps.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
update-docs.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
verify.md feat: package as Claude Code plugin with marketplace distribution 2026-01-22 04:16:49 -08:00