shapeup-sdlc 1.6.2

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 (135) hide show
  1. package/.claude/settings.local.example.json +20 -0
  2. package/.claude-plugin/marketplace.json +16 -0
  3. package/.claude-plugin/plugin.json +18 -0
  4. package/.env.shapeup.example +14 -0
  5. package/AGENTS.md +133 -0
  6. package/LICENSE +21 -0
  7. package/README.md +362 -0
  8. package/SECURITY.md +72 -0
  9. package/bin/init.mjs +329 -0
  10. package/commands/build.md +14 -0
  11. package/commands/eval.md +15 -0
  12. package/commands/hammer.md +12 -0
  13. package/commands/orient.md +11 -0
  14. package/commands/qa.md +12 -0
  15. package/commands/retro.md +13 -0
  16. package/commands/scopes.md +14 -0
  17. package/commands/shape.md +12 -0
  18. package/commands/ship.md +53 -0
  19. package/commands/wire.md +11 -0
  20. package/hooks/anti-rationalization.mjs +244 -0
  21. package/hooks/compact-snapshot.mjs +47 -0
  22. package/hooks/gate-deadline.mjs +151 -0
  23. package/hooks/gate-intake.mjs +110 -0
  24. package/hooks/gate-l2.mjs +161 -0
  25. package/hooks/gate-zerowork.mjs +264 -0
  26. package/hooks/hooks.json +118 -0
  27. package/hooks/lib/decision.mjs +183 -0
  28. package/hooks/safety-spine.mjs +296 -0
  29. package/hooks/sandbox-guard.mjs +172 -0
  30. package/hooks/session-rehydrate.mjs +109 -0
  31. package/hooks/slop-cleaner.mjs +176 -0
  32. package/oracles/_shared.mjs +46 -0
  33. package/oracles/http-oracle.mjs +155 -0
  34. package/oracles/index.mjs +36 -0
  35. package/oracles/process-oracle.mjs +146 -0
  36. package/oracles/snapshot-oracle.mjs +119 -0
  37. package/oracles/test-oracle.mjs +138 -0
  38. package/package.json +49 -0
  39. package/skills/advisor-protocol/SKILL.md +171 -0
  40. package/skills/ba-pitch-analyzer/SKILL.md +175 -0
  41. package/skills/ba-pitch-analyzer/assets/templates/_index.tmpl.md +84 -0
  42. package/skills/ba-pitch-analyzer/assets/templates/api-feasibility.tmpl.md +65 -0
  43. package/skills/ba-pitch-analyzer/assets/templates/assess-report.tmpl.md +127 -0
  44. package/skills/ba-pitch-analyzer/assets/templates/contracts/be-service.contract.tmpl.md +62 -0
  45. package/skills/ba-pitch-analyzer/assets/templates/contracts/offline-storage.contract.tmpl.md +92 -0
  46. package/skills/ba-pitch-analyzer/assets/templates/contracts/third-party-api.contract.tmpl.md +66 -0
  47. package/skills/ba-pitch-analyzer/assets/templates/cross-context/context-map.tmpl.md +64 -0
  48. package/skills/ba-pitch-analyzer/assets/templates/cross-context/event-choreography.tmpl.md +77 -0
  49. package/skills/ba-pitch-analyzer/assets/templates/cross-context/migration-plan.tmpl.md +104 -0
  50. package/skills/ba-pitch-analyzer/assets/templates/cross-context/team-handoff.tmpl.md +79 -0
  51. package/skills/ba-pitch-analyzer/assets/templates/domain-model.tmpl.md +79 -0
  52. package/skills/ba-pitch-analyzer/assets/templates/feedback.tmpl.md +87 -0
  53. package/skills/ba-pitch-analyzer/assets/templates/integration.tmpl.md +64 -0
  54. package/skills/ba-pitch-analyzer/assets/templates/run-state.tmpl.md +77 -0
  55. package/skills/ba-pitch-analyzer/assets/templates/scope-summary.tmpl.md +105 -0
  56. package/skills/ba-pitch-analyzer/assets/templates/synthesis.tmpl.md +215 -0
  57. package/skills/ba-pitch-analyzer/assets/templates/task-board.tmpl.md +35 -0
  58. package/skills/ba-pitch-analyzer/assets/templates/task-spike.tmpl.md +86 -0
  59. package/skills/ba-pitch-analyzer/assets/templates/task.tmpl.md +84 -0
  60. package/skills/ba-pitch-analyzer/assets/templates/usecase.tmpl.md +105 -0
  61. package/skills/ba-pitch-analyzer/assets/templates/ux-behavior.tmpl.md +65 -0
  62. package/skills/ba-pitch-analyzer/references/contract-patterns.md +152 -0
  63. package/skills/ba-pitch-analyzer/references/ddd-patterns.md +173 -0
  64. package/skills/ba-pitch-analyzer/references/doc-schemas.md +275 -0
  65. package/skills/ba-pitch-analyzer/references/integration-analysis.md +152 -0
  66. package/skills/ba-pitch-analyzer/references/task-generation.md +623 -0
  67. package/skills/ba-pitch-analyzer/references/test-surface.md +102 -0
  68. package/skills/ba-pitch-analyzer/references/ux-behavior-patterns.md +269 -0
  69. package/skills/ba-pitch-analyzer/scripts/board-derive.mjs +241 -0
  70. package/skills/ba-pitch-analyzer/scripts/spec-lint.mjs +239 -0
  71. package/skills/coach/SKILL.md +202 -0
  72. package/skills/orient/SKILL.md +262 -0
  73. package/skills/qa-edge-hunter/SKILL.md +369 -0
  74. package/skills/scope-architect/SKILL.md +111 -0
  75. package/skills/scope-hammer/SKILL.md +186 -0
  76. package/skills/shapeup/SKILL.md +403 -0
  77. package/skills/shapeup/resources/breadboard-reflection.md +88 -0
  78. package/skills/shapeup/resources/breadboarding.md +334 -0
  79. package/skills/shapeup/resources/context-compaction.md +240 -0
  80. package/skills/shapeup/resources/framing-doc.md +92 -0
  81. package/skills/shapeup/resources/kickoff-doc.md +95 -0
  82. package/skills/shapeup/resources/shaping.md +194 -0
  83. package/skills/shapeup/resources/spike.md +86 -0
  84. package/skills/solution-architect/SKILL.md +129 -0
  85. package/skills/spec-evaluator/README.md +93 -0
  86. package/skills/spec-evaluator/SKILL.md +213 -0
  87. package/skills/spec-evaluator/references/anti-leniency.md +50 -0
  88. package/skills/spec-evaluator/references/dimension-contract.md +126 -0
  89. package/skills/spec-evaluator/references/dimensions/_registry.md +40 -0
  90. package/skills/spec-evaluator/references/dimensions/completeness.md +102 -0
  91. package/skills/spec-evaluator/references/dimensions/integration.md +129 -0
  92. package/skills/spec-evaluator/references/dimensions/performance.md +48 -0
  93. package/skills/spec-evaluator/references/dimensions/security.md +60 -0
  94. package/skills/spec-evaluator/references/dimensions/spec-conformance.md +134 -0
  95. package/skills/spec-evaluator/references/dimensions/tdd-surface.md +110 -0
  96. package/skills/spec-evaluator/references/dimensions/test-surface-conformance.md +100 -0
  97. package/skills/spec-evaluator/references/probing.md +177 -0
  98. package/skills/spec-evaluator/references/report-schema.md +101 -0
  99. package/skills/spec-evaluator/references/verdict-ledger.md +92 -0
  100. package/skills/spec-evaluator/scripts/verdict-ledger.mjs +166 -0
  101. package/skills/task-executor/SKILL.md +194 -0
  102. package/skills/tech-lead/README.md +71 -0
  103. package/skills/tech-lead/SKILL.md +459 -0
  104. package/skills/tech-lead/references/delegation.md +254 -0
  105. package/skills/tech-lead/references/gates.md +379 -0
  106. package/skills/tech-lead/references/invocation.md +45 -0
  107. package/skills/tech-lead/references/ledger-schema.md +214 -0
  108. package/skills/tech-lead/references/round-protocol.md +184 -0
  109. package/skills/tech-lead/references/state-model.md +66 -0
  110. package/skills/tech-lead/references/tiny-lane.md +52 -0
  111. package/skills/tech-lead/schemas/domain.schema.json +2294 -0
  112. package/skills/tech-lead/schemas/gate-answers.schema.json +92 -0
  113. package/skills/tech-lead/schemas/work-order.schema.json +21 -0
  114. package/skills/tech-lead/schemas/work-result.schema.json +40 -0
  115. package/skills/tech-lead/scripts/aegis-digest.mjs +124 -0
  116. package/skills/tech-lead/scripts/budget-check.mjs +156 -0
  117. package/skills/tech-lead/scripts/compile-order.mjs +518 -0
  118. package/skills/tech-lead/scripts/fit-check.mjs +196 -0
  119. package/skills/tech-lead/scripts/gate-answers.mjs +338 -0
  120. package/skills/tech-lead/scripts/ingest-result.mjs +270 -0
  121. package/skills/tech-lead/scripts/init-run.mjs +326 -0
  122. package/skills/tech-lead/scripts/lib/argv.mjs +224 -0
  123. package/skills/tech-lead/scripts/lib/contract-md.mjs +481 -0
  124. package/skills/tech-lead/scripts/lib/is-main.mjs +82 -0
  125. package/skills/tech-lead/scripts/lib/paths.mjs +278 -0
  126. package/skills/tech-lead/scripts/lib/ratchet-tree.mjs +112 -0
  127. package/skills/tech-lead/scripts/run-snapshot.mjs +269 -0
  128. package/skills/tech-lead/scripts/ship-report.mjs +275 -0
  129. package/skills/tech-lead/scripts/stats.mjs +423 -0
  130. package/skills/tech-lead/scripts/t0-verify.mjs +470 -0
  131. package/skills/tech-lead/scripts/trace-lint.mjs +367 -0
  132. package/skills/tech-lead/scripts/validate-envelope.mjs +283 -0
  133. package/skills/translator/README.md +66 -0
  134. package/skills/translator/SKILL.md +258 -0
  135. package/skills/translator/references/preservation-rules.md +102 -0
@@ -0,0 +1,215 @@
1
+ ---
2
+ type: synthesis
3
+ feature: FEATURE_SLUG
4
+ generated_at: YYYY-MM-DD
5
+ skill_version: "2.8"
6
+ coverage_status: 🟢 | 🟡 | 🔴
7
+ risk_status: 🟢 | 🟡 | 🔴
8
+ dependency_status: 🟢 | 🟡 | 🔴
9
+ depends_on:
10
+ - "[[domain-model]]"
11
+ - "[[ux-behavior]]"
12
+ - "[[usecases/_index]]"
13
+ - "[[scope-summary]]"
14
+ ---
15
+
16
+ # Synthesis: FEATURE TITLE
17
+
18
+ > **How to use this document:**
19
+ > Read the Health Dashboard first (30 seconds).
20
+ > Each indicator tells you which section to open next — skip green sections.
21
+ > 🟢 = no action needed · 🟡 = review recommended · 🔴 = must resolve before execution
22
+
23
+ ---
24
+
25
+ ## Health Dashboard
26
+
27
+ | Indicator | Status | Signal |
28
+ |-----------|--------|--------|
29
+ | Coverage | COVERAGE_STATUS | COVERAGE_SIGNAL |
30
+ | Risk | RISK_STATUS | RISK_SIGNAL |
31
+ | Dependency | DEPENDENCY_STATUS | DEPENDENCY_SIGNAL |
32
+
33
+ ### Execution Gate (Synthesis)
34
+
35
+ <!--
36
+ ✅ PASS = Coverage 🟢 AND Risk 🟢
37
+ ⚠️ REVIEW = any indicator 🟡, none 🔴
38
+ 🚫 BLOCK = any indicator 🔴
39
+ -->
40
+ SYNTHESIS_GATE
41
+
42
+ *Combine with Audit score gate: both must pass for autonomous `/execute-plan`.*
43
+
44
+ ---
45
+
46
+ ## S-01 — Traceability Matrix
47
+
48
+ > Open this section when **Coverage** is 🟡 or 🔴.
49
+
50
+ Derived from: `use_case_refs` in each task frontmatter — the single link source (v3.3: UC
51
+ frontmatter carries no back-link; reverse lookup is always computed live from the task board).
52
+
53
+ ### UC × Task Coverage
54
+
55
+ <!--
56
+ Coverage is DERIVED by inverting each task's use_case_refs over the LOCAL board
57
+ (.shapeup/<slug>/tasks/) at generation time. Record only the count + status —
58
+ never task ids or [[tasks/...]] links: ids are machine-local (boards regenerate and
59
+ renumber) and this doc is committed. Tier rule: links flow LOCAL → SHARED only;
60
+ spec-lint flags [[tasks/...]] here as a red TIER-DIRECTION finding.
61
+ Status key:
62
+ ✅ covered = ≥ 1 task with this UC in use_case_refs
63
+ ❌ missing = no task references this UC
64
+ -->
65
+
66
+ | Use Case | Actor | Covering Tasks | Status |
67
+ |----------|-------|----------------|--------|
68
+ | [[usecases/UC-Name]] | Actor | 3 | ✅ covered |
69
+ | [[usecases/UC-Name]] | Actor | 0 | ❌ missing |
70
+
71
+ **Coverage gaps (❌ items above — must resolve before execution):**
72
+ - [ ] UC-[Name]: no tasks found — create task or mark UC as deferred in Non-Go
73
+
74
+ ### UC × Entity Participation
75
+
76
+ <!--
77
+ For each UC row: list entities from its frontmatter `entities` field.
78
+ Role key:
79
+ actor = UC operates ON this entity (create/update/delete)
80
+ target = UC reads this entity
81
+ emits = UC emits a domain event on this entity
82
+ -->
83
+
84
+ | Use Case | Entity | Role |
85
+ |----------|--------|------|
86
+ | [[usecases/UC-Name]] | `EntityName` | actor |
87
+ | [[usecases/UC-Name]] | `EntityName` | target |
88
+
89
+ **Entity orphans (entities in domain-model with no UC reference):**
90
+ <!--
91
+ 🔴 orphan = aggregate root entity with no UC reference → coverage gap
92
+ 🟡 orphan = value object or child entity with no UC reference → acceptable
93
+ -->
94
+ - `EntityName` — aggregate root — 🔴 no UC references this entity
95
+
96
+ ### Screen → UC Backing
97
+
98
+ <!--
99
+ For each screen in ux-behavior.md `screens` frontmatter:
100
+ Check if at least one UC in ux-behavior `usecases` frontmatter references it.
101
+ ❌ unbacked screen = screen with no UC → UX spec is ahead of domain model
102
+ -->
103
+
104
+ | Screen | Backed By | Status |
105
+ |--------|-----------|--------|
106
+ | ScreenName | [[usecases/UC-Name]] | ✅ |
107
+ | ScreenName | — | ❌ no UC |
108
+
109
+ ### Domain Event Flow
110
+
111
+ <!--
112
+ For each domain event in domain-model `domain_events` frontmatter:
113
+ Check if any UC has it in `domain_events_emitted`.
114
+ Check if integration.md has a consumer for it.
115
+ dead-end = event emitted but no consumer declared in integration.md
116
+ -->
117
+
118
+ | Event | Emitted By UC | Consumer (integration.md) | Status |
119
+ |-------|--------------|--------------------------|--------|
120
+ | `EventName` | [[usecases/UC-Name]] | [[integration#Section]] | ✅ |
121
+ | `EventName` | [[usecases/UC-Name]] | — | ⚠️ dead-end |
122
+
123
+ ---
124
+
125
+ ## S-02 — Risk Register
126
+
127
+ > Open this section when **Risk** is 🟡 or 🔴.
128
+
129
+ Derived from: `_index.md` rabbit holes + `api-feasibility.md` SPIKE blocks + `integration.md` external deps.
130
+
131
+ ### SPIKE Risks
132
+
133
+ <!-- Only present if api-feasibility.md exists -->
134
+
135
+ | Ref | Third-Party | Capability Claimed | Investigation | Time Box | Status |
136
+ |-----|------------|-------------------|---------------|----------|--------|
137
+ | API-01 | ServiceName | what pitch assumes | [[api-feasibility#API-01]] | Nh | ⏳ open |
138
+
139
+ **Risk formula:** SPIKE risk is 🔴 when any SPIKE `time_box_hours` × (number of blocked tasks) > 20% of appetite hours.
140
+
141
+ ### Rabbit Hole Register
142
+
143
+ | Risk | From | Likelihood | Mitigation | Status |
144
+ |------|------|-----------|------------|--------|
145
+ | [risk description] | [[_index#Rabbit Holes]] | high/med/low | [mitigation] | ✅ mitigated |
146
+ | [risk description] | [[_index#Rabbit Holes]] | high | — | ❌ no mitigation |
147
+
148
+ **Unmitigated risks (❌ items — PO must decide: accept, mitigate, or cut scope):**
149
+ - [ ] [risk] — no mitigation declared
150
+
151
+ ### External Dependency Risks
152
+
153
+ | Dependency | Declared In | Type | Unblock Condition |
154
+ |------------|------------|------|------------------|
155
+ | ENV_VAR_NAME | [[integration#Env]] | env var | add to `.env.example` |
156
+ | External Account | [[integration#Setup]] | sandbox | provision before sprint |
157
+
158
+ ### Hammered Out (Cut)
159
+
160
+ <!--
161
+ The SINGLE source of truth for tasks that were scope-hammered out of the cycle.
162
+ A Cut produces NO task file (no bet yet, so no spec). Only record a trace line here.
163
+ Mostly populated/appended by the reconcile operation over the discovered ledger.
164
+ Each line: what was cut — Cut @ GATE-N · reason · (if hammer-traded) which task it was traded for.
165
+ -->
166
+
167
+ | Cut | At | Reason | Traded for (if any) |
168
+ |-----|-----|-------|---------------------|
169
+ | ~~[cut capability]~~ | GATE-N | appetite overflow — saved for a later bet | TASK-NNN |
170
+
171
+ *A Cut is a healthy shaping signal, not debt. Revisit it at the betting table next cycle.*
172
+
173
+ ---
174
+
175
+ ## S-03 — Dependency Graph
176
+
177
+ > Open this section when **Dependency** is 🟡 or 🔴, or when planning parallel work.
178
+
179
+ Derived from: `depends_on` and `unlocks` in every task frontmatter + `estimated_hours`.
180
+
181
+ ### Critical Path
182
+
183
+ ```
184
+ Critical path: N tasks · NN hours · NN% of total estimated hours
185
+
186
+ TASK-001 [SPIKE] spike-[api]-feasibility 2h
187
+ └─ blocks ──► TASK-004, TASK-005, TASK-006
188
+ TASK-002 [TASK] shared-schema 3h ← parallel (no dependency on 001)
189
+ TASK-003 [TASK] contract-stub 2h ← parallel
190
+ TASK-004 [FEAT] implement-[repo] ⏳ blocked by TASK-001 4h
191
+ └─ blocks ──► TASK-005
192
+ TASK-005 [FEAT] [use-case]-service ⏳ blocked by TASK-004 6h
193
+ └─ blocks ──► TASK-006, TASK-007
194
+ TASK-006 [FEAT] [feature]-ui ⏳ blocked by TASK-005 8h
195
+ TASK-007 [FEAT] [feature]-ui-edge-cases ⏳ blocked by TASK-005 4h
196
+ ```
197
+
198
+ ### Parallel Opportunities
199
+
200
+ Tasks at the same dependency depth with no interdependency — can be executed in parallel:
201
+
202
+ | Wave | Tasks | Total Hours | Can Parallelize |
203
+ |------|-------|-------------|-----------------|
204
+ | Wave 1 (no deps) | TASK-001, TASK-002, TASK-003 | Nh | ✅ yes — 3 agents |
205
+ | Wave 2 (after 001) | TASK-004 | Nh | — single task |
206
+ | Wave 3 (after 004) | TASK-005 | Nh | — single task |
207
+ | Wave 4 (after 005) | TASK-006, TASK-007 | Nh | ✅ yes — 2 agents |
208
+
209
+ ### Single Points of Failure
210
+
211
+ Tasks whose delay cascades to > 2 downstream tasks:
212
+
213
+ | Task | Blocks | Cascaded Hours at Risk |
214
+ |------|--------|----------------------|
215
+ | TASK-NNN | TASK-NNN, TASK-NNN, TASK-NNN | Nh |
@@ -0,0 +1,35 @@
1
+ ---
2
+ type: task-board
3
+ feature: FEATURE_SLUG
4
+ tags: []
5
+ ---
6
+
7
+ # Task Board: FEATURE TITLE
8
+
9
+ ## Progress
10
+ ⬜ 0 / N tasks complete · Est. total: Xh
11
+
12
+ ## Tasks
13
+
14
+ | ID | Title | Package | Status | Priority | Depends On | Est. |
15
+ |----|-------|---------|--------|----------|------------|------|
16
+ | [[TASK-001\|TASK-001]] | [title] | shared | ⬜ | 1 | — | Xh |
17
+ | [[TASK-002\|TASK-002]] | [title] | api | ⬜ | 2 | TASK-001 | Xh |
18
+
19
+ <!-- Status: ⬜ ready · 🔄 in-progress · 🚫 blocked · ✅ done -->
20
+
21
+ ## Execution Order
22
+
23
+ ```
24
+ TASK-001 (schema)
25
+ └──► TASK-002 (repository)
26
+ └──► TASK-003 (use case)
27
+ └──► TASK-004 (endpoint)
28
+ └──► TASK-005 (frontend)
29
+ ```
30
+
31
+ ## Blocked Tasks
32
+
33
+ <!-- Move tasks here if they are blocked, with reason -->
34
+ | ID | Blocked By | Reason |
35
+ |----|------------|--------|
@@ -0,0 +1,86 @@
1
+ ---
2
+ id: TASK-[NNN]
3
+ type: SPIKE
4
+ slug: spike-[api-name]-feasibility
5
+ feature: "[feature-slug]"
6
+ api_ref: "API-[NN]"
7
+ time_box_hours: 4
8
+ priority: 1
9
+ package: research
10
+ estimated_hours: ~
11
+ status: todo
12
+ blocks:
13
+ - TASK-[NNN]
14
+ - TASK-[NNN]
15
+ linked_docs:
16
+ - "[[api-feasibility#API-NN]]"
17
+ - "[[contracts/[repo].contract.md]]"
18
+ ---
19
+
20
+ # SPIKE: [ServiceName] API Feasibility
21
+
22
+ > This is a **SPIKE task** — output is a decision document, not code.
23
+ > Time-boxed to `[N]h`. If questions remain unanswered, escalate to PO.
24
+
25
+ ## Objective
26
+
27
+ Determine whether [ServiceName] API/SDK supports [capability claimed in pitch],
28
+ and produce a confirmed contract skeleton for [[contracts/[repo].contract.md]].
29
+
30
+ ---
31
+
32
+ ## Questions to Answer
33
+
34
+ - [ ] Does [ServiceName] support [specific operation] via REST or SDK?
35
+ - [ ] What is the exact request input format? (field names, types, limits)
36
+ - [ ] What does the success response body look like? (field names, types)
37
+ - [ ] What auth model is required? (API Key, OAuth, Bearer, Service Account)
38
+ - [ ] Is there a sandbox / test environment available?
39
+ - [ ] What are the rate limits? Is there a retry-after header?
40
+ - [ ] Are there known deprecations or upcoming breaking changes?
41
+
42
+ ---
43
+
44
+ ## Verification Method
45
+
46
+ ```
47
+ 1. Read official docs at: [URL — search during SPIKE]
48
+ Target sections: Authentication, [relevant endpoint group], Error Handling
49
+
50
+ 2. If official docs are incomplete or ambiguous:
51
+ Search: "[ServiceName] [operation] site:github.com OR site:stackoverflow.com"
52
+ Check: [ServiceName] official GitHub issues, changelog, Discord/Slack
53
+
54
+ 3. If still unconfirmed: write a minimal test:
55
+ curl -X POST [endpoint] -H "Authorization: [key]" -d '[minimal payload]'
56
+ or: write 5-line SDK test against sandbox credentials
57
+
58
+ 4. Record all findings with direct source URL before closing task
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Definition of Done
64
+
65
+ - [ ] All questions above answered — each with direct source URL citation
66
+ - [ ] [[contracts/[repo].contract.md]] updated — all `⏳ TBD` fields replaced with confirmed values
67
+ - [ ] [[api-feasibility#API-NN]] `Resolution` block filled: status, source URL, date
68
+ - [ ] If capability confirmed: tasks in `blocks` list have `⏳ BLOCKED` annotation removed
69
+ - [ ] If capability NOT confirmed: PO notified with fallback scope options from [[api-feasibility#API-NN]]
70
+
71
+ ---
72
+
73
+ ## Non-Go (not in this task)
74
+
75
+ - Writing any implementation code
76
+ - Integrating the API into the application
77
+ - Performance testing or load testing the API
78
+ - Evaluating alternative providers
79
+
80
+ ---
81
+
82
+ ## Output Location
83
+
84
+ Update directly in:
85
+ - `[[api-feasibility#API-NN]]` — Resolution block
86
+ - `[[contracts/[repo].contract.md]]` — replace all ⏳ TBD fields
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: task
3
+ feature: FEATURE_SLUG
4
+ id: TASK-NNN
5
+ title: "[imperative verb phrase — e.g. Create Order aggregate schema]"
6
+ package: packages/shared | apps/api | apps/web
7
+ status: ready
8
+ priority: N
9
+ depends_on: []
10
+ unlocks: []
11
+ use_case_refs: []
12
+ entities: []
13
+ repositories: []
14
+ linked_docs: []
15
+ estimated_hours: N
16
+ tags: []
17
+ ---
18
+
19
+ # TASK-NNN: [Title]
20
+
21
+ ## Context
22
+ [2-3 sentences. Wikilink to the source spec, not re-describe it.]
23
+ Reference: [[domain-model#Section]] / [[usecases/UC-Name#Steps]]
24
+ Style reference: `[path/to/existing/similar/file.ts]`
25
+
26
+ ## Acceptance Criteria
27
+
28
+ ### ✅ Baseline (always required)
29
+ - [ ] [File X is created at path Y]
30
+ - [ ] `pnpm --filter [package] typecheck` exits 0
31
+ - [ ] `pnpm --filter [package] test [file]` passes
32
+ - [ ] [Exported type Z is available from package index]
33
+
34
+ ### 🔁 Inverse Conditions
35
+ <!-- _trigger: layer=ui + keyword=show/hide/display/visible/render -->
36
+ <!-- Include ONLY if this task has conditional rendering logic. Remove section if not applicable. -->
37
+ - [ ] [Element X does NOT appear when condition C1 is false]
38
+ - [ ] [Element X does NOT appear before prerequisite state S is reached]
39
+
40
+ ### 📭 Empty & Null States
41
+ <!-- _trigger: layer=repository/api + keyword=fetch/load/list, OR ui task references data prop -->
42
+ <!-- Include ONLY if this task fetches data or renders data-driven UI. Remove section if not applicable. -->
43
+ - [ ] Loading: [Skeleton/spinner renders while fetch is pending]
44
+ - [ ] Empty result: [EmptyState component renders when API returns `[]`]
45
+ - [ ] Null guard: [No crash or render error when `[field]` is `null` or `undefined`]
46
+
47
+ ### 🔢 Boundary Values
48
+ <!-- _trigger: any numeric value, file size, limit, max, min mentioned in description -->
49
+ <!-- Include ONLY if this task enforces a limit or validates a range. Remove section if not applicable. -->
50
+ - [ ] At min value ([N]): [expected behavior]
51
+ - [ ] At max value ([N]): [expected behavior — e.g. reject with error code E_XXX]
52
+ - [ ] At zero/empty string: [expected behavior]
53
+
54
+ ### 🧪 BDD Scenarios
55
+ <!-- _trigger: task.type=FEAT + user-facing action OR cross-layer boundary (UI→API, API→DB) -->
56
+ <!-- 1–3 scenarios max: happy path required, key rejection optional. Remove for CHORE/DOCS/MIGRATION/SPIKE. -->
57
+
58
+ **Scenario: [describe the happy-path action]**
59
+ Given [precondition — who/what is in what state]
60
+ When [actor performs specific action]
61
+ Then [expected observable outcome]
62
+
63
+ **Scenario: [describe a key guard or rejection]**
64
+ Given [precondition that leads to rejection]
65
+ When [action is attempted]
66
+ Then [error response or system rejection]
67
+
68
+ ### 🔗 Integration Flow
69
+ <!-- _trigger: task crosses ≥1 service boundary (UI→API, API→DB, service→external) -->
70
+ <!-- Name layers explicitly. Remove for tasks isolated to a single layer (domain types, pure domain logic). -->
71
+
72
+ **[Source layer] → [Target layer/service]**
73
+ Given [upstream caller/actor is in [state]]
74
+ When [action triggers at [layer — e.g. POST /api/resource or Repository.save()]]
75
+ Then [downstream side effect — DB row created, event published]
76
+ And [caller receives — HTTP status + response body shape]
77
+
78
+ ## Implementation Notes
79
+ <!-- Optional — only include non-obvious decisions -->
80
+ <!-- Remove this section if empty -->
81
+
82
+ ## Non-Go (not in this task)
83
+ - [What explicitly comes later — with task reference if known]
84
+ - [Another thing that's out of scope]
@@ -0,0 +1,105 @@
1
+ ---
2
+ type: usecase
3
+ feature: FEATURE_SLUG
4
+ id: UC-[Name]
5
+ bounded_context: CONTEXT
6
+ actor: Customer | Admin | System
7
+ entities: []
8
+ repositories: []
9
+ domain_events_emitted: []
10
+ tags: []
11
+ depends_on: ["[[domain-model]]", "[[ux-behavior]]"]
12
+ status: draft
13
+ ---
14
+
15
+ # Use Case: [Name]
16
+
17
+ ## Summary
18
+ [One sentence: Actor does X which results in Y.]
19
+
20
+ ## Preconditions
21
+ - [condition that must be true before this use case can execute]
22
+
23
+ ## Input
24
+
25
+ ```typescript
26
+ interface [UseCaseName]Input {
27
+ // fields from [[ux-behavior#ScreenName]] form
28
+ }
29
+ ```
30
+
31
+ ## Steps
32
+
33
+ ```
34
+ 1. Validate input schema
35
+ 2. [Load aggregate from repository]
36
+ 3. [Call domain method — business logic stays in aggregate]
37
+ 4. [Repository.save()]
38
+ 5. [Publish domain event]
39
+ 6. Return output
40
+ ```
41
+
42
+ ## Output
43
+
44
+ ```typescript
45
+ interface [UseCaseName]Output {
46
+ // fields returned to caller
47
+ }
48
+ ```
49
+
50
+ ## System Flow
51
+
52
+ <!--
53
+ Trace the full path this use case travels from UI trigger to data persistence.
54
+ Include only layers relevant to the current lens. Remove if a SPIKE is unresolved.
55
+ -->
56
+
57
+ ```
58
+ [UI: ScreenName → CTA/event]
59
+ → [API: METHOD /endpoint]
60
+ → [Use Case: Actor.action()]
61
+ → [Repository.method() → DB: table_name]
62
+ ← [Domain Event: EventName emitted (if any)]
63
+ ```
64
+
65
+ ## Invariants
66
+
67
+ <!--
68
+ An invariant must STILL hold after this UC is built.
69
+ Each invariant is a source of regression tasks — that task anchors use_case_refs back to THIS UC
70
+ (do NOT create a new anchor axis; an invariant is a property of the UC, not a UC of its own).
71
+ This section MAY be APPENDED by the reconcile operation when a build discovers a new constraint
72
+ (append-only — never edit the locked Steps/Input/Output).
73
+ Drop this section if the UC produces no invariants.
74
+ -->
75
+ - [INV-01] [Short invariant description — e.g. "A board saved before this cycle (old schema) loads without error and without data loss"]
76
+
77
+ ## Error Cases
78
+
79
+ | Error Code | Condition | HTTP Status | Handling |
80
+ |---|---|---|---|
81
+ | `[CODE]` | [when] | 400/404/409/422 | [description] |
82
+
83
+ ## Test Surface
84
+
85
+ <!--
86
+ DERIVED section — generated mechanically from Invariants (D1) + Error Cases (D2) +
87
+ Contract/Input shape (D3) + pitch No-gos touching this UC (D4).
88
+ Rules → references/test-surface.md. Never hand-author rows; never invent behaviors.
89
+ Regenerable via a retrofit-surface order. Appended-to (TS-INV rows) by the reconcile operation when
90
+ a new invariant lands. Exploratory/edge tests do NOT live here (qa-edge-hunter owns those).
91
+ If all four sources are empty, replace the table with:
92
+ _No derivable surface — sources empty. Exploratory coverage only (see qa-edge-hunter)._
93
+ Oracle = how the evaluator verifies the row (ui|process|test|snapshot|http); default ui.
94
+ Non-ui when this UC's deliverable has no browser (CLI/library/service). See references/test-surface.md.
95
+ -->
96
+ | ID | Oracle | Probe | Expect | Source |
97
+ |---|---|---|---|---|
98
+ | TS-INV-01 | ui | [action that would violate INV-01] | [rejection + state unchanged] | D1: INV-01 |
99
+ | TS-ERR-[CODE] | http | [trigger the Condition] | [error code + HTTP status] | D2 |
100
+ | TS-REQ-[field]-missing | http | [omit required field] | [400 validation, no side effect] | D3 |
101
+ | TS-NOGO-[NN] | ui | [attempt the excluded behavior] | [blocked/absent] | D4 |
102
+
103
+ ## Integration Points
104
+ - → [[integration#[service-section]]] — [what flows out]
105
+ - ← [[ux-behavior#[ScreenName]]] — triggered by [which CTA/event]
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: ux-spec
3
+ feature: FEATURE_SLUG
4
+ entities: []
5
+ usecases: []
6
+ screens: []
7
+ tags: [ux]
8
+ depends_on: ["[[domain-model]]"]
9
+ status: draft
10
+ ---
11
+
12
+ # UX Behavior: FEATURE TITLE
13
+
14
+ ## Screen Flow
15
+
16
+ ```
17
+ [ScreenA]
18
+
19
+ ├─ [condition] ──► [ScreenB]
20
+
21
+ └─ [condition] ──► [ScreenC]
22
+
23
+ ┌───────┴───────┐
24
+ │ │
25
+ success failed
26
+ │ │
27
+ [SuccessScreen] [ErrorScreen]
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Screen: [ScreenName]
33
+
34
+ ### States
35
+
36
+ | State | Trigger | UI Behavior | CTA |
37
+ |-------|---------|-------------|-----|
38
+ | `idle` | screen mount | form editable | enabled |
39
+ | `submitting` | user taps CTA | full loader | loading |
40
+ | `error` | API failure | error banner | enabled |
41
+ | `success` | API success | [redirect / toast] | — |
42
+
43
+ ### Behavior Rules
44
+
45
+ - [RULE-01] ...
46
+ - [RULE-02] ...
47
+
48
+ ### Error Catalog
49
+
50
+ | Error Code | Condition | User Message | Action |
51
+ |---|---|---|---|
52
+ | `NETWORK_TIMEOUT` | No response in 30s | "Can't connect, please retry" | [Retry] |
53
+ | `[CODE]` | [condition] | "[message in English]" | [action] |
54
+
55
+ ---
56
+
57
+ <!-- Repeat "Screen: [Name]" section for each screen -->
58
+
59
+ ---
60
+
61
+ ## Platform Differences
62
+
63
+ | Behavior | Mobile | Web |
64
+ |---|---|---|
65
+ | [behavior] | [mobile treatment] | [web treatment] |