distill

distill is a skill for Claude Code, Codex from kirkchen/beat. It costs 29 tokens per session (3,493 once invoked), scanned A, original, MIT.

A workflow for reverse-engineering existing code into Gherkin feature files, which are readable descriptions of software behavior. The files describe what the code currently does rather than what it should do in the future.

In plain words
What is it for?
Use it to document an existing module or bring an established codebase into the Beat workflow.
Why use it?
It helps introduce behavior-driven development into an existing codebase without writing specifications from scratch. This provides a starting record of current behavior.

Skill for Claude CodeCodex

Part of the beat plugin — 8 skills, 1 hook shipped together

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.

agentmods
npx agentmods add skills/kirkchen/beat/distill
Any agent
npx skills add kirkchen/beat --skill distill
Clone the repo
git clone --depth 1 https://github.com/kirkchen/beat

Made for: Claude Code, Codex.

Or install beat, the plugin that ships this one along with the rest of its 8 skills, 1 hook.

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 distill

README.md
[![agentmods](https://agentmods.dev/badge/skills/kirkchen/beat/distill.svg)](https://agentmods.dev/skills/kirkchen/beat/distill)
Your own site
<a href="https://agentmods.dev/skills/kirkchen/beat/distill"><img src="https://agentmods.dev/badge/skills/kirkchen/beat/distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00029 $0.03493
Opus 5 $0.00015 $0.01747
Sonnet 5 $0.00006 $0.00699
Haiku 4.5 $0.00003 $0.00349

Measured 3d ago against content hash eb25b888840b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 3d 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.

skills/distill/SKILL.md · 275 lines

How it starts

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

Distill — reverse-engineer Gherkin feature files from existing code.

Use this to bring existing codebases into the Beat workflow. The output is draft .feature files that describe current behavior (not aspirational), verified independently by /beat:verify.

<decision_boundary>

Use for:

  • Extracting BDD specs from an existing codebase that doesn't have feature files yet
  • Bringing a module, directory, or functionality into the Beat workflow retroactively
  • Generating draft .feature files that describe what the code currently does

NOT for:

  • Designing new behavior or features (use /beat:design)
  • Writing aspirational specs for code that doesn't exist yet (use /beat:design)
  • Greenfield projects with no existing code to distill
  • Exploring ideas or thinking through a problem (use /beat:explore)

Trigger examples:

  • "Distill the auth module into feature files" / "Extract specs from existing code" / "Bring this codebase into Beat"
  • Should NOT trigger: "design a new feature" / "write specs for something we want to build" / "explore this idea"

</decision_boundary>

Before writing feature files: you MUST run the glossary check (see step 6) and ensure every project-specific term used in scenarios is defined in beat/CONTEXT.md. Create the glossary lazily — only when the first term is added.

After writing each artifact: you MUST run the four-check spec self-review (placeholder / consistency / scope / ambiguity). Fix issues inline.

While writing design.md: you MUST run the three-condition ADR gate (hard-to-reverse + surprising + real trade-off — see references/adr-format.md) on each Key Decision recovered from the code. When all three hold, offer to lift it into docs/adr/. The user may decline. NEVER invent rationale the code doesn't show — mark it unverified or ask the user.

If a prerequisite skill is unavailable (not installed), continue with fallback — but NEVER skip because you judged it unnecessary.

Prerequisites (invoke before proceeding)

Superpower When Priority
using-git-worktrees Before first file write MUST

If a superpower is unavailable (skill not installed), skip and continue.

Rationalization Prevention

Thought Reality
"I don't need a worktree for just writing feature files" Distilled artifacts flow through verify and archive. Without isolation, they won't carry forward correctly.
"The code is simple, I can verify the scenarios myself" Self-verification of distilled specs is explicitly forbidden. Always use /beat:verify for independent accuracy checking.
"I'll skip scanning existing features, this is a new area" Existing features may already cover this behavior. Distilling duplicates creates maintenance burden.
"These scenarios are obviously correct, verification is overkill" Distill extracts specs from code — the most likely error is describing aspirational behavior instead of current behavior. Verification catches this.
"I'll commit later, let me just generate the files first" Uncommitted artifacts can be lost. Commit before presenting to the user, matching design's behavior.
"The terms are already in the code, no need for a glossary" Code shows usage, not meaning. Distill is the moment an established codebase gets its glossary — entries are two lines, add them inline.
"I can't know why this decision was made, so no ADR" You can't invent the why, but you can record the what and ask. Run the gate; mark unverified rationale as unverified instead of skipping.
"Spec self-review is overkill, the scenarios came straight from code" Reading code ≠ describing it accurately. The four checks catch placeholders, contradictions, and ambiguities in 30 seconds.

Read the full file on GitHub · 275 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 275 lines · 29 tokens per session scan A eb25b888840b

Subscribe to this mod's changes

distill is a skill published in the GitHub repository kirkchen/beat (7 stars, last pushed 2mo ago), licensed MIT. It adds 29 tokens to every session and 3,493 once invoked, about $0.0001 per session on Opus 5. 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-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens