/common:spec-first-dev Optional feature name or initial contextfrom common
Guides a 5-phase spec-first workflow: understand business needs, explore code, produce specification, implement, and verify against acceptance criteria. Use when requirements are fuzzy.
Ships in common. Installing the plugin adds it to Claude Code.
Spec-driven development harness. Inspired by Harness Engineering (Fowler), Context Engineering (Karpathy), and Spec-Driven Development (OpenSpec, Spec Kit).
Principle: Lock a validated specification BEFORE touching the code. The spec — built from explicit business intent, scope, and command-line verifiable acceptance criteria — becomes the contract the implementation must satisfy.
When to use this workflow:
When to use /feature-tdd-dev instead:
When to use goal instead:
goal pipeline (/goal:spec → /goal:plan) runs this same spec-building grill, then executes autonomously slice by sliceThis workflow is the single-session, no-branch path; goal is the iterated pipeline. See docs/workflows-decision-guide.md for the full map.
Goal: Extract the business knowledge you don't have. NO code exploration here.
Round 1 — The Need (always asked, adapted to the provided context):
Ask the following questions conversationally in free text. Adapt based on what the user has already given — don't re-ask anything already clear.
WAIT for the answers before continuing.
Round 2 — The System (after Round 1, questions adapted to the answers):
Principle: Only ask questions you can NOT answer by exploring the code. Technical questions (which pattern? which FormType? which route?) will be resolved in Phase 2 by code exploration. Here we only look for information external to the code.
WAIT for the answers before continuing.
Synthesis: Present a structured summary:
## Requirement understanding
### Ubiquitous Language (FR -> EN)
| FR term | EN term | Definition |
|---------|---------|------------|
### User flow
1. The user does X
2. The system does Y
3. ...
### Business rules
- BR1: If [condition] then [result]
- BR2: ...
### Data sources
- [System] -> [endpoint/table] -> [data]
### Scope
- IN: ...
- OUT: ...
GATE: Ask "Is this understanding correct? What is missing?"
Iterate on the synthesis until explicit confirmation. DO NOT move to Phase 2 without validation.
Goal: Explore the code GUIDED by the validated business understanding.
Principle: Explorer agents receive the Phase 1 business synthesis as input. They look for "how the code handles [business concept X]", not "what patterns exist in general".
Actions:
GATE: Quick checkpoint — "Do these patterns match what you expect?"
Goal: Produce ONE concrete, validated implementation specification, persisted to a file.
Principle: No multiple architects. The architecture is dictated by the project's DDD/hexagonal conventions and the loaded skills. Produce an actionable document.
Persist the document at .claude/plans/<feature>-spec.md:
# Spec: [Feature name]
## Business context
[Validated summary from Phase 1]
## Existing patterns
[Mapped results from Phase 2]
## Implementation
### Files to create
- `src/Domain/[BoundedContext]/...`: [description, method signatures]
- `src/Infrastructure/[BoundedContext]/...`: [description]
- `src/Api/[BoundedContext]/...`: [description]
### Files to modify
- `config/services.yaml`: [exact wiring of services]
- `config/routes/...`: [routes if needed]
### Templates/JS (if applicable)
- `templates/...`: [description]
- `assets/...`: [description]
### Translations
- `translations/...`: [keys to add]
### Tests
- Unit: [what to test, which cases]
- Integration: [what to test]
- Acceptance: [what to test, optional]
## Ubiquitous Language
[UL table from Phase 1]
Simplicity check (run before the gate) — every layer earns its place:
If a box can't be checked, either simplify or record the justification in the spec.
GATE: "Do you validate this specification? What would you change?"
The validated spec becomes the implementation contract. Any deviation must come back to the spec. If a change is needed during implementation, update the spec FIRST.
Goal: Build the feature following the spec, test-first.
TDD is the implementation mode. No production code is written in Phase 4 before a failing test demands it — including "structural" files (enum case, empty interface, DTO, config wiring). Each behavior goes through RED → GREEN → REFACTOR, and you run the test at each step so the user SEES it go red, then green.
Actions:
Propose the breakdown into iterations based on the spec. Load
product:vertical-slice and run its procedure: name the core complexity, pick the
techniques that isolate it, apply the technical constraints, then verify against
INVEST. The number of iterations is an output of that, not an input — sizing by
"small feature, 2 iterations" is estimating, and it is how horizontal slices get
written down as iterations. Not installed? Say so once and split by hand.
For each iteration, drive every behavior through the micro-loop: a. Announce the behavior. b. RED — write the test, run it, confirm it fails for the expected reason. c. GREEN — write the minimal code to pass, run it, confirm green. d. REFACTOR — clean up (names, duplication, conventions) with the test still green.
Batching a few related tests in one RED/GREEN cycle is fine; skipping RED is not.
Checkpoint (end of iteration) — stop and report: "Iteration N done. Result: [summary]. Tests: [RED→GREEN]. CI: [status]. Want to review before continuing?" This is the human-in-the-loop control point: it lets the user correct course between iterations and catch a deviation early instead of at the end.
If correction needed: update the spec first, then apply the correction test-first.
Test typology — adapt to the project; the test-first rule is fixed, the kind of test adapts:
Goal: Ensure the implementation matches the spec.
Actions:
If the goal plugin is installed and you want to drive the implementation
autonomously via /goal instead of implementing in this session, the spec
from Phase 3 (.claude/plans/<feature>-spec.md) is already in the shape
/goal:spec expects.
> /goal:spec .claude/plans/<feature>-spec.md
# → creates the GitHub issue
> /goal:plan <N>
# → Session 1 of the autonomous workflow
See plugins/goal/README.md for the full chain.
This is purely opt-in — if you prefer to implement directly via Phase 4
in this session, ignore it.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
5 commands in this plugin
/deep-reviewDeep Review — Adversarial Code ReviewAdversarial 3-agent code review — produces ~2 high-impact comments per PR/feature-tdd-devFeature Development (TDD)Guided feature development with TDD workflow and architecture focus/install-global-claude-md/common:install-global-claude-mdInstall or refresh ~/.claude/CLAUDE.md with the canonical universal rules (verification, anti-over-engineering, git discipline) bundled with this plugin/researchObjective ResearchObjective technical research — investigate a codebase or technical question separately from implementation, to avoid confirmation bias. For market / competitive / product research, see the product-research skill.npx claudepluginhub fabiensalles/claude-marketplace --plugin common