Use this stage to convert the approved journeys and component index into component-level contracts that are detailed enough for implementation.
This stage answers: what each component owns, what interfaces it exposes, what state and data it manages, and what code-level constraints must hold.
Shared Operating Rules
- This skill runs only in Plan mode. If the runtime is not Plan mode, stop and tell the user to switch before continuing.
- Confirm both chat language and file language before component questions.
- Keep decisions in chat. YAML remains the persisted source of truth, but the user should not need to inspect files directly.
- Approvals happen from chat summaries, then get persisted into YAML.
Required Shared CLI Commands
spec-forge-cli resolvespec-forge-cli applyspec-forge-cli artifact getspec-forge-cli artifact putspec-forge-cli artifact mergespec-forge-cli approvespec-forge-cli focusspec-forge-cli gate checkspec-forge-cli stage advance
Required UX Contract
Read ../spec-forge/assets/contracts/ux-contracts.yaml
before collecting parameters.
At the start of the stage, run:
spec-forge-cli resolve --target <target-dir> --skill spec-forge-components --stage components --write
If the runtime is not Plan mode, stop and ask the user to switch before collecting inputs or showing any choice dialog.
Use chat summaries as the approval surface; YAML remains the persisted contract for the stage.
Entry Gate
| # | Check | Source |
|---|---|---|
| 1 | Journey artifacts exist | Journeys stage |
| 2 | Journey artifacts are approved | Journeys stage |
Required Inputs
- Approved journey artifacts
- Approved component index
- The current component batch plan
Workflow
- Resolve invocation UX first with:
spec-forge-cli resolve --target <target-dir> --skill spec-forge-components --stage components --writeConfirm chat language and file language before stage-specific component questions. Then collect only the next missing parameter, one step at a time, and record every accepted answer or choice withspec-forge-cli apply .... - Select the next review batch with:
spec-forge-cli focus --target <target-dir> --spec-id <spec-id> --stage components --max-items 1 --write - Focus on one component at a time unless the batch contains a tiny, inseparable pair.
- For each selected component, create or update
.spec-forge/specs/<spec-id>/components/<component-id>.yaml. Usespec-forge-cli artifact getto inspect the current artifact when needed, then persist detail withspec-forge-cli artifact mergefor incremental patches orspec-forge-cli artifact putfor a full replacement. - Record the relevant
discussion_rolesfor that component. Choose roles that fit the component, such as:tech-leadfrontend-engineerbackend-engineerdata-engineersecurity-reviewerqa-leadsre-operator
- Fill the component artifact progressively:
- purpose, responsibilities, and non-responsibilities
- inputs, outputs, and events
- source of truth, persisted state, and derived state
- dependencies
- algorithms, validation rules, and error handling
- concurrency or ordering constraints when relevant
- performance, security, accessibility, and observability requirements
- feature flags, migrations, and testing expectations
- links back to journeys
- Keep the review progressive:
- no more than 3 tightly related questions in a turn
- prefer the next code-level question that most reduces ambiguity
- do not review unrelated components together
- Update
.spec-forge/specs/<spec-id>/components/batches.yamlas work progresses, usingspec-forge-cli artifact merge --file components/batches.yamlorspec-forge-cli artifact put --file components/batches.yaml. - Present a concise component summary in chat for each finished component and
ask for explicit approval there. Summarize the batch status in chat before
approving the batch file as well. Do not ask the user to inspect YAML files
directly.
Use a choice dialog when the runtime supports it; otherwise fall back to a
compact numbered menu.
When the user approves the chat summary, record it with:
spec-forge-cli approve --target <target-dir> --spec-id <spec-id> --file components/<component-id>.yamlspec-forge-cli approve --target <target-dir> --spec-id <spec-id> --file components/batches.yaml
- Run:
spec-forge-cli gate check --target <target-dir> --spec-id <spec-id> --stage components --writespec-forge-cli stage advance --target <target-dir> --spec-id <spec-id> --stage components
Outputs
.spec-forge/specs/<spec-id>/components/batches.yaml.spec-forge/specs/<spec-id>/components/<component-id>.yaml.spec-forge/specs/<spec-id>/gates/components.yaml
Exit Gate
| # | Check |
|---|---|
| 1 | Component batches exist |
| 2 | Every in-scope component has a YAML detail artifact |
| 3 | Every in-scope component detail artifact is user-approved |
| 4 | Component batch file is user-approved |
Guardrails
- Do not modify implementation code in this stage.
- Do not accept hand-wavy code detail such as "handle errors somehow."
- Do not hide migrations, feature flags, or testing expectations.
- Do not force the user to review multiple complex components in one pass.
- Do not collect missing required parameters in one large batch.
- Do not continue in non-Plan mode.
- Do not ask the user to inspect YAML files directly. Summarize component content in chat instead.
Next Step
Continue with
../spec-forge-readiness/SKILL.md.