بازگشت به مهندسی مدرن و کار با هوش مصنوعی · فصل ۱ — از خواستهی مبهم تا قرارداد قابل اجرا · 11
Build a complete implementation-ready specification
Combine problem, scope, done criteria, and a reviewed plan into an implementation-ready specification. Implementation-Ready Spec تولید میکند که قبل از coding قابل review است.
Lesson summary
Combine problem, scope, done criteria, and a reviewed plan into an implementation-ready specification.
Implementation-Ready Spec تولید میکند که قبل از coding قابل review است.
This lesson produces
Implementation-Ready Spec تولید میکند که قبل از coding قابل review است.
Who it is for
Foundation
Shared task-list filter case + explicit artifact structure + concept-by-concept guided closure.
Repair
Misconception from the exact B02 teaching contract is diagnosed and repaired; mastered concepts are not replayed.
Experienced
Use the same artifact but with missing/contradictory requirements, dependency ambiguity and less scaffold.
Prerequisites
Turn scattered decisions into one implementation contract
A stakeholder asks for an “Unfinished” view in an existing task list. By this point, the problem has been clarified, scope has been bounded, Done has been made observable, and the proposed implementation plan has been reviewed before editing. But if those decisions remain scattered across separate artifacts or conversations, the implementer still has to reconstruct the links between them—and may invent a missing decision.
In this lesson you build Implementation-Ready Spec v1: one reviewable specification that brings together the Problem Brief, Scope Box, constraints, acceptance evidence, and an approved plan with explicit assumptions. Every criterion must be traceable from a named need/problem/scope/constraint source through a plan step to evidence; unresolved contradictions and blocking unknowns must be closed before READY; and executable examples, when useful, remain a technique inside the specification rather than the definition of the specification.
This lesson does not decompose the work into tasks or vertical slices. FND-002 takes the complete specification and performs that decomposition; P05 does not absorb that responsibility.
Estimated active time: 55 minutes.
This lesson is for you if: you already have a Problem Brief, Scope Box, Done Matrix, and Plan Review, but they are not yet one traceable artifact that another person can judge independently.
This lesson is not for: replacing a specification with a long prompt, forcing every requirement into Gherkin, starting task decomposition, guessing blocking unknowns, or implementing code.
Hard prerequisite — FND-001-P04: you must be able to review a concrete plan before editing and record a human ACCEPT/MODIFY/REJECT decision with evidence.
Short prerequisite probe
The packet identity for this probe is fixed: spec_version=PREREQ-SPEC-v3 and plan_version=PREREQ-PLAN-v2. Review this bounded packet; do not invent missing implementation facts.
Source packet:
SCOPE-P04-01: add anAll / Unfinishedview choice to the existing task list; no new persistence is approved.AC-P04-01: inUnfinished, completed tasks are hidden and unfinished tasks remain visible.AC-P04-02: returning toAllrestores the ordinary visible set.CONSTRAINT-P04-01: task schema/storage behavior must not change.
Reviewed three-step plan:
PRE-PLAN-01— connect the view selector to the existing list-view state. Primary Trace:SCOPE-P04-01. Decision-driving unknown:U-P04-01= the selector integration point has not yet been inspected. Required pre-edit verification:V-P04-01inspect the current view-state owner/integration point.PRE-PLAN-02— deriveUnfinishedfrom existing task status. Primary Trace:AC-P04-01. Verification fact:VF-P04-01= the current list contract exposes completed/unfinished status semantics. Required verification:V-P04-02confirm those semantics on a mixed-status sample.PRE-PLAN-03— verifyUnfinished → Allreturn behavior and non-change of storage/schema. Primary Trace:AC-P04-02; secondary constraint check:CONSTRAINT-P04-01. Verification fact:VF-P04-02= no schema/storage change is authorized. Required verification:V-P04-03run the return-to-All check and inspect the contract for non-change.
Write three review lines—Trace, decision-driving assumption/unknown or supplied verification fact, and verification—for PRE-PLAN-01..03. Then give one human ACCEPT/MODIFY/REJECT decision and bind the reason explicitly to both reviewed versions.
PASS: no step lacks a valid Trace; U-P04-01 is not converted into fact; verification is clear before edit; and the decision + reason records the same spec_version and plan_version.
If the probe fails, return only to the matching FND-001-P04 skill: repair Trace assignment if a step has no primary source/criterion; repair assumption/unknown + pre-edit verification if an unknown was guessed; or repair the version-bound decision record if the verdict is not tied to both reviewed versions. A complete specification cannot legitimize an unreviewed plan or a hidden assumption.
Choose the amount of support you need
Every route reaches the same artifact and evidence bar. Only the scaffold changes.
Four-concept route probe
Answer these without reading ahead:
- Implementation-ready specification: why is it not the same as a long prompt or a descriptive document?
- Traceability: if a test passes but nobody can tell which criterion it covers, what is missing?
- Ambiguity/contradiction audit: if two parts of the spec define conflicting behavior, may an AI silently choose the “most reasonable” one?
- Executable example: when is Given/When/Then useful, and why should architectural constraints not be forced into that form?
4/4 → Fast Path; 2–3/4 → repair only the failed concepts; 0–1/4 → foundation route.
- Foundation: follow the task-list filter case with the full reusable blank scaffold.
- Repair: rebuild only the fragile distinction.
- Experienced/Fast Path: go directly to the independent case with less explanation and more contradiction/unknown pressure.
Fast Path does not lower the evidence bar.
Mental model: a specification connects decisions; it is not a text warehouse
Implementation-Ready Spec v1 is the final connection point before decomposition:
Problem → Scope/Constraints → Done criteria → Reviewed Plan → Implementation-Ready Spec → FND-002 decomposition
The four concepts play different roles:
| Concept | Core question | Sufficient evidence |
|---|---|---|
| Implementation-ready spec | Can a new implementer reconstruct goal, boundary, Done, and the plan gate without guessing? | an independently reviewable artifact |
| Traceability | Why does each criterion, plan step, and evidence item exist, and which need/problem/scope/constraint is its source? | source need/problem/scope/constraint → criterion → plan → evidence links with no orphans |
| Ambiguity/contradiction audit | Is any decision-driving ambiguity or blocking unknown still open? | zero unresolved contradictions and zero blocking unknowns |
| Executable example | Would a behavioral rule benefit from a concrete observable example? | an example linked to a criterion, with implementation hidden from the steps |
A strong spec does not need to be large. Its value comes from connected decisions, not documentation volume.
The four foundation concepts
1. Implementation-ready specification
An implementation-ready specification is a single package that makes the problem, scope, constraints, acceptance evidence, and plan-approved assumptions clear enough for implementation to begin without inventing decision-driving requirements. “Implementation-ready” does not mean the entire document is machine-executable.
2. Traceability
Traceability is the followable relationship among the problem, boundary, criterion, plan step, and evidence. A criterion with no plan/evidence path is an orphan; so is a plan/evidence item with no source. Traceability is not the same as writing more documentation—a compact ID-based matrix can be stronger than pages of prose.
3. Ambiguity and contradiction audit
Before READY, inspect decision-driving terms, conflicting statements, and blocking unknowns. Proofreading is not enough: two perfectly grammatical sentences can define incompatible behavior. Keep unresolved decision blockers explicitly OPEN_BLOCKING; do not “complete” the spec by guessing.
4. Executable example (optional technique)
For suitable behavioral rules, a Given/When/Then example—or a simpler equivalent—can make context, event, and observable outcome concrete. With tools such as Cucumber, such examples can connect to step definitions and automated tests. The technique is optional: scope boundaries, architectural constraints, and human approval decisions do not need to be forced into scenarios.
Build Implementation-Ready Spec v1
Do not erase the input artifacts and rewrite everything from scratch. Connect them into one traceable contract:
- Identity and version: the output has an ID/version and records the identities/versions of the Problem Brief, Scope Box, Done Matrix, and Plan Review inputs; the Plan Review record also preserves the reviewed
spec_versionandplan_version. - Problem/outcome: restate the problem and intended outcome without re-solving the design.
- Scope Box: keep
IN,OUT, and constraints distinct. - Acceptance Matrix: give observable criteria stable IDs.
- Reviewed Plan: record the approved plan and the assumptions the human gate has explicitly allowed; hidden assumptions are forbidden.
- Trace Map: every row starts from a named need/problem/scope/constraint source, reaches a specific criterion, and then maps to a plan step and evidence. No criterion, plan step, or evidence item may be source-less.
- Readiness Audit: unresolved contradictions and blocking unknowns must both be zero. A non-blocking unknown may remain only with explicit ownership, impact, and follow-up.
- Optional executable-example decision: for each suitable rule, record
USEDwith an observable example linked to a criterion, orNOT_USEDwith a bounded rationale. - Boundary note: task breakdown, vertical slicing, and delivery sequencing belong to FND-002 and are not authored here.
Reusable blank scaffold
This scaffold contains only current-lesson fields; do not add task breakdown or vertical slicing.
Spec ID: <id>
Spec version: <version>
Input artifact versions:
Problem Brief: <id/version>
Scope Box: <id/version>
Done Matrix: <id/version>
Plan Review record: <id/version>
Plan Review binding:
spec_version: <reviewed version>
plan_version: <reviewed version>
gate: <ACCEPT|MODIFY|REJECT as supplied by the reviewed record>
Problem / Outcome: <bounded statement>
Scope IN: <items>
Scope OUT: <items>
Constraints: <items>
Acceptance: <AC IDs + observable criteria>
Reviewed Plan: <PLAN IDs + approved assumptions>
Trace Map: <source need/problem/scope/constraint → criterion → plan step → evidence>
Readiness Audit: <unresolved contradictions + blocking unknowns>
Executable-example decision: <USED + criterion-linked example | NOT_USED + bounded rationale>
FND-002 boundary: <task breakdown / vertical slicing / delivery sequencing remain for FND-002>
Minimum trace row:
| Source need/problem/scope/constraint | Criterion | Plan step | Evidence | State |
|---|---|---|---|---|
SCOPE-IN-02 | AC-01 | PLAN-02 | EV-01 | linked |
If AC-01 has no evidence, the spec is not READY. If PLAN-02 or EV-01 cannot be traced back to a named need/problem/scope/constraint source and criterion, remove it or justify it again.
AI may suggest wording, surface possible orphans, flag contradictions, or critique consistency. Scope, unknown closure, acceptance, and the READY decision remain human-owned and evidence-backed.
Worked case: unfinished-task filtering
The shared case contains an existing list with completed and unfinished tasks. The request is to let the user switch between “All” and “Unfinished” without silently adding persistence, a schema change, a redesign, or unrelated cleanup. Assume the preceding Plan Review has already checked the selected path against evidence and approved it; this lesson does not redesign the plan.
Implementation-Ready Spec v1 — core slices
Output identity: spec_id=TASK-FILTER-SPEC; spec_version=v1
Input versions: Problem Brief=TASK-FILTER-PB-v1; Scope Box=TASK-FILTER-SCOPE-v1; Done Matrix=TASK-FILTER-DONE-v1; Plan Review record=TASK-FILTER-PR-v1
Plan Review binding: spec_version=TASK-FILTER-REQ-v1; plan_version=TASK-FILTER-PLAN-v2; gate=ACCEPT
Named source statements:
NEED-01: a user needs to focus on remaining work without changing underlying task data.SCOPE-IN-01: the user can switch betweenAllandUnfinishedand can return toAll.SCOPE-IN-02: inUnfinished, completed tasks are hidden while unfinished tasks remain visible.SCOPE-OUT-01: filter persistence, page redesign, and unrelated cleanup are out of scope.CONSTRAINT-01: the task schema/storage contract and the meaning of completed/unfinished do not change.
Problem: NEED-01.
Scope IN: SCOPE-IN-01; SCOPE-IN-02.
Scope OUT: SCOPE-OUT-01.
Constraints: CONSTRAINT-01.
Acceptance:
AC-01: in Unfinished view, completed tasks are not shown and unfinished tasks remain visible.AC-02: switching back to All restores the normal visible set.AC-03: boundary/failure handling introduces no schema change or new persistence behavior.
Reviewed plan:
PLAN-01: connect the view selector to the existing list state.PLAN-02: derive the unfinished view from existing task status while preserving scope boundaries.PLAN-03: verify mixed-status, all-completed, and return-to-All behavior, plus inspect the contract/schema for non-change.
Trace map:
| Source | Criterion | Plan | Evidence | Expected result |
|---|---|---|---|---|
SCOPE-IN-02 | AC-01 | PLAN-02 | EV-01 mixed-status check | only unfinished remains visible |
SCOPE-IN-01 | AC-02 | PLAN-01/02 | EV-02 toggle-back check | All returns correctly |
CONSTRAINT-01 | AC-03 | PLAN-02/03 | EV-03 contract/schema inspection | no contract change |
Readiness audit: unresolved contradictions = 0; blocking unknowns = 0. If new evidence later shows the plan does not fit the real data flow, READY must be revoked and Plan Review reopened.
Optional executable example for AC-01
Scenario: Show unfinished tasks only
Given the task list contains completed and unfinished tasks
When the user selects Unfinished
Then only unfinished tasks are shown
Executable-example decision: USED for AC-01, because the filter behavior is observable and the example is linked to that criterion. The scenario clarifies one behavioral rule. Scope exclusions, the schema constraint, and approval history still belong in other parts of the specification.
Four plausible failures
Failure 1: the spec becomes a long prompt
All decisions are prose, but there are no stable IDs, traces, or readiness states. The implementer must reconstruct relationships. Repair: separate Problem/Scope/Acceptance/Plan/Trace/Audit and find orphaned items.
Failure 2: a test passes but its criterion is unknown
EV-07 = PASS is weak evidence if nobody can identify what acceptance condition it proves. Repair: bind evidence to a specific criterion. Evidence without a source and criteria without evidence are both defects.
Failure 3: a contradiction is hidden by fluent wording
One section says filter persistence is out of scope; another says the selection must survive reload. An AI may silently prefer one interpretation. Repair: record the contradiction, identify the authority/evidence needed, and block READY until it is resolved.
Failure 4: every requirement is forced into Gherkin
Behavioral examples can be excellent, but forcing architecture constraints or scope boundaries into scenarios can distort or lose meaning. Repair: use executable examples only for suitable observable behavior and link them to explicit criteria.
Experienced bridge: when the artifacts disagree
Suppose the Scope Box says “filter persistence is out of scope,” while an old plan note says “store the selection in the URL.” Do not settle the conflict by choosing the architecture you prefer. Check the authority and version of each statement. If the note belongs to a stale plan, mark it stale/deprecated. If it is a genuine new requirement, the current spec is not READY and change control is required.
Add three pressures for experienced practice:
- a known dependency whose exact contract is still unclear;
- two evidence items that imply different interpretations;
- a fluent statement with two decision-driving meanings.
The goal is not to declare READY every time. Sometimes the correct result is NOT_READY — blocking contradiction. Manufactured certainty is a defect, not velocity.
Format choices and trade-offs
- Prose-first spec: natural to read, but trace/orphan detection can be weak.
- Matrix-first spec: strong for independent review and traceability, but mechanical without context.
- Issue/template-based spec: convenient for team workflow, but a template must not become decision authority.
- Executable-example-heavy spec: useful for observable behavior, but not a complete specification by itself.
Implementation-Ready Spec v1 is not tied to one tool or file format. The invariants matter: clear problem and boundary, judgeable acceptance, traceable plan/evidence, no blocking audit defects, and human ownership.
Guided and independent practice
Guided case — Order search
Packet:
NEED-01: a user must find an order by its full order number.SCOPE-IN-01: exact order-number search on the orders page.SCOPE-OUT-01: fuzzy search, customer-name search, redesign.CONSTRAINT-01: the order schema does not change.- Done: exact match is observable; no-match is explicit; the existing list path has no regression.
- Input versions:
Problem Brief=ORDER-PB-v1;Scope Box=ORDER-SCOPE-v1;Done Matrix=ORDER-DONE-v1;Plan Review record=ORDER-PR-v1. - Plan Review binding:
spec_version=ORDER-REQ-v1;plan_version=ORDER-PLAN-v2;gate=ACCEPT. - Reviewed Plan:
PLAN-01receive the full number;PLAN-02use the verified lookup capability;PLAN-03render match/no-match;PLAN-04run match/no-match/regression verification. - Evidence packet:
EV-01lookup-capability review=verified;EV-02exact/no-match acceptance packet=available;EV-03existing-list regression verification=required.
Build Implementation-Ready Spec v1. Include at least three acceptance IDs and three complete source → criterion → plan → evidence rows, a readiness audit, an explicit FND-002 boundary note, and an Executable-example decision: USED with a criterion-linked example or NOT_USED with a bounded rationale. Do not write task decomposition.
Independent case — Fast Path destination: Avatar refresh
Closed change-request packet:
NEED-A1: after a successful avatar replacement, the new image is visible on the next profile visit.NEED-A2: failure preserves the current image and shows a clear error.CONSTRAINT-A1: the upload API contract and storage provider do not change.SCOPE-OUT-A1: crop editor, avatar history, and profile redesign are out of scope.- Input versions:
Problem Brief=AVATAR-PB-v1;Scope Box=AVATAR-SCOPE-v1;Done Matrix=AVATAR-DONE-v1;Plan Review record=AVATAR-PR-v1. - Plan Review binding:
spec_version=AVATAR-REQ-v1;plan_version=AVATAR-PLAN-v2;gate=ACCEPT. - Reviewed Plan:
PLAN-A1consumes the success/failure result from the existing upload contract;PLAN-A2on success refreshes the known-owner cache path so the next visit reads the new image;PLAN-A3on failure preserves the current image and exposes a clear error;PLAN-A4verifies success/failure and API/provider non-change. - Evidence packet:
EV-A1upload-contract inspection=verified;EV-A2cache-ownership record=verified;EV-A3next-visit success verification=required;EV-A4failure-preservation/error verification=required;EV-A5API/provider non-change inspection=required. - Packet audit state: unresolved contradictions=
0; blocking unknowns=0for this bounded scope.
Build an independent Implementation-Ready Spec v1 that:
- states problem/scope/constraints without copying filter-case wording;
- gives success and failure separate criteria;
- traces each criterion from a named source through plan/evidence;
- claims readiness only from this packet;
- records an executable-example decision as
USED+ criterion-linked example orNOT_USED+ bounded rationale; - explicitly leaves task/vertical-slice decomposition to FND-002.
If a decision needs information outside this packet, do not guess READY; record the defect.
Readiness check: when is the spec actually ready?
Before declaring READY, answer five questions:
- Can a new reader reconstruct the problem, boundary, Done, and plan gate without hidden context?
- Does every criterion trace from a named need/problem/scope/constraint source through plan/evidence, with no orphan plan/evidence items?
- Are unresolved contradictions and blocking unknowns both zero?
- Is the executable-example decision recorded—
USEDwith a criterion link orNOT_USEDwith a bounded rationale—and, when USED, are the steps free of hidden implementation detail? - Has the spec avoided taking over FND-002, while blocking decisions remain human-owned?
If a critical answer is no, the artifact is not implementation-ready. Machine validation can check structure and consistency; sufficiency and acceptance still require human review.
Assessment and transfer
Assessment covers five layers: bounded concept explanation, application on a fresh artifact, diagnosis of a plausible failure, a human decision on an ambiguous statement, and transfer to a different domain.
For blocking items to pass:
- all four concepts must be visible in the artifact; for the optional executable-example concept,
USEDorNOT_USEDmust be recorded with evidence/rationale; Implementation-Ready Spec v1must be judgeable without oral explanation;- the FND-002 boundary must remain intact;
- the final readiness decision must not be delegated to AI;
- transfer must be more than renaming nouns from the task-list case.
The lesson’s final evidence is the specification itself plus its trace/audit and decision record. This does not prove implementation skill or mastery of the entire canonical FND-001.
References and freshness
Two external references give useful context for the practices used in this lesson:
ISO/IEC/IEEE 29148:2018remains the published Edition 2; a later Edition 3 is still under development and has not replaced it.- Official Cucumber documentation continues to describe Gherkin/executable specifications and Given/When/Then behavior examples. In this lesson, executable examples therefore remain an optional technique, not a required representation for every kind of requirement.
These references support the requirements/specification practices discussed here. They do not replace the concrete Problem, Scope, Done, reviewed Plan, and evidence that your own Implementation-Ready Spec v1 must contain.
Assessment
There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.
Q1 retrieval
Distinguish an implementation-ready specification from an executable specification. Then explain how traceability makes a named need/problem/scope/constraint source followable through a criterion and plan step to evidence.
Q2 application
Fresh case — Order search. Packet: `NEED-01`=find an order by full order number; `SCOPE-IN-01`=exact order-number search; `SCOPE-OUT-01`=fuzzy/customer-name/redesign; `CONSTRAINT-01`=schema unchanged; Done=exact match visible, no-match explicit, existing list path without regression. Input versions: `Problem Brief=ORDER-PB-v1`, `Scope Box=ORDER-SCOPE-v1`, `Done Matrix=ORDER-DONE-v1`, `Plan Review record=ORDER-PR-v1`. Plan Review binding: `spec_version=ORDER-REQ-v1`, `plan_version=ORDER-PLAN-v2`, gate=`ACCEPT`. Reviewed Plan: `PLAN-01` receive full number; `PLAN-02` verified lookup capability; `PLAN-03` render match/no-match; `PLAN-04` verification. Evidence: `EV-01` lookup review=verified; `EV-02` exact/no-match acceptance packet=available; `EV-03` list-regression verification=required. Build `Implementation-Ready Spec v1` with at least three acceptance IDs, three complete `source→criterion→plan→evidence` traces, a readiness audit, an FND-002 boundary, and an executable-example decision (`USED` + criterion-linked example or `NOT_USED` + bounded rationale).
Q3 diagnosis
Diagnose this spec: `AC-02: no-match must be explicit.` The trace table only says `EV-09=PASS` and provides no plan step or link to AC-02. Another section says no-match should be shown as an empty screen with no message. Name at least two defects, map them to the correct concepts, and give a concrete repair.
Q4 decision
An AI proposes: “For consistency, convert every requirement—including the schema constraint and scope exclusions—into Given/When/Then and remove the other specification text.” Choose `ACCEPT`, `MODIFY`, or `REJECT` and justify the human decision from evidence/boundary. The AI does not choose the verdict.
Q5 transfer
Transfer — Avatar refresh. Closed packet: `NEED-A1`=after successful replacement, the new avatar is visible on the next profile visit; `NEED-A2`=failure preserves the current image and shows a clear error; `CONSTRAINT-A1`=upload API/storage provider unchanged; `SCOPE-OUT-A1`=crop/history/redesign out of scope. Input versions: `Problem Brief=AVATAR-PB-v1`, `Scope Box=AVATAR-SCOPE-v1`, `Done Matrix=AVATAR-DONE-v1`, `Plan Review record=AVATAR-PR-v1`. Plan Review binding: `spec_version=AVATAR-REQ-v1`, `plan_version=AVATAR-PLAN-v2`, gate=`ACCEPT`. Reviewed Plan: `PLAN-A1` consume existing upload success/failure result; `PLAN-A2` success→refresh known-owner cache path; `PLAN-A3` failure→preserve current image + clear error; `PLAN-A4` verify behavior and API/provider non-change. Evidence: `EV-A1` upload-contract inspection=verified; `EV-A2` cache-ownership record=verified; `EV-A3` next-visit success verification=required; `EV-A4` failure-preservation/error verification=required; `EV-A5` API/provider non-change inspection=required. Packet audit: contradictions=0, blocking unknowns=0 for the bounded scope. Build `Implementation-Ready Spec v1`; trace each criterion from source through plan/evidence; record the executable-example decision as `USED` + criterion-linked example or `NOT_USED` + bounded rationale; and state exactly what remains for FND-002.
Assessment rubric
Canonical evidence descriptors are stored in questions.json; this Markdown index does not override them.
Implementation-ready specification, executable examples, and traceability
- Critical: NO
- Canonical descriptor: see Q1 expected evidence in
questions.json.
Implementation-Ready Spec construction from a bounded packet
- Critical: YES
- Canonical descriptor: see Q2 expected evidence in
questions.json.
Diagnosis and repair of traceability/contradiction defects
- Critical: YES
- Canonical descriptor: see Q3 expected evidence in
questions.json.
Human decision on executable-example representation
- Critical: YES
- Canonical descriptor: see Q4 expected evidence in
questions.json.
Changed-context transfer to an independent specification
- Critical: YES
- Canonical descriptor: see Q5 expected evidence in
questions.json.
References & freshness
Case studies
Lesson media & slides
Teaching files (download)