@camacho/distill
Use when agent instruction files (AGENTS.md, rules/) need analysis, trimming, or restructuring. Orchestrates /imperatives → /policy-algebra → /visualize into a distillation pipeline.
| name | distill |
| description | Use when agent instruction files (AGENTS.md, rules/) need analysis, trimming, or restructuring. Orchestrates /imperatives → /policy-algebra → /visualize into a distillation pipeline. |
/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
Loading...
Select a file to preview
Analyzing security...
Checking scan reports and verification data.
Bill of Materials
Everything this skill can do — files, network, commands, and more.