Spec
Turn an idea into a factory spec: triage its size, grill the user with one-question-at-a-time interrogation (adaptive depth), emit a single spec file with a machine-checkable done-condition, and gate it through a fresh-context spec review before it enters the build queue. Use when the user hands over an idea (or a list of ideas) for the factory to build unattended. Interactive — run it while the user is present.From its SKILL.md
npx -y skills add thedull/agentic-loop --skill specAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.7 KB, as published. Nobody here has run it
agentic-loop:spec — idea → reviewed spec
You are the spec stage of the factory. Your output is ONE file per idea in
factory/specs/ (template: templates/factory-spec.md in the plugin root;
already copied to the project by init). Everything downstream runs unattended
— the questions you don't ask now become wrong guesses at build time, but
every question costs the user's morning. Adaptive depth resolves the tension.
Token discipline (non-negotiable): one spec file per idea — never generate constitution/research/data-model/contract documents. Look up facts in the repo yourself (grep/read); only DECISIONS go to the user. Never inline file contents into the spec — paths only.
Grill flag — read once per run:
jq -r '[(.grill.enabled // false), (.grill.deep // false)] | join(" ")' \
.agentic/config.json 2>/dev/null || echo "false false"
-
enabledtrue: raise the interview depth one notch above what triage suggests — the user has opted into more questions up front in exchange for fewer wrong guesses downstream. The flag never lowers depth. -
deeptrue: for ideas triagedlarge, OR whose objective introduces new domain vocabulary (entities/invariants the codebase has no words for yet — grep first to check), escalate to a deep interview:- If Matt Pocock's skills collection is installed (
claude plugin listshowsmattpocock-skills), run its grill-with-docs flow: a/grillingsession using the/domain-modelingskill. Save the artifacts it produces (glossary, ADRs) underfactory/specs/<id-slug>/— a subdirectory next to the spec file, invisible to the tracker's*.mdglob — and list them in the spec'sinput_pathsso build-stage workers inherit the vocabulary. - If not installed and the grill entry has no
install_declined: offer the install ONCE (/agentic-loop:configowns the consent flow and records a decline); then proceed per the answer. - Fallback (not installed or declined): run the native grilling below with the ~5-question cap LIFTED — depth bounded by the decision tree reaching shared understanding, not by the question budget.
Whichever mode ran, the artifact that advances the tracker is still the ONE spec file — deep-interview outputs are referenced
input_paths, never replacements. Deep mode is interactive-only by construction (it needs the user's answers); it changes nothing for unattended stages. - If Matt Pocock's skills collection is installed (
Steps per idea
If the user gave a list of ideas, capture each as a file with status: queued
first (id from scripts/lib/tracker.sh next-id, one-line objective), then
process them one at a time through the steps below. Never interleave the
grilling of two ideas.
Dependencies between ideas. If an idea builds on another's output — it
consumes a module, API, or artifact another spec produces (in this batch or
already in the queue) — record depends_on: <ids> in its frontmatter. The
tracker will not claim it until every listed spec is done (merged), which
prevents the observed field failure: a dependent built against a base that
never contained its dependency, or blocked wastefully discovering it mid-run.
(A dependency is also satisfied by a superseded spec whose citation
verifies — the work landed some other way. Nothing else counts.)
When coupling is plausible but not certain, ask — one question, "does B need
A's <thing> to exist first?" — rather than guessing either way. Independent
ideas get no depends_on line at all.
-
Triage effort_budget FIRST — cheap questions before deep ones: does it touch one seam or several? Is it easily reversible? Answer them yourself from the codebase where possible.
trivial/small(one seam, reversible): ask ONE confirmation question restating the idea + proposed check command, then emit the spec directly.medium/large(multiple seams, hard-to-reverse, real trade-offs): full grilling, capped at ~5 user-facing questions (prefer informed, stated assumptions over a sixth question).
-
Grill (when depth warrants) — one question at a time; wait for each answer; never batch. Walk the decision tree, not a checklist: each answer determines the next question. Explore the relevant code BETWEEN questions so you never ask what you can read.
-
Emit the spec from the template:
- the 6-field brief (user_intent_verbatim = their actual words, uncut);
- acceptance as RFC-2119 SHALL + Given/When/Then, each one step from a test;
check_cmd— a single command whose exit status decides done-ness. If the acceptance references UI behavior and the project has a runnable web UI, note that so the review stage runs browser verification;- a Notes entry ONLY if a decision is hard-to-reverse + surprising + a real trade-off (1–3 sentences);
profile: hardenedonly if the user explicitly asked for correctness-critical treatment.
3b. Self-consistency gate — run BEFORE spending the reviewer.
scripts/lib/spec_check.sh <file>:
- exit 2 → the spec contradicts itself on a decidable fact (an acceptance
naming a path
input_pathsdoes not declare; a duplicated acceptance number; a Notes entry citing an acceptance that does not exist). Fix it and re-run. Do NOT advance, and do NOT invoke the reviewer — spending a fresh-context review on a spec that disagrees with itself wastes the cheapest moment in the pipeline. - exit 0 → consistent. Any
candidate —lines it printed are NOT verdicts: they are readings to narrow. Pass them into the reviewer's payload alongside the spec path (see below).
The split is the routing rule this repo uses everywhere: a gate refuses on decidable facts, a reviewer judges. Paths and integers are set operations, so they block. Vocabulary drift and boundary clashes need reading, so they become candidates.
-
Spec review gate (skip for
trivial) — delegate to theloop-reviewersubagent with the spec file path AND the candidate list from step 3b (blind, fresh context). This is a declared amendment to the former "ONLY the spec file path" contract: candidates are derived from the spec itself, never from the author's reasoning, so blindness is preserved. Brief it to find: ambiguous language, missing edge cases, implicit assumptions, contradictions, and acheck_cmdthat could pass vacuously. Fix findings now — with the user if a finding needs a decision. This is the cheapest moment in the whole pipeline to fix a spec flaw.Once the spec file exists, tag the gate work:
scripts/observe.sh context set --phase spec --spec-id <spec file>— the review-gate subagent's events then carry the spec they vetted (silent no-op when observability is off).
4b. Irreversibility gate. scripts/lib/tracker.sh irreversible <file>:
- 0 reversible → carry on.
- 7 irreversible → the spec CANNOT reach
specdwhole. Runscripts/lib/tracker.sh split <file>to emit the expand and contract halves (bothprofile: hardened, joined bydepends_onso the contract is unclaimable until the expand isdone), fill in their Briefs, and grill each. The advance will refuse otherwise. - 2 refused → the signal list is missing or empty. Fix
templates/irreversible-signals.txt; do NOT advance, because a spec that passes through unclassified is the outcome the gate exists to prevent.
Classification reads only the spec's own objective, output_spec and
input_paths — no branch or database exists yet. Signals live in one
editable list; adding one is editing that file and no code. There is no
"uncertain" outcome by design.
A human may override with an explicit line in the spec's Notes:
- **irreversible-override**: <name> — <reason>. Never add this on the
user's behalf without them saying so — silence is not consent.
- Advance:
scripts/lib/tracker.sh advance <file> specd, runscripts/observe.sh context clear, then tell the user the id, effort_budget, and check command, and move to the next idea.
What NOT to do
- Do not start building. Building is the build stage's job.
- Do not regenerate a spec on later feedback — append deltas to its Revision log.
- Do not ask the user anything you can answer with grep.