@xhulz/nina 0.83.0 → 0.85.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 (273) hide show
  1. package/README.md +2 -0
  2. package/bin/nina.mjs +6 -1
  3. package/package.json +1 -1
  4. package/releases/0.84.0/core/GAPS.md +125 -0
  5. package/releases/0.84.0/core/answered.json +134 -0
  6. package/releases/0.84.0/core/defaults/tree/.claude/agents/architect.md +1 -0
  7. package/releases/0.84.0/core/defaults/tree/.claude/agents/dba.md +3 -0
  8. package/releases/0.84.0/core/defaults/tree/.claude/agents/devops.md +1 -0
  9. package/releases/0.84.0/core/defaults/tree/.claude/agents/implementer.md +1 -0
  10. package/releases/0.84.0/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
  11. package/releases/0.84.0/core/defaults/tree/.claude/agents/qa.md +7 -0
  12. package/releases/0.84.0/core/defaults/tree/.claude/agents/reviewer.md +3 -0
  13. package/releases/0.84.0/core/defaults/tree/.claude/agents/secops.md +3 -0
  14. package/releases/0.84.0/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
  15. package/releases/0.84.0/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
  16. package/releases/0.84.0/core/tiers.json +5 -0
  17. package/releases/0.84.0/core/tree/.claude/agents/architect.md +140 -0
  18. package/releases/0.84.0/core/tree/.claude/agents/dba.md +123 -0
  19. package/releases/0.84.0/core/tree/.claude/agents/design-reviewer.md +82 -0
  20. package/releases/0.84.0/core/tree/.claude/agents/devops.md +122 -0
  21. package/releases/0.84.0/core/tree/.claude/agents/implementer.md +208 -0
  22. package/releases/0.84.0/core/tree/.claude/agents/integration-tester.md +174 -0
  23. package/releases/0.84.0/core/tree/.claude/agents/planner.md +132 -0
  24. package/releases/0.84.0/core/tree/.claude/agents/qa.md +154 -0
  25. package/releases/0.84.0/core/tree/.claude/agents/reviewer.md +191 -0
  26. package/releases/0.84.0/core/tree/.claude/agents/secops.md +124 -0
  27. package/releases/0.84.0/core/tree/.claude/agents/solidity-auditor.md +130 -0
  28. package/releases/0.84.0/core/tree/.claude/agents/solidity-dev.md +127 -0
  29. package/releases/0.84.0/core/tree/.claude/agents-overview.md +65 -0
  30. package/releases/0.84.0/core/tree/.claude/frontend.md +10 -0
  31. package/releases/0.84.0/core/tree/.claude/graph.md +79 -0
  32. package/releases/0.84.0/core/tree/.claude/patterns.md +256 -0
  33. package/releases/0.84.0/core/tree/.claude/pills/README.md +150 -0
  34. package/releases/0.84.0/core/tree/.claude/pipeline.md +101 -0
  35. package/releases/0.84.0/core/tree/.claude/retrieval.md +103 -0
  36. package/releases/0.84.0/core/tree/.claude/router.md +224 -0
  37. package/releases/0.84.0/core/tree/.claude/templates/integration.md +48 -0
  38. package/releases/0.84.0/core/tree/CLAUDE.md +167 -0
  39. package/releases/0.84.0/core/tree/scripts/cost-watch.mjs +27 -0
  40. package/releases/0.84.0/core/tree/scripts/edit-guard.mjs +24 -0
  41. package/releases/0.84.0/core/tree/scripts/harness-check.mjs +84 -0
  42. package/releases/0.84.0/core/tree/scripts/loop-gate.mjs +19 -0
  43. package/releases/0.84.0/core/vocabulary.json +18 -0
  44. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
  45. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
  46. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
  47. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
  48. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
  49. package/releases/0.84.0/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
  50. package/releases/0.84.0/surfaces/blockchain/tree/.claude/graph.md +11 -0
  51. package/releases/0.84.0/surfaces/blockchain/tree/.claude/router.md +6 -0
  52. package/releases/0.84.0/surfaces/blockchain/tree/CLAUDE.md +12 -0
  53. package/releases/0.84.0/surfaces/d1/tree/.claude/agents/dba.md +15 -0
  54. package/releases/0.84.0/surfaces/d1/tree/.claude/agents/devops.md +2 -0
  55. package/releases/0.84.0/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
  56. package/releases/0.84.0/surfaces/d1/tree/.claude/patterns.md +8 -0
  57. package/releases/0.84.0/surfaces/d1/tree/CLAUDE.md +2 -0
  58. package/releases/0.84.0/surfaces/db/tree/.claude/agents/architect.md +5 -0
  59. package/releases/0.84.0/surfaces/db/tree/.claude/agents/dba.md +54 -0
  60. package/releases/0.84.0/surfaces/db/tree/.claude/agents/devops.md +5 -0
  61. package/releases/0.84.0/surfaces/db/tree/.claude/agents/implementer.md +2 -0
  62. package/releases/0.84.0/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
  63. package/releases/0.84.0/surfaces/db/tree/.claude/agents/planner.md +2 -0
  64. package/releases/0.84.0/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
  65. package/releases/0.84.0/surfaces/db/tree/.claude/agents/secops.md +2 -0
  66. package/releases/0.84.0/surfaces/db/tree/.claude/agents-overview.md +5 -0
  67. package/releases/0.84.0/surfaces/db/tree/.claude/graph.md +8 -0
  68. package/releases/0.84.0/surfaces/db/tree/.claude/patterns.md +22 -0
  69. package/releases/0.84.0/surfaces/db/tree/.claude/pipeline.md +13 -0
  70. package/releases/0.84.0/surfaces/db/tree/.claude/retrieval.md +5 -0
  71. package/releases/0.84.0/surfaces/db/tree/.claude/router.md +4 -0
  72. package/releases/0.84.0/surfaces/db/tree/CLAUDE.md +17 -0
  73. package/releases/0.84.0/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
  74. package/releases/0.84.0/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
  75. package/releases/0.84.0/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
  76. package/releases/0.84.0/surfaces/drizzle/tree/.claude/patterns.md +7 -0
  77. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
  78. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
  79. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
  80. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
  81. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
  82. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
  83. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
  84. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
  85. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
  86. package/releases/0.84.0/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
  87. package/releases/0.84.0/surfaces/edge-cf/tree/CLAUDE.md +29 -0
  88. package/releases/0.84.0/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
  89. package/releases/0.84.0/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
  90. package/releases/0.84.0/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
  91. package/releases/0.84.0/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
  92. package/releases/0.84.0/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
  93. package/releases/0.84.0/surfaces/frontend/tree/.claude/patterns.md +8 -0
  94. package/releases/0.84.0/surfaces/frontend/tree/.claude/retrieval.md +2 -0
  95. package/releases/0.84.0/surfaces/frontend/tree/.claude/router.md +14 -0
  96. package/releases/0.84.0/surfaces/frontend/tree/CLAUDE.md +5 -0
  97. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
  98. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
  99. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
  100. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
  101. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
  102. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
  103. package/releases/0.84.0/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
  104. package/releases/0.84.0/surfaces/integrations/tree/.claude/graph.md +10 -0
  105. package/releases/0.84.0/surfaces/integrations/tree/.claude/patterns.md +38 -0
  106. package/releases/0.84.0/surfaces/integrations/tree/.claude/pipeline.md +16 -0
  107. package/releases/0.84.0/surfaces/integrations/tree/.claude/retrieval.md +16 -0
  108. package/releases/0.84.0/surfaces/integrations/tree/.claude/router.md +6 -0
  109. package/releases/0.84.0/surfaces/integrations/tree/CLAUDE.md +17 -0
  110. package/releases/0.84.0/surfaces/money/tree/.claude/agents/architect.md +12 -0
  111. package/releases/0.84.0/surfaces/money/tree/.claude/agents/dba.md +14 -0
  112. package/releases/0.84.0/surfaces/money/tree/.claude/agents/implementer.md +11 -0
  113. package/releases/0.84.0/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
  114. package/releases/0.84.0/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
  115. package/releases/0.84.0/surfaces/money/tree/.claude/agents/secops.md +5 -0
  116. package/releases/0.84.0/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
  117. package/releases/0.84.0/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
  118. package/releases/0.84.0/surfaces/money/tree/.claude/graph.md +2 -0
  119. package/releases/0.84.0/surfaces/money/tree/.claude/patterns.md +49 -0
  120. package/releases/0.84.0/surfaces/money/tree/.claude/pipeline.md +2 -0
  121. package/releases/0.84.0/surfaces/money/tree/.claude/retrieval.md +2 -0
  122. package/releases/0.84.0/surfaces/money/tree/CLAUDE.md +11 -0
  123. package/releases/0.84.0/surfaces/pii/tree/.claude/agents/dba.md +2 -0
  124. package/releases/0.84.0/surfaces/pii/tree/.claude/agents/devops.md +8 -0
  125. package/releases/0.84.0/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
  126. package/releases/0.84.0/surfaces/pii/tree/.claude/agents/secops.md +2 -0
  127. package/releases/0.84.0/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
  128. package/releases/0.84.0/surfaces/pii/tree/CLAUDE.md +5 -0
  129. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
  130. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
  131. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
  132. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
  133. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
  134. package/releases/0.84.0/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
  135. package/releases/0.84.0/surfaces/prisma/tree/.claude/patterns.md +15 -0
  136. package/releases/0.84.0/surfaces/prisma/tree/CLAUDE.md +5 -0
  137. package/releases/0.85.0/core/GAPS.md +125 -0
  138. package/releases/0.85.0/core/answered.json +137 -0
  139. package/releases/0.85.0/core/defaults/tree/.claude/agents/architect.md +1 -0
  140. package/releases/0.85.0/core/defaults/tree/.claude/agents/dba.md +3 -0
  141. package/releases/0.85.0/core/defaults/tree/.claude/agents/devops.md +1 -0
  142. package/releases/0.85.0/core/defaults/tree/.claude/agents/implementer.md +1 -0
  143. package/releases/0.85.0/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
  144. package/releases/0.85.0/core/defaults/tree/.claude/agents/qa.md +7 -0
  145. package/releases/0.85.0/core/defaults/tree/.claude/agents/reviewer.md +3 -0
  146. package/releases/0.85.0/core/defaults/tree/.claude/agents/secops.md +3 -0
  147. package/releases/0.85.0/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
  148. package/releases/0.85.0/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
  149. package/releases/0.85.0/core/tiers.json +5 -0
  150. package/releases/0.85.0/core/tree/.claude/agents/architect.md +140 -0
  151. package/releases/0.85.0/core/tree/.claude/agents/dba.md +123 -0
  152. package/releases/0.85.0/core/tree/.claude/agents/design-reviewer.md +82 -0
  153. package/releases/0.85.0/core/tree/.claude/agents/devops.md +122 -0
  154. package/releases/0.85.0/core/tree/.claude/agents/implementer.md +208 -0
  155. package/releases/0.85.0/core/tree/.claude/agents/integration-tester.md +174 -0
  156. package/releases/0.85.0/core/tree/.claude/agents/planner.md +132 -0
  157. package/releases/0.85.0/core/tree/.claude/agents/qa.md +154 -0
  158. package/releases/0.85.0/core/tree/.claude/agents/reviewer.md +191 -0
  159. package/releases/0.85.0/core/tree/.claude/agents/secops.md +124 -0
  160. package/releases/0.85.0/core/tree/.claude/agents/solidity-auditor.md +130 -0
  161. package/releases/0.85.0/core/tree/.claude/agents/solidity-dev.md +127 -0
  162. package/releases/0.85.0/core/tree/.claude/agents-overview.md +65 -0
  163. package/releases/0.85.0/core/tree/.claude/frontend.md +10 -0
  164. package/releases/0.85.0/core/tree/.claude/graph.md +79 -0
  165. package/releases/0.85.0/core/tree/.claude/patterns.md +256 -0
  166. package/releases/0.85.0/core/tree/.claude/pills/README.md +150 -0
  167. package/releases/0.85.0/core/tree/.claude/pipeline.md +101 -0
  168. package/releases/0.85.0/core/tree/.claude/retrieval.md +103 -0
  169. package/releases/0.85.0/core/tree/.claude/router.md +224 -0
  170. package/releases/0.85.0/core/tree/.claude/templates/integration.md +48 -0
  171. package/releases/0.85.0/core/tree/CLAUDE.md +167 -0
  172. package/releases/0.85.0/core/tree/scripts/cost-watch.mjs +27 -0
  173. package/releases/0.85.0/core/tree/scripts/edit-guard.mjs +24 -0
  174. package/releases/0.85.0/core/tree/scripts/harness-check.mjs +84 -0
  175. package/releases/0.85.0/core/tree/scripts/loop-gate.mjs +19 -0
  176. package/releases/0.85.0/core/vocabulary.json +18 -0
  177. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
  178. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
  179. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
  180. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
  181. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
  182. package/releases/0.85.0/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
  183. package/releases/0.85.0/surfaces/blockchain/tree/.claude/graph.md +11 -0
  184. package/releases/0.85.0/surfaces/blockchain/tree/.claude/router.md +6 -0
  185. package/releases/0.85.0/surfaces/blockchain/tree/CLAUDE.md +12 -0
  186. package/releases/0.85.0/surfaces/d1/tree/.claude/agents/dba.md +15 -0
  187. package/releases/0.85.0/surfaces/d1/tree/.claude/agents/devops.md +2 -0
  188. package/releases/0.85.0/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
  189. package/releases/0.85.0/surfaces/d1/tree/.claude/patterns.md +8 -0
  190. package/releases/0.85.0/surfaces/d1/tree/CLAUDE.md +2 -0
  191. package/releases/0.85.0/surfaces/db/tree/.claude/agents/architect.md +5 -0
  192. package/releases/0.85.0/surfaces/db/tree/.claude/agents/dba.md +54 -0
  193. package/releases/0.85.0/surfaces/db/tree/.claude/agents/devops.md +5 -0
  194. package/releases/0.85.0/surfaces/db/tree/.claude/agents/implementer.md +2 -0
  195. package/releases/0.85.0/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
  196. package/releases/0.85.0/surfaces/db/tree/.claude/agents/planner.md +2 -0
  197. package/releases/0.85.0/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
  198. package/releases/0.85.0/surfaces/db/tree/.claude/agents/secops.md +2 -0
  199. package/releases/0.85.0/surfaces/db/tree/.claude/agents-overview.md +5 -0
  200. package/releases/0.85.0/surfaces/db/tree/.claude/graph.md +8 -0
  201. package/releases/0.85.0/surfaces/db/tree/.claude/patterns.md +22 -0
  202. package/releases/0.85.0/surfaces/db/tree/.claude/pipeline.md +13 -0
  203. package/releases/0.85.0/surfaces/db/tree/.claude/retrieval.md +5 -0
  204. package/releases/0.85.0/surfaces/db/tree/.claude/router.md +4 -0
  205. package/releases/0.85.0/surfaces/db/tree/CLAUDE.md +17 -0
  206. package/releases/0.85.0/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
  207. package/releases/0.85.0/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
  208. package/releases/0.85.0/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
  209. package/releases/0.85.0/surfaces/drizzle/tree/.claude/patterns.md +7 -0
  210. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
  211. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
  212. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
  213. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
  214. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
  215. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
  216. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
  217. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
  218. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
  219. package/releases/0.85.0/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
  220. package/releases/0.85.0/surfaces/edge-cf/tree/CLAUDE.md +29 -0
  221. package/releases/0.85.0/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
  222. package/releases/0.85.0/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
  223. package/releases/0.85.0/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
  224. package/releases/0.85.0/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
  225. package/releases/0.85.0/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
  226. package/releases/0.85.0/surfaces/frontend/tree/.claude/patterns.md +8 -0
  227. package/releases/0.85.0/surfaces/frontend/tree/.claude/retrieval.md +2 -0
  228. package/releases/0.85.0/surfaces/frontend/tree/.claude/router.md +14 -0
  229. package/releases/0.85.0/surfaces/frontend/tree/CLAUDE.md +5 -0
  230. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
  231. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
  232. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
  233. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
  234. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
  235. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
  236. package/releases/0.85.0/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
  237. package/releases/0.85.0/surfaces/integrations/tree/.claude/graph.md +10 -0
  238. package/releases/0.85.0/surfaces/integrations/tree/.claude/patterns.md +38 -0
  239. package/releases/0.85.0/surfaces/integrations/tree/.claude/pipeline.md +16 -0
  240. package/releases/0.85.0/surfaces/integrations/tree/.claude/retrieval.md +16 -0
  241. package/releases/0.85.0/surfaces/integrations/tree/.claude/router.md +6 -0
  242. package/releases/0.85.0/surfaces/integrations/tree/CLAUDE.md +17 -0
  243. package/releases/0.85.0/surfaces/money/tree/.claude/agents/architect.md +12 -0
  244. package/releases/0.85.0/surfaces/money/tree/.claude/agents/dba.md +14 -0
  245. package/releases/0.85.0/surfaces/money/tree/.claude/agents/implementer.md +11 -0
  246. package/releases/0.85.0/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
  247. package/releases/0.85.0/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
  248. package/releases/0.85.0/surfaces/money/tree/.claude/agents/secops.md +5 -0
  249. package/releases/0.85.0/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
  250. package/releases/0.85.0/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
  251. package/releases/0.85.0/surfaces/money/tree/.claude/graph.md +2 -0
  252. package/releases/0.85.0/surfaces/money/tree/.claude/patterns.md +49 -0
  253. package/releases/0.85.0/surfaces/money/tree/.claude/pipeline.md +2 -0
  254. package/releases/0.85.0/surfaces/money/tree/.claude/retrieval.md +2 -0
  255. package/releases/0.85.0/surfaces/money/tree/CLAUDE.md +11 -0
  256. package/releases/0.85.0/surfaces/pii/tree/.claude/agents/dba.md +2 -0
  257. package/releases/0.85.0/surfaces/pii/tree/.claude/agents/devops.md +8 -0
  258. package/releases/0.85.0/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
  259. package/releases/0.85.0/surfaces/pii/tree/.claude/agents/secops.md +2 -0
  260. package/releases/0.85.0/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
  261. package/releases/0.85.0/surfaces/pii/tree/CLAUDE.md +5 -0
  262. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
  263. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
  264. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
  265. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
  266. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
  267. package/releases/0.85.0/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
  268. package/releases/0.85.0/surfaces/prisma/tree/.claude/patterns.md +15 -0
  269. package/releases/0.85.0/surfaces/prisma/tree/CLAUDE.md +5 -0
  270. package/src/commands/dashboard.mjs +31 -6
  271. package/src/dashboard.mjs +11 -8
  272. package/src/demo.mjs +434 -0
  273. package/src/office.mjs +42 -9
@@ -0,0 +1,10 @@
1
+ <!-- nina:slot integrations.1 -->
2
+ - `integration-tester` — gate: runs the real dependency when the diff touches what its spec lists
3
+
4
+ <!-- nina:slot integrations.2 -->
5
+ - `implementer` → `integration-tester` on `DIFF-READY` — the diff touches what its spec lists
6
+ - `integration-tester` → `qa` on `APPROVED` — once the reviewer, and every other gate the diff went to, approved too
7
+ - `integration-tester` → `architect` on `REJECTED` — a premise is wrong · max 2
8
+ - `architect` → `integration-tester` on `BLOCKED` — a premise of a live service must be observed before the design can settle; the report goes back to the architect · max 2
9
+ - `integration-tester` → `implementer` on `REJECTED` — the premise holds and the code does not honor it · max 2
10
+ - `qa` → `integration-tester` on `FAIL` — the failure is the environment, not the code · max 2
@@ -0,0 +1,38 @@
1
+ <!-- nina:slot integrations.1 -->
2
+ - **Queue** (`{{API_DIR}}/src/queues/<q>.ts`) / **Webhook** (`{{API_DIR}}/src/routes/<source>-webhook.ts`): same discipline — validate the input, build deps, call one service function.
3
+
4
+ <!-- nina:slot integrations.2 -->
5
+ - **Every integration is reached through its boundary module.** Services import the boundary's typed interface; they never construct an HTTP client, an SDK instance or a binding handle themselves.
6
+
7
+ <!-- nina:slot integrations.3 -->
8
+
9
+ ---
10
+
11
+ ## Integrations (enforced by integration-tester + reviewer)
12
+
13
+ An **integration** is a dependency whose behavior this project does not define. Each one is declared in `.nina/profile.json` with a `kind`, or a list of them, and a premise's kind decides what counts as evidence for it:
14
+
15
+ | kind | what it is | a premise is settled by |
16
+ |---|---|---|
17
+ | `installed-library` | code on disk under `node_modules` | `<package dir>/node_modules/<lib>/<file>:<line>`, the version beside it; one no package links, through the one that depends on it: `<package dir>/node_modules/<parent> → <lib>@<version>/<file>:<line>` |
18
+ | `live-api` | a third-party HTTP API | a contract-test case, or a response observed against the service and captured verbatim |
19
+ | `platform-binding` | a runtime the host provides | behavior observed under the local emulator, plus the platform's installed types |
20
+
21
+ - **One boundary per integration.** All access goes through the module named as its `boundary`. A service, route, queue consumer or scheduled handler that reaches the dependency directly is a hard reject: there is then no single place to mock it, retry it, log it, or fix it.
22
+ - **A `live-api` gets two implementations behind one interface** — the real client, and a deterministic in-memory mock. One **contract-test suite** exercises the interface and **BOTH** must pass it. The mock passing alone proves nothing about production; when the two disagree, the mock is wrong, never the other way round.
23
+ - **Validate responses at the boundary**, in both implementations, so drift in the dependency surfaces structurally instead of as a type error three layers downstream.
24
+ - **Typed errors at the boundary.** It maps the dependency's failures to this project's own error types; callers never handle a raw HTTP status or a vendor error code.
25
+
26
+ ### Adding an integration
27
+
28
+ Four things, and none of them is optional:
29
+
30
+ 1. **The doc** — `.claude/integrations/<slug>.md`, from `.claude/templates/integration.md`. It opens with a premise index, then one `## P<n>` section per premise: a one-sentence claim, and the evidence that settles it in the form its kind requires.
31
+ 2. **The boundary** — one module, named in the profile entry. For a `live-api`: the interface, both implementations, and the contract suite.
32
+ 3. **The profile entry** — `slug`, `name`, `kind`, `boundary` and `skill` in `.nina/profile.json`. This is what makes the integration visible to the gates; an integration that is not declared is not gated.
33
+ 4. **The skill binding, when one exists.** If an installed skill covers this dependency, name it in the entry's `skill` field and add its row to the *Skills you MUST consult* table of every agent that touches the surface. The table ends in a `skills` slot for exactly this: write the row in `.nina/project/tree/.claude/agents/<role>.md` under that slot's marker (`nina where .claude/agents/<role>.md` names it), with the skill in the first cell and the trigger in the second (where the section is a list or a paragraph, the skill in bold), then `nina compose`. `nina check` confirms the agent's `tools:` grants `Skill`, which is an allowlist, not a hint. **If no installed skill covers it, bind none:** an invented binding is worse than none, because it reads as retrieval while being recall.
34
+
35
+ The **integration-tester** owns the doc: it creates it on first contact and appends a premise whenever it observes behavior the doc does not yet carry. The architect cites it, the implementer honors it, and the reviewer refuses a spec that touches the surface without it.
36
+
37
+ <!-- nina:slot integrations.4 -->
38
+ - **`live-api` integrations:** the contract-test suite for the boundary runs against BOTH implementations. Tests elsewhere inject the mock; the integration gate exercises the real service.
@@ -0,0 +1,16 @@
1
+ <!-- nina:slot integrations.1 -->
2
+
3
+ ### Integration-tester (mandatory for integration boundaries)
4
+
5
+ - **Trigger:** any diff touching the boundary module of a declared integration, or adding a call into one.
6
+ - **Input:** architect spec (with its **Integration premises** section) + implementer diff + repo state.
7
+ - **Output:** approve or reject. Approve includes a verified-premise table (premise → verdict → citation). Reject identifies which premise or contract case failed, and whether the fix is upstream (respec) or in code.
8
+ - **Tools:** Read, Write, Edit, Glob, Grep, Bash. Edits scoped to integration/contract test dirs and `.claude/integrations/**`.
9
+ - **Checks:**
10
+ - **`installed-library` / `platform-binding`:** run the real flow against the real dependency. Read `.claude/integrations/<slug>.md` and probe each premise it lists.
11
+ - **`live-api`:** run the **contract-test suite** for that boundary against **both** implementations. A mock that is green while the real client is not is a lie. Confirm nothing reaches the service outside its boundary module.
12
+ - Update `.claude/integrations/<slug>.md` when new behavior is observed.
13
+ - **Position:** after implementer, in parallel with any other gate the diff triggered. Reviewer verifies both gates ran.
14
+
15
+ <!-- nina:slot integrations.2 -->
16
+ - **If an integration boundary was touched → integration-tester approved.**
@@ -0,0 +1,16 @@
1
+ <!-- nina:slot integrations.1 -->
2
+
3
+ ## Integration docs (load whenever an integration is touched)
4
+
5
+ `.claude/integrations/<slug>.md` holds the verified premises for one integration. The architect MUST cite premises from it — or add new ones, carrying the evidence the integration's kind requires — in any spec that touches the boundary. The integration-tester probes each cited premise before `qa` goes out.
6
+
7
+ This project's integrations:
8
+
9
+ <!-- nina:slot integrations.2 -->
10
+
11
+ The integration-tester owns these docs. It creates one on first contact with a dependency and appends a premise whenever it observes behavior the doc does not yet carry, written against the version actually installed here or the response actually observed — never against the vendor's documentation.
12
+
13
+ Read the doc's index and the premise sections your task cites. **Not the whole file:** an integration doc for a large dependency runs to thousands of lines, and reading it end to end is one of the biggest time sinks in this pipeline.
14
+
15
+ <!-- nina:slot integrations.3 -->
16
+ | Integration boundary change | `.claude/integrations/<slug>.md`, and the boundary module named in the profile | architect (cites premises) → implementer → reviewer + **integration-tester** → qa |
@@ -0,0 +1,6 @@
1
+ <!-- nina:slot integrations.1 -->
2
+
3
+ ### Integration-tester is a guardrail for integration boundaries
4
+ Invoke **integration-tester** any time the diff touches the boundary module of a declared integration, or adds a call into one. It runs the real dependency, never a mock of it; for a `live-api` it runs the **contract-test suite against BOTH implementations**, so the mock can never pass while the live path is broken. No such change merges without its approval.
5
+
6
+ The architect's spec MUST carry an **Integration premises** section: every behavior the implementation relies on, each with the evidence its kind requires — `<package dir>/node_modules/<lib>/<file>:<line>` with its version for an installed library, a contract case or an observed response for a live API, the local emulator for a platform binding. Never by inference. An architect `BLOCKED` on a live service's premise gets it observed by the integration-tester, then resumes with its report.
@@ -0,0 +1,17 @@
1
+ <!-- nina:slot integrations.1 -->
2
+ | **ANY integration surface** (the boundary module of a declared integration, or a new call into one) | architect cites a premise, with the evidence its kind requires, for every dependency behavior the code relies on; **+ integration-tester beside the reviewer** |
3
+
4
+ <!-- nina:slot integrations.3 -->
5
+ - **integration-tester** → mandatory gate on any integration boundary; runs the real dependency rather than a mock of it, and for a `live-api` runs the contract-test suite against both implementations so they cannot diverge; verifies every cited premise; keeps `.claude/integrations/<slug>.md` current
6
+
7
+ <!-- nina:slot integrations.4 -->
8
+ 11. **Every integration has one boundary and one doc.** A dependency whose behavior you do not define — an installed library, a live third-party API, a platform binding — is reached through exactly ONE module, and nothing else speaks to it: no raw HTTP, SDK instance or binding handle in a route, service, queue consumer or scheduled handler. Each is declared in `.nina/profile.json` with its `kind` — a list, where it is more than one — and `boundary`, and documented at `.claude/integrations/<slug>.md`. A `live-api` carries two implementations behind one interface — the real client and a deterministic mock — and one contract-test suite that BOTH must pass; a mock that is green while the real client is not is a lie, and a hard reject.
9
+
10
+ <!-- nina:slot integrations.5 -->
11
+ 12. **A premise about an integration requires a citation, and the form depends on the kind.** The architect MAY NOT state a dependency's behavior as fact without evidence: for an `installed-library`, `<package dir>/node_modules/<lib>/<file>:<line>` with the version installed here beside it — the package's own link, not the store directory a peer change renames, and for a dependency of a dependency, which no package links, its parent's: `<package dir>/node_modules/<parent> → <lib>@<version>/<file>:<line>`; for a `live-api`, a contract-test case or a response observed against the service and captured verbatim — observed by the integration-tester, before the spec when the design depends on it; for a `platform-binding`, behavior observed under the local emulator. An integration of two kinds — a client library over a platform binding — cites each premise by the kind it is about: the library's own behavior from its source, the binding's from the emulator. Vendor docs, a README, a changelog and recall are NOT citations. An uncited premise is an assumption, and the spec is rejected by the reviewer.
12
+
13
+ <!-- nina:slot integrations.6 -->
14
+ 13. **Integration boundaries require the integration-tester gate before qa.** Any diff touching a boundary module, or adding a call into one, MUST pass the integration-tester, which runs beside the reviewer, before `qa` goes out. Unit-test mocks honor the spec, not the dependency — a mock is green because we wrote it that way. Only a run against the real thing, or a contract suite both implementations pass, catches drift.
15
+
16
+ <!-- nina:slot integrations.7 -->
17
+ - **an integration boundary**: a call to an external service, or a webhook or callback from one
@@ -0,0 +1,12 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Money invariants** — if the spec touches distribution, transfer generation, or a send to the payment integration, explicitly confirm the design honors:
3
+ - Money is integer {{MINOR_UNIT}} end to end; percentages are basis points. Never a floating-point type.
4
+ - A distribution may NEVER exceed the amount → **block** (reject the operation, do not clamp it).
5
+ - A distribution **less** than the amount → **allow**, surface the shortfall, leave the remainder **parked** — never silently distributed.
6
+ - Transfers are **idempotent** — never sent twice. Dedupe happens at the serialization point, via the key, before the side effect.
7
+ - Every legal state transition writes an audit row (who / when / from → to). Illegal transitions throw.
8
+
9
+ If the design cannot satisfy all of these, redesign before submitting the spec.
10
+
11
+ <!-- nina:slot money.2 -->
12
+ - Design a money movement that can exceed the amount it distributes, silently absorb a shortfall, or send a transfer twice. If the design needs monetary computation, that computation lives in `{{CORE_PKG}}` as a pure function — never inline in a service or route.
@@ -0,0 +1,14 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **No cache on a read that feeds a money write.** Anything that loads an amount or a balance before computing, approving or dispatching a transfer MUST NOT be cached. A stale amount contaminates a real money movement, and that damage is not undone by fixing the cache afterwards. **Hard reject if violated.**
3
+
4
+ <!-- nina:slot money.2 -->
5
+ - **Monetary columns are integer.** Money is stored as an integer of the currency's minor unit ({{MINOR_UNIT}}); percentages are basis points. Reject `Decimal`, `Float`, or any type that can hold a fraction of the minor unit.
6
+
7
+ <!-- nina:slot money.3 -->
8
+ - **Money-integrity constraints.** When the change touches the record of an outbound transfer, verify the **unique constraint on its idempotency key** exists (`@unique` in the schema → `UNIQUE` in the migration SQL). That constraint is what still holds when the application-level guard fails; a missing or dropped one is a **hard reject**. Verify likewise any uniqueness the ownership model depends on. Report it in its own *Money-integrity* section, before the final verdict.
9
+
10
+ <!-- nina:slot money.4 -->
11
+ - Approve a cache policy on a query that feeds a money write.
12
+
13
+ <!-- nina:slot money.5 -->
14
+ - Approve a change to an outbound-transfer record that lacks the unique constraint on its idempotency key.
@@ -0,0 +1,11 @@
1
+ <!-- nina:slot money.1 -->
2
+
3
+ ## Money invariants you MUST honor
4
+ - **A distribution may NEVER exceed the amount** → block. Implement the reject; never clamp and continue.
5
+ - **A shortfall is parked, not distributed.** Surface it and leave the remainder where it is — never auto-distribute it, never absorb it quietly.
6
+ - **Transfers are idempotent — never sent twice.** Dedupe at the serialization point via the key, *before* the side effect. A retry, a re-delivered message or a double-click must not produce a second transfer.
7
+ - **Every state transition writes an audit row** (entity, from → to, actor). No transition without a trail.
8
+ - The deterministic money logic lives in `{{CORE_PKG}}` — call it as a pure function; never embed the arithmetic in a service.
9
+
10
+ <!-- nina:slot money.2 -->
11
+ - Embed money arithmetic (sums, deltas, value comparisons, distribution math) inline in a service. Computation lives in `{{CORE_PKG}}`.
@@ -0,0 +1,3 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Confirm idempotency holds end to end.** Two sends with the same key → one logical transfer, no double send, and the serialization point refuses the second. This is the highest-blast-radius invariant in the system — drive it explicitly against the real service; do not infer it from reading the code.
3
+ - **Confirm money crosses the boundary as an integer of the minor unit**, and that conversion happens only in the module that owns it — never in a service, never through a floating-point type.
@@ -0,0 +1,23 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Enforce the money invariants. Each violation is a HARD REJECT → loop back to architect:**
3
+ - **A distribution may NEVER exceed the amount.** It is blocked, not clamped. A retention is just another destination — same arithmetic, in integer {{MINOR_UNIT}}.
4
+ - **A shortfall must be parked, not silently distributed.** The remainder stays where it is, and the shortfall is surfaced to whoever is owed it.
5
+ - **Transfers must be idempotent — never sent twice.** Every transfer carries a key, and dedupe happens at the serialization point before the side effect. A retry, a re-delivered message or a double-click must never produce a second transfer.
6
+ - **Every state transition writes an audit row** (entity type, id, from, to, actor) and follows the transitions declared in `.claude/architecture.md`. An undeclared transition, or one missing its audit row, is a hard reject.
7
+
8
+ <!-- nina:slot money.2 -->
9
+ - **money-invariants** — a distribution never exceeds the amount; a shortfall is parked, never
10
+ distributed; transfers idempotent at the serialization point; an audit row on every transition;
11
+ integer {{MINOR_UNIT}} and basis points; no arithmetic outside `{{CORE_PKG}}`.
12
+
13
+ <!-- nina:slot money.3 -->
14
+ - `{{CORE_PKG}}` money logic touched (distribution and transfer generation are high-blast-radius)
15
+
16
+ <!-- nina:slot money.4 -->
17
+ - Approve a change that lets a distribution exceed the amount, silently distributes a shortfall, sends a transfer without idempotent dedupe, or skips an audit row — those are hard rejects, loop back to architect.
18
+
19
+ <!-- nina:slot money.5 -->
20
+ - **If APPROVED:** ≤300 words. Sections: Verification commands run (typecheck/lint/build only — NEVER vitest), Spec-match (✅/❌ per item), Hard-rule checks (tenant scoping ✅, integer {{MINOR_UNIT}} / bps ✅, each gate the diff triggered ✅ (`.claude/graph.md`), money invariants ✅ — distribution ≤ amount, shortfall parked, idempotent transfer, audit row on transition), QA-attention flags (list any condition from the "stricter audit" list so QA knows what to focus on), Final verdict.
21
+
22
+ <!-- nina:slot money.6 -->
23
+ - Money invariant violated (distribution exceeds the amount, shortfall silently distributed, non-idempotent transfer, missing audit row) → back to **architect** for redesign.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Money-movement abuse (Hard Rules #3, #4, #5)** — **the money path reaches a real service; this is not a stub audit.** Is the idempotency contract actually enforced at the seam — the unique key, the serialization point, and the dedupe happening *before* the side effect? Can a replay, a double-click, a queue redelivery, or a manual reset of processed state cause a double send? Can a distribution exceed the amount, or a shortfall be silently distributed? Is whatever authorizes money OUT forgeable — a webhook without a verified signature, a callback trusted on its word? Is every state transition forced through an audit write? Flag any seam that is structurally unable to enforce its invariant, even where nothing has exploited it yet.
3
+
4
+ <!-- nina:slot money.2 -->
5
+ - **Idempotency-key & replay surface** — keys unguessable and collision-resistant where it matters; dedup enforced before the side effect, not after.
@@ -0,0 +1,4 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **The conservation property, asserted rather than argued.** Find the test that proves in equals
3
+ out plus retained, and check it holds on the adversarial paths too, not only the intended one.
4
+ Rounding that always favours the same party is a finding; so is a fee path with no upper bound.
@@ -0,0 +1,4 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **State the conservation property and assert it in the suite.** A contract that holds or routes an
3
+ amount has one — what goes in equals what goes out plus what is retained — and it belongs in a
4
+ test, not in a comment. Rounding is part of it: say which way it goes and who it favours.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot money.1 -->
2
+ - `reviewer` → `architect` on `REJECTED` — a money invariant is broken (a distribution over the amount, a shortfall distributed, a transfer that is not idempotent, a transition with no audit row): a design question before it is a code one · max 2
@@ -0,0 +1,49 @@
1
+ <!-- nina:slot money.1 -->
2
+
3
+ ---
4
+
5
+ ## Monetary values & percentages
6
+
7
+ - **Money is an integer of the currency's minor unit**, end to end — {{MINOR_UNIT}}, never a float, never a type that can hold a fraction of one. Source of precision: `{{MONEY_MODULE}}`.
8
+ - **Percentages are basis points** (`40% → 4000`, `100% → 10000`) so a distribution is exact without floating point.
9
+ - **Parsing, formatting and percentage arithmetic live in one module and nowhere else.** A second place that turns a string into money is a second rounding rule, and the two will disagree on a value somebody is owed.
10
+ - **Never** convert to a floating-point type before formatting, and never let a display format round a stored value.
11
+ - Monetary database columns are integer. JSON responses serialize them as **strings**, not numbers, so no client parses them into a float. The service owns the conversion.
12
+
13
+ <!-- nina:slot money.2 -->
14
+
15
+ ---
16
+
17
+ ## Distribution invariants (enforced by reviewer + unit tests)
18
+
19
+ The distribution engine lives in `{{CORE_PKG}}`. It is pure and total over integer {{MINOR_UNIT}}:
20
+
21
+ - A destination is either a percentage (basis points of the amount) or a fixed value.
22
+ - `total = Σ destinations`, computed in {{MINOR_UNIT}}.
23
+ - `total > amount` → **reject.** Never clamp, never distribute what is not there.
24
+ - `total < amount` → **allow**, surface the shortfall, and leave the remainder **parked**. Silence is the defect here: an unexplained remainder is indistinguishable from a bug.
25
+ - `total = amount` → OK.
26
+ - A retention is just another destination — the same arithmetic applies to it, with no special case.
27
+
28
+ <!-- nina:slot money.3 -->
29
+
30
+ ---
31
+
32
+ ## State machines & idempotency (enforced by reviewer)
33
+
34
+ - **Every money-moving entity is a state machine.** Its states and legal transitions are declared in `.claude/architecture.md`; the code follows the declaration, not the other way round. Illegal transitions throw; they are never silently coerced.
35
+ - **Every transition writes an audit row** (entity type, entity id, from, to, actor). No transition without a trail — the trail is what makes a money bug diagnosable after the money has moved.
36
+ - **Outbound transfers are idempotent.** Each carries a unique key, and dedupe happens before the side effect, at the serialization point.
37
+ - **One serialization point per balance.** Whatever computes and dispatches against a single balance never runs concurrently with itself. Two concurrent runs over one balance is how a double send happens even when every individual write is correct.
38
+
39
+ <!-- nina:slot money.4 -->
40
+ - **Money computation and dispatch go through the serialization point.** Routes, queue consumers and tools never run a distribution or a transfer synchronously in the request path.
41
+
42
+ <!-- nina:slot money.5 -->
43
+ - **The distribution engine lives in `{{CORE_PKG}}`.** Services call it as a pure function; they do not embed money logic inline.
44
+
45
+ <!-- nina:slot money.6 -->
46
+ - Idempotency on money-moving writes: the record carries an idempotency key, and the serialization point refuses the second attempt *before* the side effect.
47
+
48
+ <!-- nina:slot money.7 -->
49
+ - `{{CORE_PKG}}` is the most-tested package — pure functions over fixtures. Cover the distribution invariants exhaustively: over, under, exact, mixed percentage and fixed, and rounding.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Money invariants respected** — a distribution never exceeds the amount; a shortfall is parked, not distributed; transfers idempotent; every transition audited.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot money.1 -->
2
+ | New distribution / transfer logic | `.claude/architecture.md` § *Money*, `.claude/patterns.md` § *Distribution invariants*, `{{CORE_PKG}}/` | architect → implementer → reviewer → qa |
@@ -0,0 +1,11 @@
1
+ <!-- nina:slot money.1 -->
2
+ 3. **An outbound transfer is idempotent — it is NEVER sent twice.** Every transfer carries an idempotency key, and deduplication happens at a single serialization point **before** the side effect, never after it. A retry, a re-delivered queue message, a double-click and a replayed webhook must all collapse to one transfer. This is the highest-blast-radius invariant in the system: almost everything else can be corrected afterwards, and a duplicated transfer cannot.
3
+
4
+ <!-- nina:slot money.2 -->
5
+ 4. **Conservation — what comes in equals what goes out plus what is retained.** A distribution may NEVER exceed the amount it distributes → **block**. If it is **less**, **alert** and leave the remainder **parked** and visible — never silently distributed, never silently absorbed. All arithmetic is integer {{MINOR_UNIT}}; percentages are basis points. The LLM never computes a monetary value.
6
+
7
+ <!-- nina:slot money.3 -->
8
+ 5. **State-machine integrity.** Every money-moving entity has an explicit set of states and legal transitions, declared in `.claude/architecture.md` § *State machines* — not inferred from whatever code happens to exist. Only declared transitions are legal; an illegal one throws and is never silently coerced. **Every transition writes an audit row** (entity, id, from → to, actor, when). Skipping a state, inventing one, or landing a transition with no audit row is a hard reject.
9
+
10
+ <!-- nina:slot money.4 -->
11
+ - **money movement**: anything that creates, moves, settles or records a balance
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Privacy.** No sensitive value in clear text where it must not be. The categories are declared in `.claude/architecture.md` § *Privacy* — they are not decided per query, and not decided by you. **Document bytes live only in the object store, referenced by key: the column holds the key, never the bytes.** Any column the architect's spec flagged for masking must be encrypted at rest. Reject a schema that widens what is stored in the clear.
@@ -0,0 +1,8 @@
1
+ <!-- nina:slot pii.1 -->
2
+
3
+ **Point it at an UNAUTHENTICATED route — a sign-in page is the right one.** Never sign in, and never
4
+ screenshot a signed-in page. Accounts on deployed environments hold real personal data, and a
5
+ screenshot or a console dump pulls it into agent transcripts and logs, where it persists and nobody
6
+ ever looks for it again. That is a privacy leak with no upside here: the sign-in page proves
7
+ everything this check is for. It renders from the same bundle, it exercises the same build-time env
8
+ inlining (a missing variable blanks it identically), and it needs no session.
@@ -0,0 +1,8 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - Check for privacy regressions: **no sensitive value in a log, an error message — a library's own included — a URL or a test fixture**, per the categories in `.claude/architecture.md` § *Privacy*; document bytes only in the object store, never plaintext in the database; no leaked secret.
3
+
4
+ <!-- nina:slot pii.2 -->
5
+ - **privacy** — the privacy check above, in full: no sensitive value in a log, an error message, a
6
+ URL or a test fixture; document bytes only in the object store; no leaked secret. Where
7
+ **tenant-and-privacy** is dispatched, its reviewer owns this too and there is no separate one; where
8
+ it is not, this is a dimension of its own. Either way it is never nobody's.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Privacy (Hard Rule #8)** — the categories declared in `.claude/architecture.md` § *Privacy* must never appear in logs, in responses that do not need them, in error paths, or in the database in clear text. Check every endpoint that returns a person's record for fields it includes by accident: a `select` that quietly grew a column is the usual way this leaks. Check the error paths too — they are written last and reviewed least — and what the libraries on them print or carry in their own errors, bound values included.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Nothing personal reaches the chain.** What is written on-chain is public, permanent, and beyond
3
+ deletion by anyone — including by you, and including after a subject asks. A hash of a personal
4
+ identifier is not a protection: it is a lookup table for whoever holds the input set. Reject a
5
+ personal datum stored in state, emitted in an event, or passed as calldata.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot pii.1 -->
2
+ 8. **Sensitive personal data is classified, and the classification is enforced.** What counts as sensitive here — identity documents, financial identifiers, anything a person would not expect to be readable by whoever can read a log — is declared in `.claude/architecture.md` § *Privacy*, along with the regime that governs it ({{PRIVACY_REGIME}}). Encrypted at rest. **No sensitive value in a log, an error message, a URL, an analytics event, or an agent transcript** — the places nobody thinks about are exactly the ones that persist. That includes what a library puts in its own errors and prints itself: a database client's error can carry the query and every bound value, and a framework can log a whole error past the logger it was given. A database error is mapped at the data layer to a typed error from a closed list before anything logs or returns it, and a test proves that a bound value it writes reaches no thrown error. **A value absent from an error that never held it proves nothing:** each test that shows a mapper or a sanitizer keeps a value out drives a failure whose raw error carries it — the spec names that failure class and cites where it renders bound values, an error that prints the call or a violation that echoes the input, never one that names only its constraint — and asserts first that the raw, unmapped error of the same operation contains the value, a control kept in memory and never printed; the mutant that copies the raw error's `message`, `cause` or details across turns it red.<!-- nina:why --> In one project a spec proved its error mapper on a foreign-key failure, whose message and details name only the constraint, so no mapper that copied them could turn the test red.<!-- /nina:why --> **A test that proves a value stays out matches by containment** (`String(v).includes(value)`), never by equality: a leak arrives inside an id, a message or a key. It gives each log call in the source a run, counts the console's calls by method and asserts each method the path must not use at zero, and reads at least what the console prints of each entry and each error the runs produce, recursively: every own key, symbols and non-enumerable ones too (`Reflect.ownKeys`), and the entries of every `Map`, `Set`, `Headers` and `URLSearchParams`, unless the spec rules one out in writing. Its controls put their value where the real emitter puts its own, past a call's first argument and among several, and the spec names the window its spy covers and why nothing logs after it. Its forbidden values are the run's own that § *Privacy* keeps out — where it lists what may be logged, every other value the run carries — each with a control that embeds it in a longer string under an allowed key and must fail the check — the values one run adds as much as a shared list's, since a check that folds accents passes every control written in ASCII — and no fixture value inside another's.<!-- nina:why --> In one project an allowlist check that refused only equal values passed a mutant logging `${id}:${amount}`; the next read `Object.keys` and missed an amount on a non-enumerable property and an info log no row inspected; the one after left out a class and four log paths.<!-- /nina:why --> Where what it claims to keep out names a class — an attribute, an amount — it covers every member: a surface with open-ended slots is read whole, never through a list of them — every attribute of every element a rendered page carries, just as every property of an error is — and a sweep that read nothing fails; each forbidden value is looked for in every form the code can give it, formatted and raw; and each state that shows, hides or replaces a value is swept on its own, the one built to withhold it most of all. One mutant puts the value in a slot the check does not name — `data-x` on a page; on an object or an error, a non-enumerable key, a symbol key, a nested object, a `Map` entry, `cause`, the end of `message` or `stack` — and one per field puts that field's raw value in each such slot, on every error the code throws, not only one it builds: one left green is a slot or a form the check misses. The implementer runs them on its mirror, as one block it reuses, before `DIFF-READY`, whatever the step lists, and reports one left green as the row the spec lacks (Hard Rule #17), adding it only in a file the step authorizes.<!-- nina:why --> In one project a walk of own keys missed a `Map`, a symbol key and a nested object, and every control put its value in a call's first argument, where the runtime's loggers put theirs second; then three steps in two days went back from review for a slot no listed mutant tried — an error's `cause`, its `stack`, a hidden key.<!-- /nina:why --><!-- nina:why --> In one project a sweep of `data-testid`, `aria-label` and `title`, proven by mutants in those three, stayed green with the label in a `data-label`; the next swept every attribute for the formatted amounts and missed their raw centavos; the one after swept only the state that shows the figure, and the row built to show none carried it in a `title`.<!-- /nina:why --> Document bytes live only in the object store, referenced by key, never in the database in clear text.
3
+
4
+ <!-- nina:slot pii.2 -->
5
+ - **personal data**: where it is collected, stored, logged or sent
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,42 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-cli` | **before ANY `prisma` CLI command** — `validate`, `format`, `migrate dev`, `migrate diff`, `migrate deploy`. Flags differ between versions, and one of them (`migrate diff --shadow-database-url` against a live database) destroys the database it points at |
3
+ | `prisma-client-api` | auditing a new or changed query — filters, operators, `$transaction` semantics. Through a driver adapter, cite the adapter's installed source for what a transaction does: the skill describes the default engine, and an adapter can roll back less |
4
+
5
+ <!-- nina:slot prisma.2 -->
6
+ Neither skill covers a **caching or edge layer sitting on top of the client** — cache strategy,
7
+ edge-client behaviour and the rule about never caching a read that authorizes a write belong to that
8
+ layer's own integration doc, declared like any other integration. A skill does not replace it.
9
+
10
+ <!-- nina:slot prisma.3 -->
11
+ - **With Prisma, both offline.** Run `pnpm --filter {{DB_PKG_NAME}} exec prisma validate`; it must pass. Then run `prisma migrate diff` in its **offline, file-only form** and read the generated SQL, not just the Prisma delta. Its flags changed in Prisma 7, so read the installed major (`prisma --version`) before writing the command:
12
+
13
+ ```
14
+ # Prisma 6. Compare the PREVIOUS schema against the working one — pure file-to-file, no database.
15
+ git show HEAD:{{DB_PKG}}/prisma/schema.prisma > /tmp/schema-head.prisma
16
+ pnpm --filter {{DB_PKG_NAME}} exec prisma migrate diff \
17
+ --from-schema-datamodel /tmp/schema-head.prisma \
18
+ --to-schema-datamodel prisma/schema.prisma \
19
+ --script
20
+ ```
21
+
22
+ From Prisma 7 the two flags are `--from-schema` and `--to-schema`, and the schema engine starts from the
23
+ datasource in `prisma.config.ts` even for this diff: with none there, it prints nothing and exits 0. For
24
+ SQLite a placeholder the diff never opens is enough, a `file:` URL under a gitignored directory; for any
25
+ other provider, find out what the diff opens before you give it one. Never a real database's URL. A first schema has nothing at `HEAD`: diff it `--from-empty`. Compare the output against the
26
+ hand-written `migration.sql` to confirm the declarative parts match.
27
+
28
+ ⚠️ **Do NOT reach for `--from-migrations`.** It looks like the natural choice and it is a trap:
29
+ Prisma refuses it without a shadow database (`--shadow-database-url`, or from Prisma 7 a
30
+ `shadowDatabaseUrl` in `prisma.config.ts`), which pushes you toward supplying a database URL — the exact move that destroys databases (below). The file-to-file form above answers the
31
+ same question with no database involved.
32
+
33
+ ⛔ **NEVER point `--shadow-database-url`, `--from-url`, `--to-url`, `--from-schema-datasource` — or, from Prisma 7, a `shadowDatabaseUrl` or the config datasource behind `--from-config-datasource` — at a real database, most of all not the one `{{SECRETS_LOCAL}}` names.** Prisma **executes** the entire migration history against whatever database those flags name, which **DESTROYS ALL DATA** in it. A shadow database must be a disposable, empty database and nothing else. It does not announce itself: the command completes with a reassuring "empty migration" result and no error, having already destroyed everything in the database it was pointed at. If the offline form above cannot answer your question, **STOP and report that to the orchestrator** instead of reaching for a database URL.
34
+
35
+ <!-- nina:slot prisma.4 -->
36
+ - **Where reads are cached through Prisma Accelerate,** every `findUnique` / `findMany` on a hot read path names its `cacheStrategy` (`ttl` / `swr`), and one that feeds a correctness-critical write names none.
37
+
38
+ <!-- nina:slot prisma.5 -->
39
+ - **On an edge runtime,** new Prisma code paths use the edge client of the installed major: `@prisma/client/edge` up to Prisma 6; from 7, the client the `prisma-client` generator writes with the platform's `runtime` set, imported from where it is generated — `@prisma/client/edge` fails there with `MODULE_NOT_FOUND`.
40
+
41
+ <!-- nina:slot prisma.6 -->
42
+ - Run a Prisma command that writes to a real database — `prisma migrate dev`, `migrate deploy`, `migrate reset`, `migrate resolve`, `db push`, `db execute`, `$executeRaw*` — or **any `prisma migrate diff` variant carrying a database URL**, which silently wipes the database it points at.
@@ -0,0 +1,11 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ - **`prisma-cli`** — before `migrate deploy` or any other Prisma CLI command against a real database.
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ - **Prisma migrations go out with `prisma migrate deploy`**, and nothing else changes a shared database's schema.
6
+
7
+ <!-- nina:slot prisma.3 -->
8
+ - Run `prisma migrate diff --shadow-database-url <url>` against any live database. It **executes** the migration history against that database, destroying everything in it, and reports success. Use a disposable shadow database or don't run it.
9
+
10
+ <!-- nina:slot prisma.4 -->
11
+ - Run `prisma migrate reset` against a shared database, ever.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-cli` | a Prisma CLI command |
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,15 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ - **Database table/column names** (Prisma `@map` / `@@map`): `snake_case` in SQL, `camelCase` in TS.
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ - Where Prisma reads are cached through Accelerate, `cacheStrategy` lives in `{{DB_PKG}}`: services do not add, strip, or override cache policies.
6
+
7
+ <!-- nina:slot prisma.3 -->
8
+
9
+ ### Prisma
10
+
11
+ - Schema lives in `{{DB_PKG}}/prisma/schema.prisma`. Nowhere else.
12
+ - **Never write raw SQL** unless justified in a code comment with perf data.
13
+ - N+1 is solved with `include` / `select`, chosen deliberately.
14
+ - Where reads are cached through Accelerate, every `findUnique` / `findMany` on a hot path defines its `cacheStrategy`, and no direct connection string is embedded in code.
15
+ - Tests run a real Prisma client against a real database; the client is never mocked.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | Run any `prisma` CLI command (the database gate, devops, and the integration gate where there is one) | `prisma-cli` | flags differ between versions; `migrate diff --shadow-database-url` against a live DB wiped dev/staging once |
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ | Write or audit a Prisma query (architect, implementer, the database gate, reviewer) | `prisma-client-api` | filters, operators, `$transaction` semantics. a caching or edge layer on top of the client is **NOT covered** — its cache strategy belongs to that layer's own integration doc |
@@ -3,12 +3,14 @@
3
3
  * this machine, its address printed for a click (src/dashboard.mjs).
4
4
  *
5
5
  * nina dashboard [--project <dir>] [--port <n>] [--open]
6
+ * nina dashboard --demo [--port <n>] [--open] an invented project, anywhere, its office playing in a loop
6
7
  */
7
8
 
8
9
  import { existsSync } from 'node:fs';
9
10
  import { join, resolve } from 'node:path';
10
11
  import { HARNESS } from '../paths.mjs';
11
12
  import { viewDashboard } from '../dashboard.mjs';
13
+ import { makeDemo } from '../demo.mjs';
12
14
 
13
15
  /**
14
16
  * Runs the command.
@@ -19,15 +21,38 @@ import { viewDashboard } from '../dashboard.mjs';
19
21
  */
20
22
  export async function dashboard(argv, ctx) {
21
23
  const arg = (flag) => (argv.includes(flag) ? argv[argv.indexOf(flag) + 1] ?? '' : null);
22
- const target = resolve(arg('--project') ?? '.');
23
- if (!existsSync(join(target, HARNESS, 'profile.json'))) {
24
- console.error(` no ${HARNESS}/profile.json under ${target} — run it inside a project, or name one with --project\n`);
25
- return 1;
26
- }
27
24
  const port = arg('--port');
28
25
  if (port !== null && !(/^\d+$/.test(port) && Number(port) <= 65535)) {
29
26
  console.error(` --port takes a port number, 0 to 65535, and was given ${port}\n`);
30
27
  return 2;
31
28
  }
32
- return viewDashboard({ target, ctx, port: port === null ? undefined : Number(port), open: argv.includes('--open') });
29
+ const options = { ctx, port: port === null ? undefined : Number(port), open: argv.includes('--open') };
30
+ if (argv.includes('--demo')) {
31
+ if (arg('--project') !== null) {
32
+ console.error(' --demo shows an invented project, so it takes no --project: give one or the other\n');
33
+ return 2;
34
+ }
35
+ let demo;
36
+ try {
37
+ demo = await makeDemo(ctx);
38
+ } catch (error) {
39
+ console.error(` the demo could not be made — ${error?.message ?? error}\n`);
40
+ return 1;
41
+ }
42
+ // Removed however the process ends; on Ctrl+C, once the dashboard has closed. A terminal closed under it hangs it up,
43
+ // which ends the process with no `exit` event unless something listens.
44
+ process.once('exit', demo.remove);
45
+ process.once('SIGHUP', () => process.exit(129));
46
+ try {
47
+ return await viewDashboard({ ...options, target: demo.project, demo: true });
48
+ } finally {
49
+ demo.remove();
50
+ }
51
+ }
52
+ const target = resolve(arg('--project') ?? '.');
53
+ if (!existsSync(join(target, HARNESS, 'profile.json'))) {
54
+ console.error(` no ${HARNESS}/profile.json under ${target} — run it inside a project, or name one with --project, or see one with --demo\n`);
55
+ return 1;
56
+ }
57
+ return viewDashboard({ ...options, target });
33
58
  }
package/src/dashboard.mjs CHANGED
@@ -16,6 +16,7 @@ import { fileURLToPath } from 'node:url';
16
16
  import { readProfile } from './paths.mjs';
17
17
  import { projectRecords } from './store.mjs';
18
18
  import { officeRoutes } from './office.mjs';
19
+ import { DEMO_OFFICE } from './demo.mjs';
19
20
  import { listenHere, openInBrowser, refuseElsewhere, untilStopped } from './serve.mjs';
20
21
  import { layerRootFor } from './commands/compose.mjs';
21
22
  import { taskList } from './commands/runs.mjs';
@@ -100,18 +101,19 @@ export function dashboardTabs(target, ctx) {
100
101
  /**
101
102
  * Serves the dashboard: the page at `/`, each tab's data at `/api/<tab>`, and the office at `/office/`.
102
103
  *
103
- * @param {{target: string, ctx: {root: string}, port?: number, tell?: (line: string) => void}} options - `tell` is where
104
- * a failure is said: the terminal by default.
104
+ * @param {{target: string, ctx: {root: string}, port?: number, tell?: (line: string) => void, replay?: boolean, loop?: boolean, rest?: number, scale?: number}} options -
105
+ * `tell` is where a failure is said: the terminal by default. `replay`, `loop`, `rest` and `scale` are the office's
106
+ * (`officeRoutes`): the demo's plays its one session over and over (`DEMO_OFFICE`).
105
107
  * @returns {Promise<{url: string, close: () => Promise<void>}>}
106
108
  */
107
- export async function serveDashboard({ target, ctx, port = DASHBOARD_PORT, tell = console.error }) {
109
+ export async function serveDashboard({ target, ctx, port = DASHBOARD_PORT, tell = console.error, replay = false, loop = false, rest, scale }) {
108
110
  const tabs = dashboardTabs(target, ctx);
109
111
  const room = JSON.stringify({ project: basename(target) }).replace(/</g, '\\u003c');
110
112
  const page = readFileSync(PAGE, 'utf8').replace('/*NINA_DASHBOARD*/null', () => room);
111
113
  // The office polls its ledger while anyone watches it: made when its tab is first opened, not before.
112
114
  let office = null;
113
115
  const officeFor = () => {
114
- if (!office) office = officeRoutes({ target });
116
+ if (!office) office = officeRoutes({ target, replay, loop, scale, ...(rest === undefined ? {} : { rest }) });
115
117
  return office;
116
118
  };
117
119
  // What failed is said in the terminal that runs the dashboard, and never in the response: an error's message carries
@@ -172,13 +174,14 @@ export async function serveDashboard({ target, ctx, port = DASHBOARD_PORT, tell
172
174
  /**
173
175
  * Runs the dashboard until Ctrl+C: serves it, says where for a click, and opens it in the system's browser when asked.
174
176
  *
175
- * @param {{target: string, ctx: {root: string}, port?: number, open?: boolean}} options
177
+ * @param {{target: string, ctx: {root: string}, port?: number, open?: boolean, demo?: boolean}} options - `demo`: the
178
+ * project is the demo's, its office a replay in a loop, and the terminal says the data is invented.
176
179
  * @returns {Promise<number>} Process exit code.
177
180
  */
178
- export async function viewDashboard({ target, ctx, port = DASHBOARD_PORT, open = false }) {
181
+ export async function viewDashboard({ target, ctx, port = DASHBOARD_PORT, open = false, demo = false }) {
179
182
  let dashboard;
180
183
  try {
181
- dashboard = await serveDashboard({ target, ctx, port });
184
+ dashboard = await serveDashboard({ target, ctx, port, ...(demo ? DEMO_OFFICE : {}) });
182
185
  } catch (error) {
183
186
  console.error(` the dashboard could not open a port — ${error?.message ?? error}\n`);
184
187
  return 1;
@@ -186,7 +189,7 @@ export async function viewDashboard({ target, ctx, port = DASHBOARD_PORT, open =
186
189
  const stopped = untilStopped();
187
190
  const opened = open ? await openInBrowser(dashboard.url) : false;
188
191
  // The address ends its line, with nothing after it, so a terminal makes it a link.
189
- console.log(` the dashboard · ${basename(target)}`);
192
+ console.log(demo ? ' the dashboard · a demo: an invented notes app, three weeks of made-up work, no real project' : ` the dashboard · ${basename(target)}`);
190
193
  if (open && !opened) console.log(' No browser could be opened from here.');
191
194
  console.log(` ${opened ? 'Opened in your browser' : 'Click to open it'}: ${dashboard.url}`);
192
195
  console.log(' Ctrl+C closes the dashboard.\n');