Full KB pipeline orchestrator. Chains /kb-brainstorm → /kb-plan → /kb-work → kb-complete → DONE. kb-work handles the per-slice gauntlet (scope lock, execution, tests, diff-scope, destructive guard, QA, repair, Figma sync). kb-complete handles post-work quality, follow-up resolution, proof/demo evide
Install
mkdir -p .claude/skills/klfg && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15972" && unzip -o skill.zip -d .claude/skills/klfg && rm skill.zipInstalls to .claude/skills/klfg
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Full KB pipeline orchestrator. Chains /kb-brainstorm → /kb-plan → /kb-work → kb-complete → DONE. kb-work handles the per-slice gauntlet (scope lock, execution, tests, diff-scope, destructive guard, QA, repair, Figma sync). kb-complete handles post-work quality, follow-up resolution, proof/demo evidence, learning, memory refresh, compaction, and alerts. Use when the user says 'klfg', 'run the full KB pipeline', 'go from brainstorm to done', or wants the hands-off KB vertical-slice workflow.About this skill
CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any required step. Do NOT jump ahead to coding or implementation. The brainstorm (step 1), plan (step 2), work (step 3), and complete (step 4) phases each have a GATE that must verify required evidence before the next step begins. Violating this order produces bad output.
Gate evidence lives in the KB manifest gate_ledger once a manifest exists.
Before advancing phases, read kb-gate/references/gate-ledger.md when needed
and verify the relevant gate status and allowed_next_action. Artifact
existence is necessary but not sufficient.
klfg is the strict workflow governor. It must not let the agent assume across
phase boundaries:
- Brainstorm cannot advance while
ask-noworresearch-firstitems remain. - Plan cannot advance without a passed
plan-to-workgate. - Work cannot advance while runnable slices remain or slice proof is missing.
- Complete cannot emit DONE without a passed or quarantined
complete-to-shipgate.
This pipeline is interactive in two specific places and autonomous everywhere else:
- Step 1 (brainstorm) stops for product Q&A. That is the design. Under
klfg, once the requirements doc is complete and unblocked, the orchestrator continues to planning. - Step 3 (work) stops only on slices the manifest flagged
hitl: trueand when safety gates fire (scope violations, destructive commands, QA failures that exhaust repair).kb-workhandles them and resumes automatically once the user answers.
Everything else — including kb-plan, kb-work, and kb-complete — proceeds without prompting unless a gate blocks. This auto-chaining belongs to klfg, not to standalone kb-brainstorm or kb-plan.
Pipeline
-
/kb-brainstorm $ARGUMENTSGATE: STOP. Verify the brainstorm produced a requirements document at
docs/brainstorms/*-requirements.md. If no requirements doc exists, re-run/kb-brainstorm $ARGUMENTSand resume the conversation. Do NOT proceed to step 2 until a written requirements doc exists.Record the requirements doc path. Refer to it as
<reqs-path>for the rest of the pipeline.Also check the requirements doc for
## Outstanding Questions→### Resolve Before Planning, unresolvedask-now, and unresolvedresearch-firstentries. If any exist, do NOT proceed — return to step 1 and resolve or reclassify them first.kb-brainstormis responsible for not handing off until that section is empty, but verify here as a safety check.GATE: run
kb-gateif brainstorm/document-review surfaced P0/P1/P2/P3 issues. Safe/actionable P0/P1 are rectified by the agent; human-only P0/P1 block planning. P2/P3 get the rectify-all prompt. Recordbrainstorm-to-planas passed, blocked, or needs-human before invokingkb-plan. -
/kb-plan <reqs-path>GATE: STOP. Verify
/kb-planproduced a manifest file atdocs/plans/*-kb-*-manifest.mdand one plan file per slice. If no manifest was created, re-run/kb-plan <reqs-path>. Do NOT proceed to step 3 until both the manifest and per-slice plans exist.Record the manifest path. Refer to it as
<manifest-path>for the rest of the pipeline.GATE: read the manifest
gate_ledger.plan-to-workmust bepassedandallowed_next_actionmust bekb-work <manifest-path>. Runkb-gate/scripts/check_gate_ledger.py <manifest-path> --gate plan-to-work --allowed-next "kb-work <manifest-path>". If absent, pending, blocked, stale, or the checker fails, runkb-gate/repair planning and do not start work. Safe/actionable P0/P1 are rectified by the agent; human-only P0/P1 block work. P2/P3 get the rectify-all prompt. -
/kb-work <manifest-path>kb-workexecutes every pending slice in dependency order, running the full gauntlet per slice:Per-slice gates (all mandatory):
- 3.0 Scope Lock — block writes outside
expected_files - 3 Execute — TDD/integration/verification-only
- 3.5 System-Wide Test Check — trace side effects
- 3.6 Diff-Scope Verification — git diff vs declared scope
- 3.7 Destructive Command Guard — block rm -rf, force push, etc.
- 3.8 QA — lint (all slices) + browser checks (frontend) → kb-repair on failure
- 3.9 Figma Design Sync — UI slices only
After all slices: persists scope-verified file list in manifest for kb-complete.
HITL pauses: slices flagged
hitl: true, scope violations, destructive commands, QA failures that exhaust repair (5-iteration cap, stuck detection).GATE: STOP. After
kb-workreturns, re-read the manifest. Every slice must bestatus: doneorstatus: skipped, every completed slice must have a passingslice-<id>-to-donegate, andwork-to-completemust bepassedwithallowed_next_actionset tokb-complete <manifest-path>. Runkb-gate/scripts/check_gate_ledger.py <manifest-path> --gate work-to-complete --allowed-next "kb-complete <manifest-path>". If any slice ispending,in_progress, orblocked, re-run/kb-work <manifest-path>to resume.If a slice is genuinely stuck (e.g.,
blockedfor an external reason), surface that to the user and stop the pipeline. Do not paper over a blocked slice. - 3.0 Scope Lock — block writes outside
-
/kb-complete <manifest-path>kb-completeruns automatically — no pause, no prompt. The whole point ofklfgis hands-off.kb-completeruns the post-work quality and learning pipeline:- kb-review — full multi-agent code review with scope passthrough from kb-work's gates
- Resolution Gate — P0/P1 must be fixed before proceeding
- Follow-up Resolution — resolve or record review/TODO fallout
- Proof/Demo Evidence — re-run final checks and capture demo evidence when useful
- Compound + Learn + Evolve — document patterns, extract instincts, promote mature ones
- Memory Refresh + Compact + Alerts — keep fresh-session memory usable
- Cleanup — prune ephemeral artifacts (screenshots, old observations)
GATE: STOP. After
kb-completereturns, verify the manifest status isreviewedandcomplete-to-shipispassedor explicitly quarantined with forbidden claims recorded. Runkb-gate/scripts/check_gate_ledger.py <manifest-path> --gate complete-to-ship --allow-quarantine. If kb-review found unresolved P0/P1s, or the final proof/cleanup/learning evidence is missing,kb-completemust stop — re-run it after fixes. -
Output
<promise>DONE</promise>once steps 1–4 are complete.
Notes
- Why no
/unslop: intentionally omitted. Risk of flagging parallel agent WIP as false positives. Run manually if needed. - Why a separate
kb-complete: the finish pipeline (review, follow-up resolution, proof/demo evidence, compound, learn, evolve, memory refresh, compact, cleanup, alerts) is a separate skill.kb-workinvokes it automatically only after all slices are done or intentionally skipped;klfgverifies that happened. - Why no separate
/kb-review: kb-complete runs kb-review at Step 1 with full scope context from kb-work's gates. A second pass would be redundant. - Why no separate
/learnor/observe: kb-complete feeds resolved P0/P1 findings to.kb/observations.jsonl(Step 2), runs/learn(Step 3), and auto-triggers/evolveevery 5th KB completion. - Why no separate
/ce-compound: kb-complete invokes ce-compound at Step 3 for features with novel patterns. Skips automatically for boilerplate. - Why no
/land: committing, pushing, and opening a PR is a separate, deliberate act. Run/landafterklfgfinishes when you're ready to ship. - Resuming after interruption:
klfgis idempotent across restarts because each step's GATE checks for the produced artifact. If the session is interrupted between steps, re-invokeklfgwith the same arguments and it will pick up at the first failing GATE.
Start with step 1 now. Remember: brainstorm FIRST, plan SECOND, work THIRD. Never skip a phase.