Phase I turns fuzzy product ideas into falsifiable, machine-checkable artifacts.
- Capture scope, users, and measurable success metrics.
- Define system capabilities, contracts, and invariants.
- Establish governance and CI gates that keep the spec authoritative.
| Step | Goal | Key Outputs |
|---|---|---|
| 00 — Charter | Align on problem, scope, stakeholders | spec/00_charter.json |
| 01 — Capabilities | Describe system verbs and boundaries | spec/01_capabilities.json |
| 02 — System Sketch | Shape components and connections | spec/02_system_sketch.json |
| 02a — Delivery Baseline | Nail environments, CI, compliance | spec/02a_delivery_baseline.json |
| 03 — Glossary | Eliminate ambiguous terms | spec/03_glossary.json |
| 04 — Functional Requirements | Define falsifiable behavior | spec/04_fr_list.json |
| 05 — Interface Contracts | Establish API surface | spec/05_interface_contracts.json |
| 06 — Invariants | Capture truths that must hold | spec/06_invariants.json |
| 07 — NFRs | Set performance/reliability targets | spec/07_nfrs.json |
| 08 — Fixtures | Provide traceable test data | spec/08_fixtures.json |
| 09 — Implementation Plan | Sequence delivery milestones | spec/09_impl_plan.json |
| 10 — Governance | Define change control policies | spec/10_governance.json |
| 11 — Red Team | Enumerate threats and mitigations | spec/11_redteam.json |
| 12 — CI Gates | Wire automated enforcement | spec/12_ci_gates.json |
- Step 13 (Extension Generator): Identify if you need specialized extensions (e.g.,
ext_01_database.json) for complex domains found in System Sketch. - Step 13a (Completeness): Run
spec/13a_completeness_assessment.jsonto identify unresolved tracing or definitions. - Step 14 (Roadmap): Only once 13/13a are clear, proceed to the Roadmap phase.
Consult the matching spec/NN_name.guide.md before running the prompt for each step.
Prompts are designed for a two‑phase interaction to reduce rework:
- Phase A — Clarify: the assistant ingests the step’s context and asks targeted Gap Questions when the “Self‑Audit Gate” is not satisfied.
- Phase B — Emit: once answers are provided, the assistant writes the artifact JSON directly to disk and validates against the schema. Clarify responses should be short, bulleted questions grouped by topic (no JSON, no code fences), prioritizing gating items; the assistant stops until answers are provided.
Use the core validation commands after each artifact update to keep discovery outputs consistent before moving to implementation.
- Missing
trace_refson components or connections will fail schema validation. - Components must include 3–6 responsibilities and an owner.
- Multiple components require at least one connection; each connection must include
trust_boundary. partner/publicconnections requireauthandrate_limit;eventprotocol requiresreliability.schema_refmust usefile://,https://,glossary:,api:, or-tbd.
- Empty Environments: Validation fails with
minProperties: 1if an environment (dev,ci, etc.) object is empty. You must properly define keys (e.g., region, runner) or remove the environment from the list if not applicable (though all 4 are required by default). - Invalid Gate Names:
ci_gatesmust be kebab-case strings (regex:^[a-z0-9-]+$). "Run Tests" or "Schema Validate" will fail; userun-testsorschema-validate. - Missing Trace:
tracearray is required to link the delivery baseline to upstream capabilities or charter.
- Empty Terms: Validation fails if
termsarray is empty (minItems: 1). - Lazy Definitions: Validation fails if
definitionis under 20 characters. - Missing Optional Fields:
domainandunitsare recommended; if provided, they must follow strict patterns (lowercase kebab-case for domain, alphanumeric/slash for units) and cannot be empty strings. - NFR/Monitor Coverage: Tooling will flag if metrics in NFRs/Monitoring do not match glossary terms or units.
- Broken Bridge: Every FR must trace to at least one upstream
capability-*. Matrix validation will fail if this link is missing or broken. - Trace Format: The
tracefield must be an array of objects ({type, id, note}), not strings. - Lazy Requirements: Validation fails if
statement< 20 chars oracceptance_criteria.text< 15 chars. - Invalid ID:
fr_idmust follow kebab-case and be unique.
- Missing Parameters: Validation fails if
parametersare needed but not defined in the new array format. - Invalid Schema Refs:
input_schema_refandoutput_schema_refshould point to validfile://,glossary:, or be marked-tbd. - Protocol Mismatch: Non-HTTP protocols like
grpcmust mapping their methods (e.g., toPOST) as per proper guidance. - Empty Errors: Every API must define at least one error state or explicitly justify why it cannot fail.
- Invalid ID Pattern: NFR IDs must follow the
nfr-<category>-<metric>pattern (e.g.,nfr-latency-p95). - Qualitative Targets: Target values cannot be purely qualitative strings (e.g., "fast"). They must contain at least one digit or be a number.
- Missing Owner: Owners must be one of the allowed types (e.g.,
product,engineering,ops) and cannot be invented.
- Orphan Fixtures: Validation fails if
targetsis missing or empty. Every fixture must trace to at least one ID (fr-*,api-*,nfr-*, orinv-*). - Unknown Target: The linter will flag any target ID that does not exist in the ingested spec context. Ensure you are referencing real IDs from Steps 4, 5, 6, or 7.
- Mode Strictness: If
modeiscontract, you must provide anexpectedobject withstatus(integer 100-599). - Format Errors: String IDs in
targetsare invalid; they must be objects{ "type": "...", "id": "..." }.
- Unstructured Tech Stack: Validation fails if
tech_stackis a simple list of strings. It must be an object with keyslanguages,frameworks,infrastructure,tools, each containing objects withnameandversion. - Missing Traceability:
milestones[].deliverablesis now required to link execution steps to FRs or APIs. Ensure you have validfr-*orapi-*IDs. - Capabilities Mismatch: If you list a technology in
tech_stackthat isn't inspec/01_capabilities.json, you must either add it to Step 1 or justify it as a "Spike" in the plan. - Date Format:
target_datemust use YYYY-MM-DD format.
- Traceability: Validation now supports
traceandlinks. If you reference an upstream requirement (like Charter), ensure the IDs exist. - Spec Policy:
spec_first_policymust be a boolean. If set tofalse, justify it in the PR rules. - Invalid PR Rules:
pr_rulesmust use the allowed enum values (e.g.,validate,test,audit). Free-form strings are forbidden. - Regex Errors:
commit_message_rules.patternmust be a valid regular expression. Invalid patterns will fail the verification script. - Schema Detection: Ensure your file is named
spec/10_governance.jsonor has an ID starting withgovernance-so tooling can detect it.
- Missing Targets: Validation fails if
target_idsis missing or empty. Every threat must trace to at least oneapi-*orcomponent-*. - Bad Mitigation Links:
mitigationskeys must use stricttraceRefobjects. If you link toinv-*ornfr-*, the tooling verifies those IDs exist. - Invalid Category:
categorymust be one of the strict enum values (authn,authz,business_logic,transport,data_privacy). - Schema Sync:
prompt_11_redteam.mdhas an referenced step schema that must matchschema/11_redteam.schema.json. Ensure they are kept in sync.
- Cycle Detected: The validation tool (
validators/step_12.py) enforces a DAG. If you have a cycle (A->B->A), you must break it by refactoring job dependencies. - Missing Dependency: All job IDs listed in
requiresmust exist in thejobslist. - Unstructured Steps: Steps must be objects with
id,name,command. String steps are forbidden to prevent hallucinations. - Invalid Trace: The
tracefield must be an array of objects (e.g.,[{ "type": "doc", "id": "10-governance" }]) linking to upstream authority. Valid types are defined incore/collections.schema.json. - Command Prefixes: Commands should theoretically map to standard tools (
python,bash,npm). While not strictly enforced as a blocking error yet, stick to known tools.
- Referential Integrity: Validation fails if
source_milestonescontains IDs that do not exist in09_impl_plan.json. Ensure the upstream milestone IDs are correct. - Tech Stack Mismatch: Validation fails if
tech_stackitems in Roadmap do not match (name and version) the items defined in Step 09. - Date Sequencing: Milestones must be ordered chronologically. If
m2liststarget_dateearlier thanm1, validation fails. - Migration Plan:
migration_plancannot be empty. If no migration is needed, explicitly state "No migration required..." (must be > 3 words). "none" or "n/a" is also allowed but monitored. - Dependency Rationale: External dependencies must include a
noteexplaining why they are blocking.
- Validated JSON artifacts under
spec/00*throughspec/12*. - Updated trace matrix demonstrating FR ↔ API ↔ fixture ↔ NFR coverage.
- Governance rules embedded in CI to keep the spec authoritative.