Distill the given body of data into an artifact far smaller than the data, one
that keeps what a reader or a program needs and drops the rest.
Arguments: $ARGUMENTS
Distill the data named in the arguments if given. Otherwise distill the data
already gathered in this conversation. If neither exists, ask the user what to
distill and stop.
Principles
- The artifact answers a question. Name the question and who asks it before
reading, or the result is a summary of everything and a distillate of nothing
- Distillation is loss. Choosing what to drop is the work; keeping it all is
refusal to do the work
- Read every item, or state the sampling rule and its limits. A pattern found in
the first ten items and asserted over a thousand is a guess
- Every claim in the artifact traces to something in the data. A claim that
traces to nothing is your prior, not the data
These aren't exhaustive. Reason from first principles when none fits cleanly.
Workflow
- Fix the target: what artifact, for whom, answering what question, and what it
must let them do. See "Kinds of artifact". If the arguments name data but no
artifact, propose one in a sentence and continue with it, saying so in the
report
- Enumerate the sources mechanically (
rg, a glob, a manifest, a query, an API
listing), not from memory. Record the count and what you excluded
- Read a handful of items spanning the visible variety and write down a
provisional shape: the dimensions along which items differ, the candidate
categories, the fields that seem to matter. This orients the full pass, but
doesn't replace it
- Check every enumerated item against that shape. Record extractions in a
working file under the scratchpad directory, each tagged with its source, so
the artifact's claims stay traceable. Revise the shape when an item doesn't
fit, then re-check the earlier items against the revision
- Reduce: cluster the extractions, keep what recurs or changes the answer, drop
the rest. See "Deciding what to keep"
- Write the artifact at the smallest size that still answers the question, in
the form its consumer needs, not as a list of everything you found
- Verify it against the data (see "Verifying the distillate") and fix what
fails
- Report as in "Reporting"
Kinds of artifact
The artifact determines what step 5 keeps:
- Research document: keep the findings, the evidence for each, and the
disagreements between sources. Cite every claim
- Code that handles the data: keep the invariants the code may rely on and
every shape it must tolerate. Here the outliers are the specification, because
a format seen once still has to parse
- Skill: keep the procedure that worked and the judgment calls it turns on.
Load
/create-skill and follow its conventions
- Schema or type: keep the fields that are always present, always absent, or
meaningfully optional, and the values each admits. Load
/outlaw-states to
keep the illegal shapes unrepresentable
- Glossary: load
/ubiquitize-language, which already does this
- Reference table or checklist: keep one row per item and one column per
question the consumer asks, and nothing else
Deciding what to keep
Keep an item when:
- It recurs across sources that didn't copy each other. What appears once is an
example at best
- Dropping it would change what the consumer does
- It's the only evidence for a claim the artifact makes
- It contradicts the pattern. An artifact that covers the average and hides the
outliers fails where it's needed
Drop an item when it's an instance of a pattern already stated, when it's
context the consumer already has, or when it's true but bears on no decision.
When two sources disagree, neither one wins by default. Say what each holds and
what would settle it.
Watch for distilling your own output: once you've written a summary, later
passes confirm it rather than test it. Return to the sources.
Verifying the distillate
- Round-trip: take items from the data at random, including ones you read late,
and check that the artifact accounts for each. What it doesn't account for is
either a gap or an exclusion you must state
- Trace every claim back to a tagged extraction. Cut the ones that don't trace
- For code and schemas, run the artifact against the real data, not a
hand-written sample
- Ask what a reader would still get wrong knowing only the artifact
- Cut the largest section and ask whether the question is still answered. If it
is, that section was padding
Reporting
Deliver the artifact itself. Alongside it, say:
- What the artifact answers, and for whom
- How many sources you enumerated, how many you read, and what you excluded
- What you dropped and on what rule
- The residue: items that fit no pattern, and the disagreements left open
- How much you trust the enumeration
For a prose artifact, offer /refine-context and /humanize.
1---2name: distill3description: |4 Distill a body of data into a small artifact that keeps what matters: a5 research document, code that handles the data, a skill, a schema.6argument-hint: '<data to distill, and what artifact to produce>'7---89Distill the given body of data into an artifact far smaller than the data, one10that keeps what a reader or a program needs and drops the rest.1112Arguments: $ARGUMENTS1314Distill the data named in the arguments if given. Otherwise distill the data15already gathered in this conversation. If neither exists, ask the user what to16distill and stop.1718# Principles1920- The artifact answers a question. Name the question and who asks it before21 reading, or the result is a summary of everything and a distillate of nothing22- Distillation is loss. Choosing what to drop is the work; keeping it all is23 refusal to do the work24- Read every item, or state the sampling rule and its limits. A pattern found in25 the first ten items and asserted over a thousand is a guess26- Every claim in the artifact traces to something in the data. A claim that27 traces to nothing is your prior, not the data2829These aren't exhaustive. Reason from first principles when none fits cleanly.3031# Workflow32331. Fix the target: what artifact, for whom, answering what question, and what it34 must let them do. See "Kinds of artifact". If the arguments name data but no35 artifact, propose one in a sentence and continue with it, saying so in the36 report372. Enumerate the sources mechanically (`rg`, a glob, a manifest, a query, an API38 listing), not from memory. Record the count and what you excluded393. Read a handful of items spanning the visible variety and write down a40 provisional shape: the dimensions along which items differ, the candidate41 categories, the fields that seem to matter. This orients the full pass, but42 doesn't replace it434. Check every enumerated item against that shape. Record extractions in a44 working file under the scratchpad directory, each tagged with its source, so45 the artifact's claims stay traceable. Revise the shape when an item doesn't46 fit, then re-check the earlier items against the revision475. Reduce: cluster the extractions, keep what recurs or changes the answer, drop48 the rest. See "Deciding what to keep"496. Write the artifact at the smallest size that still answers the question, in50 the form its consumer needs, not as a list of everything you found517. Verify it against the data (see "Verifying the distillate") and fix what52 fails538. Report as in "Reporting"5455# Kinds of artifact5657The artifact determines what step 5 keeps:5859- **Research document**: keep the findings, the evidence for each, and the60 disagreements between sources. Cite every claim61- **Code that handles the data**: keep the invariants the code may rely on and62 every shape it must tolerate. Here the outliers are the specification, because63 a format seen once still has to parse64- **Skill**: keep the procedure that worked and the judgment calls it turns on.65 Load `/create-skill` and follow its conventions66- **Schema or type**: keep the fields that are always present, always absent, or67 meaningfully optional, and the values each admits. Load `/outlaw-states` to68 keep the illegal shapes unrepresentable69- **Glossary**: load `/ubiquitize-language`, which already does this70- **Reference table or checklist**: keep one row per item and one column per71 question the consumer asks, and nothing else7273# Deciding what to keep7475Keep an item when:7677- It recurs across sources that didn't copy each other. What appears once is an78 example at best79- Dropping it would change what the consumer does80- It's the only evidence for a claim the artifact makes81- It contradicts the pattern. An artifact that covers the average and hides the82 outliers fails where it's needed8384Drop an item when it's an instance of a pattern already stated, when it's85context the consumer already has, or when it's true but bears on no decision.8687When two sources disagree, neither one wins by default. Say what each holds and88what would settle it.8990Watch for distilling your own output: once you've written a summary, later91passes confirm it rather than test it. Return to the sources.9293# Verifying the distillate9495- Round-trip: take items from the data at random, including ones you read late,96 and check that the artifact accounts for each. What it doesn't account for is97 either a gap or an exclusion you must state98- Trace every claim back to a tagged extraction. Cut the ones that don't trace99- For code and schemas, run the artifact against the real data, not a100 hand-written sample101- Ask what a reader would still get wrong knowing only the artifact102- Cut the largest section and ask whether the question is still answered. If it103 is, that section was padding104105# Reporting106107Deliver the artifact itself. Alongside it, say:108109- What the artifact answers, and for whom110- How many sources you enumerated, how many you read, and what you excluded111- What you dropped and on what rule112- The residue: items that fit no pattern, and the disagreements left open113- How much you trust the enumeration114115For a prose artifact, offer `/refine-context` and `/humanize`.