
distill
Use when agent instruction files (AGENTS.md, rules/) need analysis, trimming, or restructuring. Orchestrates /imperatives → /policy-algebra → /visualize into a distillation pipeline.
- Installs
- 300
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/camacho/ai-skills --skill distill- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads distill automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
/distill
Distill agent instruction files into structured imperatives, compose with policy algebra, and visualize the rule system. Three-stage pipeline.
Usage
/distill # full pipeline on default files
/distill ai-workspace/rules/*.md # specific targets
/distill --stage imperatives # run only extraction
/distill --stage compose # run only policy algebra (requires prior extraction)
/distill --stage visualize # run only visualization (requires prior composition)
Pipeline
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ /imperatives │────▶│/policy-algebra│────▶│ /visualize │
│ extract │ │ compose │ │ render │
└─────────────┘ └──────────────┘ └─────────────┘
│ │ │
JSONL file Starlark block Mermaid diagrams
Stage 1 — Extract (/imperatives)
- Invoke
/imperativeswith the target files (or defaults:ai-workspace/rules/*.md+AGENTS.md). - Save output to
ai-workspace/research/<name>-imperatives.jsonl. - Present the summary (count, level breakdown, scope breakdown).
Ask the user: "Review the extraction before composing? (y/continue)"
- If yes: present the JSONL for review, wait for feedback, re-extract if needed.
- If continue: proceed to Stage 2.
Stage 2 — Compose (/policy-algebra)
- Project the JSONL to natural-language bullets:
<level>[ NOT] <subject> <predicate>[ when <when>]— one bullet per imperative. - Invoke
/policy-algebrawith the projected bullets. - Save the Starlark composition to
ai-workspace/research/<name>-policy.md. - Present the surfaced structure (decision functions, branching points).
Stage 3 — Visualize (/visualize)
- For each major decision function in the Starlark output, invoke
/visualize. - Content shape is typically graph (decision trees) → Mermaid flowcharts.
- Append diagrams to the policy doc.
Naming
The <name> slug defaults to the current date + "distill" (e.g., 2026-05-04-distill). Override with --name <slug>.
Output
All artifacts land in ai-workspace/research/:
<name>-imperatives.jsonl— structured extraction<name>-policy.md— Starlark composition + diagrams
Failure modes
| Condition | Behavior |
|---|---|
| /imperatives finds zero imperatives | Report and stop. No point composing empty input. |
| /policy-algebra unavailable | Skip Stage 2, warn. Stage 3 can still visualize the JSONL directly. |
| User interrupts between stages | Artifacts from completed stages are preserved. Resume with --stage. |
When to use
- AGENTS.md or rules/ grew past a size threshold and needs trimming
- Before a major restructuring of agent instruction files
- To audit what rules actually exist vs what you think exists
- As input to a plan that modifies the rule system
FAQ
What does the distill skill do?
Use when agent instruction files (AGENTS.md, rules/) need analysis, trimming, or restructuring. Orchestrates /imperatives → /policy-algebra → /visualize into a distillation pipeline.
How do I install distill?
Run npx skills add https://github.com/camacho/ai-skills --skill distill in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/distill/ (personal) or .claude/skills/distill/ (project).
Which AI agents can use distill?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is distill safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains distill?
It is published by camacho in camacho/ai-skills. It has 300 recorded installs.
More from camacho/ai-skills
archive
camacho/ai-skills
Fills Outcomes & Learnings in a plan file and renames it to .done.md.
bail
camacho/ai-skills
Reflects, updates GitHub Issue, closes PR if open, cleans up worktree/branch.
capture
camacho/ai-skills
Creates a draft GitHub Issue with triage label from natural language description.
plan-review
camacho/ai-skills
Auto-assembles review panel using deterministic rules, dispatches agents against plan file, collects verdicts.
orient
camacho/ai-skills
Fetches issue context, auto-detects task type, maps to branch prefix, presents brief.
reflect
camacho/ai-skills
Use after merging a branch or completing a task to consolidate learnings into memory layers, close out issues, and verify the phase gate.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.