distill
Skill9 starsChanged 7 months agoMITView on GitHub
Use when extracting BDD specs from existing code — for adopting Beat in an established codebase or distilling a module into feature files
75 other projects use a version of this.
Adopted by
Most recently taken up by
- venhdev/skillstheir own version, first seen Nov 8, 2026
- kylehughes/distillation-for-agentstheir own version, first seen Nov 8, 2026
- komluk/scaffoldingtheir own version, first seen Nov 7, 2026
- Integralist/agent-skillstheir own version, first seen Nov 6, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- JHostalek/dotclaudetheir own version, first seen Nov 1, 2026
Used with
Projects with it also use layout, shape and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
owshq-mecSkilllayout
Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.
Also in 8 projects that use this
HAR5HA-7663Skillshape
Plan the UX and UI for a feature before writing code. Runs a structured discovery interview, then produces a design brief that guides implementation. Use during the planning phase to establish design direction, constraints, and strategy before any code is written.
Also in 11 projects that use this
klauswgSkillckm:design-system
Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing/typography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.
Also in 3 projects that use this
iovisorSkillevolve
Evolve uBPF through a gated spec-first workflow that propagates approved changes through requirements, design, validation, implementation, and RFC alignment artifacts.
Also in 3 projects that use this
termdockSkillrecall
Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.
Also in 5 projects that use this
bidodevSkilldevils-advocate
Challenges decisions, plans, and code by systematically arguing the opposing side. Surfaces risks, pokes holes in assumptions, and stress-tests thinking before committing. Supports intensity levels (gentle, balanced, ruthless, linus) and works with conversation context or a specific file reference. Trigger on requests like "challenge this", "poke holes", "what could go wrong", "play devil's advocate", "linus mode", or "/devils-advocate".
Also in 3 projects that use this
Other versions75 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 75
- talesofai/cohub★ 585same name
- juxt/allium★ 506same name
- educlopez/ui-craft★ 441same name
- Michaelliv/napkin★ 428same name
- nexmoe/DayBee★ 424same name
- nexmoe/eve★ 424same name
- Southclaws/storyden★ 348same name
- 10xChengTu/Mux0★ 337same name
- theexperiencecompany/gaia★ 325same name
- AkaraChen/aghub★ 271same name
65 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 0 are common, 16 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this to bring existing codebases into the Beat workflow.
- Distinctive: line 25
Should NOT trigger: "design a new feature" / "write specs for something we want to build" / "explore this idea"
- Distinctive: line 30
Before writing any artifact files: you MUST invoke superpowers:using-git-worktrees.
- Very specific: line 34
Before writing feature files: you MUST run the glossary check (see step 6) and ensure every project-specific term used in scenarios is …
- Distinctive: line 37
Create the glossary lazily — only when the first term is added.
- Distinctive: line 39
After writing each artifact: you MUST run the four-check spec self-review (placeholder / consistency / scope / ambiguity).
- Distinctive: line 48
If a prerequisite skill is unavailable (not installed), continue with fallback — but NEVER skip because you judged it unnecessary.
- Distinctive: line 60
If a superpower is unavailable (skill not installed), skip and continue.
- Distinctive: line 133
If not specified, use AskUserQuestion tool:
- Distinctive: line 142
Read the specified code. Map out:
- Very specific: line 151
Read Feature: and Scenario: lines to map existing coverage
- Distinctive: line 154
If the scope is entirely covered: inform user and STOP
- Very specific: line 158
Create beat/changes/distill-<scope-name>/ with status.yaml (schema: references/status-schema.md):
- Very specific: line 177
Read beat/config.yaml if it exists (schema: references/config-schema.md).
- Very specific: line 181
Read GLOSSARY.md if it exists (schema: references/context-format.md).
- Very specific: line 190
Every project-specific term used in scenarios MUST exist in GLOSSARY.md before the scenario is written.
- Very specific: line 193
Read references/feature-writing.md for conventions on description blocks, scenario organization, and review checklist
- Distinctive: line 194
Write feature files describing CURRENT behavior (not desired behavior)
- Very specific: line 196
Use tags: @distilled (always), plus @happy-path, @error-handling, @edge-case
- Very specific: line 197
Every scenario MUST have a testing layer tag (@e2e or @behavior, default @behavior)
- Distinctive: line 198
If behavior is ambiguous, note it as uncertain rather than guessing
- Distinctive: line 201
If the purpose is clear from code/docs: write a brief "why this exists" proposal
- Very specific: line 203
If you choose not to write it: set proposal: { status: skipped } in status.yaml — never leave it pending (archive warns on pending …
- Distinctive: line 206
Document the current technical architecture and key decisions visible in the code
- Very specific: line 214
If you choose not to write design.md: set design: { status: skipped } in status.yaml — never leave it pending
- Very specific: line 227
Update status.yaml for each artifact created, and mark optional artifacts you chose not to create as skipped.
- Very specific: line 235
Run node <skill-dir>/scripts/lint-features.mjs beat/changes/<name>/features/*.feature and node <skill-dir>/scripts/validate-beat.mjs --file …
- Distinctive: line 237
Commit the change directory and every living-documentation file this run wrote or modified — they are one unit of work:
- Distinctive: line 251
Use a descriptive message: "distill(<scope>): extract BDD specs from existing code"
- Distinctive: line 256
All generated feature files (summary of scenarios per feature)
“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
.featurefiles 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>
<HARD-GATE>
Before writing any artifact files: you MUST invoke superpowers:using-git-worktrees.
Distilled artifacts live in a change container that flows through verify → archive.
Worktree isolation ensures they don't contaminate the main workspace.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 GLOSSARY.md at the project
root (path: references/project-layout.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. If the user explicitly asks to skip the worktree, say that
the change container will be written and committed on the current branch, confirm once, then
proceed there — never imply an isolation you don't have.
</HARD-GATE>
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 user said no worktree, so I'll just not mention it" | Honour it — after saying where the files land and that the commit goes on the current branch. The failure is the silent skip, not the skip. |
| "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. |
Red Flags — STOP if you catch yourself:
- Writing any file before invoking using-git-worktrees
- Writing scenarios that describe desired behavior instead of current behavior
- Skipping the existing feature scan
- Claiming verification passed without running
/beat:verify - Finishing without committing artifacts
- Writing Gherkin scenarios that contain internal method names, numeric thresholds, or implementation constants
- Writing scenarios that use project-specific domain terms not defined in
GLOSSARY.md - Writing a Key Decision in
design.mdwithout running the three-condition ADR gate - Inventing rationale for a recovered decision instead of marking it unverified or asking
- Skipping the spec self-review because the scenarios "came straight from the code"
- Telling the user to run
/beat:planor/beat:applyon the distill change itself (there is nothing to implement) - Thinking "I know the code well enough to skip verification"
Process Flow
digraph distill {
"Ask for scope" [shape=box];
"Invoke using-git-worktrees" [shape=box, style=bold];
"Read and understand code" [shape=box];
"Scan existing features" [shape=box];
"Scope already covered?" [shape=diamond];
"STOP: inform user" [shape=box, style=dashed];
"Create change container" [shape=box];
"Glossary check\n(terms → GLOSSARY.md)" [shape=box, style=bold];
"Generate draft artifacts\n(self-review each)" [shape=box];
"design.md included?" [shape=diamond];
"ADR gate\n(design.md Key Decisions)" [shape=box, style=bold];
"Offer module README\n(Layer 3, optional)" [shape=box];
"Commit artifacts" [shape=box];
"Present to user" [shape=doublecircle];
"Ask for scope" -> "Invoke using-git-worktrees";
"Invoke using-git-worktrees" -> "Read and understand code";
"Read and understand code" -> "Scan existing features";
"Scan existing features" -> "Scope already covered?";
"Scope already covered?" -> "STOP: inform user" [label="yes"];
"Scope already covered?" -> "Create change container" [label="no"];
"Create change container" -> "Glossary check\n(terms → GLOSSARY.md)";
"Glossary check\n(terms → GLOSSARY.md)" -> "Generate draft artifacts\n(self-review each)";
"Generate draft artifacts\n(self-review each)" -> "design.md included?";
"design.md included?" -> "ADR gate\n(design.md Key Decisions)" [label="yes"];
"design.md included?" -> "Offer module README\n(Layer 3, optional)" [label="no"];
"ADR gate\n(design.md Key Decisions)" -> "Offer module README\n(Layer 3, optional)";
"Offer module README\n(Layer 3, optional)" -> "Commit artifacts";
"Commit artifacts" -> "Present to user";
}Input: User specifies the code scope to distill (module, directory, or functionality).
Steps
Ask for scope
If not specified, use AskUserQuestion tool:
"What code do you want to distill into BDD specs? Specify a module, directory, or describe the functionality."
Ensure worktree isolation
Invoke
using-git-worktreesbefore reading or writing any files.Read and understand the code
Read the specified code. Map out:
- User-visible behaviors (functionality)
- Edge cases handled
- Error conditions
- Existing tests (if any) that reveal behavior
Scan existing features
Scan
beat/features/**/*.featureandbeat/changes/*/features/*.feature(excluding archive):- Read
Feature:andScenario:lines to map existing coverage - Deep-read only features that overlap with the distill scope
- Note which behaviors are already covered — do NOT distill duplicates
- If the scope is entirely covered: inform user and STOP
- Read
Create a change container
Create
beat/changes/distill-<scope-name>/withstatus.yaml(schema:references/status-schema.md):name: distill-<scope-name> created: YYYY-MM-DD phase: new source: distill pipeline: proposal: { status: pending } gherkin: { status: pending } design: { status: pending } tasks: { status: skipped }tasksisskippedbecause a distill change describes current behavior — there is nothing to implement. Future changes to this area get their own change containers via the normal/beat:design→/beat:plan→/beat:applyflow.Generate draft artifacts
Read
beat/config.yamlif it exists (schema:references/config-schema.md). Uselanguagefor artifact output language, injectcontextas project background, and apply matchingrulesper artifact type (e.g.,rules.gherkin,rules.proposal,rules.design).Glossary check (Layer 1) — before writing feature files:
Read
GLOSSARY.mdif it exists (schema:references/context-format.md). Create it lazily when the first term is added — never preemptively.Distill is often the first time an established codebase builds its glossary, and the code itself is the source. For each project-specific term that will appear in scenarios, adapt the four challenges from
references/context-format.mdand updateGLOSSARY.mdinline as terms resolve (never batch). Insert each entry where "Where a new entry goes" inreferences/context-format.mdsays — inside its## <group>section (or## Language), never appended after## Flagged ambiguities; when creating the file, write the full skeleton first:- Against the glossary — the term conflicts with an existing entry? Surface, resolve, update.
- Sharpen fuzzy — the code uses synonyms for one concept (e.g.
user/account/memberfor the same entity)? Pick the canonical word, list the others as_Avoid_. - Stress-test against code — probe term boundaries with the edge cases the code actually handles; name the boundary.
- Cross-reference docs — README/comments/docs use a term differently from the code? Surface it and ask the user which is canonical.
Every project-specific term used in scenarios MUST exist in
GLOSSARY.mdbefore the scenario is written. Bold terms in scenarios are the canonical form (seereferences/feature-writing.md). If a term's meaning is genuinely uncertain from code alone, ask the user rather than guessing.features/*.feature (mandatory):
- Read
references/feature-writing.mdfor conventions on description blocks, scenario organization, and review checklist - Write feature files describing CURRENT behavior (not desired behavior)
- Each scenario must accurately reflect what the code actually does
- Use tags:
@distilled(always), plus@happy-path,@error-handling,@edge-case - Every scenario MUST have a testing layer tag (
@e2eor@behavior, default@behavior) - If behavior is ambiguous, note it as uncertain rather than guessing
proposal.md (optional):
- If the purpose is clear from code/docs: write a brief "why this exists" proposal
- Sections:
## Why,## What Changes,## Impact - If you choose not to write it: set
proposal: { status: skipped }in status.yaml — never leave itpending(archive warns on pending artifacts)
design.md (optional):
- Document the current technical architecture and key decisions visible in the code
- Sections:
## Approach,## Key Decisions,## Components - ADR gate — for each Key Decision recovered from the code, run the three-condition check from
references/adr-format.md:- Hard to reverse?
- Surprising without context?
- Result of a real trade-off?
Recovered decisions are prime candidates — "surprising without context" is exactly what code archaeology surfaces. Caveat: the code shows what was decided, not why. Take rationale from evidence (commit history, comments, docs) or from the user; if neither is available, record the decision with rationale marked unverified (e.g. "Rationale unconfirmed — recovered from code"). Never invent a why.
If all three hold, use AskUserQuestion tool: "This recovered decision meets the ADR gate. Lift it into
docs/adr/?" On Yes, follow "Before writing an ADR" inreferences/adr-format.md(apply configrules.adr; use the project'sdocs/adr/TEMPLATE.mdif it exists, otherwise Beat's front-matter template withsource: beat/changes/distill-<scope-name>), write the 1-3 sentence ADR, incrementing the highest existing number. On No, continue. Createdocs/adr/lazily — only on first ADR. Step 7 commits the ADR with the change.
- If you choose not to write design.md: set
design: { status: skipped }in status.yaml — never leave itpending
Spec self-review (after writing each artifact):
Re-read the artifact with fresh eyes and check:
- Placeholder scan — any
TBD,TODO, incomplete sections, vague descriptions? - Internal consistency — do sections contradict each other? Do scenarios contradict the proposal/design?
- Scope check — does the artifact stay within the distill scope, or did it drift into adjacent behavior?
- Ambiguity check — could any scenario be read two different ways? If so, pick the reading the code supports and make it explicit.
Fix issues inline. No need to re-review the fix — just fix and move on.
Update
status.yamlfor each artifact created, and mark optional artifacts you chose not to create asskipped. Set phase to the latest completed spec artifact.Module README offer (Layer 3, optional):
If the distilled scope is a module (its own directory with a public interface) and it has no
README.md, offer once to scaffold one perreferences/architecture-format.md. Ifbeat/ARCHITECTURE.mdexists and is missing this module's row, offer to add it. Advisory — the user may decline; never block.Lint and commit artifacts
Run
node <skill-dir>/scripts/lint-features.mjs beat/changes/<name>/features/*.featureandnode <skill-dir>/scripts/validate-beat.mjs --file beat/changes/<name>/status.yaml(seereferences/lint-tools.md); fix every error before committing. Distilled scenarios have no tests yet, so@covered-bywarnings are expected here.Commit the change directory and every living-documentation file this run wrote or modified — they are one unit of work:
git add beat/changes/distill-<scope-name>/ git add docs/adr/NNNN-<slug>.md # each ADR from the ADR gate, by file name git add docs/adr/<index-file> # only if the project keeps an ADR index there and this run updated it git add GLOSSARY.md # glossary entries from the glossary check git add beat/ARCHITECTURE.md # if the hub row was added git add <module>/README.md # if the module README scaffold was accepted git commitStage files by name, never
docs/adr/as a directory: a path is staged whengit statusshows it and this run wrote it; a path that is absent, unchanged, or was modified by the user outside this run stays unstaged.Use a descriptive message: "distill(
<scope>): extract BDD specs from existing code"Present to user for review
Show:
- All generated feature files (summary of scenarios per feature)
- Any remaining uncertainties about behavior
- Existing features that overlap (from step 4 scan)
## Distill Complete: distill-<scope-name> Created: - features/*.feature (N scenarios across M files) - proposal.md (or skipped) - design.md (or skipped) Glossary: N terms added to GLOSSARY.md (or "no new terms") ADRs: N written to docs/adr/ (or "none qualified") Uncertainties: [list any ambiguous behaviors] Next steps: - Review the draft feature files for accuracy - Run `/beat:verify` to independently verify scenarios match code behavior (accuracy mode) - Run `/beat:archive` to sync verified features into `beat/features/` living documentation - Future changes to this area use the normal flow: `/beat:design` → `/beat:plan` → `/beat:apply`Then end with the handoff block from
references/handoff-report.md(next: /beat:verify <name>).
Distill vs Normal Flow
Normal: Spec -> Code (write spec first, then implement)
Distill: Code -> Spec (extract spec from existing code)
|
/beat:verify confirms accuracy (source: distill → accuracy mode)
|
/beat:archive syncs features into living documentation
|
Future changes use normal BDD flow (new change container)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

