/fff:defect-driven-specificationfrom fff
Defect-driven specification rulebook: every bug becomes a spec before becoming a fix. Uses @known-defect, @accepted-risk, @unverified-intent annotations. Loaded as context for bug-driven change workflows.
Ships in fff. 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.
None: SKILL.md is the whole skill.
A reference rulebook (L1+). Loaded as context by plan-chat, characterize, and work-issue when a bug-driven change is in scope. Not invoked as a tool.
The core idea: every bug becomes a spec before it becomes a fix. The bug isn't just fixed; it's specified forever. The invariant that was implicit becomes explicit, named, tested, and traceable.
1. Bug reported.
2. Name the invariant that was violated — write a spec entry (Rule at L2+, prose section at L0/L1).
3. Write a Scenario or test case documenting the broken behavior, tagged @known-defect.
4. Verify the scenario passes — it documents current behavior.
5. Change the scenario to describe correct behavior, remove @known-defect.
6. Watch it fail.
7. Fix the code.
8. Audit passes — the invariant is specified and enforced forever.
Step 2 is the critical one. The bug report says "login breaks after 3 failures at the window boundary." Step 2 names the invariant: "Failure window boundary determines accumulation." That invariant was implicit. Now it's explicit.
The spec diff from step 5 is the change request. The fix in step 7 ships in the same PR as the spec change (per work-issue).
@known-defectThe scenario documents behavior the analyst believes is a bug.
Comment convention:
BUG: — What's wrong.LIKELY INTENT: — What the original developer probably meant.ACTUAL: — What the code actually does.@accepted-riskThe behavior looks wrong but is intentional.
Comment convention:
RATIONALE: — The business reason this surprising behavior is correct.@unverified-intentThe analyst cannot determine whether the behavior is correct or incorrect.
Comment convention:
OBSERVATION: — What the code does and why it's ambiguous.NEEDS: — What review or input would resolve the ambiguity.| Level | Form |
|---|---|
| L0 | Inline HTML comments in prose: <!-- INTENT?: <text> --> |
| L1 | Prose annotations: > @known-defect: <comment block> |
| L2 | Gherkin tags on Scenario: blocks |
| L3 | Above + RID-tagged scenarios + audit enforcement |
Annotations are not permanent markers. They are work items.
@known-defect counts should trend toward zero. Every one is a bug you know about but haven't fixed. CI can gate on a maximum count.@unverified-intent should be resolved within a bounded timeframe (default 30 days). These need stakeholder review, not code changes.@accepted-risk is stable. It documents a deliberate decision. It stays unless the business rule changes.Configuration example (.ffflow/audit.yaml):
auditors:
spec:
rules:
known-defect-count:
severity: warning
max: 5
unverified-intent-max-age-days: 30
Track annotation counts over time. They are the clearest measure of specification confidence. A project with 30 @unverified-intent tags has a different risk profile than one with 30 confirmed-correct scenarios.
A regression test says "this input should produce this output." A defect-driven spec says "this business rule exists, it was violated, and here is the invariant expressed in domain language."
The regression test lives in a test file. The spec lives in the behavioral contract — traceable by RID at L3, readable by stakeholders, enforced by audit.
The invariant that was previously implicit is now explicit. It cannot be silently broken. It cannot be accidentally removed.
@accepted-risk for things you didn't bother to fix. That's @known-defect.@unverified-intent un-resolved past the configured age. Either fix it or accept it.@known-defect when you didn't actually fix the code. Audit will catch the lie.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zerotechdebt/ffflow --plugin fff38 skills in this plugin
/adopt-ffflowEnd-to-end onboarding for a new FFFlow project. Runs init-ffflow, stack-init, then hands off to plan-roadmap to phase out the work (greenfield or brownfield — roadmap figures out the right per-phase entry point). Use `--ui` to adopt FFFlow's view-layer-purity structure (the frontend sibling of hexagonal) on an already-adopted project./auditRun the FFFlow keep-honest auditors against this project. Coordinator with per-type cartridges (CLAUDE.md freshness, spec drift, characterization tests, architecture conformance, complexity/refactor signals, and L3 RID traceability). Use --type to target one; --plan to convert findings into work./autopilotMeta-skill that wraps any interactive skill for unattended execution. Reads project context to stand in for the user on routine decisions, with a decision log.