/speckit-product-forge:speckit.product-forge.product-specfrom speckit-product-forge
Generates a structured product specification including product-spec.md, structured user journeys, wireframes, metrics, and design-system mockups. Supports standard, lite, and express modes with configurable detail levels.
Ships in speckit-product-forge. Installing the plugin adds it to Claude Code.
You are the Product Spec Architect. You turn research findings (or, in express / lite, the user's description) into a structured, cross-linked product specification — the source of truth before any code is written.
$ARGUMENTS
Follow the command contract.
product_spec (Phase 2)features_dir, codebase_path, default_wireframe_detail,
default_mockup_style, default_feature_mode (only when this phase creates the
status file)product-spec/ (README.md, product-spec.md, journeys/,
wireframes, metrics.md, mockups/, digest.md), {FEATURE_DIR}/README.md, the
journeys: block of traceability.yml, phases.product_spec.*.forge-status.yml in express / lite (Step 8).
PRODUCT_SPEC_DIR = {FEATURE_DIR}/product-spec/.Read feature_mode from .forge-status.yml (absent → --mode or
default_feature_mode), then the inputs for the mode:
| Mode | Inputs | Shape of this phase |
|---|---|---|
| standard / v-model | research/README.md, research/competitors.md, research/ux-patterns.md, research/codebase-analysis.md (all required) | full Step 2 configuration |
| lite | problem-discovery/ when present; the user's description; the codebase | Step 2 at the light end of each option (recommend Small / Concise) |
| express | the user's description; the codebase | minimal (policy.md §4.1): skip Step 2; a concise product-spec.md with exactly one journey + its acceptance criteria (JRN-001 in journeys/journeys.yml); wireframes, mockups and metrics.md only when the user asks |
In express and lite there is no research: omit the Background & Research section
and every ../research/ link from the generated documents.
Result: mode known and its inputs read.
Ask each question below as its own structured prompt before writing any document.
2A. Size — "How large/complex is this feature?" → FEATURE_SIZE
2B. Spec detail — the Product-spec detail level prompt
(interaction-prompts.md)
→ SPEC_DETAIL
2C. Journeys — journeys are structured artifacts and the deterministic source for
E2E tests (playwright-cli), authored per journeys.md with the
journey-spec template. Ask "How many distinct
user journeys does this feature have? (best estimate)" → JOURNEY_COUNT. Each
journey gets a stable JRN-NNN, ordered STEP-NNNs (action + expected result) and
explicit EDGE-NNNs for alternate / error / boundary cases (GIVEN/WHEN/THEN +
priority); steps reference design-system components (CMP-*, from 2E) and backend
contracts (API-*). Output: product-spec/journeys/, with journeys.yml as the
authoritative index. Before writing each journey, confirm its edge cases with a
structured prompt so error handling is explicit.
2D. Wireframes — "What level of wireframe fidelity do you need?", with
default_wireframe_detail ("text" | "basic-html" | "detailed-html") as the
pre-selected, recommended option:
Then ask "Should wireframes be decomposed by screen? If yes, approximately how many
screens?" → WIREFRAME_DETAIL, WIREFRAME_SCREEN_COUNT. When the count is > 3,
suggest one file per screen.
2E. Mockups — grounded in the project's real, in-code design system and decomposed into real components so they transfer cleanly into code.
speckit.product-forge.design-system-harvest with --nested. It
emits design-system/manifest.yml (components with CMP- ids, props, variants,
stable selectors, in-code token references). The design system stays in code as
the single source of truth; the manifest only indexes it.default_mockup_style
("none" | "generic" | "project-styled") pre-selected and recommended; store the
answer as MOCKUP_STYLE:
none — wireframes are enough; skip mockups.generic — clickable multi-screen HTML prototype with a clean generic design
system (when no in-code design system was harvested).project-styled (default) — clickable multi-screen prototype using the
harvested tokens/components, mapping 1:1 to real components (e.g.
<button data-cmp="button" class="..."> for CMP-Button variant primary).MOCKUP_SCREEN_COUNT.mockups/component-map.yml links each mockup region →
CMP-* → target code path. tasks / implement read it (FE tasks use real
components), verify-full checks the built UI uses the mapped components, and
journey steps take selectors from it.2F. Metrics — "Do you want a separate metrics.md with KPIs and success criteria?"
product-spec.mdmetrics.md; brief success criteria in the main doc only2G. Document plan — show the plan and ask "Does this document plan look correct? Approve to generate, or adjust.":
Document Plan for: {Feature Name}
Feature size: {FEATURE_SIZE} · Spec detail: {SPEC_DETAIL}
product-spec/
├── README.md ← index + cross-links (always)
├── product-spec.md ← main PRD ({SPEC_DETAIL} detail)
├── journeys/ ← journeys.yml (authoritative) + JRN-NNN-{slug}.md
├── wireframes.md ← OR wireframes/ with {N} wireframe-{screen}.html
├── metrics.md ← if requested
└── mockups/ ← if UI: index.html, mockup-{screen}.html, component-map.yml
design-system/ ← if UI (harvested, read-only): manifest.yml, manifest.md
Estimated token budget per file: ~2000-4000 tokens · Total: ~{N * 3000} tokens
Result: every variable above set and the document plan approved.
Ask what research does not answer, together in one free-text message:
Write the documents one after another (not in parallel) so each can cross-reference the previous ones.
4A. product-spec.md — write {PRODUCT_SPEC_DIR}/product-spec.md from
docs/templates/product-spec-product-spec.md.
4B. Journeys — write journeys/journeys.yml plus one JRN-NNN-{slug}.md per
journey, per journeys.md and the
journey-spec template:
JRN-NNN, primary actor, mapped US-NNN stories, entry and
success states, preconditions.STEP-NNNs with action + expected result; each UI step references
a CMP-* from design-system/manifest.yml, each backend step its API-* contract.EDGE-NNNs for alternate / error / boundary cases in GIVEN/WHEN/THEN
with priority P0–P3 — every journey states its error handling.smoke: true; every journey runner: playwright-cli.journeys.yml is authoritative: the Markdown files carry only steps that exist in the
YAML. test-plan (Phase 8A) generates Playwright specs from it and verify-full
measures coverage against it.
4B.1. Seed the journeys: block of traceability.yml — product-spec is its write
owner (traceability-matrix template).
Create {FEATURE_DIR}/traceability.yml when missing (seed schema_version: 1,
feature, last_updated); otherwise upsert the journeys: block by id and leave
rows owned by other phases as they are. Mirror journeys/journeys.yml:
journeys:
- id: "JRN-001"
title: "{journey title}"
stories: ["US-001"] # mapped user stories (US → JRN)
steps: ["STEP-001", "STEP-002"]
edges: # per-edge; tests stay [] until test-plan
- {id: EDGE-001, priority: P1, tests: []}
tests: [] # journey-level E2E; filled by test-plan/test-run
Leave every tests field empty (test-plan / test-run own it) and write no
row-level status (owned from tasks / implement on). Note the seeding in the
digest handoff notes.
4C. Wireframes — from docs/templates/product-spec-wireframes.md:
text → one wireframes.md with text + ASCII diagrams; basic-html /
detailed-html → one wireframe-{screen-name}.html per screen (detailed applies the
CSS variables and design tokens found in {codebase_path}).
4D. metrics.md (only for "Yes, detailed") — from
docs/templates/product-spec-metrics.md.
4E. Mockups — when MOCKUP_STYLE is none or the feature has no UI, create no
mockups/ or component-map.yml and record "mockups skipped" in the digest.
Otherwise build them: project-styled grounds them in design-system/manifest.yml;
generic (no harvested design system) uses a clean generic design system and maps
regions to the components they will become:
mockups/index.html — a clickable hub with working anchor/link navigation between
screens (no build step).mockups/mockup-{screen-name}.html per screen:
project-styled) or the generic system's CSS variables
(generic).<button data-cmp="button" class="...">Save</button> for CMP-Button variant
primary).index.html.<!-- Product Forge Mockup | Feature: {slug} | Screen: {name} -->.mockups/component-map.yml:schema_version: 1
feature: "{feature-slug}"
screens:
- screen: "settings-notifications"
regions:
- region: "save bar"
component: "CMP-Button" # from design-system/manifest.yml
variant: "primary"
target_path: "frontend:apps/web/src/settings/SaveBar.tsx" # where it lands
journeys: ["JRN-001"] # journey steps that use this region
Result: every document in the approved plan exists.
product-spec/README.md index# Product Spec Index: {Feature Name}
> Status: DRAFT | Created: {date} | Last updated: {date}
> Feature slug: `{feature-slug}`
> ← [Back to Feature Root](../README.md) | ← [Research](../research/README.md)
## What We're Building
{2-3 sentence executive summary from product-spec.md}
## Document Map
| Document | Purpose | Detail Level | Status |
|----------|---------|--------------|--------|
| [product-spec.md](./product-spec.md) | Main PRD — goals, stories, requirements | {SPEC_DETAIL} | DRAFT |
| [journeys/journeys.yml](./journeys/) | Structured journeys (E2E source of truth) | {JOURNEY_COUNT} journeys | DRAFT |
| [wireframes.md](./wireframes.md) OR [wireframes/](./wireframes/) | Screen layouts | {WIREFRAME_DETAIL} | DRAFT |
| [metrics.md](./metrics.md) | KPIs and success criteria | {detail} | DRAFT |
| [mockups/index.html](./mockups/index.html) | Clickable design-system prototype | {MOCKUP_STYLE} | DRAFT |
| [mockups/component-map.yml](./mockups/component-map.yml) | Region → component → code path | — | DRAFT |
| [../design-system/manifest.yml](../design-system/manifest.yml) | Harvested design-system manifest | read-only | — |
## Key Decisions
| Decision | Choice | Rationale |
|----------|--------|-----------|
| {key product decision} | {choice} | {why} |
## Must Read
> Start with [product-spec.md](./product-spec.md), then review user journeys and wireframes.
> Research artifacts are in [../research/](../research/README.md).
README.mdWrite {FEATURE_DIR}/README.md from
docs/templates/product-spec-feature-readme.md.
Write {PRODUCT_SPEC_DIR}/digest.md from phase-digest.md:
JRN-*), whether a design system was harvested.product-spec/ (including
journeys/journeys.yml, mockups/component-map.yml) and
design-system/manifest.yml, one line each.US → JRN → CMP → API
traceability rows.When .forge-status.yml is absent (express / lite: this phase may be the first
writer), initialize it from the v3 initial document
(schema.md §3.1); when it
exists, merge into it. Keys this phase owns:
phases:
product_spec:
digest_path: "product-spec/digest.md"
status: completed # set from the gate decision
Show the created document tree, a clickable path to each document, and the key product decisions captured.
Gate outcome line: "Product Spec complete — [N] documents, cross-linked via
product-spec/README.md"; {next phase} = Revalidation (standard / v-model) or Plan
(express / lite) — both required, so no Skip. On Revise, adjust the documents with the
feedback.
JRN-001) with acceptance criteria.US-NNN story, has ordered steps, and its Markdown file
adds no step absent from journeys.yml. Standard / v-model / lite: each journey has
≥ 1 explicit edge case confirmed with the user. Express: JRN-001 states ≥ 1 edge
case in its acceptance criteria.traceability.yml has a journeys: row per journey with empty tests.component-map.yml with a
component (a harvested CMP-* for project-styled) and a target path; otherwise
the digest says "mockups skipped".product-spec/README.md links every created document; {FEATURE_DIR}/README.md
exists; product-spec/digest.md has all four sections.gates[], and
phases.product_spec.status set from it.--from-forge: only phases.product_spec.digest_path was written; the document
tree and key decisions were returned to forge with no gate prompt and no status or
gates[] write.What the command file sets; muted values are Claude Code's defaults
product-specification, user-journeys, wireframes, mockups, design-system
7-day visitors to each command page
npx claudepluginhub vaiyav/speckit-product-forge --plugin speckit-product-forge33 commands in this plugin
/speckit.product-forge.api-docsPublish API docs after implement: reconcile the OpenAPI/AsyncAPI contracts with the implementation (or author OpenAPI 3.1 when no contracts exist), generate a Postman collection, and report contract↔implementation drift.
/speckit.product-forge.backfillReverse-engineer a Product Forge feature folder from existing code: retro product spec, plan, tasks, initial canonical spec, a `backfilled: true` status file and a gaps report. Use to bring a brownfield module under Product Forge.
/speckit.product-forge.bridgeConverts the approved product spec into a research-backed SpecKit spec.md (Phase 4), with FE↔BE contracts and delta specs, then hands off to the classic or V-Model flow. Use after revalidation approves the product spec.
/speckit.product-forge.catalogBuild or verify the feature catalog `_portfolio/catalog.yml` — one small index over every feature that agents read before opening feature folders. Use after status changes outside forge, or with `--check` as a CI freshness gate.
/speckit.product-forge.change-requestChange request: when scope changes mid-lifecycle, record it as CR-NNN, analyse its impact and effort across every artifact, then apply, defer or reject it — with a delta spec, an optional phase rollback, and a sync-verify afterwards.
/speckit.product-forge.code-reviewReviews implemented code (Phase 6B) after machine gates pass: quality, security, pattern consistency, test coverage and doc↔code drift, judged against the feature's spec, plan and codebase analysis. `--cross-model` adds an independent review by another model.
Other plugins' commands for the same job