rules-distill

rules-distill is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 0 tokens per session (831 once invoked), scanned A, original, MIT.

A command that scans the project's skills for repeated behavior patterns and suggests turning well-supported patterns into shared rules.

In plain words
What is it for?
It is for reviewing skills, finding duplicated practices, and proposing updates to a rules directory after user approval.
Why use it?
It helps prevent useful guidance from staying hidden in separate skill files. Patterns are only suggested when they appear in at least two skills and help avoid real mistakes.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Good fit It is for reviewing skills, finding duplicated practices, and proposing updates to a rules directory after user approval.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/rules-distill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rules-distill

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/rules-distill.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/rules-distill)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/rules-distill"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/rules-distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00831
Opus 5 $0.00000 $0.00415
Sonnet 5 $0.00000 $0.00166
Haiku 4.5 $0.00000 $0.00083

Measured 4d ago against content hash 4770e2077e6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

rules-distill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/rules-distill.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/rules-distill — Distill Skill Patterns Into Rules

Scan all skills for repeated behavioral patterns and promote high-value ones to rules.

Iron Law

Only promote patterns with evidence in 2+ skills AND a clear violation scenario — no speculative rules.

Usage

/rules-distill              # Scan all skills
/rules-distill flutter      # Scan only Flutter skills
/rules-distill security     # Scan only security-related skills

What It Does

Runs the 3-phase pipeline:

  1. Inventory — Find all skills + rules files, build index of behavioral claims
  2. Cross-Read & Match — Find patterns appearing in 2+ skills, apply 4 filters
  3. User Review — Present candidates with verdict options, get approval before writing

4 Promotion Filters (all must pass)

Filter Test Fail = Skip
2+ skills evidence Pattern found in ≥ 2 separate skill files Appears in only 1 skill
Actionable behavior Claude can detect violation at write time Vague preference ("write clean code")
Violation risk Missing this causes real bugs or inconsistency Low-stakes style preference only
Not already in rules Pattern NOT already in .claude/rules/*.md Already covered

Verdict Taxonomy

Verdict Meaning Action
Append New rule fits cleanly in an existing rules file Add to bottom of named file
Revise Existing rule in rules file needs strengthening Edit the specific rule
New Section New rules file section needed Add H2 section to named file
New File Cross-cutting enough to warrant its own file Create new .claude/rules/xxx.md
Already Covered Pattern exists in rules — show exact file:line Skip
Too Specific Pattern belongs in a skill, not a rule Skip — stays in skill

Output Format (Phase 3 — User Review)

For each candidate, show:

## Candidate N: [Pattern Name]

**Evidence:**
- `skills/flutter-mobile/SKILL.md:47` — [quote]
- `skills/nestjs-api/SKILL.md:82` — [quote]

**Proposed Rule:**
> [One sentence rule, starting with "Always" or "Never" or a verb]

**Violation Scenario:**
> [One sentence: what breaks if this rule is absent]

**Verdict:** [Append to `rules/code-standards.md` / Revise / New Section / New File / Too Specific]

**Awaiting: APPROVE / SKIP / MODIFY**

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 93 lines · 0 tokens per session scan A 4770e2077e6c

Subscribe to this mod's changes

rules-distill is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 831 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.