You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .specify/templates/spec-template.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,18 @@ When creating this spec from a user prompt:
82
82
-**[Entity 1]**: [What it represents, key attributes without implementation]
83
83
-**[Entity 2]**: [What it represents, relationships to other entities]
84
84
85
+
## Risk Register *(mandatory)*
86
+
Document the critical risks the team must mitigate. Capture each risk on its own line using the canonical format so downstream automation can parse it:
87
+
88
+
-`- RISK: R1 | Statement: Unauthorized access to admin endpoints | Impact: High | Likelihood: Medium | Test: Assert RBAC denies non-admin roles`
Copy file name to clipboardExpand all lines: templates/commands/implement.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ User input:
11
11
12
12
$ARGUMENTS
13
13
14
-
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
14
+
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR, AVAILABLE_DOCS, SPEC_RISKS, and PLAN_RISKS. All paths must be absolute.
15
15
16
16
2. Verify feature context:
17
17
- Load `context.md` from FEATURE_DIR.
@@ -25,6 +25,7 @@ $ARGUMENTS
25
25
-**IF EXISTS**: Read research.md for technical decisions and constraints
26
26
-**IF EXISTS**: Read quickstart.md for integration scenarios
27
27
- Extract the Execution Mode for each task (`[SYNC]` or `[ASYNC]`) and ensure every task is explicitly tagged. STOP and raise an error if any tasks lack a mode.
28
+
- Consolidate the Risk Register by merging SPEC_RISKS and PLAN_RISKS. Ensure every Risk ID listed in tasks.md has a corresponding definition (statement, mitigation, test strategy, evidence artefact). STOP if any gaps remain.
-**Polish and validation**: Unit tests, performance optimization, documentation
52
+
-**Risk validation**: For each `[SYNC]` risk test task (`TRxx`), execute the specified tests, capture pass/fail output, and record the evidence in the artefact defined by plan.md (e.g., `risk-tests/R1.log` or the Risk Evidence Log table).
51
53
52
54
7. Progress tracking and error handling:
53
55
- Report progress after each completed task
@@ -56,6 +58,7 @@ $ARGUMENTS
56
58
- Provide clear error messages with context for debugging
57
59
- Suggest next steps if implementation cannot proceed
58
60
-**IMPORTANT** For completed tasks, mark the task off as `[X]` in tasks.md while preserving `[SYNC]/[ASYNC]` tags and [P] markers.
61
+
- Update the **Risk Evidence Log** in tasks.md with the test task ID, evidence artefact, and a concise summary (include command executed and assertion outcome). Missing evidence is a blocker for completion.
Copy file name to clipboardExpand all lines: templates/commands/tasks.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ User input:
11
11
12
12
$ARGUMENTS
13
13
14
-
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
14
+
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR, AVAILABLE_DOCS, SPEC_RISKS, and PLAN_RISKS. All paths must be absolute.
15
15
2. Load and validate `context.md` from the feature directory:
16
16
- STOP if the file is missing or contains `[NEEDS INPUT]` markers.
17
17
- Capture mission highlights, relevant code paths, directives, and gateway status for downstream reasoning.
@@ -28,7 +28,12 @@ $ARGUMENTS
28
28
- Simple libraries might not need data-model.md
29
29
- Generate tasks based on what's available
30
30
31
-
4. Generate tasks following the template:
31
+
4. Build a consolidated Risk Register:
32
+
- Merge SPEC_RISKS and PLAN_RISKS by `id` (Risk ID). If the same risk appears in both, prefer the richer description from plan.md for mitigation details.
33
+
- STOP and prompt the developer if the spec declares risks but the plan lacks matching mitigation/test strategy rows.
34
+
- For each consolidated risk, capture: `id`, `statement`, `impact`, `likelihood`, `test` (focus), and `evidence` (artefact path). Missing fields must be escalated to the developer.
35
+
36
+
5. Generate tasks following the template:
32
37
- Use `/templates/tasks-template.md` as the base
33
38
- Replace example tasks with actual tasks based on:
***Integration tasks**: DB connections, middleware, logging
38
43
***Polish tasks [P]**: Unit tests, performance, docs
39
44
- For every task, append the Execution Mode tag `[SYNC]` or `[ASYNC]` as dictated by the plan. Never invent a mode—ask the developer when absent.
45
+
- Introduce dedicated `[SYNC]` risk test tasks (prefix `TR`) for each Risk ID, referencing the exact file path to implement and the evidence artefact where `/implement` must store test output.
40
46
41
-
5. Task generation rules:
47
+
6. Task generation rules:
42
48
- Each contract file → contract test task marked [P]
43
49
- Each entity in data-model → model creation task marked [P]
44
50
- Each endpoint → implementation task (not parallel if shared files)
45
51
- Each user story → integration test marked [P]
46
52
- Different files = can be parallel [P]
47
53
- Same file = sequential (no [P])
48
54
- Preserve the Execution Mode from the plan so downstream tooling can enforce SYNC vs ASYNC workflows.
55
+
- Every Risk ID MUST have at least one `[SYNC]` test task with a clearly defined evidence artefact. If multiple mitigations exist, generate a task per mitigation/test.
49
56
50
-
6. Order tasks by dependencies:
57
+
7. Order tasks by dependencies:
51
58
- Setup before everything
52
59
- Tests before implementation (TDD)
53
60
- Models before services
54
61
- Services before endpoints
55
62
- Core before integration
56
63
- Everything before polish
57
64
58
-
7. Include parallel execution examples:
65
+
8. Include parallel execution examples:
59
66
- Group [P] tasks that can run together
60
67
- Show actual Task agent commands
61
68
62
-
8. Create FEATURE_DIR/tasks.md with:
69
+
9. Create FEATURE_DIR/tasks.md with:
63
70
- Correct feature name from implementation plan
64
71
- Numbered tasks (T001, T002, etc.)
65
72
- Clear file paths for each task
66
73
- Dependency notes
67
74
- Parallel execution guidance
75
+
- Updated **Risk Evidence Log** table populated with Risk IDs and placeholder evidence entries (`TBD`) for `/implement` to update.
-`Evidence Artefact` states where `/implement` must record the passing test output (e.g., `specs/001-feature/risk-test-evidence.md`).
88
+
78
89
### Source Code (repository root)
79
90
<!--
80
91
ACTION REQUIRED: Replace the placeholder tree below with the concrete layout
@@ -186,6 +197,7 @@ directories captured above]
186
197
- Each user story → integration test task
187
198
- Implementation tasks to make tests pass
188
199
- Carry forward the Execution Mode from the Triage Overview: annotate each generated task with `[SYNC]` or `[ASYNC]` based on the finalized plan decision.
200
+
- For every risk entry, generate at least one dedicated `[SYNC]` test task referencing the Risk ID and the evidence artefact.
0 commit comments