@eeshaai/code 0.0.1 → 1.0.0

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 (129) hide show
  1. package/LICENSE.md +115 -0
  2. package/README.md +322 -0
  3. package/dist/THIRD-PARTY-NOTICES.md +23 -0
  4. package/dist/claude-agent-sdk/LICENSE.md +1 -0
  5. package/dist/claude-agent-sdk/sdk.mjs +156 -0
  6. package/dist/cli.js +23 -0
  7. package/dist/pluginWorker.js +1610 -0
  8. package/dist/resources/styles/custom/instructions/design.md +284 -0
  9. package/dist/resources/styles/custom/instructions/requirements.md +161 -0
  10. package/dist/resources/styles/custom/instructions/tasks-implement.md +90 -0
  11. package/dist/resources/styles/custom/instructions/tasks.md +159 -0
  12. package/dist/resources/styles/custom/process.md +49 -0
  13. package/dist/resources/styles/custom/prompts/first.md +29 -0
  14. package/dist/resources/styles/custom/prompts/implement.md +27 -0
  15. package/dist/resources/styles/custom/prompts/rewrite-note.md +40 -0
  16. package/dist/resources/styles/custom/prompts/rewrite.md +32 -0
  17. package/dist/resources/styles/custom/style.yml +46 -0
  18. package/dist/resources/styles/grammar.md +731 -0
  19. package/dist/server.js +839 -0
  20. package/dist/web/chunks/abnfDiagram-VCTEODGH-6KC3BO47.js +2 -0
  21. package/dist/web/chunks/architecture-7GRP2DOG-JLXNDD4H.js +2 -0
  22. package/dist/web/chunks/architectureDiagram-5GKGNRK7-QKPCVOD2.js +37 -0
  23. package/dist/web/chunks/blockDiagram-I7D4REHJ-4XZWNXLB.js +130 -0
  24. package/dist/web/chunks/c4Diagram-7LVT6UL2-4HJHKNE3.js +39 -0
  25. package/dist/web/chunks/chunk-2DLEMZHM.js +33 -0
  26. package/dist/web/chunks/chunk-2RFQIKC6.js +232 -0
  27. package/dist/web/chunks/chunk-37NHO5VO.js +2 -0
  28. package/dist/web/chunks/chunk-46RPN6IE.js +3 -0
  29. package/dist/web/chunks/chunk-4IPDIKAU.js +2 -0
  30. package/dist/web/chunks/chunk-4KP3BIPB.js +2 -0
  31. package/dist/web/chunks/chunk-4S2DRQJ6.js +340 -0
  32. package/dist/web/chunks/chunk-4TORDSRR.js +2 -0
  33. package/dist/web/chunks/chunk-5KNOHX5X.js +15 -0
  34. package/dist/web/chunks/chunk-6FQEBIA3.js +133 -0
  35. package/dist/web/chunks/chunk-6KSWTVXD.js +3 -0
  36. package/dist/web/chunks/chunk-6TGTE6CF.js +2 -0
  37. package/dist/web/chunks/chunk-6URXM4C4.js +2 -0
  38. package/dist/web/chunks/chunk-6VRLULJH.js +2 -0
  39. package/dist/web/chunks/chunk-7XAOOQR4.js +2 -0
  40. package/dist/web/chunks/chunk-BUZPUGIT.js +2 -0
  41. package/dist/web/chunks/chunk-DIRT34TZ.js +2 -0
  42. package/dist/web/chunks/chunk-FGASMJTA.js +4 -0
  43. package/dist/web/chunks/chunk-FNIFXWXL.js +2 -0
  44. package/dist/web/chunks/chunk-FPLIRG3U.js +73 -0
  45. package/dist/web/chunks/chunk-GQPX4EIC.js +11 -0
  46. package/dist/web/chunks/chunk-HAKJ3AUV.js +2 -0
  47. package/dist/web/chunks/chunk-HBEUVMXY.js +2 -0
  48. package/dist/web/chunks/chunk-HNYXDXPN.js +63 -0
  49. package/dist/web/chunks/chunk-HX7W7GSO.js +2 -0
  50. package/dist/web/chunks/chunk-II6WN3ZG.js +2 -0
  51. package/dist/web/chunks/chunk-JOSXY3EP.js +169 -0
  52. package/dist/web/chunks/chunk-L34PKG4P.js +2 -0
  53. package/dist/web/chunks/chunk-LDXBIOBF.js +2 -0
  54. package/dist/web/chunks/chunk-LHNPPNB7.js +3 -0
  55. package/dist/web/chunks/chunk-LQ6CTWX6.js +2 -0
  56. package/dist/web/chunks/chunk-LSVIQRSY.js +2 -0
  57. package/dist/web/chunks/chunk-M3SWKTLZ.js +2 -0
  58. package/dist/web/chunks/chunk-MBZYSJFT.js +2 -0
  59. package/dist/web/chunks/chunk-MZEMPN3C.js +2 -0
  60. package/dist/web/chunks/chunk-OODDZ447.js +2 -0
  61. package/dist/web/chunks/chunk-OXLTOJNY.js +3 -0
  62. package/dist/web/chunks/chunk-PR453BYT.js +2 -0
  63. package/dist/web/chunks/chunk-QNEZP2TE.js +179 -0
  64. package/dist/web/chunks/chunk-R7TFKRNM.js +2 -0
  65. package/dist/web/chunks/chunk-T4HEWXAQ.js +2 -0
  66. package/dist/web/chunks/chunk-TPXX77KB.js +2 -0
  67. package/dist/web/chunks/chunk-TPYBIPJG.js +2 -0
  68. package/dist/web/chunks/chunk-TXNHMPKM.js +89 -0
  69. package/dist/web/chunks/chunk-VAKN3BTM.js +2 -0
  70. package/dist/web/chunks/chunk-VY4GEFSG.js +2 -0
  71. package/dist/web/chunks/chunk-XBYCKXUJ.js +207 -0
  72. package/dist/web/chunks/chunk-YM7LHP34.js +16 -0
  73. package/dist/web/chunks/classDiagram-ZZMXUADV-4J5HHZD6.js +2 -0
  74. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-X6WY2DAS.js +2 -0
  75. package/dist/web/chunks/cose-bilkent-JH36ORCC-ZPRW5JRW.js +2 -0
  76. package/dist/web/chunks/cynefin-OW5HDTMX-SVVTQRRB.js +2 -0
  77. package/dist/web/chunks/cynefinDiagram-5FMLGOSQ-O7GURHJG.js +63 -0
  78. package/dist/web/chunks/dagre-GXQ25YYZ-WK67O4N6.js +5 -0
  79. package/dist/web/chunks/diagram-S7CK7UJ4-2CEO2EN2.js +31 -0
  80. package/dist/web/chunks/diagram-UQ7AKVKN-2Z4VHGF3.js +42 -0
  81. package/dist/web/chunks/diagram-VSXAHHWV-AN4BOWYB.js +4 -0
  82. package/dist/web/chunks/diagram-VX7I27RA-VEZ2GXCM.js +25 -0
  83. package/dist/web/chunks/diagram-Z3DM3KII-TGGNDSLW.js +25 -0
  84. package/dist/web/chunks/ebnfDiagram-PWID7BFC-7RM57IJV.js +2 -0
  85. package/dist/web/chunks/erDiagram-RLTQ6QDP-LCATC3YT.js +100 -0
  86. package/dist/web/chunks/eventmodeling-NTZA5JFV-2SR57JAH.js +2 -0
  87. package/dist/web/chunks/flowDiagram-HODETNUW-HU6Y2EYQ.js +2 -0
  88. package/dist/web/chunks/ganttDiagram-EL5Y4UJY-5VPBBF2V.js +293 -0
  89. package/dist/web/chunks/gitGraph-4MIJSDKK-25JPIQP7.js +2 -0
  90. package/dist/web/chunks/gitGraphDiagram-WWUBYQGX-HZMAGPIJ.js +107 -0
  91. package/dist/web/chunks/info-A6RAGUB7-72MROTVX.js +2 -0
  92. package/dist/web/chunks/infoDiagram-27XIBGKW-BQYTPGNG.js +3 -0
  93. package/dist/web/chunks/ishikawaDiagram-5VMMS53U-A54WWBPX.js +71 -0
  94. package/dist/web/chunks/journeyDiagram-3NMN7TZE-XRCTMTR7.js +140 -0
  95. package/dist/web/chunks/kanban-definition-UXKFOSKX-UW2PQXZF.js +90 -0
  96. package/dist/web/chunks/katex-B7HWCVTN.js +258 -0
  97. package/dist/web/chunks/mermaid.core-VL5SQK5M.js +19 -0
  98. package/dist/web/chunks/mindmap-definition-YA3MSWOX-2H2Z6CVN.js +97 -0
  99. package/dist/web/chunks/packet-AYTQ26CC-NEGDW4B6.js +2 -0
  100. package/dist/web/chunks/pegDiagram-XKGWAZYB-KC4BYUN7.js +2 -0
  101. package/dist/web/chunks/pie-WAS4IAKB-OT3EMGHT.js +2 -0
  102. package/dist/web/chunks/pieDiagram-E7YTZNPT-54T6XSU5.js +40 -0
  103. package/dist/web/chunks/quadrantDiagram-AXDQQJYC-3G3RXSTE.js +8 -0
  104. package/dist/web/chunks/radar-RG4KPBEZ-DCHU5FOQ.js +2 -0
  105. package/dist/web/chunks/railroad-74A4TZTK-RZX6D7H6.js +2 -0
  106. package/dist/web/chunks/railroad-abnf-HS5TGJTU-STTFN7R4.js +2 -0
  107. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-RBXU3IBK.js +2 -0
  108. package/dist/web/chunks/railroad-peg-WCYAUIDC-OD5BXOH6.js +2 -0
  109. package/dist/web/chunks/railroadDiagram-O6MQD6OU-3LHKFF5N.js +2 -0
  110. package/dist/web/chunks/requirementDiagram-BXWQKSXE-M4LF54YT.js +85 -0
  111. package/dist/web/chunks/sankeyDiagram-P5KCCOFB-USCKKKNT.js +41 -0
  112. package/dist/web/chunks/sequenceDiagram-WJ2MYXX4-QZ2O4KWV.js +163 -0
  113. package/dist/web/chunks/sizeCapture-INFHLROL-DZI5JWEV.js +2 -0
  114. package/dist/web/chunks/stateDiagram-D77RDMKH-EQJNTBF3.js +2 -0
  115. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-WSCDKLG6.js +2 -0
  116. package/dist/web/chunks/swimlanes-42K2YHIH-H7SZ2HG6.js +2 -0
  117. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-DFYTBPVS.js +9 -0
  118. package/dist/web/chunks/timeline-definition-24CTP7MA-4Q2ARIQ6.js +121 -0
  119. package/dist/web/chunks/treeView-Q6P3EWNA-ADCP6RPT.js +2 -0
  120. package/dist/web/chunks/treemap-WGGIJYW6-NEV7DUDY.js +2 -0
  121. package/dist/web/chunks/vennDiagram-4TSXK5OY-WMJVK74C.js +35 -0
  122. package/dist/web/chunks/wardley-WFR3VGLG-4QZOFDI5.js +2 -0
  123. package/dist/web/chunks/wardleyDiagram-VM6X3IG4-CLB324RQ.js +79 -0
  124. package/dist/web/chunks/xychartDiagram-S5SC5T6Z-G5C2R7C2.js +8 -0
  125. package/dist/web/index.html +24 -0
  126. package/dist/web/page.css +2 -0
  127. package/dist/web/page.js +210 -0
  128. package/package.json +62 -10
  129. package/cli.js +0 -2
@@ -0,0 +1,284 @@
1
+ # Design: <Feature Name>
2
+
3
+ <!-- Fill rules: cite acceptance criteria, never restate them. Omit anything the
4
+ repo can answer for itself (paths, signatures, field lists, payloads). A
5
+ decision nobody has made is an open question, not an omission. Target: 2 pages.
6
+
7
+ A requirement that cannot be satisfied as written is a blocker - raise it as an
8
+ open question, never design around it silently. A principles or standards file
9
+ attached to this phase wins over your own preferences. Research is context, not
10
+ an artifact: what you look up shapes the design and is cited inline next to the
11
+ decision it justifies - no `research.md`, no notes file; `code-findings.md` is the
12
+ only side file, and only for code facts.
13
+
14
+ Do not write this file until the pre-write gate is cleared: unknowns asked,
15
+ proposed deviations agreed. Silent assumptions are the failure mode, not slow
16
+ drafts. -->
17
+
18
+ **Requirements:** `requirements.md`
19
+
20
+ ## Decisions Requiring Sign-off
21
+
22
+ <!-- The review. 3-7 decisions. Only decisions an architect could reasonably have
23
+ made differently. Driving factor precedence: NFR/steering > existing codebase
24
+ pattern > industry standard.
25
+
26
+ A feature shipping behind a flag records that as a Dec-<n> here, not in
27
+ requirements.md — a flag is a rollout mechanism, not behavior: record the key,
28
+ default state, and rollback. -->
29
+
30
+ ### Dec-1: <short title>
31
+
32
+ - **Decision:** <one line>
33
+ - **Alternative rejected:** <one line>
34
+ - **Driving factor:** <NFR / pattern in `X` / standard>
35
+ - **Reversible after ship?:** <Yes / No — why>
36
+
37
+ ## Proposed Deviations
38
+
39
+ <!-- Where the requested approach, or what the codebase does today, conflicts with
40
+ design standards or an NFR. Max 3, agreed with the requester before this file was
41
+ written. Cite the standard — a preference is not a deviation. Omit if none. -->
42
+
43
+ ### Dev-1: <short title>
44
+
45
+ - **Proposal:** <one line>
46
+ - **Conflicts with:** <requested approach / existing pattern in `X`>
47
+ - **Standard/NFR cited:** <the standard or NFR>
48
+ - **Agreed?:** <Yes/No — by whom, when>
49
+
50
+ ## Overview
51
+
52
+ <3-5 sentences: the approach, and which requirements it satisfies, cited as
53
+ [Requirements : 1, 2](requirements.md).>
54
+
55
+ **Non-goals:** <max 4 bullets. Adjacent work the implementer will be tempted to
56
+ pick up. Mark anything deferred-not-rejected and name the follow-up.>
57
+
58
+ ## Non-Functional Requirements
59
+
60
+ <!-- One feature-specific fact per applicable category - performance, scale,
61
+ resilience/availability, security (including whether a security/threat review
62
+ is triggered), observability, cost, compatibility/legacy surfaces, operability,
63
+ code coverage, accessibility (any new UI surface), localization (translation
64
+ policy for changed strings), automation/test scope - never restated
65
+ methodology. Security, performance, and code coverage always get a line - no
66
+ feature is exempt from those three.
67
+
68
+ Every line traces to a source: an obligation the inputs state, or one a human
69
+ gives when asked. Part of the pre-write gate: ask - with your ask tool, in this
70
+ run - whether there are NFR obligations to add, inviting free-text; interpret
71
+ whatever comes back into the line shape below, write it here, and record it as
72
+ an answered question (who, when). A valid performance line is "no obligation
73
+ stated - none applies": never invent a target, bound, or measurement nobody
74
+ asked for. Consider the rest and omit any with nothing feature-specific to say.
75
+ How each obligation is met and verified belongs to the sections that follow -
76
+ this section records only the obligations. -->
77
+
78
+ - Security: <RBAC/tenant isolation/PII handling for this feature; any
79
+ logging the criteria require masks personal data>
80
+ - Performance: <target, e.g. "p95 < 400ms at 200 concurrent requests" -
81
+ or "no obligation stated - none applies">
82
+ - Code coverage: <delta vs. baseline for new/changed code>
83
+ - <other applicable category>: <the fact>
84
+
85
+ ## Architecture
86
+
87
+ <Component diagram (`flowchart`), max 10 nodes: what is new, what is
88
+ modified, what is deliberately untouched.>
89
+
90
+ **Repo scope** — one line per repo, literal github name; state "single repo" if so:
91
+
92
+ - `<repo-name>` — <role in this feature>; <new module/service/package, or modified>
93
+
94
+ **Entry points:** <sync request / cron / queue consumer / user action — and what triggers it>
95
+
96
+ ## Components and Interfaces
97
+
98
+ <!-- One entry per component this feature adds or changes. A component is a service,
99
+ module, handler, client, job or UI surface — not a file, and not a class list: the
100
+ file-level breakdown belongs to tasks.md. Keep the heading and write "no new
101
+ component — existing ones change internally only" where that is true. -->
102
+
103
+ - **`<component>`** in `<repo>` — <new or modified>; <the operation it exposes or
104
+ the behaviour it gains, in one line>; <who calls it>
105
+
106
+ ## Runtime Flow
107
+
108
+ <`sequenceDiagram` of the primary flow per entry point — who calls whom, in
109
+ what order, sync vs async — including the failure branch that matters. More
110
+ than one entry point with genuinely different flows: one `###` per flow,
111
+ one diagram each. Omit the section only when the flow is a single
112
+ in-process call the Architecture diagram already shows.>
113
+
114
+ ## Data Models
115
+
116
+ <!-- Omit only for UI-only features. "No schema change" is itself a decision — say it.
117
+ Add an `erDiagram` of created/altered entities and their relationships — omit it
118
+ for no schema change or a single added column. -->
119
+
120
+ - **Entities:** <created vs. altered, by real schema names>
121
+ - **Nature of change:** <new fields, repurposed fields, new relationships, changed
122
+ constraints. Name a field only where its semantics drive the design.>
123
+ - **Nullability/defaults:** <only where a wrong choice changes behavior for existing rows>
124
+ - **Access patterns:** <the queries this must serve, and any index the design depends on>
125
+ - **Retention/PII:** <what is personal or regulated, and what that implies>
126
+
127
+ ## Migration
128
+
129
+ <!-- Keep the heading and write "none — no schema change" where that is true. -->
130
+
131
+ - **Migration:** <none / additive / requires backfill>
132
+ - **Order:** <migrate-then-deploy
133
+ or deploy-then-migrate>
134
+ - **Rollback:** <can this be reverted after ship; if not, why>
135
+
136
+ ## Consistency & Concurrency
137
+
138
+ <!-- Usually the section that catches the real bug. Do not skip; say "N/A — single
139
+ in-process write, no concurrent callers" if that is true. -->
140
+
141
+ - **Transaction boundary:** <what is atomic; what can end up half-applied>
142
+ - **Invariants:** <what must always hold, and which component enforces it>
143
+ - **Shared predicates:** <every term this feature branches on - "onsite", "final",
144
+ "in scope", "eligible" - written once as a single predicate, with every component
145
+ that evaluates it and the fields each one needs to do so. Two components deciding
146
+ the same term by different tests is the defect this bullet exists to catch, so
147
+ list the evaluation sites even where they agree, and name any field a site cannot
148
+ read yet. "N/A - this feature branches on no shared term" if so>
149
+ - **Concurrent callers:** <what happens on simultaneous or duplicate requests>
150
+ - **Idempotency & ordering:** <required or not; the key used; whether ordering matters>
151
+ - **Work outliving its trigger:** <every call left unawaited, backgrounded, or
152
+ fire-and-forget: the mechanism that keeps it alive past the request that
153
+ started it, and what it does not survive — "unawaited" is not a mechanism.
154
+ "N/A — nothing is backgrounded" if so>
155
+
156
+ ## Cross-Boundary Contracts
157
+
158
+ <!-- Another repo, external customer, published SDK/CLI, webhook, emitted event.
159
+ Keep the heading and write "no cross-boundary surface" if none. Two cases need it:
160
+ more than one Target Code Repo calling across a boundary between them; or one repo
161
+ exposing a public API an external customer integration calls directly, alongside or
162
+ instead of a UI. The second applies to single-repo features too. -->
163
+
164
+ ### `<capability>`
165
+
166
+ - **Producer → consumer(s):** `<repo>` → `<repo>` / External customer integration
167
+ - **Operation:** <semantic, one line — "consumer submits a batch and polls for completion">
168
+ - **Compatibility:** <additive / breaking — versioning, deprecation window, who is
169
+ notified. Breaking an external customer contract needs explicit architect sign-off.>
170
+ - **Auth:** <which principal, which mechanism, what the producer authorizes>
171
+ - **Failure semantics:** <retryable vs. terminal for the consumer>
172
+ - **Rollout order:** <which side ships first; behavior between the two deploys>
173
+ - **Naming mismatch:** <both real names in one line, if the requirements glossary flagged one>
174
+
175
+ ## Security & Authorization
176
+
177
+ - **Who may act:** <roles, permissions, scopes>
178
+ - **Enforcement point:** <which component checks; whether existing enforcement is relied on>
179
+ - **Tenancy isolation:** <how cross-tenant/org/user access is prevented>
180
+ - **Sensitive data:** <logged, masked, encrypted, or deliberately not persisted>
181
+
182
+ ## Performance & Scale
183
+
184
+ <!-- When Non-Functional Requirements states no performance obligation,
185
+ Constraint is "none applies" and the other two lines are omitted - never
186
+ invent a measurement (a p95 comparison, a load test) nobody asked for; an
187
+ invented verification is scope creep, not rigor. -->
188
+
189
+ - **Constraint:** <the number to design against, citing the NFR — or "none applies", and why>
190
+ - **Impact:** <expected load, payload size, or latency delta this change introduces>
191
+ - **Decision & verification:** <what the design does about it, and how that is proven>
192
+
193
+ ## Error Handling
194
+
195
+ <`stateDiagram-v2` when the feature introduces or changes an entity's status
196
+ lifecycle — states and legal transitions. Omit when no lifecycle changes.>
197
+
198
+ - **Failure modes:** <what can fail, and what the user or calling system sees for each>
199
+ - **Detection & recovery:** <how it surfaces and how it is recovered; cite the
200
+ error-related criteria, e.g. [Requirements : 2.3](requirements.md)>
201
+ - **Blast radius:** <what else degrades if this is wrong>
202
+
203
+ ## Observability
204
+
205
+ - **Instrumentation:** <max 5 bullets — what must be logged, metered, or traced for this
206
+ to be operable, and any alert the design assumes exists>
207
+
208
+ ## Correctness Properties
209
+
210
+ <!-- The design's invariants as numbered properties - deduplication, ordering,
211
+ bounds, never-blocks guarantees - not restated criteria. An invariant stated in
212
+ prose elsewhere in this document moves here and is cited from there by its id.
213
+ A property holds across every valid execution: if you cannot write "for any", it
214
+ is an example, not a property - it belongs in Testing Strategy. Name no
215
+ property-testing framework and no iteration count; how a property is verified is
216
+ Testing Strategy's business. -->
217
+
218
+ ### Property 1: <short descriptive name>
219
+
220
+ *For any* <universally quantified input>, THE <component> SHALL
221
+ <guaranteed outcome>, regardless of <what does not matter>.
222
+
223
+ **Validates: Requirements 1.2, 2.4**
224
+
225
+ ## Testing Strategy
226
+
227
+ <!-- Every acceptance criterion gets exactly one primary level. Cite criteria as
228
+ link citations grouped by level - never restate their text. Give a reason only
229
+ where the choice isn't obvious; Manual always gets its reason. This section is
230
+ what QA's sign-off covers. -->
231
+
232
+ - **Unit:** [Requirements : 1.4, 1.6](requirements.md) — <the pure logic covered here>
233
+ - **Integration:** [Requirements : 1.9](requirements.md) — <the real boundaries
234
+ covered here; name any test infrastructure that must be built first>
235
+ - **E2E/automation:** [Requirements : 1.5](requirements.md) — <the few journeys
236
+ worth automating end to end - not a re-run of what lower levels cover>
237
+ - **Manual:** [Requirements : 3.6](requirements.md) — <always with the reason it
238
+ cannot be automated>
239
+ - **Pyramid check:** <every requirement has at least one criterion above unit
240
+ level - name any that doesn't and why that's acceptable>
241
+ - **Existing tests affected:** <tests this change breaks or supersedes, and the
242
+ decision for each: update, migrate, or retire>
243
+ - **Hard to test:** <what, why, and how it will be handled>
244
+ - **Load/perf testing:** <approach, if there is a performance NFR — else omit>
245
+ - **Configuration variants:** <where behavior is driven by configuration rather
246
+ than a name or a type, the configured variants to verify - including at least
247
+ one that must not change - else omit>
248
+ - **Persona scenarios needing dedicated cases:** <cited as
249
+ [Requirements : 2.3](requirements.md)>
250
+
251
+ ## Glossary
252
+
253
+ <!-- One line per system or term this design names. Requirements only ever say
254
+ THE SYSTEM, so this is where a PO or QA reader learns what each name is. Plain
255
+ words, no architecture. -->
256
+
257
+ - **<System/term>** - <what it is, in one plain sentence>
258
+
259
+ ## Open Questions
260
+
261
+ <!-- Say what a question blocks (a criterion citation or a Dec-<n>) in the
262
+ question line. "None." if none. -->
263
+
264
+ - **QN-1** <question - what it blocks, who decides>
265
+
266
+ ## Answered Questions
267
+
268
+ - **QN-<n>** <question>
269
+ **A:** <the decision>
270
+ **By:** <name> - <datetime UTC>
271
+
272
+ ## Assumptions
273
+
274
+ <!-- Anything the author had to assume to finish. Surviving sign-off = approved. -->
275
+
276
+ - <assumption> — **if false:** <what changes>
277
+
278
+ ## Sign-off
279
+
280
+ <!-- All three required before tasks.md. -->
281
+
282
+ - **Developer (peer review):** <name> — <UTC>
283
+ - **Lead:** <name> — <UTC>
284
+ - **QA:** <name> — <UTC>
@@ -0,0 +1,161 @@
1
+ # Requirements Document
2
+ Feature : <Feature Name>
3
+
4
+ <!-- The H1 is the literal words `# Requirements Document`, never the
5
+ feature's name: Kiro's validator matches that line exactly.
6
+
7
+ Your source is `intake.md` when the spec has one: what was asked and
8
+ where it came from. Read what it points at before you draft - every file
9
+ it lists (they sit in the spec folder), and any work item or issue it
10
+ names, through the MCP server for that provider, comments included. A
11
+ description alone means that is all there is: work from it and the
12
+ repository, and invent nothing. Do not re-open the ask: intake settled
13
+ what is being asked; carry its own open questions forward where they
14
+ still block, and add no scope because the ask left room for it. Intake's
15
+ `type` shapes the framing - a `bug` states the wrong behaviour and the
16
+ right one, a `feature` states capability the system should gain - but
17
+ the sections, numbering and EARS forms are the same either way. -->
18
+
19
+ > Standalone template - everything needed to draft and record these
20
+ > requirements is in this file.
21
+ - **Approved by (PO):** <name - filled at approval>
22
+ - **Approved (UTC):** <datetime - filled at approval>
23
+
24
+ ## Introduction
25
+
26
+ A few sentences on the feature, its purpose, and the problem it solves -
27
+ not a design summary or a restatement of the requirements below.
28
+
29
+ ## Glossary
30
+
31
+ Only where artifacts genuinely name one thing differently. One line
32
+ per term: "Customer (canonical) - the mock-ups say 'Client'; the DB
33
+ table is `account`." When a field this feature writes is also
34
+ written by other flows, say so - a reader must not assume it holds
35
+ only this feature's value. A multi-word term is written with
36
+ underscores - `Scheduled_Appointment` - and then written that way
37
+ everywhere in this document, criteria included, so a defined term is
38
+ one greppable token. Omit the section when there's nothing to
39
+ record.
40
+
41
+ ## Personas
42
+
43
+ Only when an audience beyond the user stories' own roles needs
44
+ distinct verification - an integration caller that authenticates
45
+ differently, a participant who sees data a requirement exposes. One
46
+ line per persona: who they are and what makes their path different.
47
+ Omit when the user stories' roles cover everyone.
48
+
49
+ - **<Persona>** - <what makes their path distinct>
50
+
51
+ ## Requirements
52
+
53
+ Each requirement is one clear capability, stated as the PO would state
54
+ it: a user story plus the complete acceptance criteria that verify it.
55
+ Group by what a reader verifies together, never by system or repo - a
56
+ requirement is an outcome, not a component's work list. Requirements
57
+ are not deployment units: no requirement here carries release
58
+ mechanics or dependency ordering. A requirement that documents
59
+ existing behavior for verification only says so in one italic line
60
+ under its heading - it implies no new build work, only tests. Each
61
+ requirement must read on its own, criteria written out in full - no
62
+ resolving other documents to know what to build.
63
+
64
+ A requirement is one thing a PO can approve or reject whole. Where its
65
+ criteria fall into groups that need their own headings or labels to
66
+ stay readable, the cut is wrong and those groups are separate
67
+ requirements - a label inside the criteria list is the signal, never
68
+ the remedy, because a reader signs the requirement and nobody scans
69
+ dozens of criteria for the one that is missing.
70
+
71
+ Three cases go missing by default, so state or consciously exclude each
72
+ one per requirement: the identifier that resolves to nothing; the
73
+ multi-item operation where one item fails and the others must still
74
+ succeed; and the dependency that is unreachable rather than merely
75
+ returning an error. Where one genuinely does not apply, say so in the
76
+ test notes - an absence nobody explains reads as an oversight, and
77
+ usually is one.
78
+
79
+ ### Requirement 1: <Short title>
80
+
81
+ **User Story:** As a <role>, I want <capability>, so that <benefit>.
82
+
83
+ #### Acceptance Criteria
84
+
85
+ State WHAT the system observably does - HOW it's built and
86
+ tested (repos, endpoints, test levels) belongs to design.md. Write
87
+ every line in the product's language the PO can sign: a line that
88
+ needs a service name, endpoint, header, transaction, or storage type
89
+ is carrying a design fact - move the fact to design.md and restate the
90
+ line in product terms. Include
91
+ at least one criterion that exercises a real boundary (a persisted
92
+ save, a call across a service, a full user action), not just
93
+ logic/validation. State when the action must NOT apply - the entity
94
+ states or conditions under which nothing is recorded or changed.
95
+ Every surface the changed data reaches - reports, exports, emails,
96
+ templates/merge fields, APIs - appears in some criterion. Name the
97
+ concrete limit where one exists; a testable number beats an
98
+ abstraction. Persona- or flag-specific behavior is its own
99
+ criterion (the WHERE form) - for flag-gated work, state the flag-OFF
100
+ behavior ("as today") as a criterion too, in product terms, never
101
+ naming the flag key: the key and rollout mechanics are design's
102
+ Dec-<n>. An NFR measurable as a single trigger/response (e.g. a
103
+ response-time target) is a numbered criterion here; cross-cutting NFR
104
+ facts belong to design's Non-Functional Requirements section - never
105
+ a section here.
106
+
107
+ 1. WHEN <trigger> THEN THE SYSTEM SHALL <behaviour>.
108
+ 2. IF <error/edge condition> THEN THE SYSTEM SHALL <behaviour>.
109
+ 3. WHERE <context/persona/configuration> THE SYSTEM SHALL
110
+ <behaviour>.
111
+
112
+ **Test notes** (optional) - only when there's something real to say:
113
+ data or situations worth testing, anything only checkable by hand and
114
+ why, or a persona whose path needs separate verification.
115
+
116
+ ### Requirement 2: <Short title>
117
+
118
+ **User Story:** As a <role>, I want <capability>, so that <benefit>.
119
+
120
+ #### Acceptance Criteria
121
+
122
+ 1. WHEN <trigger> THEN THE SYSTEM SHALL <behaviour>.
123
+ 2. WHEN <trigger> THEN THE SYSTEM SHALL <behaviour>.
124
+
125
+ ## Out of Scope
126
+
127
+ Concrete exclusions a reviewer could otherwise reasonably assume were
128
+ in scope - a functional variant, persona, legacy surface, or
129
+ integration. Ground each in the inputs - the PRD, the code, an
130
+ answered question - don't invent them here. State permanent boundary or
131
+ deferred phase - never ambiguous - and the consequence the product
132
+ lives with (e.g. "no criterion can be written for it, so there is no
133
+ test for it either").
134
+
135
+ - **<Excluded item, e.g. "Portal v1">** - <why>. <Permanent, or
136
+ "planned for a future phase - <link or 'not yet scheduled'>">.
137
+ <The consequence the product lives with.>
138
+
139
+ ## Open Questions
140
+
141
+ Questions raised while drafting these requirements. Name the
142
+ requirement a question blocks, if any.
143
+
144
+ - **QN-1** <question>
145
+
146
+ ## Answered Questions
147
+
148
+ - **QN-<n>** <question>
149
+ **A:** <the decision>
150
+ **By:** <name> - <datetime UTC>
151
+
152
+ ## Assumptions
153
+
154
+ What you decided for yourself and proceeded on - a guess, said so.
155
+ Surviving PO sign-off makes it approved. Omit when empty.
156
+
157
+ - <assumption> - **if false:** <what changes>
158
+
159
+ ## Sign-off
160
+
161
+ - **Approved by (PO):** <name> - <UTC>
@@ -0,0 +1,90 @@
1
+ # Implement the named tasks
2
+
3
+ You are implementing tasks from the approved `tasks.md` of this
4
+ feature - **exactly the ones named in your instructions, nothing else**:
5
+ not a related task, not an improvement you spotted.
6
+
7
+ ## Scope
8
+
9
+ - Read `requirements.md`, `design.md` (when the spec has one) and
10
+ `tasks.md` from the spec folder before writing any code. A document stamped
11
+ `> STALE:` is not implementable - stop and say so.
12
+ - Implement only what the named task describes, the way the design
13
+ says. If the task references requirements, satisfy exactly those.
14
+ - A task's anchors are file paths plus symbols. An anchor that does not
15
+ resolve is one of two things, and they are not handled the same way.
16
+ Where the file exists elsewhere under an obviously equivalent path,
17
+ or the symbol has moved within the repo, that is drift: re-resolve
18
+ it, record the correction in `code-findings.md`, and carry on. Where
19
+ nothing in the repo carries that symbol at all, the anchor was never
20
+ right: stop, and report it as a defect in `tasks.md` rather than a
21
+ change in the code. Never guess a replacement in either case.
22
+ - Include the task's tests. Run what can be run.
23
+ - Touch only the files the task requires. If a task cannot be
24
+ implemented as written, stop and say why instead of improvising -
25
+ that is a finding for the human, not a licence to redesign.
26
+ - **A true blocker: check `decisions.md`, then ask the person once only
27
+ if it has no answer.** Update that question-and-answer pair with their
28
+ answer. If nobody answers, stop and report - never proceed on a guess.
29
+ - Never commit, push, or open a pull request unless explicitly told to.
30
+
31
+ ## Waves - what may run at the same time
32
+
33
+ `tasks.md` ends with a `## Task Dependency Graph`: a `waves` array
34
+ saying which tasks are safe to run concurrently, built from each task's
35
+ `Files:` line so that tasks sharing a wave touch disjoint files. Read
36
+ those lines before fanning out; if two tasks in the wave name the same
37
+ path, work those two one after the other.
38
+
39
+ - If you can delegate to sub-agents, do - one sub-agent per task, one
40
+ task each, told to stay inside its task's files. If you cannot, work
41
+ them one at a time.
42
+ - **Never start a later wave until every task in the current wave is
43
+ finished and ticked.** Waves are a barrier, not a suggestion.
44
+ - **You own `tasks.md`. Sub-agents never write to it.** They report
45
+ back; you tick each box yourself after each reports success.
46
+ - The same ownership applies to `code-findings.md`: check it before
47
+ searching the repository, and append what a task's work uncovers -
48
+ one line per fact: repo, file or symbol, the fact. Sub-agents report
49
+ findings back; you append them.
50
+ - If a task in a wave fails: tick the ones that succeeded, leave the
51
+ failed one unticked, say what broke, and **stop** - never roll into
52
+ the next wave.
53
+
54
+ ## Every task ends green
55
+
56
+ The repository builds and its tests pass at the end of every task - not
57
+ at the end of the plan. With the feature flag off, behavior is exactly
58
+ today's at every stopping point: a half-wired path is unreachable, never
59
+ broken. When several tasks share a wave, the guarantee lands when the
60
+ wave completes.
61
+
62
+ The final verification group records real outcomes per suite - a result
63
+ is what actually ran, never an assumption. Anything unrunnable in this
64
+ environment is named for CI, not reported green.
65
+
66
+ ## When done - the checkbox is the contract
67
+
68
+ A task is not complete until its checkbox in `tasks.md` is ticked
69
+ (`- [x]`). In order, as the final acts of each task:
70
+
71
+ 1. Verify what you built - run the task's tests.
72
+ 2. Call the `task_done` tool with the task's id (`1.2`). It ticks
73
+ exactly that box and changes nothing else. Never open or edit
74
+ `tasks.md` to tick a box - not the text, not the numbering, not the
75
+ graph; the tool is the only way a box gets ticked.
76
+ 3. Summarize what changed and why, in one short paragraph, and name
77
+ every file you created or edited for it - the same list your final
78
+ `## Changed` section gathers up across all the tasks you were handed.
79
+ The panel reads that list; it is how a person sees what the wave
80
+ touched without opening the chat.
81
+
82
+ If a task could not be completed, leave its box unticked, state what
83
+ blocked you, and stop there. An honest unticked box is correct; a
84
+ ticked box over unfinished work breaks the plan for everyone.
85
+
86
+ ## The plan's shape
87
+
88
+ The attached grammar owns the checkbox spacing, tick marks and the
89
+ `## Task Dependency Graph` fence - the implement lens parses those
90
+ lines. Keep every line you touch to that shape.