Extract shared principles from skills and turn them into maintainable rule files.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "rules-distill" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/rules-distill/SKILL.md 2. Save it as ~/.claude/skills/rules-distill/SKILL.md 3. Reload skills and tell me it's ready
Scan all skill descriptions in this project, identify recurring constraints, style requirements, and execution principles, and compile them into a rule file; deduplicate existing rules and keep the more general wording.
A deduplicated rule file draft with shared principles, revision suggestions, and new rules.
Compare the current rule file with the latest skill definitions, identify outdated, conflicting, or missing rules, and specify what should be appended, revised, or removed.
A rule diff summary and updated rule text that can be applied directly.
Based on this set of skills, extract cross-skill consistency requirements and generate a new rule file for future writing and review, grouped by theme.
A new rule file organized by theme, clearly stating each rule’s scope and purpose.
Scan installed skills, extract cross-cutting principles that appear in multiple skills, and distill them into rules — appending to existing rule files, revising outdated content, or creating new rule files.
Applies the "deterministic collection + LLM judgment" principle: scripts collect facts exhaustively, then an LLM cross-reads the full context and produces verdicts.
The rules distillation process follows three phases:
bash ~/.claude/skills/rules-distill/scripts/scan-skills.sh
bash ~/.claude/skills/rules-distill/scripts/scan-rules.sh
Rules Distillation — Phase 1: Inventory
────────────────────────────────────────
Skills: {N} files scanned
Rules: {M} files ({K} headings indexed)
Proceeding to cross-read analysis...
Extraction and matching are unified in a single pass. Rules files are small enough (~800 lines total) that the full text can be provided to the LLM — no grep pre-filtering needed.
Group skills into thematic clusters based on their descriptions. Analyze each cluster in a subagent with the full rules text.
After all batches complete, merge candidates across batches:
Launch a general-purpose Agent with the following prompt:
You are an analyst who cross-reads skills to extract principles that should be promoted to rules.
## Input
- Skills: {full text of skills in this batch}
- Existing rules: {full text of all rule files}
## Extraction Criteria
Include a candidate ONLY if ALL of these are true:
1. **Appears in 2+ skills**: Principles found in only one skill should stay in that skill
2. **Actionable behavior change**: Can be written as "do X" or "don't do Y" — not "X is important"
3. **Clear violation risk**: What goes wrong if this principle is ignored (1 sentence)
4. **Not already in rules**: Check the full rules text — including concepts expressed in different words
## Matching & Verdict
For each candidate, compare against the full rules text and assign a verdict:
- **Append**: Add to an existing section of an existing rule file
- **Revise**: Existing rule content is inaccurate or insufficient — propose a correction
- **New Section**: Add a new section to an existing rule file
- **New File**: Create a new rule file
- **Already Covered**: Sufficiently covered in existing rules (even if worded differently)
- **Too Specific**: Should remain at the skill level
## Output Format (per candidate)
```json
{
"principle": "1-2 sentences in 'do X' / 'don't do Y' form",
"evidence": ["skill-name: §Section", "skill-name: §Section"],
"violation_risk": "1 sentence",
"verdict": "Append / Revise / New Section / New File / Already Covered / Too Specific",
"target_rule": "filename §Section, or 'new'",
"confidence": "high / medium / low",
"draft": "Draft text for Append/New Section/New File verdicts",
"revision": {
"reason": "Why the existing content is inaccurate or insufficient (Revise only)",
"before": "Current text to be replaced (Revise only)",
"after": "Proposed replacement text (Revise only)"
}
}
```
## Exclude
- Obvious principles already in rules
- Language/framework-specific knowledge (belongs in language-specific rules or skills)
- Code examples and commands (belongs in skills)
…
Plan demand forecasts, safety stock, and replenishment for multi-location retail inventory.
Record polished web app UI demo videos for walkthroughs, tutorials, and showcases.
Create iOS liquid glass interfaces with dynamic visuals and interactive morphing.
Unify multi-channel notifications for routing, deduplication, escalation, and inbox consolidation.
Audit, plan, and implement SEO improvements for better search visibility.
Refine retrieved context iteratively to improve subagent understanding and output quality.
Generate test scenarios and measure how well agents follow skills and rules.
Scan AI skill packages for malicious docs and scripts before execution.
Create, refine, validate, and restructure AgentSkills and SKILL.md files.
Capture key learnings into reusable repository skills and instructions.
Turn a repeated workflow into a reusable skill file from the current session.
Audit Claude skills and commands with quick scans or full stocktakes.