@eeshaai/code 1.0.0 → 1.0.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 (150) hide show
  1. package/LICENSE.md +3 -3
  2. package/README.md +337 -322
  3. package/dist/cli.js +4 -4
  4. package/dist/resources/styles/custom/instructions/design.md +283 -283
  5. package/dist/resources/styles/custom/instructions/requirements.md +161 -161
  6. package/dist/resources/styles/custom/instructions/tasks-implement.md +90 -90
  7. package/dist/resources/styles/custom/instructions/tasks.md +159 -159
  8. package/dist/resources/styles/custom/process.md +49 -49
  9. package/dist/resources/styles/custom/prompts/first.md +29 -29
  10. package/dist/resources/styles/custom/prompts/implement.md +27 -27
  11. package/dist/resources/styles/custom/prompts/rewrite-note.md +40 -40
  12. package/dist/resources/styles/custom/prompts/rewrite.md +32 -32
  13. package/dist/resources/styles/custom/style.yml +46 -46
  14. package/dist/resources/styles/grammar.md +727 -731
  15. package/dist/resources/styles/kiro/style.yml +63 -0
  16. package/dist/resources/styles/speckit/style.yml +59 -0
  17. package/dist/server.js +465 -486
  18. package/dist/web/chunks/{abnfDiagram-VCTEODGH-6KC3BO47.js → abnfDiagram-VCTEODGH-P6AZFXJU.js} +2 -2
  19. package/dist/web/chunks/architecture-7GRP2DOG-K6PMPK7N.js +2 -0
  20. package/dist/web/chunks/{architectureDiagram-5GKGNRK7-QKPCVOD2.js → architectureDiagram-5GKGNRK7-JB5DD7KL.js} +2 -2
  21. package/dist/web/chunks/{blockDiagram-I7D4REHJ-4XZWNXLB.js → blockDiagram-I7D4REHJ-ARCDWS5D.js} +2 -2
  22. package/dist/web/chunks/{c4Diagram-7LVT6UL2-4HJHKNE3.js → c4Diagram-7LVT6UL2-57CIXPJZ.js} +2 -2
  23. package/dist/web/chunks/{chunk-GQPX4EIC.js → chunk-3EZ2OKHV.js} +2 -2
  24. package/dist/web/chunks/{chunk-37NHO5VO.js → chunk-4KJ2U3VQ.js} +2 -2
  25. package/dist/web/chunks/{chunk-OXLTOJNY.js → chunk-4ZUFUR3U.js} +2 -2
  26. package/dist/web/chunks/{chunk-46RPN6IE.js → chunk-63W35XXT.js} +2 -2
  27. package/dist/web/chunks/{chunk-LSVIQRSY.js → chunk-6YVFH4BZ.js} +2 -2
  28. package/dist/web/chunks/{chunk-6VRLULJH.js → chunk-7PUK2GON.js} +2 -2
  29. package/dist/web/chunks/{chunk-TPXX77KB.js → chunk-7Q4TXKAS.js} +2 -2
  30. package/dist/web/chunks/{chunk-4S2DRQJ6.js → chunk-7QRY2XB7.js} +2 -2
  31. package/dist/web/chunks/{chunk-2DLEMZHM.js → chunk-CA2KMNVI.js} +2 -2
  32. package/dist/web/chunks/{chunk-LHNPPNB7.js → chunk-CFMSYLIK.js} +2 -2
  33. package/dist/web/chunks/{chunk-4TORDSRR.js → chunk-CKJRXIX7.js} +2 -2
  34. package/dist/web/chunks/{chunk-L34PKG4P.js → chunk-CXXG5KL5.js} +2 -2
  35. package/dist/web/chunks/chunk-EFBAEJZJ.js +2 -0
  36. package/dist/web/chunks/{chunk-LQ6CTWX6.js → chunk-FKTXB6RJ.js} +2 -2
  37. package/dist/web/chunks/{chunk-TXNHMPKM.js → chunk-FU7R4QOG.js} +2 -2
  38. package/dist/web/chunks/{chunk-DIRT34TZ.js → chunk-GEV6X2TZ.js} +2 -2
  39. package/dist/web/chunks/{chunk-II6WN3ZG.js → chunk-GPW7TXQS.js} +2 -2
  40. package/dist/web/chunks/{chunk-5KNOHX5X.js → chunk-I6RMTJPN.js} +2 -2
  41. package/dist/web/chunks/{chunk-6TGTE6CF.js → chunk-IKC3ZQV7.js} +2 -2
  42. package/dist/web/chunks/{chunk-LDXBIOBF.js → chunk-ITN3D7RJ.js} +2 -2
  43. package/dist/web/chunks/{chunk-OODDZ447.js → chunk-J6N7AUC2.js} +2 -2
  44. package/dist/web/chunks/{chunk-FGASMJTA.js → chunk-J7VDGOTK.js} +2 -2
  45. package/dist/web/chunks/chunk-KVRWT2YT.js +2 -0
  46. package/dist/web/chunks/{chunk-6URXM4C4.js → chunk-NBC6B3KN.js} +2 -2
  47. package/dist/web/chunks/{chunk-HBEUVMXY.js → chunk-NLHJT4GD.js} +2 -2
  48. package/dist/web/chunks/{chunk-HNYXDXPN.js → chunk-NOVL2262.js} +2 -2
  49. package/dist/web/chunks/{chunk-FPLIRG3U.js → chunk-NQ2XP5EN.js} +2 -2
  50. package/dist/web/chunks/chunk-P44J6WNO.js +2 -0
  51. package/dist/web/chunks/{chunk-6KSWTVXD.js → chunk-QBOSTM7Q.js} +2 -2
  52. package/dist/web/chunks/{chunk-HAKJ3AUV.js → chunk-QKU4ZFG5.js} +2 -2
  53. package/dist/web/chunks/{chunk-T4HEWXAQ.js → chunk-RINQGKTH.js} +2 -2
  54. package/dist/web/chunks/{chunk-TPYBIPJG.js → chunk-RK4EOCHJ.js} +2 -2
  55. package/dist/web/chunks/{chunk-YM7LHP34.js → chunk-S4X6ERXI.js} +2 -2
  56. package/dist/web/chunks/{chunk-VY4GEFSG.js → chunk-SE57RN36.js} +2 -2
  57. package/dist/web/chunks/{chunk-6FQEBIA3.js → chunk-SGL7WI35.js} +3 -3
  58. package/dist/web/chunks/chunk-SOAWGUAD.js +2 -0
  59. package/dist/web/chunks/{chunk-7XAOOQR4.js → chunk-U6ILIHMR.js} +2 -2
  60. package/dist/web/chunks/{chunk-M3SWKTLZ.js → chunk-USZ3ZJYA.js} +2 -2
  61. package/dist/web/chunks/{chunk-MBZYSJFT.js → chunk-UU7BHEBD.js} +2 -2
  62. package/dist/web/chunks/{chunk-QNEZP2TE.js → chunk-WL4ZMLPV.js} +2 -2
  63. package/dist/web/chunks/{chunk-MZEMPN3C.js → chunk-XE4RLI22.js} +2 -2
  64. package/dist/web/chunks/{chunk-VAKN3BTM.js → chunk-XJ6FSQEO.js} +2 -2
  65. package/dist/web/chunks/{chunk-XBYCKXUJ.js → chunk-XM7VXEGI.js} +2 -2
  66. package/dist/web/chunks/{chunk-2RFQIKC6.js → chunk-XO4SHRSO.js} +2 -2
  67. package/dist/web/chunks/{chunk-BUZPUGIT.js → chunk-XOZZFIHV.js} +2 -2
  68. package/dist/web/chunks/{chunk-FNIFXWXL.js → chunk-YYJ5VFH5.js} +2 -2
  69. package/dist/web/chunks/{chunk-JOSXY3EP.js → chunk-ZX45GMMJ.js} +2 -2
  70. package/dist/web/chunks/{chunk-4IPDIKAU.js → chunk-ZXMMITLE.js} +2 -2
  71. package/dist/web/chunks/classDiagram-ZZMXUADV-ALD5ECFE.js +2 -0
  72. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-IMIEVQNX.js +2 -0
  73. package/dist/web/chunks/{cose-bilkent-JH36ORCC-ZPRW5JRW.js → cose-bilkent-JH36ORCC-YVEPG7XZ.js} +2 -2
  74. package/dist/web/chunks/cynefin-OW5HDTMX-5G3MG4ZJ.js +2 -0
  75. package/dist/web/chunks/{cynefinDiagram-5FMLGOSQ-O7GURHJG.js → cynefinDiagram-5FMLGOSQ-A3E3NM6X.js} +2 -2
  76. package/dist/web/chunks/{dagre-GXQ25YYZ-WK67O4N6.js → dagre-GXQ25YYZ-WKL3XLC6.js} +2 -2
  77. package/dist/web/chunks/{diagram-S7CK7UJ4-2CEO2EN2.js → diagram-S7CK7UJ4-AENTNBTM.js} +2 -2
  78. package/dist/web/chunks/{diagram-UQ7AKVKN-2Z4VHGF3.js → diagram-UQ7AKVKN-BN6IVDBP.js} +2 -2
  79. package/dist/web/chunks/{diagram-VSXAHHWV-AN4BOWYB.js → diagram-VSXAHHWV-X7IW7FU6.js} +2 -2
  80. package/dist/web/chunks/{diagram-VX7I27RA-VEZ2GXCM.js → diagram-VX7I27RA-4V6RQ6IS.js} +2 -2
  81. package/dist/web/chunks/{diagram-Z3DM3KII-TGGNDSLW.js → diagram-Z3DM3KII-ODYVRYAT.js} +2 -2
  82. package/dist/web/chunks/{ebnfDiagram-PWID7BFC-7RM57IJV.js → ebnfDiagram-PWID7BFC-2KD46JNN.js} +2 -2
  83. package/dist/web/chunks/{erDiagram-RLTQ6QDP-LCATC3YT.js → erDiagram-RLTQ6QDP-6MYZ2NRT.js} +2 -2
  84. package/dist/web/chunks/eventmodeling-NTZA5JFV-QZXC5VKS.js +2 -0
  85. package/dist/web/chunks/flowDiagram-HODETNUW-BILJ37ZX.js +2 -0
  86. package/dist/web/chunks/{ganttDiagram-EL5Y4UJY-5VPBBF2V.js → ganttDiagram-EL5Y4UJY-LVA23DND.js} +2 -2
  87. package/dist/web/chunks/gitGraph-4MIJSDKK-H43S2MKN.js +2 -0
  88. package/dist/web/chunks/{gitGraphDiagram-WWUBYQGX-HZMAGPIJ.js → gitGraphDiagram-WWUBYQGX-JRB4SUZI.js} +2 -2
  89. package/dist/web/chunks/info-A6RAGUB7-DKS7Q63Q.js +2 -0
  90. package/dist/web/chunks/infoDiagram-27XIBGKW-JLOVILVF.js +3 -0
  91. package/dist/web/chunks/{ishikawaDiagram-5VMMS53U-A54WWBPX.js → ishikawaDiagram-5VMMS53U-SUA2YN5D.js} +2 -2
  92. package/dist/web/chunks/{journeyDiagram-3NMN7TZE-XRCTMTR7.js → journeyDiagram-3NMN7TZE-ORMC2WB2.js} +2 -2
  93. package/dist/web/chunks/{kanban-definition-UXKFOSKX-UW2PQXZF.js → kanban-definition-UXKFOSKX-TPRG3VMF.js} +2 -2
  94. package/dist/web/chunks/{katex-B7HWCVTN.js → katex-DLHJF5VS.js} +2 -2
  95. package/dist/web/chunks/{mermaid.core-VL5SQK5M.js → mermaid.core-ZM3JSPVU.js} +3 -3
  96. package/dist/web/chunks/{mindmap-definition-YA3MSWOX-2H2Z6CVN.js → mindmap-definition-YA3MSWOX-BLW6WWFS.js} +2 -2
  97. package/dist/web/chunks/packet-AYTQ26CC-FIXQVEDM.js +2 -0
  98. package/dist/web/chunks/{pegDiagram-XKGWAZYB-KC4BYUN7.js → pegDiagram-XKGWAZYB-BYMP3YHY.js} +2 -2
  99. package/dist/web/chunks/pie-WAS4IAKB-R4EUNVPB.js +2 -0
  100. package/dist/web/chunks/{pieDiagram-E7YTZNPT-54T6XSU5.js → pieDiagram-E7YTZNPT-XOJE3H3L.js} +2 -2
  101. package/dist/web/chunks/{quadrantDiagram-AXDQQJYC-3G3RXSTE.js → quadrantDiagram-AXDQQJYC-23VSADTC.js} +2 -2
  102. package/dist/web/chunks/radar-RG4KPBEZ-O6Y2TENX.js +2 -0
  103. package/dist/web/chunks/railroad-74A4TZTK-PHWZ7KVH.js +2 -0
  104. package/dist/web/chunks/railroad-abnf-HS5TGJTU-DZ4OSJAN.js +2 -0
  105. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-GYBLRQUL.js +2 -0
  106. package/dist/web/chunks/railroad-peg-WCYAUIDC-ZK4ZOBSX.js +2 -0
  107. package/dist/web/chunks/{railroadDiagram-O6MQD6OU-3LHKFF5N.js → railroadDiagram-O6MQD6OU-Z5IEAZJK.js} +2 -2
  108. package/dist/web/chunks/{requirementDiagram-BXWQKSXE-M4LF54YT.js → requirementDiagram-BXWQKSXE-MNP4O73E.js} +2 -2
  109. package/dist/web/chunks/{sankeyDiagram-P5KCCOFB-USCKKKNT.js → sankeyDiagram-P5KCCOFB-PADI35QR.js} +2 -2
  110. package/dist/web/chunks/{sequenceDiagram-WJ2MYXX4-QZ2O4KWV.js → sequenceDiagram-WJ2MYXX4-FGWOVXU4.js} +2 -2
  111. package/dist/web/chunks/{sizeCapture-INFHLROL-DZI5JWEV.js → sizeCapture-INFHLROL-Y6H3VQLE.js} +2 -2
  112. package/dist/web/chunks/{stateDiagram-D77RDMKH-EQJNTBF3.js → stateDiagram-D77RDMKH-7PRO4WYR.js} +2 -2
  113. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-2Y6SWEJW.js +2 -0
  114. package/dist/web/chunks/{swimlanes-42K2YHIH-H7SZ2HG6.js → swimlanes-42K2YHIH-DXVTFB6Q.js} +2 -2
  115. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-U2LP4OEE.js +9 -0
  116. package/dist/web/chunks/{timeline-definition-24CTP7MA-4Q2ARIQ6.js → timeline-definition-24CTP7MA-7ZIALE6C.js} +2 -2
  117. package/dist/web/chunks/treeView-Q6P3EWNA-VSJ7TJ36.js +2 -0
  118. package/dist/web/chunks/treemap-WGGIJYW6-JZWFGRKS.js +2 -0
  119. package/dist/web/chunks/{vennDiagram-4TSXK5OY-WMJVK74C.js → vennDiagram-4TSXK5OY-IPXNDYWM.js} +2 -2
  120. package/dist/web/chunks/wardley-WFR3VGLG-PAUUFL5N.js +2 -0
  121. package/dist/web/chunks/{wardleyDiagram-VM6X3IG4-CLB324RQ.js → wardleyDiagram-VM6X3IG4-4Z2U2NNR.js} +2 -2
  122. package/dist/web/chunks/{xychartDiagram-S5SC5T6Z-G5C2R7C2.js → xychartDiagram-S5SC5T6Z-NAEIWN4K.js} +2 -2
  123. package/dist/web/page.css +1 -1
  124. package/dist/web/page.js +156 -125
  125. package/package.json +64 -62
  126. package/dist/web/chunks/architecture-7GRP2DOG-JLXNDD4H.js +0 -2
  127. package/dist/web/chunks/chunk-4KP3BIPB.js +0 -2
  128. package/dist/web/chunks/chunk-HX7W7GSO.js +0 -2
  129. package/dist/web/chunks/chunk-PR453BYT.js +0 -2
  130. package/dist/web/chunks/chunk-R7TFKRNM.js +0 -2
  131. package/dist/web/chunks/classDiagram-ZZMXUADV-4J5HHZD6.js +0 -2
  132. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-X6WY2DAS.js +0 -2
  133. package/dist/web/chunks/cynefin-OW5HDTMX-SVVTQRRB.js +0 -2
  134. package/dist/web/chunks/eventmodeling-NTZA5JFV-2SR57JAH.js +0 -2
  135. package/dist/web/chunks/flowDiagram-HODETNUW-HU6Y2EYQ.js +0 -2
  136. package/dist/web/chunks/gitGraph-4MIJSDKK-25JPIQP7.js +0 -2
  137. package/dist/web/chunks/info-A6RAGUB7-72MROTVX.js +0 -2
  138. package/dist/web/chunks/infoDiagram-27XIBGKW-BQYTPGNG.js +0 -3
  139. package/dist/web/chunks/packet-AYTQ26CC-NEGDW4B6.js +0 -2
  140. package/dist/web/chunks/pie-WAS4IAKB-OT3EMGHT.js +0 -2
  141. package/dist/web/chunks/radar-RG4KPBEZ-DCHU5FOQ.js +0 -2
  142. package/dist/web/chunks/railroad-74A4TZTK-RZX6D7H6.js +0 -2
  143. package/dist/web/chunks/railroad-abnf-HS5TGJTU-STTFN7R4.js +0 -2
  144. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-RBXU3IBK.js +0 -2
  145. package/dist/web/chunks/railroad-peg-WCYAUIDC-OD5BXOH6.js +0 -2
  146. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-WSCDKLG6.js +0 -2
  147. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-DFYTBPVS.js +0 -9
  148. package/dist/web/chunks/treeView-Q6P3EWNA-ADCP6RPT.js +0 -2
  149. package/dist/web/chunks/treemap-WGGIJYW6-NEV7DUDY.js +0 -2
  150. package/dist/web/chunks/wardley-WFR3VGLG-4QZOFDI5.js +0 -2
@@ -1,284 +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>
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
284
  - **QA:** <name> — <UTC>