Agent skill · operations · affaan-m

rules-distill

Scan skills to extract cross-cutting principles and distill them into rules — append, revise, or create new rule files. Use when the same principle keeps recurring across skills and belongs in a rule file instead.

Why this skill is useful

Adds a systematic approach to distilling rules from skills, enhancing the AI's ability to generate actionable guidelines based on existing knowledge.

What it needs

Requires bash installed locally. About 5k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Rules Distill 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. When to Use Periodic rules maintenance (monthly or after installing new skills) After a skill-stocktake reveals patterns that should be rules When rules feel incomplete relative to the skills being used How It Works The rules distillation process follows three phases: Phase 1: Inventory (Deterministic Collection) 1a. Collect skill inventory 1b. Collect rules index 1c. Present to user Phase 2: Cross-read, Match & Verdict (LLM Judgment) 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. Batching Group skills into thematic clusters based on their descriptions. Analyze each cluster in a subagent with the full rules text. Cross-batch Merge After all batches complete, merge candidates across batches: Deduplicate candidates with the same or overlapping principles Re-check the "2+ skills" requirement using evidence from all batches combined — a principle found in 1 skill per batch but 2+ skills total is valid Subagent Prompt Launch a general-purpose Agent with the following prompt: json { "principle": "1-2 sentences in 'do X' / 'don't do Y' form", "evidence": ["skill-name: §Section", "skill-name: §Section"], "violationrisk": "1 sentence", "verdict": "Append / Revise / New Section / New File / Already Covered / Too Specific", "targetrule": "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)", "befor …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/rules-distill--6c53c0

View the source on GitHub

Browse the @skills marketplace