@xhulz/nina 0.72.0 → 0.74.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 (269) hide show
  1. package/package.json +1 -1
  2. package/releases/0.73.0/core/GAPS.md +125 -0
  3. package/releases/0.73.0/core/answered.json +104 -0
  4. package/releases/0.73.0/core/defaults/tree/.claude/agents/architect.md +1 -0
  5. package/releases/0.73.0/core/defaults/tree/.claude/agents/dba.md +3 -0
  6. package/releases/0.73.0/core/defaults/tree/.claude/agents/devops.md +1 -0
  7. package/releases/0.73.0/core/defaults/tree/.claude/agents/implementer.md +1 -0
  8. package/releases/0.73.0/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
  9. package/releases/0.73.0/core/defaults/tree/.claude/agents/qa.md +7 -0
  10. package/releases/0.73.0/core/defaults/tree/.claude/agents/reviewer.md +3 -0
  11. package/releases/0.73.0/core/defaults/tree/.claude/agents/secops.md +3 -0
  12. package/releases/0.73.0/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
  13. package/releases/0.73.0/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
  14. package/releases/0.73.0/core/tree/.claude/agents/architect.md +135 -0
  15. package/releases/0.73.0/core/tree/.claude/agents/dba.md +119 -0
  16. package/releases/0.73.0/core/tree/.claude/agents/design-reviewer.md +78 -0
  17. package/releases/0.73.0/core/tree/.claude/agents/devops.md +118 -0
  18. package/releases/0.73.0/core/tree/.claude/agents/implementer.md +184 -0
  19. package/releases/0.73.0/core/tree/.claude/agents/integration-tester.md +170 -0
  20. package/releases/0.73.0/core/tree/.claude/agents/planner.md +132 -0
  21. package/releases/0.73.0/core/tree/.claude/agents/qa.md +150 -0
  22. package/releases/0.73.0/core/tree/.claude/agents/reviewer.md +187 -0
  23. package/releases/0.73.0/core/tree/.claude/agents/secops.md +120 -0
  24. package/releases/0.73.0/core/tree/.claude/agents/solidity-auditor.md +126 -0
  25. package/releases/0.73.0/core/tree/.claude/agents/solidity-dev.md +123 -0
  26. package/releases/0.73.0/core/tree/.claude/agents-overview.md +65 -0
  27. package/releases/0.73.0/core/tree/.claude/frontend.md +10 -0
  28. package/releases/0.73.0/core/tree/.claude/graph.md +79 -0
  29. package/releases/0.73.0/core/tree/.claude/patterns.md +256 -0
  30. package/releases/0.73.0/core/tree/.claude/pills/README.md +150 -0
  31. package/releases/0.73.0/core/tree/.claude/pipeline.md +101 -0
  32. package/releases/0.73.0/core/tree/.claude/retrieval.md +103 -0
  33. package/releases/0.73.0/core/tree/.claude/router.md +221 -0
  34. package/releases/0.73.0/core/tree/.claude/templates/integration.md +48 -0
  35. package/releases/0.73.0/core/tree/CLAUDE.md +167 -0
  36. package/releases/0.73.0/core/tree/scripts/cost-watch.mjs +27 -0
  37. package/releases/0.73.0/core/tree/scripts/edit-guard.mjs +24 -0
  38. package/releases/0.73.0/core/tree/scripts/harness-check.mjs +82 -0
  39. package/releases/0.73.0/core/tree/scripts/loop-gate.mjs +19 -0
  40. package/releases/0.73.0/core/vocabulary.json +15 -0
  41. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
  42. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
  43. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
  44. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
  45. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
  46. package/releases/0.73.0/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
  47. package/releases/0.73.0/surfaces/blockchain/tree/.claude/graph.md +11 -0
  48. package/releases/0.73.0/surfaces/blockchain/tree/.claude/router.md +6 -0
  49. package/releases/0.73.0/surfaces/blockchain/tree/CLAUDE.md +12 -0
  50. package/releases/0.73.0/surfaces/d1/tree/.claude/agents/dba.md +15 -0
  51. package/releases/0.73.0/surfaces/d1/tree/.claude/agents/devops.md +2 -0
  52. package/releases/0.73.0/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
  53. package/releases/0.73.0/surfaces/d1/tree/.claude/patterns.md +8 -0
  54. package/releases/0.73.0/surfaces/d1/tree/CLAUDE.md +2 -0
  55. package/releases/0.73.0/surfaces/db/tree/.claude/agents/architect.md +5 -0
  56. package/releases/0.73.0/surfaces/db/tree/.claude/agents/dba.md +54 -0
  57. package/releases/0.73.0/surfaces/db/tree/.claude/agents/devops.md +5 -0
  58. package/releases/0.73.0/surfaces/db/tree/.claude/agents/implementer.md +2 -0
  59. package/releases/0.73.0/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
  60. package/releases/0.73.0/surfaces/db/tree/.claude/agents/planner.md +2 -0
  61. package/releases/0.73.0/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
  62. package/releases/0.73.0/surfaces/db/tree/.claude/agents/secops.md +2 -0
  63. package/releases/0.73.0/surfaces/db/tree/.claude/agents-overview.md +5 -0
  64. package/releases/0.73.0/surfaces/db/tree/.claude/graph.md +8 -0
  65. package/releases/0.73.0/surfaces/db/tree/.claude/patterns.md +22 -0
  66. package/releases/0.73.0/surfaces/db/tree/.claude/pipeline.md +13 -0
  67. package/releases/0.73.0/surfaces/db/tree/.claude/retrieval.md +5 -0
  68. package/releases/0.73.0/surfaces/db/tree/.claude/router.md +4 -0
  69. package/releases/0.73.0/surfaces/db/tree/CLAUDE.md +17 -0
  70. package/releases/0.73.0/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
  71. package/releases/0.73.0/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
  72. package/releases/0.73.0/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
  73. package/releases/0.73.0/surfaces/drizzle/tree/.claude/patterns.md +7 -0
  74. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
  75. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
  76. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
  77. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
  78. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
  79. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
  80. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
  81. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
  82. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
  83. package/releases/0.73.0/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
  84. package/releases/0.73.0/surfaces/edge-cf/tree/CLAUDE.md +29 -0
  85. package/releases/0.73.0/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
  86. package/releases/0.73.0/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
  87. package/releases/0.73.0/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
  88. package/releases/0.73.0/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
  89. package/releases/0.73.0/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
  90. package/releases/0.73.0/surfaces/frontend/tree/.claude/patterns.md +8 -0
  91. package/releases/0.73.0/surfaces/frontend/tree/.claude/retrieval.md +2 -0
  92. package/releases/0.73.0/surfaces/frontend/tree/.claude/router.md +14 -0
  93. package/releases/0.73.0/surfaces/frontend/tree/CLAUDE.md +5 -0
  94. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
  95. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
  96. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
  97. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
  98. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
  99. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
  100. package/releases/0.73.0/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
  101. package/releases/0.73.0/surfaces/integrations/tree/.claude/graph.md +10 -0
  102. package/releases/0.73.0/surfaces/integrations/tree/.claude/patterns.md +38 -0
  103. package/releases/0.73.0/surfaces/integrations/tree/.claude/pipeline.md +16 -0
  104. package/releases/0.73.0/surfaces/integrations/tree/.claude/retrieval.md +16 -0
  105. package/releases/0.73.0/surfaces/integrations/tree/.claude/router.md +6 -0
  106. package/releases/0.73.0/surfaces/integrations/tree/CLAUDE.md +17 -0
  107. package/releases/0.73.0/surfaces/money/tree/.claude/agents/architect.md +12 -0
  108. package/releases/0.73.0/surfaces/money/tree/.claude/agents/dba.md +14 -0
  109. package/releases/0.73.0/surfaces/money/tree/.claude/agents/implementer.md +11 -0
  110. package/releases/0.73.0/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
  111. package/releases/0.73.0/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
  112. package/releases/0.73.0/surfaces/money/tree/.claude/agents/secops.md +5 -0
  113. package/releases/0.73.0/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
  114. package/releases/0.73.0/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
  115. package/releases/0.73.0/surfaces/money/tree/.claude/graph.md +2 -0
  116. package/releases/0.73.0/surfaces/money/tree/.claude/patterns.md +49 -0
  117. package/releases/0.73.0/surfaces/money/tree/.claude/pipeline.md +2 -0
  118. package/releases/0.73.0/surfaces/money/tree/.claude/retrieval.md +2 -0
  119. package/releases/0.73.0/surfaces/money/tree/CLAUDE.md +11 -0
  120. package/releases/0.73.0/surfaces/pii/tree/.claude/agents/dba.md +2 -0
  121. package/releases/0.73.0/surfaces/pii/tree/.claude/agents/devops.md +8 -0
  122. package/releases/0.73.0/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
  123. package/releases/0.73.0/surfaces/pii/tree/.claude/agents/secops.md +2 -0
  124. package/releases/0.73.0/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
  125. package/releases/0.73.0/surfaces/pii/tree/CLAUDE.md +5 -0
  126. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
  127. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
  128. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
  129. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
  130. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
  131. package/releases/0.73.0/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
  132. package/releases/0.73.0/surfaces/prisma/tree/.claude/patterns.md +15 -0
  133. package/releases/0.73.0/surfaces/prisma/tree/CLAUDE.md +5 -0
  134. package/releases/0.74.0/core/GAPS.md +125 -0
  135. package/releases/0.74.0/core/answered.json +104 -0
  136. package/releases/0.74.0/core/defaults/tree/.claude/agents/architect.md +1 -0
  137. package/releases/0.74.0/core/defaults/tree/.claude/agents/dba.md +3 -0
  138. package/releases/0.74.0/core/defaults/tree/.claude/agents/devops.md +1 -0
  139. package/releases/0.74.0/core/defaults/tree/.claude/agents/implementer.md +1 -0
  140. package/releases/0.74.0/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
  141. package/releases/0.74.0/core/defaults/tree/.claude/agents/qa.md +7 -0
  142. package/releases/0.74.0/core/defaults/tree/.claude/agents/reviewer.md +3 -0
  143. package/releases/0.74.0/core/defaults/tree/.claude/agents/secops.md +3 -0
  144. package/releases/0.74.0/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
  145. package/releases/0.74.0/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
  146. package/releases/0.74.0/core/tree/.claude/agents/architect.md +135 -0
  147. package/releases/0.74.0/core/tree/.claude/agents/dba.md +119 -0
  148. package/releases/0.74.0/core/tree/.claude/agents/design-reviewer.md +78 -0
  149. package/releases/0.74.0/core/tree/.claude/agents/devops.md +118 -0
  150. package/releases/0.74.0/core/tree/.claude/agents/implementer.md +184 -0
  151. package/releases/0.74.0/core/tree/.claude/agents/integration-tester.md +170 -0
  152. package/releases/0.74.0/core/tree/.claude/agents/planner.md +132 -0
  153. package/releases/0.74.0/core/tree/.claude/agents/qa.md +150 -0
  154. package/releases/0.74.0/core/tree/.claude/agents/reviewer.md +187 -0
  155. package/releases/0.74.0/core/tree/.claude/agents/secops.md +120 -0
  156. package/releases/0.74.0/core/tree/.claude/agents/solidity-auditor.md +126 -0
  157. package/releases/0.74.0/core/tree/.claude/agents/solidity-dev.md +123 -0
  158. package/releases/0.74.0/core/tree/.claude/agents-overview.md +65 -0
  159. package/releases/0.74.0/core/tree/.claude/frontend.md +10 -0
  160. package/releases/0.74.0/core/tree/.claude/graph.md +79 -0
  161. package/releases/0.74.0/core/tree/.claude/patterns.md +256 -0
  162. package/releases/0.74.0/core/tree/.claude/pills/README.md +150 -0
  163. package/releases/0.74.0/core/tree/.claude/pipeline.md +101 -0
  164. package/releases/0.74.0/core/tree/.claude/retrieval.md +103 -0
  165. package/releases/0.74.0/core/tree/.claude/router.md +224 -0
  166. package/releases/0.74.0/core/tree/.claude/templates/integration.md +48 -0
  167. package/releases/0.74.0/core/tree/CLAUDE.md +167 -0
  168. package/releases/0.74.0/core/tree/scripts/cost-watch.mjs +27 -0
  169. package/releases/0.74.0/core/tree/scripts/edit-guard.mjs +24 -0
  170. package/releases/0.74.0/core/tree/scripts/harness-check.mjs +82 -0
  171. package/releases/0.74.0/core/tree/scripts/loop-gate.mjs +19 -0
  172. package/releases/0.74.0/core/vocabulary.json +15 -0
  173. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
  174. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
  175. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
  176. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
  177. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
  178. package/releases/0.74.0/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
  179. package/releases/0.74.0/surfaces/blockchain/tree/.claude/graph.md +11 -0
  180. package/releases/0.74.0/surfaces/blockchain/tree/.claude/router.md +6 -0
  181. package/releases/0.74.0/surfaces/blockchain/tree/CLAUDE.md +12 -0
  182. package/releases/0.74.0/surfaces/d1/tree/.claude/agents/dba.md +15 -0
  183. package/releases/0.74.0/surfaces/d1/tree/.claude/agents/devops.md +2 -0
  184. package/releases/0.74.0/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
  185. package/releases/0.74.0/surfaces/d1/tree/.claude/patterns.md +8 -0
  186. package/releases/0.74.0/surfaces/d1/tree/CLAUDE.md +2 -0
  187. package/releases/0.74.0/surfaces/db/tree/.claude/agents/architect.md +5 -0
  188. package/releases/0.74.0/surfaces/db/tree/.claude/agents/dba.md +54 -0
  189. package/releases/0.74.0/surfaces/db/tree/.claude/agents/devops.md +5 -0
  190. package/releases/0.74.0/surfaces/db/tree/.claude/agents/implementer.md +2 -0
  191. package/releases/0.74.0/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
  192. package/releases/0.74.0/surfaces/db/tree/.claude/agents/planner.md +2 -0
  193. package/releases/0.74.0/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
  194. package/releases/0.74.0/surfaces/db/tree/.claude/agents/secops.md +2 -0
  195. package/releases/0.74.0/surfaces/db/tree/.claude/agents-overview.md +5 -0
  196. package/releases/0.74.0/surfaces/db/tree/.claude/graph.md +8 -0
  197. package/releases/0.74.0/surfaces/db/tree/.claude/patterns.md +22 -0
  198. package/releases/0.74.0/surfaces/db/tree/.claude/pipeline.md +13 -0
  199. package/releases/0.74.0/surfaces/db/tree/.claude/retrieval.md +5 -0
  200. package/releases/0.74.0/surfaces/db/tree/.claude/router.md +4 -0
  201. package/releases/0.74.0/surfaces/db/tree/CLAUDE.md +17 -0
  202. package/releases/0.74.0/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
  203. package/releases/0.74.0/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
  204. package/releases/0.74.0/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
  205. package/releases/0.74.0/surfaces/drizzle/tree/.claude/patterns.md +7 -0
  206. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
  207. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
  208. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
  209. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
  210. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
  211. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
  212. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
  213. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
  214. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
  215. package/releases/0.74.0/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
  216. package/releases/0.74.0/surfaces/edge-cf/tree/CLAUDE.md +29 -0
  217. package/releases/0.74.0/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
  218. package/releases/0.74.0/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
  219. package/releases/0.74.0/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
  220. package/releases/0.74.0/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
  221. package/releases/0.74.0/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
  222. package/releases/0.74.0/surfaces/frontend/tree/.claude/patterns.md +8 -0
  223. package/releases/0.74.0/surfaces/frontend/tree/.claude/retrieval.md +2 -0
  224. package/releases/0.74.0/surfaces/frontend/tree/.claude/router.md +14 -0
  225. package/releases/0.74.0/surfaces/frontend/tree/CLAUDE.md +5 -0
  226. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
  227. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
  228. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
  229. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
  230. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
  231. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
  232. package/releases/0.74.0/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
  233. package/releases/0.74.0/surfaces/integrations/tree/.claude/graph.md +10 -0
  234. package/releases/0.74.0/surfaces/integrations/tree/.claude/patterns.md +38 -0
  235. package/releases/0.74.0/surfaces/integrations/tree/.claude/pipeline.md +16 -0
  236. package/releases/0.74.0/surfaces/integrations/tree/.claude/retrieval.md +16 -0
  237. package/releases/0.74.0/surfaces/integrations/tree/.claude/router.md +6 -0
  238. package/releases/0.74.0/surfaces/integrations/tree/CLAUDE.md +17 -0
  239. package/releases/0.74.0/surfaces/money/tree/.claude/agents/architect.md +12 -0
  240. package/releases/0.74.0/surfaces/money/tree/.claude/agents/dba.md +14 -0
  241. package/releases/0.74.0/surfaces/money/tree/.claude/agents/implementer.md +11 -0
  242. package/releases/0.74.0/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
  243. package/releases/0.74.0/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
  244. package/releases/0.74.0/surfaces/money/tree/.claude/agents/secops.md +5 -0
  245. package/releases/0.74.0/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
  246. package/releases/0.74.0/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
  247. package/releases/0.74.0/surfaces/money/tree/.claude/graph.md +2 -0
  248. package/releases/0.74.0/surfaces/money/tree/.claude/patterns.md +49 -0
  249. package/releases/0.74.0/surfaces/money/tree/.claude/pipeline.md +2 -0
  250. package/releases/0.74.0/surfaces/money/tree/.claude/retrieval.md +2 -0
  251. package/releases/0.74.0/surfaces/money/tree/CLAUDE.md +11 -0
  252. package/releases/0.74.0/surfaces/pii/tree/.claude/agents/dba.md +2 -0
  253. package/releases/0.74.0/surfaces/pii/tree/.claude/agents/devops.md +8 -0
  254. package/releases/0.74.0/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
  255. package/releases/0.74.0/surfaces/pii/tree/.claude/agents/secops.md +2 -0
  256. package/releases/0.74.0/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
  257. package/releases/0.74.0/surfaces/pii/tree/CLAUDE.md +5 -0
  258. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
  259. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
  260. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
  261. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
  262. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
  263. package/releases/0.74.0/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
  264. package/releases/0.74.0/surfaces/prisma/tree/.claude/patterns.md +15 -0
  265. package/releases/0.74.0/surfaces/prisma/tree/CLAUDE.md +5 -0
  266. package/src/cost.mjs +3 -3
  267. package/src/office.html +52 -9
  268. package/src/office.mjs +155 -18
  269. package/src/transcripts.mjs +13 -1
@@ -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 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, asserts the silent channels silent, and reads every property of each entry and each error the runs produce, the non-enumerable ones too (`Object.getOwnPropertyNames`). 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, 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 --> 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 |
package/src/cost.mjs CHANGED
@@ -23,7 +23,7 @@
23
23
  import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
24
24
  import { dirname, join } from 'node:path';
25
25
  import { projectGateDir } from './gate.mjs';
26
- import { CLIP_MARK } from './transcripts.mjs';
26
+ import { CLIP_MARK, contextSize } from './transcripts.mjs';
27
27
 
28
28
  /** Where a run's counts are kept between calls, one file per agent. */
29
29
  const stateDir = (root) => join(projectGateDir(root), 'cost');
@@ -38,7 +38,7 @@ const KEEP_MS = 7 * 86_400_000;
38
38
  * @param {number} from - The offset already read.
39
39
  * @returns {{text: string, to: number}}
40
40
  */
41
- function gained(path, from) {
41
+ export function gained(path, from) {
42
42
  const size = statSync(path).size;
43
43
  if (size <= from) return { text: '', to: size < from ? 0 : from };
44
44
  const buffer = Buffer.alloc(size - from);
@@ -238,7 +238,7 @@ function count(input, { root, warnAt, now }) {
238
238
  state.read[message.id] = read;
239
239
  last = read;
240
240
  // The whole context that turn held, which a turn after an expired cache writes again.
241
- state.context = read + n(message.usage.cache_creation_input_tokens) + n(message.usage.input_tokens);
241
+ state.context = contextSize(message.usage);
242
242
  }
243
243
  } catch {
244
244
  // A torn line loses one message's count.
package/src/office.html CHANGED
@@ -31,8 +31,15 @@
31
31
  #tasks .who { margin-top: 3px; color: #c9cde0; font-size: 12px; overflow-wrap: anywhere; }
32
32
  #tasks .now { margin-top: 2px; color: #ffd34d; font-size: 12px; }
33
33
  #tasks .now.quiet { color: #8a8fa8; }
34
+ #tasks ul.agents { list-style: none; margin: 8px 0 0; padding: 0; }
35
+ #tasks ul.agents li { margin: 0 0 7px; padding: 0 0 0 14px; }
36
+ #tasks ul.agents li::before { left: 1px; top: 4px; width: 7px; height: 7px; border: 0; background: #ffd34d; animation: beat 1.2s ease-in-out infinite; }
37
+ #tasks .agent { overflow-wrap: anywhere; font-size: 12px; color: #c9cde0; }
38
+ #tasks .role { font: 600 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #fff8e8; margin-right: 6px; }
39
+ #tasks .desc { margin-top: 1px; color: #8a8fa8; font-size: 11px; overflow-wrap: anywhere; }
40
+ #tasks .took { margin-top: 1px; color: #a9adbf; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
34
41
  @keyframes beat { 50% { opacity: 0.35; } }
35
- @media (prefers-reduced-motion: reduce) { #tasks li.running::before { animation: none; } }
42
+ @media (prefers-reduced-motion: reduce) { #tasks li.running::before, #tasks ul.agents li::before { animation: none; } }
36
43
  </style>
37
44
  </head>
38
45
  <body>
@@ -805,6 +812,14 @@ function onBeat(b) {
805
812
  }
806
813
  return;
807
814
  }
815
+ if (b.type === 'home') {
816
+ // Reported, and nobody came for the work in time: it goes home, unless it was sent back to work meanwhile.
817
+ const p = b.agent ? people.get(b.agent) : null;
818
+ if (!p || !(p.reported || p.reporting) || p.leaving) return;
819
+ if (b.instant) leave(p, true);
820
+ else act(p, () => p.reported && !p.typing && !p.leaving && leave(p));
821
+ return;
822
+ }
808
823
  if (b.type === 'refused' || b.type === 'stale') {
809
824
  // A dispatch the owner refused never ran; a run that never reported has stopped. Either way, whoever sat down
810
825
  // for it gets up — and a refusal answers the gate's call.
@@ -975,14 +990,16 @@ function syncButtons() {
975
990
  * The session's work, task by task, as the server cuts it — the way `nina runs` does: each named by the words the
976
991
  * orchestrator gave its first dispatch, with the stages that worked on it, from when that went out to the verdict
977
992
  * that closed it. The server sends the whole list whenever it changes, and it replaces what is here. A task still
978
- * open counts up while anyone is at work on it, and stops at the last thing that happened while nobody is.
993
+ * open counts up while anyone is at work on it, and stops at the last of its runs to start or end while nobody is;
994
+ * under it, each of its agents at work, as Claude Code lists its own: the stage, what it is doing now, the words of
995
+ * its dispatch, how long it has been at work and the context it holds.
979
996
  */
980
997
  const SIDE = 300;
981
998
  /** Narrower than this, the timeline is drawn over the room, and starts hidden. */
982
999
  const NARROW = 760;
983
1000
  const TASKS_KEY = 'nina-office-tasks';
984
1001
  let tasks = [];
985
- /** The newest dispatch or verdict: a replay's clock, and where an idle task's count stops. */
1002
+ /** The newest dispatch or verdict: a replay's clock. */
986
1003
  let lastActivity = 0;
987
1004
  let tasksOpen = (() => {
988
1005
  try {
@@ -998,6 +1015,15 @@ let tasksOpen = (() => {
998
1015
  const atWork = () => [...new Set([...people.values()].filter((p) => p.work && !p.reported && !p.leaving).map((p) => p.role))];
999
1016
 
1000
1017
  const two = (n) => String(n).padStart(2, '0');
1018
+ /** How long an agent has been at work, as Claude Code says it: 28s, 7m 19s, 1h 4m. */
1019
+ function took(ms) {
1020
+ const s = Math.max(0, Math.floor(ms / 1000));
1021
+ if (s < 60) return `${s}s`;
1022
+ if (s < 3600) return `${Math.floor(s / 60)}m ${s % 60}s`;
1023
+ return `${Math.floor(s / 3600)}h ${Math.floor((s % 3600) / 60)}m`;
1024
+ }
1025
+ /** A count of tokens: 850, 49.8k, 1.2M — a count that rounds to a thousand thousands is a million. */
1026
+ const tokens = (n) => (n >= 999_950 ? `${(n / 1e6).toFixed(1)}M` : n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n));
1001
1027
  /** A moment as the hour, with the day when it is not the day of `beside` — now, or the moment it follows. */
1002
1028
  function stamp(at, beside) {
1003
1029
  const t = new Date(at);
@@ -1021,26 +1047,43 @@ function counter(ms) {
1021
1047
  function drawTasks() {
1022
1048
  if (!tasksOpen) return;
1023
1049
  const clock = status.startsWith('replay') ? lastActivity : Date.now();
1024
- const working = atWork();
1025
- const line = (cls, text) => {
1026
- const el = document.createElement('div');
1050
+ const line = (cls, text, tag = 'div') => {
1051
+ const el = document.createElement(tag);
1027
1052
  el.className = cls;
1028
1053
  el.textContent = text;
1029
1054
  return el;
1030
1055
  };
1056
+ // What it is doing now, as Claude Code's list leads with, and under it the words its dispatch was given.
1057
+ const agentRow = (a) => {
1058
+ const li = document.createElement('li');
1059
+ const what = line('agent', '');
1060
+ what.append(line('role', a.role, 'span'), a.doing ?? a.desc ?? '');
1061
+ li.append(what);
1062
+ if (a.doing && a.desc) li.append(line('desc', a.desc));
1063
+ li.append(line('took', a.tokens === null ? took(clock - a.start) : `${took(clock - a.start)} · ${tokens(a.tokens)} tokens`));
1064
+ return li;
1065
+ };
1031
1066
  const shown = [...tasks].sort((a, b) => b.start - a.start);
1032
1067
  document.getElementById('task-list').replaceChildren(
1033
1068
  ...shown.map((t) => {
1034
1069
  const li = document.createElement('li');
1035
1070
  const running = t.end === null;
1036
- const idle = running && working.length === 0;
1071
+ const agents = t.agents ?? [];
1072
+ const idle = running && agents.length === 0;
1037
1073
  li.className = running ? (idle ? 'idle' : 'running') : t.how === 'closed' ? 'done' : 'ended';
1038
1074
  li.append(line('name', t.name || '(no description)'));
1039
1075
  if (t.who?.length > 0) li.append(line('who', t.who.map(([role, n]) => (n > 1 ? `${role} ×${n}` : role)).join(' · ')));
1040
1076
  if (running) {
1041
- const upTo = idle ? Math.max(t.start, lastActivity) : Math.max(t.start, clock);
1077
+ // Idle, it stops at the last of its own runs to start or end, whatever another task is doing.
1078
+ const upTo = idle ? Math.max(t.start, t.last ?? t.start) : Math.max(t.start, clock);
1042
1079
  li.append(line('when', `${stamp(t.start, clock)} → now · ${counter(upTo - t.start)}`));
1043
- li.append(line('now', idle ? `idle since ${stamp(lastActivity, clock)}` : `at work: ${working.join(', ')}`));
1080
+ if (idle) li.append(line('now', `idle since ${stamp(t.last ?? t.start, clock)}`));
1081
+ else {
1082
+ const list = document.createElement('ul');
1083
+ list.className = 'agents';
1084
+ list.append(...agents.map(agentRow));
1085
+ li.append(list);
1086
+ }
1044
1087
  } else {
1045
1088
  li.append(line('when', `${stamp(t.start, clock)} → ${stamp(t.end, t.start)} · ${span(t.end - t.start)}`));
1046
1089
  // A task that waited — overnight, on the owner — says how much of it anyone was at work.