From adlc
Distill repeated review findings and PR rejections into permanent, deterministic defenses (ADLC P7).
How this command is triggered — by the user, by Claude, or both
Slash command
/adlc:adlc-distill (no arguments)Files this command reads when invoked
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /adlc-distill — compound the lifecycle (P7) P7 is where the lifecycle compounds: repeated findings become deterministic defenses (lint checks, skills, spec-gap templates) so the same mistake cannot recur. This is idle-time work — run it after a batch of reviews, or on a schedule (see "Scheduling" below). Both gates here are LLM-backed, and inside Claude Code **you are the model** — use `--prompt-only`, answer the printed prompt yourself, and apply the result. No API keys. Prerequisite: `adlc --version` works (else `npm i -g @adlc/cli`). ## 1. Lesson foundry — mine repeated findings (C9...
P7 is where the lifecycle compounds: repeated findings become deterministic defenses (lint checks, skills, spec-gap templates) so the same mistake cannot recur. This is idle-time work — run it after a batch of reviews, or on a schedule (see "Scheduling" below).
Both gates here are LLM-backed, and inside Claude Code you are the model —
use --prompt-only, answer the printed prompt yourself, and apply the result.
No API keys. Prerequisite: adlc --version works (else npm i -g @adlc/cli).
adlc lesson-foundry --prompt-only
(no clusters to refine), there are not yet enough repeated
findings in .adlc/findings.jsonl to distill — report that and stop here.Run adlc lesson-foundry --write --out-dir .adlc/lessons (the writer is
dry-run by default, so nothing is created without --write). This scaffolds
one defense file per cluster from the finding data, with default wording.
Then edit the scaffolded files to match the defenses you decided above.
--write on its own does NOT apply your prompt-only refinement — that is
only auto-applied with --llm (which needs an API key). So in the keyless
in-Claude flow you scaffold with --write, then refine the wording yourself.
For any defense that is a skill (a SKILL.md), validate it before PR.
lesson-foundry only scaffolds the stub; it does not dedup against the public
ecosystem or confirm the skill is usable cold. Hand the scaffolded SKILL.md
to skill-mining for the registry-management half of P7 (see ADLC.md §P7):
npx skills add voodootikigod/skill-mining # once per machine
Then hand it the scaffolded stub with a scoped request — point it at the specific staged file rather than asking for a full-repo mine, e.g.:
"Validate the scaffolded skill at
.adlc/lessons/<name>.SKILL.md: dedup it against installed skills and the skills.sh registry, then run Gate B on it. Report REUSE/EXTEND/BUILD/REJECT and SHIP/FIX/REJECT — do not mine the rest of the repo."
(lesson-foundry writes a flat file, .adlc/lessons/<name>.SKILL.md — not
a <name>/SKILL.md directory. The skills CLI expects a skill directory
containing a SKILL.md, so to install it you first move the flat file into
its own subdir: <name>/SKILL.md.)
Validation reads the file content — Gate B hands a fresh agent the
SKILL.md text directly, so it works on the flat staged file and does not
require the skill to be installed/discoverable first. Lifecycle, in order:
.adlc/lessons/<name>.SKILL.md):
skills.sh registry (via its
find-skills subagent) → REUSE / EXTEND / BUILD / REJECT. If a maintained
public skill already covers it, install that and drop the stub.SKILL.md and attempts a real repo task → SHIP / FIX / REJECT, proving
the skill carries specific commands/paths/invariants, not generic prose..adlc/lessons/
is a staging area, not on the skill-discovery path — a SKILL.md left
there is inert. The skills CLI expects a skill directory, so move the flat
file into <name>/SKILL.md, then let skill-mining's author step (or the
skills CLI) place it in the correct location for the active harness. Don't
hand-guess the path or the exact subcommand — run npx skills --help for
the install verb your CLI version uses; skill-mining's author step does this
for you..adlc/lessons/<name>.SKILL.md staging copy so it isn't
committed twice.(skill-mining today is repo-wide by design; a single-stub scoped mode is a desired enhancement — until then, constrain it via the prompt above.)
Lint-rule and spec-gap defenses do not go through skill-mining — PR them
directly from .adlc/lessons/.
This step is keyless (skill-mining is agentic — Claude is the agent, no
API key), but it is not a deterministic gate: no --prompt-only/exit-code
contract, and npx skills add is an interactive, once-per-machine developer
action — never run it from a scheduled/headless /adlc-distill (see
"Scheduling"). If skill-mining is unavailable, do not PR the skill stubs —
hold them for explicit human review rather than landing default-worded,
un-deduped, cold-untested skills. Report them as held-unvalidated in the
summary so the coverage stays honest.
adlc rejection-mining --prompt-only
gh CLI. If it errors with a
gh/auth/repo message, the repo is not GitHub-linked or gh is not
authenticated — note that this gate was skipped and why, then continue.--write only after approval.Report: how many finding clusters and rejection lenses were found, the concrete
defenses proposed, which were written (if any), and which gates were skipped
(e.g. rejection-mining when gh is unavailable) so the coverage is honest. For
any skill defense, report its skill-mining verdict (REUSE/EXTEND/BUILD/REJECT +
Gate B SHIP/FIX/REJECT), or flag it as held for human review (not PR'd) if
skill-mining was not run. Point the user at /adlc-maintain for the decay-driven
checks.
This command is idle-time metabolism. To run it automatically, schedule a Claude
routine (e.g. via /schedule) that invokes /adlc-distill on a cadence — Claude
is the model, so no API keys are needed.
Headless runs are advisory by default. The write steps above require human
approval, so an unattended scheduled run will propose defenses (in its summary)
without materializing them — that is intentional: auto-writing lint rules/skills
from clustered findings unattended is risky. A scheduled routine should surface
the proposals for a human to review and then approve --write. Only wire an
auto---write routine if you have explicitly accepted that the generated
defenses land without review. The skill-mining handoff (step 1.3) is likewise
interactive only — a headless run must never npx skills add or auto-validate
skills; it surfaces the scaffolded stubs for a human to validate later. The
deterministic maintenance checks (/adlc-maintain) can additionally run in CI on
a cron; see docs/ci/adlc-maintenance.yml.
npx claudepluginhub voodootikigod/adlc --plugin adlc