sdtk-spec-kit 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/assets/manifest/toolkit-bundle.manifest.json +82 -37
  2. package/assets/manifest/toolkit-bundle.sha256.txt +27 -18
  3. package/assets/toolkit/toolkit/AGENTS.md +1 -1
  4. package/assets/toolkit/toolkit/README.md +4 -3
  5. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +9 -3
  6. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +111 -0
  7. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +103 -0
  8. package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +87 -0
  9. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +317 -246
  10. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +1 -1
  11. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +1 -1
  12. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +17 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +29 -4
  14. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +71 -0
  15. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +8 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +37 -0
  17. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +25 -0
  18. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +17 -0
  19. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +59 -57
  20. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +71 -0
  21. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +7 -0
  22. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +38 -2
  23. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +13 -2
  24. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -0
  25. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -0
  26. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +60 -29
  27. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +5 -1
  28. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +50 -0
  29. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +63 -0
  30. package/package.json +46 -46
@@ -0,0 +1,369 @@
1
+ # OPS_HANDOFF Creation Rules
2
+
3
+ Version: 0.1
4
+ Document Type: Creation Rules
5
+
6
+ ---
7
+
8
+ ## 1. Purpose
9
+
10
+ These creation rules define how to author an `OPS_HANDOFF` artifact for a bounded
11
+ small-app feature. The OPS_HANDOFF document bridges CODE-phase delivery to an
12
+ operational readiness review. It is a human-authored, human-reviewed guidance artifact.
13
+
14
+ The artifact path convention is:
15
+
16
+ `docs/dev/OPS_HANDOFF_[FEATURE_KEY].json`
17
+
18
+ This path is consistent with the broader toolkit artifact layout and must not be
19
+ changed without updating all referencing skill guidance, AGENTS.md, and handoff
20
+ template references.
21
+
22
+ ---
23
+
24
+ ## 2. Non-Claims
25
+
26
+ The following limitations apply to every OPS_HANDOFF document regardless of feature.
27
+ These must be preserved verbatim in every artifact authored against this schema.
28
+
29
+ 1. "This handoff is not a CI/CD pipeline configuration."
30
+ 2. "This handoff does not automate deployment."
31
+ 3. "This handoff does not replace human review before any deployment action."
32
+ 4. "This handoff does not configure a production monitoring or alerting platform."
33
+ 5. "This handoff does not provide automated rollback."
34
+ 6. "This handoff is starter-level guidance for a bounded small-app internal deployment only."
35
+
36
+ Authors may add feature-specific non_claims entries to the array, but the six entries
37
+ above are the minimum required set and must not be removed.
38
+
39
+ ---
40
+
41
+ ## 3. Schema Version
42
+
43
+ The current schema version is `"0.1"`. Every OPS_HANDOFF artifact must include:
44
+
45
+ ```json
46
+ "schema_version": "0.1"
47
+ ```
48
+
49
+ Future schema revisions will increment this value. Do not use schema version `"0.1"`
50
+ for artifacts that add fields or structures not defined in this document.
51
+
52
+ ---
53
+
54
+ ## 4. Required Fields
55
+
56
+ The OPS_HANDOFF JSON artifact must contain all of the following top-level fields.
57
+ Optional fields are described in Section 10.
58
+
59
+ | Field | Type | Notes |
60
+ |---|---|---|
61
+ | `schema_version` | string | Must be `"0.1"` for this release. |
62
+ | `feature_key` | string | Must match the CODE_HANDOFF feature_key for this feature. |
63
+ | `ops_handoff_status` | string | Either `"READY_FOR_OPS_REVIEW"` or `"BLOCKED_FOR_OPS_REVIEW"`. Human sets this after completing the document. |
64
+ | `source_handoff_ref` | string | Repo-relative path to the CODE_HANDOFF artifact that feeds this handoff (e.g., `"docs/dev/CODE_HANDOFF_SRT-001.json"`). |
65
+ | `non_claims` | array of strings | Minimum six entries as defined in Section 2. |
66
+ | `deploy_starter` | object | See Section 5. |
67
+ | `env_expectations` | array of objects | See Section 6. |
68
+ | `health_check_baseline` | object | See Section 7. |
69
+ | `monitoring_baseline` | object | See Section 8. |
70
+ | `rollback_starter` | object | See Section 9. |
71
+ | `human_gates` | array of objects | See Section 11. Gate H5 is the minimum required entry. |
72
+
73
+ ---
74
+
75
+ ## 5. deploy_starter Object
76
+
77
+ This object describes the bounded steps a human operator would take to start the
78
+ application in an initial deployment environment. It does not automate those steps
79
+ and does not claim cloud-platform management or auto-provisioning.
80
+
81
+ Required sub-fields:
82
+
83
+ | Sub-field | Type | Guidance |
84
+ |---|---|---|
85
+ | `runtime` | string | Runtime technology, e.g., `"node"`, `"python"`, `"docker"`. Match the tech stack documented in FEATURE_IMPL_PLAN. |
86
+ | `start_command` | string | The exact command a human would run to start the application. Must be a real command, not a placeholder. |
87
+ | `recommended_platform` | string | Deployment target appropriate for a bounded starter, e.g., `"local Docker"`, `"VPS"`, `"basic PaaS tier"`. Must not claim cloud-platform management or automatic provisioning. |
88
+ | `known_limitations` | array of strings | Explicit list of what this starter guidance does not handle. Include at minimum: load balancing, secrets rotation, auto-scaling, and any feature-specific operational gap. |
89
+
90
+ Authoring guidance:
91
+ - `start_command` must reflect the actual runtime entry point from CODE_HANDOFF.
92
+ Do not copy a placeholder command from a template without verifying the real command.
93
+ - `recommended_platform` must not imply that the feature is ready for production traffic.
94
+ - `known_limitations` must be non-empty. A starter deployment for a bounded small app
95
+ always has operational gaps relative to a production-grade deployment.
96
+
97
+ ---
98
+
99
+ ## 6. env_expectations Array
100
+
101
+ Each entry in this array documents one environment variable or configuration value
102
+ that the application requires before it can start or function correctly.
103
+
104
+ Each entry must contain:
105
+
106
+ | Sub-field | Type | Guidance |
107
+ |---|---|---|
108
+ | `name` | string | Environment variable name, e.g., `"DATABASE_URL"`. |
109
+ | `required` | boolean | `true` if the app cannot start or operate without this value. |
110
+ | `description` | string | Human-readable explanation of what this variable controls. |
111
+ | `example_value` | string | A safe placeholder, e.g., `"postgres://user:password@localhost:5432/dbname"`. Never include real credentials or real secrets. |
112
+ | `resolution_owner` | string | Who must supply the real value before deployment, e.g., `"deployer"`, `"operator"`, `"maintainer"`. |
113
+
114
+ Authoring guidance:
115
+ - Source env_expectations from the CODE_HANDOFF impact_map and ARCH_DESIGN.
116
+ - example_value entries must be clearly placeholder values. Do not copy real
117
+ credentials, tokens, or connection strings from any environment.
118
+ - If a variable is conditionally required (only in certain deployment modes),
119
+ set `required` to `false` and explain the condition in `description`.
120
+ - An empty env_expectations array is not valid for most real applications.
121
+ If no environment variables exist, document why that is true.
122
+
123
+ ---
124
+
125
+ ## 7. health_check_baseline Object
126
+
127
+ This object defines the minimum health signal that a human operator or monitoring
128
+ process can use to verify that the application started successfully.
129
+
130
+ Required sub-fields:
131
+
132
+ | Sub-field | Type | Guidance |
133
+ |---|---|---|
134
+ | `endpoint` | string | HTTP path for the health check, e.g., `"/health"` or `"/api/health"`. Must be a real endpoint implemented by the feature, not a hypothetical path. |
135
+ | `method` | string | HTTP method, typically `"GET"`. |
136
+ | `expected_status` | integer | Expected HTTP status code when the app is healthy, typically `200`. |
137
+ | `check_notes` | string | Human guidance for interpreting the response. Explain what a successful response looks like and what a failure means for this specific feature. |
138
+
139
+ Authoring guidance:
140
+ - Verify that the endpoint documented here is actually implemented in the feature
141
+ CODE_HANDOFF before authoring this section.
142
+ - `check_notes` must be specific to the feature, not generic. A reviewer reading
143
+ this field should know whether the app is healthy or not after checking the endpoint.
144
+ - If the feature does not expose an HTTP endpoint, adapt this section to the actual
145
+ health signal available (e.g., process liveness, queue depth check) and note the
146
+ deviation from the default HTTP pattern.
147
+
148
+ ---
149
+
150
+ ## 8. monitoring_baseline Object
151
+
152
+ This object defines the minimum observability posture for a starter deployment.
153
+ It does not configure a monitoring platform and does not claim that automated
154
+ alerting is available.
155
+
156
+ Required sub-fields:
157
+
158
+ | Sub-field | Type | Guidance |
159
+ |---|---|---|
160
+ | `key_signals` | array of strings | What a human operator should observe without a full monitoring platform. Examples: `"error log patterns"`, `"response time from health endpoint"`, `"queue depth if applicable"`. Must be non-empty. |
161
+ | `recommended_tooling` | string | Lightweight tooling appropriate for a starter deployment. Example: `"system logs plus manual health check endpoint polling"`. Must not claim a monitoring platform is configured or available. |
162
+ | `non_claim` | string | Explicit statement that this section is not a production monitoring suite. Author this as a complete, human-readable sentence. |
163
+
164
+ Authoring guidance:
165
+ - `key_signals` must be specific to the feature behavior. A reviewer should know
166
+ which signals to watch for this particular app, not generic server health.
167
+ - `recommended_tooling` must be achievable without purchasing or deploying a
168
+ monitoring platform. The recommended tooling is bounded to what a small team can
169
+ apply immediately.
170
+ - `non_claim` is distinct from the top-level `non_claims` array. This field lives
171
+ inside the monitoring_baseline object and provides a context-specific disclaimer.
172
+
173
+ ---
174
+
175
+ ## 9. rollback_starter Object
176
+
177
+ This object provides bounded, human-executable recovery steps for reverting to a
178
+ prior working state after a failed deployment. It does not implement or trigger
179
+ automated rollback.
180
+
181
+ Required sub-fields:
182
+
183
+ | Sub-field | Type | Guidance |
184
+ |---|---|---|
185
+ | `strategy` | string | High-level rollback approach, e.g., `"redeploy the previous image tag or git commit"`. Must be a real strategy available to the deployment target, not a generic description. |
186
+ | `manual_steps` | array of strings | Ordered, human-executable recovery steps. Each step must be concrete and specific to the feature deployment. Must not claim automated rollback. |
187
+ | `non_claim` | string | Explicit statement that this section does not provide automated rollback. Author as a complete human-readable sentence. |
188
+
189
+ Authoring guidance:
190
+ - `manual_steps` must reflect the actual deployment target documented in
191
+ `deploy_starter.recommended_platform`. Steps for a Docker-based deployment differ
192
+ from steps for a PaaS deployment.
193
+ - Every step must be something a human operator can execute without additional
194
+ tooling beyond what is already documented in `deploy_starter`.
195
+ - `non_claim` is required. A starter rollback procedure is a recovery guide,
196
+ not a rollback automation contract.
197
+
198
+ ---
199
+
200
+ ## 10. open_questions Array (Optional)
201
+
202
+ This array captures environment-specific or deployment-specific details that have
203
+ not yet been resolved at the time the OPS_HANDOFF is authored. Including this array
204
+ is optional, but strongly recommended whenever deployment details are still unknown.
205
+
206
+ Each entry must contain:
207
+
208
+ | Sub-field | Type | Guidance |
209
+ |---|---|---|
210
+ | `id` | string | Short identifier, e.g., `"OQ-01"`. Increment sequentially within the artifact. |
211
+ | `question` | string | Specific unresolved detail that must be answered before the deployment can proceed. |
212
+ | `resolution_owner` | string | Who must resolve this before Gate H5 can pass, e.g., `"deployer"`, `"operator"`, `"maintainer"`. |
213
+
214
+ Authoring guidance:
215
+ - An unresolved open_question does not by itself block authoring the artifact.
216
+ It does block setting `ops_handoff_status` to `"READY_FOR_OPS_REVIEW"` unless
217
+ the question is informational rather than blocking.
218
+ - If all open_questions are blocking, set `ops_handoff_status` to
219
+ `"BLOCKED_FOR_OPS_REVIEW"` and list the blocking questions explicitly.
220
+
221
+ ---
222
+
223
+ ## 11. human_gates Array
224
+
225
+ This array documents the required human checkpoints that must pass before any
226
+ deployment action may proceed. Every OPS_HANDOFF must include at minimum Gate H5.
227
+
228
+ Each gate entry must contain:
229
+
230
+ | Sub-field | Type | Guidance |
231
+ |---|---|---|
232
+ | `gate_id` | string | Identifier consistent with the broader golden path gate numbering. Gate H5 is the minimum required gate for OPS_HANDOFF review. |
233
+ | `description` | string | What a human must confirm at this gate. Must be specific to the deployment and feature, not generic. |
234
+ | `required_before` | string | What action this gate blocks, e.g., `"any deployment action"`. |
235
+
236
+ ### Gate H5: Minimum Required Entry
237
+
238
+ Every OPS_HANDOFF artifact must include Gate H5. The minimum required entry is:
239
+
240
+ ```json
241
+ {
242
+ "gate_id": "H5",
243
+ "description": "Controller reviews OPS_HANDOFF artifact and confirms all required fields are complete, non_claims are present, open_questions are resolved or explicitly deferred, and the feature is approved for an initial bounded deployment.",
244
+ "required_before": "any deployment action"
245
+ }
246
+ ```
247
+
248
+ Gate H5 must not be removed, weakened, or restated to imply that automated review
249
+ replaces human controller judgment.
250
+
251
+ Additional gates (e.g., `"H5a"`, `"H6"`) may be added for feature-specific
252
+ deployment checkpoints, but Gate H5 is always the minimum anchor.
253
+
254
+ ---
255
+
256
+ ## 12. Full Schema Example
257
+
258
+ The following is a minimal conforming example for a small app with one required
259
+ environment variable. Replace all placeholder values with real, feature-specific
260
+ values before submitting for review.
261
+
262
+ ```json
263
+ {
264
+ "schema_version": "0.1",
265
+ "feature_key": "FEATURE-001",
266
+ "ops_handoff_status": "BLOCKED_FOR_OPS_REVIEW",
267
+ "source_handoff_ref": "docs/dev/CODE_HANDOFF_FEATURE-001.json",
268
+ "non_claims": [
269
+ "This handoff is not a CI/CD pipeline configuration.",
270
+ "This handoff does not automate deployment.",
271
+ "This handoff does not replace human review before any deployment action.",
272
+ "This handoff does not configure a production monitoring or alerting platform.",
273
+ "This handoff does not provide automated rollback.",
274
+ "This handoff is starter-level guidance for a bounded small-app internal deployment only."
275
+ ],
276
+ "deploy_starter": {
277
+ "runtime": "python",
278
+ "start_command": "gunicorn app:app --bind 0.0.0.0:8000",
279
+ "recommended_platform": "local Docker or basic VPS",
280
+ "known_limitations": [
281
+ "No load balancing is configured.",
282
+ "No secrets rotation is configured.",
283
+ "No auto-scaling is configured.",
284
+ "Not suitable for production traffic without additional review."
285
+ ]
286
+ },
287
+ "env_expectations": [
288
+ {
289
+ "name": "DATABASE_URL",
290
+ "required": true,
291
+ "description": "Connection string for the application database.",
292
+ "example_value": "postgres://user:password@localhost:5432/dbname",
293
+ "resolution_owner": "deployer"
294
+ }
295
+ ],
296
+ "health_check_baseline": {
297
+ "endpoint": "/health",
298
+ "method": "GET",
299
+ "expected_status": 200,
300
+ "check_notes": "A 200 response indicates the app started and reached the database. A 500 or timeout indicates a startup failure; check application logs for the error."
301
+ },
302
+ "monitoring_baseline": {
303
+ "key_signals": [
304
+ "Application error log patterns (look for ERROR or CRITICAL entries).",
305
+ "Response time from the health endpoint (manual polling).",
306
+ "Database connection errors in application logs."
307
+ ],
308
+ "recommended_tooling": "System logs plus manual health check endpoint polling.",
309
+ "non_claim": "This monitoring baseline is not a production monitoring or alerting platform configuration."
310
+ },
311
+ "rollback_starter": {
312
+ "strategy": "Redeploy the previous Docker image tag or the previous git commit.",
313
+ "manual_steps": [
314
+ "Stop the current running container or process.",
315
+ "Pull or build the previous known-good image tag or checkout the previous commit.",
316
+ "Restart using the deploy_starter start_command with the previous build.",
317
+ "Confirm the health endpoint returns 200 before declaring recovery complete."
318
+ ],
319
+ "non_claim": "This rollback procedure is manual. No automated rollback is provided or implied."
320
+ },
321
+ "human_gates": [
322
+ {
323
+ "gate_id": "H5",
324
+ "description": "Controller reviews OPS_HANDOFF artifact and confirms all required fields are complete, non_claims are present, open_questions are resolved or explicitly deferred, and the feature is approved for an initial bounded deployment.",
325
+ "required_before": "any deployment action"
326
+ }
327
+ ],
328
+ "open_questions": [
329
+ {
330
+ "id": "OQ-01",
331
+ "question": "What is the target deployment environment hostname or IP address?",
332
+ "resolution_owner": "deployer"
333
+ }
334
+ ]
335
+ }
336
+ ```
337
+
338
+ ---
339
+
340
+ ## 13. Authoring Checklist
341
+
342
+ Before setting `ops_handoff_status` to `"READY_FOR_OPS_REVIEW"`, confirm:
343
+
344
+ - [ ] `schema_version` is `"0.1"`.
345
+ - [ ] `feature_key` matches the CODE_HANDOFF feature_key exactly.
346
+ - [ ] `source_handoff_ref` points to a real file that exists in the repo.
347
+ - [ ] `non_claims` contains all six minimum required entries from Section 2.
348
+ - [ ] `deploy_starter.start_command` is a real, verified command (not a placeholder).
349
+ - [ ] `deploy_starter.known_limitations` is non-empty.
350
+ - [ ] `env_expectations` entries contain safe placeholder `example_value` values only.
351
+ No real secrets, credentials, or connection strings.
352
+ - [ ] `health_check_baseline.endpoint` is implemented by the feature.
353
+ - [ ] `monitoring_baseline.non_claim` is present and accurate.
354
+ - [ ] `rollback_starter.non_claim` is present and accurate.
355
+ - [ ] `human_gates` contains Gate H5 with the minimum required wording.
356
+ - [ ] All `open_questions` that are blocking have been resolved, or
357
+ `ops_handoff_status` is set to `"BLOCKED_FOR_OPS_REVIEW"` with a clear explanation.
358
+ - [ ] No internal tracker IDs or review-only labels appear anywhere in the artifact.
359
+ - [ ] A human controller has reviewed and approved the artifact before any deployment
360
+ action proceeds.
361
+
362
+ ---
363
+
364
+ ## 14. Distribution Parity
365
+
366
+ Packaged distribution parity for this creation rules document is intentionally
367
+ deferred from the current batch. This file is a canonical toolkit template only.
368
+ Distribution payload sync is a separate controlled step and must not be performed
369
+ during the same batch that produces this template.
@@ -0,0 +1,276 @@
1
+ # CONDENSED UPSTREAM INPUT: {{FEATURE_KEY}}
2
+
3
+ **Document ID:** CONDENSED_UPSTREAM_INPUT_{{FEATURE_KEY}}
4
+ **Version:** 1.0.0
5
+ **Date:** {{DATE}}
6
+ **Author:** PM Agent (condensation step)
7
+ **Status:** REQUIRES_HUMAN_REVIEW
8
+
9
+ ---
10
+
11
+ > **REQUIRES_HUMAN_REVIEW**
12
+ >
13
+ > This document is a machine-assisted condensation of a basic product brief.
14
+ > All derived content below (actors, entities, screens, flows, rules, and
15
+ > acceptance criteria) is DRAFT only. A human PM or maintainer must review
16
+ > and confirm this package before the SPEC phase begins. SDTK must not
17
+ > auto-advance to PM or BA phases without explicit human confirmation (Gate H2).
18
+ >
19
+ > If the source brief was outside the agreed bounded domain, stop here and
20
+ > surface a boundary flag rather than proceeding (Gate H1).
21
+
22
+ ---
23
+
24
+ ## Input Statement
25
+
26
+ **Source brief:** Provide a one-line description of what was submitted as input.
27
+
28
+ **Approximate input length:** State the approximate word count of the source brief.
29
+
30
+ **Feature key assigned:** {{FEATURE_KEY}} (confirm or replace if the brief did not
31
+ include one; do not invent a feature key without human review).
32
+
33
+ **Condensation notes:** Record any material assumptions made during condensation
34
+ that were not explicit in the brief. List them as numbered items.
35
+
36
+ ---
37
+
38
+ ## 1. Actors
39
+
40
+ > Derived from the brief. Minimum: one requester-type role and one operator-type
41
+ > role. Mark additional roles with (implied) if not named explicitly in the brief.
42
+
43
+ | Role | Responsibility |
44
+ |------|----------------|
45
+ | Add derived actor rows here | One-line responsibility |
46
+
47
+ ---
48
+
49
+ ## 2. Entities
50
+
51
+ > Named data entities with key attributes at summary level. No full normalized
52
+ > data model required. Minimum: the primary request or work-item entity and its
53
+ > actor-linked entities.
54
+
55
+ | Entity | Key Attributes | Relationships |
56
+ |--------|----------------|---------------|
57
+ | Add derived entity rows here | Key attributes | Relationship notes |
58
+
59
+ ---
60
+
61
+ ## 3. Screen Candidates
62
+
63
+ > Candidate screens mapped to at least one actor. This is a candidate list only,
64
+ > not a final UI specification. Minimum: list screen, detail screen, creation
65
+ > form, and operator work-queue or dashboard.
66
+
67
+ | Screen | Purpose | Primary Actor |
68
+ |--------|---------|---------------|
69
+ | Add candidate screen rows here | One-sentence purpose | Actor |
70
+
71
+ ---
72
+
73
+ ## 4. Flows
74
+
75
+ > Named flows with start actor, trigger, key steps, and expected outcome.
76
+ > Minimum required flows: submit request, view requests, assign request,
77
+ > update status, close request.
78
+
79
+ ### Flow 1: [Flow Name]
80
+
81
+ - **Start actor:** Actor name
82
+ - **Trigger:** Triggering event
83
+ - **Key steps:**
84
+ 1. Step one
85
+ 2. Step two
86
+ - **Expected outcome:** Outcome
87
+
88
+ > Add additional named flows following the same structure.
89
+
90
+ ---
91
+
92
+ ## 5. Business Rules (DRAFT)
93
+
94
+ > All rules below are DRAFT and require human review before adoption.
95
+ > Rules are derived from the brief or implied by the bounded domain.
96
+
97
+ | ID | Rule | Source |
98
+ |----|------|--------|
99
+ | BR-D01 | Add derived rule | Brief / Implied |
100
+
101
+ ---
102
+
103
+ ## 6. Draft Acceptance Criteria (DRAFT)
104
+
105
+ > All criteria below are DRAFT. They seed the SPEC phase and require human
106
+ > review before adoption. Express in Given/When/Then form.
107
+
108
+ | ID | Given | When | Then | Linked Flow |
109
+ |----|-------|------|------|-------------|
110
+ | AC-D01 | Precondition | Action | Expected result | Flow name |
111
+
112
+ ---
113
+
114
+ ## Gaps
115
+
116
+ > List any areas where the brief did not provide enough signal to derive content
117
+ > confidently. Each gap must be addressed by the PM or maintainer before the
118
+ > SPEC phase can proceed.
119
+
120
+ | ID | Gap Description | Needed By |
121
+ |----|----------------|-----------|
122
+ | GAP-01 | Describe what is missing | PM / BA phase |
123
+
124
+ ---
125
+
126
+ ## Approval/Workflow Domain Extension
127
+
128
+ > **Use this extension only for approval/workflow domain briefs.**
129
+ > For service/request tracker and other non-approval/workflow domains, omit
130
+ > this section entirely.
131
+ >
132
+ > When the source brief describes a request-approval pattern (e.g., leave
133
+ > approval, purchase approval, access request), the condensed upstream output
134
+ > document must use a **flat eight-section structure** rather than the base
135
+ > six-section structure above. The output document begins with the same
136
+ > REQUIRES_HUMAN_REVIEW header, Input Statement, and Next Step blocks, but
137
+ > replaces all numbered sections with the eight sections below, numbered
138
+ > consecutively. Do not append these subsections after a completed base
139
+ > six-section document; instead, produce the approval/workflow flat structure
140
+ > as the single unified output document.
141
+ >
142
+ > Section mapping from base to approval/workflow flat structure:
143
+ > - Section 1 Actors: same content and purpose as base Section 1. No change.
144
+ > - Section 2 Role Matrix: new section. Supplements Section 1 Actors with a
145
+ > permission table. Must surface ambiguities rather than silently resolving
146
+ > them.
147
+ > - Section 3 Workflow Entities: replaces base Section 2 Entities. Same
148
+ > purpose but must include workflow-state-carrying fields explicitly.
149
+ > - Section 4 State Set: new section. Makes the workflow state machine
150
+ > explicit with named states and terminal flags.
151
+ > - Section 5 State Transitions: new section. Lists all allowed and blocked
152
+ > transitions with guard conditions and policy constraints.
153
+ > - Section 6 Policy And Approval Rules: replaces base Section 5 Business
154
+ > Rules. Same DRAFT-labelled purpose; approval-specific rule set.
155
+ > - Section 7 Screens And Interaction Points: replaces base Sections 3 and 4
156
+ > (Screen Candidates and Flows). For approval/workflow domains, named
157
+ > screens and interaction points provide sufficient upstream structure.
158
+ > - Section 8 Draft Acceptance Criteria: same as base Section 6 but the last
159
+ > column header is "Linked Transition" (not "Linked Flow") because criteria
160
+ > anchor to state transitions rather than named flows in this domain.
161
+ > - Open Questions For Human Review: replaces the base Gaps section. Must
162
+ > surface unresolved policy items explicitly with phase-owner tagging.
163
+ >
164
+ > Gate H3 (Policy Open Questions Review): all open questions in the Open
165
+ > Questions section must be reviewed by the PM or maintainer before the SPEC
166
+ > phase proceeds. Each question must be resolved with an explicit decision or
167
+ > carried forward as a named OQ-xx item into the BA_SPEC phase. Questions
168
+ > must not be silently dropped.
169
+ >
170
+ > For approval/workflow outputs, replace the generic Next Step instruction
171
+ > "Resolve all gaps listed above" with explicit review and resolution of the
172
+ > Open Questions For Human Review section under Gate H3.
173
+
174
+ ### 2. Role Matrix
175
+
176
+ > A table mapping each actor to their permitted actions within the workflow.
177
+ > Mark each cell as YES, NO, or POLICY (permission depends on a configurable
178
+ > rule not fully specified in the brief). Surface any permission ambiguity;
179
+ > do not silently resolve it. At least one POLICY-tagged cell or one open
180
+ > question must appear if the brief does not fully specify all permissions.
181
+
182
+ | Actor | Can Submit | Can Approve | Can Reject | Can Request Revision | Can Resubmit | Can Delegate | Can Admin-Configure |
183
+ |-------|-----------|-------------|------------|---------------------|-------------|-------------|---------------------|
184
+ | Add actor rows here | YES / NO / POLICY | YES / NO / POLICY | YES / NO / POLICY | YES / NO / POLICY | YES / NO / POLICY | YES / NO / POLICY | YES / NO / POLICY |
185
+
186
+ ### 3. Workflow Entities
187
+
188
+ > Named data entities with key attributes at summary level. Must include
189
+ > workflow-state-carrying fields explicitly. Minimum: Request entity (with
190
+ > state attribute), Submitter entity, Approver entity, WorkflowState entity
191
+ > or enumeration. No full normalized data model required at this stage.
192
+
193
+ | Entity | Key Attributes | Relationships |
194
+ |--------|----------------|---------------|
195
+ | Add entity rows here | Key attributes including state field | Relationship notes |
196
+
197
+ ### 4. State Set
198
+
199
+ > An explicit named list of all workflow states the Request entity can occupy.
200
+ > Each state must have a name, brief description, responsible actor, and a
201
+ > terminal flag (YES or NO). Minimum required states: Draft, Submitted, Under
202
+ > Review, Approved (terminal: YES), Rejected, Revision Required.
203
+
204
+ | State | Description | Responsible Actor | Terminal |
205
+ |-------|-------------|------------------|----------|
206
+ | Add state rows here | One-line description | Actor responsible at this state | YES / NO |
207
+
208
+ ### 5. State Transitions
209
+
210
+ > An explicit named list of allowed state transitions. Each transition must
211
+ > have: from-state, to-state, triggering actor, triggering action, and any
212
+ > guard condition or policy constraint. Mark policy-dependent transitions as
213
+ > POLICY and flag for human review. Explicitly list blocked transitions with
214
+ > the block reason.
215
+
216
+ | From State | To State | Triggering Actor | Triggering Action | Guard / Constraint |
217
+ |-----------|----------|-----------------|------------------|-------------------|
218
+ | Add transition rows here | | | | |
219
+
220
+ ### 6. Policy And Approval Rules (DRAFT)
221
+
222
+ > All rules below are DRAFT and require human review before adoption. These
223
+ > rules govern approval logic, delegation, escalation, and boundary conditions.
224
+ > Each rule must carry the DRAFT label.
225
+
226
+ | ID | Rule | DRAFT |
227
+ |----|------|-------|
228
+ | APR-D01 | Add derived approval policy rule | DRAFT |
229
+
230
+ ### 7. Screens And Interaction Points
231
+
232
+ > Named candidate screens and interaction points with one-sentence purpose,
233
+ > mapped to at least one actor. This replaces the base Screen Candidates and
234
+ > Flows sections for approval/workflow domains. Minimum required screens:
235
+ > Submit Request Form, Submitter Status View, Approver Work Queue, Request
236
+ > Detail with Action Panel, Revision Detail View.
237
+
238
+ | Screen | Purpose | Primary Actor |
239
+ |--------|---------|---------------|
240
+ | Add candidate screen rows here | One-sentence purpose | Actor |
241
+
242
+ ### 8. Draft Acceptance Criteria (DRAFT)
243
+
244
+ > All criteria below are DRAFT and require human review before adoption.
245
+ > Express in Given/When/Then form. The last column is "Linked Transition"
246
+ > because criteria anchor to state transitions in this domain.
247
+
248
+ | ID | Given | When | Then | Linked Transition |
249
+ |----|-------|------|------|------------------|
250
+ | AC-D01 | Precondition | Action | Expected result | Transition name |
251
+
252
+ ### Open Questions For Human Review
253
+
254
+ > Use this section instead of the standard Gaps section for approval/workflow
255
+ > domain condensed packages. Each open question must be numbered, described in
256
+ > one sentence, and tagged with the phase that owns resolution (PM or BA). At
257
+ > least two unresolved policy questions must appear if the brief does not
258
+ > explicitly answer quorum rules and delegation rules.
259
+
260
+ | ID | Open Question | Phase Owner |
261
+ |----|--------------|-------------|
262
+ | OQ-01 | Describe an unresolved policy or domain question | PM / BA |
263
+
264
+ ---
265
+
266
+ ## Next Step
267
+
268
+ After human review of this document:
269
+
270
+ 1. Confirm feature key {{FEATURE_KEY}} is correct.
271
+ 2. Resolve all gaps listed above.
272
+ 3. Use this package as structured input to the PM initiation step:
273
+ `@pm please create PROJECT_INITIATION_{{FEATURE_KEY}}.md`
274
+
275
+ Do not advance to the PM or BA phase until this document has been explicitly
276
+ confirmed by the PM or maintainer (Gate H2).