/feature-loop:featurefrom feature-loop
Spec-first feature LOOP: evidence-gated research (runtime-gated on ledger coverage + cited sources, not elapsed time), forced option exploration, one HTML spec dashboard as the single human gate, then an autonomous implement→verify loop where an independent checker judges with cited evidence until pass or a mandatory exit. Use when the user asks to build or redesign an app feature ("/feature", "기능 만들어", "이 화면 개선해", "add X to the app"), or to resume one ("/feature resume <slug>"). Differentiator: prevents minimal-interpretation builds AND self-graded "done" — the maker never judges its own work.
Ships in feature-loop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
/feature <request>
R Research(EVIDENCE-GATED) → O Options → S Spec dashboard [ONLY human gate]
→ I Implement → V Verify(independent checker) ↻ (≤3)
→ Exit: verified-success | failure | budget-spent | no-progress (all four end with a report)
One approval gate: the spec dashboard. Before it, build nothing. After it, never
ask again — loop I↻V autonomously until an exit fires. Progress lives on disk,
not in this conversation: every stage updates the state dir, so a dead session
resumes with /feature resume <slug> (read state.md, continue from there).
Loop hub — a cross-repo index at
${XDG_STATE_HOME:-$HOME/.local/state}/feature-loop/hub.json, kept current
automatically by a PostToolUse hook that records every state.md/clock.json
write (stage, verify count, session id). /feature hub → run
scripts/hub.sh list and render it (then hub.sh show <slug> on request —
it prints ready-to-run resume commands). /feature resume <slug> when the
slug is not in the current repo → look it up with hub.sh show <slug> and
continue in that repo's state dir. If the recorder hook is not wired (or the
hub file is older than a state.md you just wrote), announce in chat "hub hook
not wired — recording manually" and run hub.sh record <state-dir> after each
state.md write. The hub is an index only: never edit loop state through it,
and hub.sh prune clears entries whose state dir is gone.
State dir — create at start, in the TARGET repo: .feature-loop/<slug>/
(slug = short-kebab feature name). Files: contract.json (loop contract, write
once at start — schema: references/contract-schema.json), ledger.md (research
waves + one line per I/V iteration), spec.html (approved spec, immutable),
state.md (template: references/state-template.md — current stage, verify
count, open boxes, next action).
Write .feature-loop/<slug>/clock.json:
{"phase":"research","start":<epoch>,"budget_min":N,"modalities":{"web-search":3, "primary-page":2,"code-introspection":2,"community":1},"min_cited_facts":8} —
declare 3-5 modalities with minimum wave counts, and say why. budget_min is
a scoping estimate only (10 simple / 20 medium / 30-40 hard); elapsed minutes
never open the gate. A PreToolUse hook (feature-clock-gate.sh, shipped with
this plugin and wired by its hooks.json or by install.sh)
denies source edits until ledger.md shows: every declared modality at its wave
minimum, ≥min_cited_facts facts carrying a source URL, and no unlinked numeric
claim left unmarked. Do not fight it; if it isn't installed this session,
announce in chat "clock gate not installed — self-checking ledger" and run
the same three checks yourself before the first source edit.
Search in waves (load a dedicated deep-search skill such as universe-search if
one is installed; otherwise apply these rules inline): per wave 4-8 distinct
parallel queries in one turn, in every language relevant to the user and
domain, open 2-4 primary pages between waves. "I feel done" is the signal to switch angle; a dry wave
means switch modality, not stop. Log every wave in ledger.md — format is
machine-read, follow references/ledger-template.md (Waves table with a
modality column · Facts list where every number needs a URL or the line is
marked [unverified] and the spec may not state it as fact · Early exit
evidence). Also read the target repo's AGENTS.md/CLAUDE.md + 2-3 sibling screens.
Early exit is allowed only per modality, only with evidence: append
- <modality>: last 2 waves harvest 0 — <why> under ## Early exit evidence.
A modality you declared and never fired is not "exhausted"; log the dry waves
or keep searching. Once the gate conditions hold, set clock.json phase "done".
2-3 genuinely different designs (not variations): looks, effort S/M/L, what the references do, tradeoffs. At least one more ambitious than the literal request. Recommend one and say why.
One self-contained HTML (save as spec.html, also SendUserFile render).
Sections: goal+out-of-scope · options side-by-side · full state machine (every
state names its visible UI; live activity MUST be visible) · every input's
validation rule + exact inline error · failure UX per repo convention ·
consistency checklist (headers/tokens/i18n EN+ES/naming) · verification plan
(happy + EVERY sad path, and how: Maestro/browser) · research ledger ·
traceability table (mandatory).
Traceability table — one row per decisive ledger finding: finding | ledger line | spec section that acts on it | out-of-scope + reason. Build it by
walking ledger.md top to bottom, not by listing what the spec already says.
Every row lands in exactly one of the last two columns. Writing "SMS/EMAIL
infra is ready" in §6 while §4 collects no phone or email is the exact failure
this table exists to catch — so read each row against the section it names.
Checker box 9 re-derives this independently; a padded row is an anti-cheat hit.
Before opening the gate (both, in order — an unfinished draft is not a spec):
bash scripts/spec-lint.sh spec.html → must exit 0. Self-corrections,
ellipses, placeholders, half-sentences get rewritten, not shipped.Then AskUserQuestion: approve / other option / changes (revise same file, re-run
the two checks, ask again). On approval: write contract.json, update
state.md, proceed — no more questions.
Build exactly the approved spec — sad paths are the feature, not stretch goals. NO placeholder or minimal implementations; if functionality is missing, adding it is the job. Subagent prompts MUST inline the repo's AGENTS.md conventions AND the spec — the delegation prompt is the only channel; context not passed doesn't exist. i18n from the start; reuse shared widgets/tokens first. After each iteration: one ledger line (what changed, in one sentence).
scripts/verify.sh <repo-path> — analyze/tests/untranslated-count/
maestro flows. Any hard failure → back to I with the digested reason (not a
raw dump: where it failed + what it was trying).ledger.md, references/verify-rubric.md, scripts/spec-lint.sh, repo path,
and the diff. Never the build conversation. It must ACT (drive the real UI via Maestro, screenshot every
spec scenario incl. sad paths), then verdict each rubric box PASS/FAIL/
ESCALATE with cited evidence (command + result + screenshot path) — no
citation, no verdict. Stance: broken until proven otherwise.Any FAIL → increment verify count in state.md, fix, re-run V.
Mandatory exits — whichever fires first ends the loop:
Every exit: final report (shipped vs spec, per-box verdicts + evidence,
screenshots of key states, what's deferred/blocked and why) — run
scripts/spec-lint.sh over it too, the report is a deliverable. Update state.md
to the exit state, append operational gotchas discovered this run to the target
repo's AGENTS.md (one line each — patterns, traps, commands; not a diary).
references/contract-schema.json (opens in a new tab)references/ledger-template.md (opens in a new tab)references/state-template.md (opens in a new tab)references/verify-rubric.md (opens in a new tab)scripts/hub.sh (opens in a new tab)scripts/spec-lint.sh (opens in a new tab)scripts/test-gate.sh (opens in a new tab)scripts/test-hub.sh (opens in a new tab)scripts/verify.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub tumblecat44/feature-loop --plugin feature-loop