distill
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 this agent skill?
npx skills add https://github.com/camacho/ai-skills --skill distillIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill acts as an orchestration pipeline for analyzing and restructuring agent instructions. It processes local rule files to extract imperatives, compose policies, and generate visualizations. No malicious patterns or security risks were identified.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
/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
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/camacho/ai-skills/distill">View distill on skillZs</a>