Distill repeated rejections of one kind into what they teach — a linter, a positive rule or template for whoever writes code, and a short back-tested ban for the critic — instead of keeping copies of them. Usable by the critic subagent (drafts) and by the main session (drafts, owner's word, writing). Use when five rejections are alike by meaning, when the critic reports such a class, when the owner names a thing they keep rejecting, or when the user invokes sdd-code-distill or /sdd-distill.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Sdd Code Distill?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/zakyrion-sdd-code-distill)
---
name: sdd-code-distill
description: Distill repeated rejections of one kind into what they teach — a linter, a positive rule or template for whoever writes code, and a short back-tested ban for the critic — instead of keeping copies of them. Usable by the critic subagent (drafts) and by the main session (drafts, owner's word, writing). Use when five rejections are alike by meaning, when the critic reports such a class, when the owner names a thing they keep rejecting, or when the user invokes sdd-code-distill or /sdd-distill.
---
# Load
```clojure
{:requires [".sdd-flow/references/CLOJURE_NOTATION.md"]
:fields ".sdd-flow/references/ARTIFACT_FIELDS.md — read when writing a ban or a pattern"
:examples "examples.md beside this file — a class distilled badly and well, and what the author's session hears"
:light "this file is the whole procedure — the glossary is the only required read"
:missing (:then (stop!)
(tell-user! "run sdd-flow doctor ."))
:project (when (project-adapter-present? ".sdd-flow/project.md")
(:then (read-last! ".sdd-flow/project.md")))
:adapter-gives "# Entry :patterns and :patterns-form, and the meters a linter outcome would join"}
```
# Activate
```clojure
{:fits "five rejections alike by meaning, whatever their :category says, or one thing the owner names"
:by #{"the critic subagent — :draft alone, over the rejections it has already read"
"the main session — :draft and :settle"
"the user invokes the skill or /sdd-distill [class]"}
:separation "a session that writes code never reads rejections.md or the archive: there the main session has :draft done by the critic subagent or a fresh one, and takes back the rule, the ban's sentence and the back-test count (def hand-back)"
:from-words "when the owner only describes the thing and no rejection is recorded, the main session drafts from those words itself; with nothing to back-test on it says so"}
```
# Draft
```clojure
(def draft ;; by the critic subagent or a fresh one
{:reads #{".sdd-flow/rejections.md" "the archive, when a class is redrafted" "'sdd-flow stats --text' for what returned after its ban"}
:outcomes (-> (:linter "a script can catch it — propose the check; the ban is dropped once the check runs")
(:rule "a positive rule or template for the author of code — what to do, where, with clean code only")
(:ban "for the critic — one sentence, one or two synthetic fragments, its boundary"))
:usual ":rule and :ban together — one teaches the author, the other checks"
:rule-forms {:framework "{:pattern :id :where \"the code it governs\" :do \"the rule\" :template \"clean code\" :why \"what it protects\"}"
:free "as the agent judges best for this rule and document — it still opens with the code it governs"}
:ban-entry "{:id :ban-N :category :error-class :distilled-at \"YYYY-MM-DD\" :ban \"one sentence\" :examples [{:context :bad-code :acceptable-when}] :rule \"where the rule stands, or :none\" :from [:r-1 ...]}"
:category "unified — every entry of the class under one name"
:writes "Flows/Distill/<CLASS>.md alone — the drafts, until the owner's word"})
```
```clojure
(def back-test
{:where "a fresh subagent holding the drafted ban alone, launched by the main session — never the one that drafted it"
:passes "every original fragment rejected, every corrected version git holds passed"
:miss "the ban is redrafted once; a second miss leaves the originals as they are and says so"})
```
```clojure
(def hand-back
{:gives {:class :category
:linter "the proposed check, when there is one"
:rule "the rule in each form the owner may choose"
:ban "the sentence, without its fragments"
:drafts-at "Flows/Distill/<CLASS>.md"}
:never "a rejected fragment"})
```
# Settle
```clojure
(def settle ;; by the main session alone — it is the one that can ask
{:order (-> "launch the back-test"
"show the owner the rule in its exact words, the ban's sentence, the back-test count; wait"
"write the rule (def rule-home)"
"a fresh or the drafting subagent appends the originals to .sdd-flow/rejections-archive.md, reads it back, then puts the ban in their place in rejections.md and lints it"
"delete the draft file")
:owner {:brief "one screen of prose: the class in plain words, the rule, the ban, the back-test count"
:questions "numbered — inside a FLOW by the register; options lettered and rated, one the simplest; the owner answers «1A, 2B, 3 — as you propose», through the harness's choice dialog where it offers one"}
:never #{"a bad fragment in the positive rule" "writing a rule, a ban or the archive without the owner's word"}})
```
```clojure
(def rule-home
{:place "the document the adapter names under :patterns, unmarked; else .sdd-flow/patterns.md, project-owned"
:form (cond
(adapter-names? :patterns-form) "that one"
:else "the owner's choice, one question with both drafts shown — then offered to the adapter")})
```
# After
```clojure
{:archive "read by this skill's drafting subagent and sdd-flow stats alone — never by the author or the critic"
:returned "after :distilled-at the class still comes — caught by the critic: the rule is weak; caught by the owner: the ban is weak too; redraft from the archive"
:silent "a ban with no hit for long may go to the archive, on the owner's word"}
```