mcpField
D
distill

distill

github.com/camachoAgent workflows300 installs
Repository

About distill

distill is a skill for turning agent instruction files into structured rules, a composed policy, and diagrams. It helps maintainers audit or restructure growing rule sets through a resumable three-stage pipeline.

Key features

  1. 01Extracts imperatives into JSONL
  2. 02Composes rules with policy algebra
  3. 03Renders decision diagrams
  4. 04Supports stage-by-stage resumption

Use cases

  1. 01Auditing rules in AGENTS.md
  2. 02Preparing a rule-system restructuring
  3. 03Trimming large instruction files

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/camacho/ai-skills --skill distill

After installing, type/distillin Claude Code to confirm it loaded.

Details

From the project README

/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)
  1. Invoke /imperatives with the target files (or defaults: ai-workspace/rules/*.md + AGENTS.md).
  2. Save output to ai-workspace/research/<name>-imperatives.jsonl.
  3. 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)
  1. Project the JSONL to natural-language bullets: <level>[ NOT] <subject> <predicate>[ when <when>] — one bullet per imperative.
  2. Invoke /policy-algebra with the projected bullets.
  3. Save the Starlark composition to ai-workspace/research/<name>-policy.md.
  4. Present the surfaced structure (decision functions, branching points).
Stage 3 — Visualize (/visualize)
  1. For each major decision function in the Starlark output, invoke /visualize.
  2. Content shape is typically graph (decision trees) → Mermaid flowcharts.
  3. 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

ConditionBehavior
/imperatives finds zero imperativesReport and stop. No point composing empty input.
/policy-algebra unavailableSkip Stage 2, warn. Stage 3 can still visualize the JSONL directly.
User interrupts between stagesArtifacts 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

Comments

Markdown supported