| Hat | Stage | Upstream gate | Output | Unblocks |
|---|---|---|---|---|
| Eng | Engineering | PRD approved | engineering/outputs/specs/SPEC-NNN-<slug>.md |
/tdd, /erd, /adr, /ralph-workspace-plan |
When to Use
User has an approved PRD and wants to draft the engineering spec.
Prerequisites
- PRD
status: approvedAND in.workbench-state/approved.json. project.conf REPOSpopulated.
Protocol
- Read PRD (frontmatter + all sections). Identify outcomes and constraints.
- Read engineering context —
engineering/context-library/stack notes; approved ADRs only fromengineering/outputs/adrs/. - Pick SPEC number — scan
engineering/outputs/specs/SPEC-*.md, max + 1, three-digit pad. Slug matches PRD slug. - Decide per repo: modified? yes/no with one-liner.
- Write
engineering/outputs/specs/SPEC-{NNN}-{slug}.mdwith 11 sections: Scope, Target repos, Architecture impact, API+contracts, Data model, Rollout, Observability, Failure modes, Rollback, Risks+opens, Dependencies (ADRs / other SPECs / external teams). - Update
EPIC-PIPELINE.md— set PRD row’s Spec column.
Output Frontmatter
id: SPEC-{NNN}
title: {title}
status: draft
created: {today}
owner: {gh-user}
epic: {EPIC_ID}
prd: PRD-{NNN}
target_repos:
- {repo-1}
Do Not
- Include class-level pseudocode — that’s
/tdd. - Produce a spec without an approved PRD.