|
| 1 | +# spec-forge |
| 2 | + |
| 3 | +`spec-forge` is a YAML-first workflow for turning a rough request into an approved implementation spec and an auditable implementation report. It combines agent-guided stage progression with a Rust CLI that persists durable state under `.spec-forge/`. |
| 4 | + |
| 5 | +Language versions: |
| 6 | + |
| 7 | +- [English](./README.md) |
| 8 | +- [简体中文](./README.zh-CN.md) |
| 9 | +- [日本語](./README.ja-JP.md) |
| 10 | + |
| 11 | +## What It Is |
| 12 | + |
| 13 | +- A staged workflow that moves from request framing to implementation reporting. |
| 14 | +- A persistent workspace model that keeps approvals, gates, focus, and artifacts in YAML. |
| 15 | +- A CLI runtime, [`spec-forge-cli`](./spec-forge-cli/README.md), that is the source of truth for workspace mutations. |
| 16 | + |
| 17 | +## When To Use It |
| 18 | + |
| 19 | +Use `spec-forge` when you need to: |
| 20 | + |
| 21 | +- turn a vague feature request into a structured, reviewable spec |
| 22 | +- persist planning state in versionable files instead of chat memory |
| 23 | +- pause and resume multi-stage spec work safely |
| 24 | +- require explicit approvals before stage advancement |
| 25 | + |
| 26 | +If you only need the command-line surface, start with [`spec-forge-cli/README.md`](./spec-forge-cli/README.md). |
| 27 | + |
| 28 | +## Quick Start |
| 29 | + |
| 30 | +### Agent entry |
| 31 | + |
| 32 | +Ask your agent to use `$spec-forge` when you want it to initialize or resume a workspace, resolve the earliest incomplete stage, and continue from there. |
| 33 | + |
| 34 | +Example prompts: |
| 35 | + |
| 36 | +- "Use `$spec-forge` to turn this request into an approved spec." |
| 37 | +- "Use `$spec-forge` in this repo and continue `checkout-redesign`." |
| 38 | +- "Use `$spec-forge` to find the next incomplete stage and keep going." |
| 39 | + |
| 40 | +### CLI entry |
| 41 | + |
| 42 | +Run these examples from the repository root. |
| 43 | + |
| 44 | +```bash |
| 45 | +spec-forge-cli init --target . --spec-id demo --request-title "Demo Spec" |
| 46 | +spec-forge-cli resolve --target . --spec-id demo --skill spec-forge --stage router --write |
| 47 | +spec-forge-cli ux validate --target . |
| 48 | +``` |
| 49 | + |
| 50 | +> [!NOTE] |
| 51 | +> Agent skills guide the conversation, but `spec-forge-cli` is the authoritative runtime for changing persisted workflow state. |
| 52 | +
|
| 53 | +## Stage Map |
| 54 | + |
| 55 | +| Stage | Purpose | |
| 56 | +| ------------------- | ------------------------------------------------------------------- | |
| 57 | +| `P0 / Intake` | Frame the request, stakeholders, scope, and constraints. | |
| 58 | +| `P1 / Architecture` | Lock the solution outline plus the journey and component indexes. | |
| 59 | +| `P2 / Journeys` | Refine in-scope journeys in reviewable batches. | |
| 60 | +| `P3 / Components` | Refine in-scope components into implementation-facing contracts. | |
| 61 | +| `P4 / Readiness` | Consolidate approved work into the final implementation spec. | |
| 62 | +| `P5 / Implement` | Record delivery status, validations, blockers, and closure details. | |
| 63 | + |
| 64 | +## Workspace Model |
| 65 | + |
| 66 | +Persistent workflow state lives under `.spec-forge/`: |
| 67 | + |
| 68 | +```text |
| 69 | +.spec-forge/ |
| 70 | +├── registry.yaml |
| 71 | +└── specs/ |
| 72 | + └── <spec-id>/ |
| 73 | + ├── pipeline-state.yaml |
| 74 | + ├── handoff.yaml |
| 75 | + ├── framing/ |
| 76 | + ├── architecture/ |
| 77 | + ├── journeys/ |
| 78 | + ├── components/ |
| 79 | + ├── synthesis/ |
| 80 | + └── gates/ |
| 81 | +``` |
| 82 | + |
| 83 | +Key artifacts: |
| 84 | + |
| 85 | +- `pipeline-state.yaml` tracks stage, focus, and UX handoff state. |
| 86 | +- `synthesis/implementation-spec.yaml` is the implementation-ready contract. |
| 87 | +- `synthesis/implementation-report.yaml` records delivery status and validations. |
| 88 | +- `gates/<stage>.yaml` records gate evaluation output per stage. |
| 89 | + |
| 90 | +## Repo Layout |
| 91 | + |
| 92 | +Paths below are relative to the repository root. |
| 93 | + |
| 94 | +```text |
| 95 | +README*.md Project entry docs |
| 96 | +AGENTS.md Agent instructions for this repo |
| 97 | +spec-forge/ Router skill and shared UX contracts/assets |
| 98 | +spec-forge-intake/ P0 stage skill |
| 99 | +spec-forge-architecture/ P1 stage skill |
| 100 | +spec-forge-journeys/ P2 stage skill |
| 101 | +spec-forge-components/ P3 stage skill |
| 102 | +spec-forge-readiness/ P4 stage skill |
| 103 | +spec-forge-implement/ P5 stage skill |
| 104 | +spec-forge-cli/ Rust CLI, tests, npm wrapper, release scripts |
| 105 | +specs/001-spec-execution-stage/ Repo-level context referenced by AGENTS.md |
| 106 | +.spec-forge/specs/001-spec-execution-stage/ |
| 107 | + Example persisted workflow state for this repo |
| 108 | +``` |
| 109 | + |
| 110 | +## CLI Entry Point |
| 111 | + |
| 112 | +Use [`spec-forge-cli/README.md`](./spec-forge-cli/README.md) for: |
| 113 | + |
| 114 | +- installation and platform support |
| 115 | +- quick-start command sequences |
| 116 | +- command reference and structured help |
| 117 | +- output formats and validation commands |
| 118 | +- release rehearsal and CI recovery workflow inputs |
| 119 | + |
| 120 | +## Documentation Map |
| 121 | + |
| 122 | +| Area | Documents | Use for | |
| 123 | +| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | |
| 124 | +| Workflow entry | [`spec-forge` router guide](./spec-forge/README.md), [`spec-forge/SKILL.md`](./spec-forge/SKILL.md) | Start or resume the workflow and inspect the executable router contract. | |
| 125 | +| Stage guides | [`spec-forge-intake`](./spec-forge-intake/README.md), [`spec-forge-architecture`](./spec-forge-architecture/README.md), [`spec-forge-journeys`](./spec-forge-journeys/README.md), [`spec-forge-components`](./spec-forge-components/README.md), [`spec-forge-readiness`](./spec-forge-readiness/README.md), [`spec-forge-implement`](./spec-forge-implement/README.md) | Understand when to use each P0-P5 stage and what the Agent will ask. | |
| 126 | +| Stage contracts | [`intake`](./spec-forge-intake/SKILL.md), [`architecture`](./spec-forge-architecture/SKILL.md), [`journeys`](./spec-forge-journeys/SKILL.md), [`components`](./spec-forge-components/SKILL.md), [`readiness`](./spec-forge-readiness/SKILL.md), [`implement`](./spec-forge-implement/SKILL.md) | Review the executable rules, gates, required inputs, and outputs for each stage. | |
| 127 | +| CLI package | [`spec-forge-cli`](./spec-forge-cli/README.md), [`npm wrapper`](./spec-forge-cli/npm/main/README.md), [`release record`](./spec-forge-cli/CHANGELOG.md) | Install, operate, package, or audit the CLI distribution. | |
| 128 | +| CLI contract | [`spec-forge-cli/SKILL.md`](./spec-forge-cli/SKILL.md) | Inspect the CLI command surface and structured output contract. | |
| 129 | +| Repo context | [`spec execution plan`](./specs/001-spec-execution-stage/plan.md), [`AGENTS.md`](./AGENTS.md) | Read repository-level context and agent instructions. | |
0 commit comments