@inharness-ai/claude4spec 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/.claude/skills/c4s-brief-implementer/SKILL.md +105 -0
  2. package/.claude/skills/c4s-spec-reader/SKILL.md +46 -0
  3. package/CHANGELOG.md +19 -0
  4. package/LICENSE +21 -0
  5. package/README.md +50 -0
  6. package/dist/bin/agent-md-template.d.ts +1 -0
  7. package/dist/bin/agent-md-template.js +76 -0
  8. package/dist/bin/agent-md-template.js.map +1 -0
  9. package/dist/bin/bootstrap-template.d.ts +1 -0
  10. package/dist/bin/bootstrap-template.js +12 -0
  11. package/dist/bin/bootstrap-template.js.map +1 -0
  12. package/dist/bin/c4s/args.d.ts +13 -0
  13. package/dist/bin/c4s/args.js +82 -0
  14. package/dist/bin/c4s/args.js.map +1 -0
  15. package/dist/bin/c4s/commands/_meta.d.ts +2 -0
  16. package/dist/bin/c4s/commands/_meta.js +13 -0
  17. package/dist/bin/c4s/commands/_meta.js.map +1 -0
  18. package/dist/bin/c4s/commands/catalog.d.ts +2 -0
  19. package/dist/bin/c4s/commands/catalog.js +38 -0
  20. package/dist/bin/c4s/commands/catalog.js.map +1 -0
  21. package/dist/bin/c4s/commands/detail.d.ts +2 -0
  22. package/dist/bin/c4s/commands/detail.js +22 -0
  23. package/dist/bin/c4s/commands/detail.js.map +1 -0
  24. package/dist/bin/c4s/commands/element-list.d.ts +2 -0
  25. package/dist/bin/c4s/commands/element-list.js +23 -0
  26. package/dist/bin/c4s/commands/element-list.js.map +1 -0
  27. package/dist/bin/c4s/commands/inline-mention.d.ts +2 -0
  28. package/dist/bin/c4s/commands/inline-mention.js +22 -0
  29. package/dist/bin/c4s/commands/inline-mention.js.map +1 -0
  30. package/dist/bin/c4s/commands/list-slugs.d.ts +2 -0
  31. package/dist/bin/c4s/commands/list-slugs.js +16 -0
  32. package/dist/bin/c4s/commands/list-slugs.js.map +1 -0
  33. package/dist/bin/c4s/commands/list-tags.d.ts +2 -0
  34. package/dist/bin/c4s/commands/list-tags.js +13 -0
  35. package/dist/bin/c4s/commands/list-tags.js.map +1 -0
  36. package/dist/bin/c4s/commands/resolve.d.ts +2 -0
  37. package/dist/bin/c4s/commands/resolve.js +40 -0
  38. package/dist/bin/c4s/commands/resolve.js.map +1 -0
  39. package/dist/bin/c4s/commands/section-ref.d.ts +2 -0
  40. package/dist/bin/c4s/commands/section-ref.js +25 -0
  41. package/dist/bin/c4s/commands/section-ref.js.map +1 -0
  42. package/dist/bin/c4s/commands/single-element.d.ts +2 -0
  43. package/dist/bin/c4s/commands/single-element.js +22 -0
  44. package/dist/bin/c4s/commands/single-element.js.map +1 -0
  45. package/dist/bin/c4s/commands/tagged-list-mixed.d.ts +2 -0
  46. package/dist/bin/c4s/commands/tagged-list-mixed.js +39 -0
  47. package/dist/bin/c4s/commands/tagged-list-mixed.js.map +1 -0
  48. package/dist/bin/c4s/commands/tagged-list.d.ts +2 -0
  49. package/dist/bin/c4s/commands/tagged-list.js +24 -0
  50. package/dist/bin/c4s/commands/tagged-list.js.map +1 -0
  51. package/dist/bin/c4s/context.d.ts +12 -0
  52. package/dist/bin/c4s/context.js +27 -0
  53. package/dist/bin/c4s/context.js.map +1 -0
  54. package/dist/bin/c4s/errors.d.ts +6 -0
  55. package/dist/bin/c4s/errors.js +11 -0
  56. package/dist/bin/c4s/errors.js.map +1 -0
  57. package/dist/bin/c4s/output.d.ts +4 -0
  58. package/dist/bin/c4s/output.js +57 -0
  59. package/dist/bin/c4s/output.js.map +1 -0
  60. package/dist/bin/c4s/project.d.ts +1 -0
  61. package/dist/bin/c4s/project.js +23 -0
  62. package/dist/bin/c4s/project.js.map +1 -0
  63. package/dist/bin/c4s/type-validation.d.ts +3 -0
  64. package/dist/bin/c4s/type-validation.js +11 -0
  65. package/dist/bin/c4s/type-validation.js.map +1 -0
  66. package/dist/bin/c4s-mcp.d.ts +2 -0
  67. package/dist/bin/c4s-mcp.js +118 -0
  68. package/dist/bin/c4s-mcp.js.map +1 -0
  69. package/dist/bin/c4s.d.ts +2 -0
  70. package/dist/bin/c4s.js +134 -0
  71. package/dist/bin/c4s.js.map +1 -0
  72. package/dist/bin/claude4spec.d.ts +2 -0
  73. package/dist/bin/claude4spec.js +132 -0
  74. package/dist/bin/claude4spec.js.map +1 -0
  75. package/dist/bin/gitignore.d.ts +1 -0
  76. package/dist/bin/gitignore.js +44 -0
  77. package/dist/bin/gitignore.js.map +1 -0
  78. package/dist/client/assets/arc-D8brDDag.js +1 -0
  79. package/dist/client/assets/architectureDiagram-3BPJPVTR-Bmh1uTQZ.js +36 -0
  80. package/dist/client/assets/blockDiagram-GPEHLZMM-55jaVWwd.js +132 -0
  81. package/dist/client/assets/c4Diagram-AAUBKEIU-Dxm0tLsZ.js +10 -0
  82. package/dist/client/assets/channel-ArVcv4Yl.js +1 -0
  83. package/dist/client/assets/chunk-2J33WTMH-vDJ1slcJ.js +1 -0
  84. package/dist/client/assets/chunk-4BX2VUAB-DP6CC-Qn.js +1 -0
  85. package/dist/client/assets/chunk-55IACEB6-SgOSJYkL.js +1 -0
  86. package/dist/client/assets/chunk-727SXJPM-BtRfbjBO.js +206 -0
  87. package/dist/client/assets/chunk-AQP2D5EJ-yIRaTgFg.js +231 -0
  88. package/dist/client/assets/chunk-FMBD7UC4-B_VD4t8N.js +15 -0
  89. package/dist/client/assets/chunk-ND2GUHAM-BvJdtX82.js +1 -0
  90. package/dist/client/assets/chunk-QZHKN3VN-BLNWKymD.js +1 -0
  91. package/dist/client/assets/classDiagram-4FO5ZUOK-B3nmPR7w.js +1 -0
  92. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-B3nmPR7w.js +1 -0
  93. package/dist/client/assets/cose-bilkent-S5V4N54A-BQyA-r-y.js +1 -0
  94. package/dist/client/assets/cytoscape.esm-D_LviqZs.js +331 -0
  95. package/dist/client/assets/dagre-BM42HDAG-CAh0mTzA.js +4 -0
  96. package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  97. package/dist/client/assets/diagram-2AECGRRQ-C83TGK4o.js +43 -0
  98. package/dist/client/assets/diagram-5GNKFQAL-2L6uowvf.js +10 -0
  99. package/dist/client/assets/diagram-KO2AKTUF-Cj5n4jdq.js +3 -0
  100. package/dist/client/assets/diagram-LMA3HP47-Bp5SDMjg.js +24 -0
  101. package/dist/client/assets/diagram-OG6HWLK6-cFsDQ8Qk.js +24 -0
  102. package/dist/client/assets/erDiagram-TEJ5UH35-D8G5xpg3.js +85 -0
  103. package/dist/client/assets/flowDiagram-I6XJVG4X-CuNudlCD.js +162 -0
  104. package/dist/client/assets/ganttDiagram-6RSMTGT7-CtFlsB15.js +292 -0
  105. package/dist/client/assets/gitGraphDiagram-PVQCEYII-h66Tso4O.js +106 -0
  106. package/dist/client/assets/graph-CAnANduQ.js +1 -0
  107. package/dist/client/assets/index-CZOpb3O7.css +1 -0
  108. package/dist/client/assets/index-D5ljIkCJ.js +727 -0
  109. package/dist/client/assets/index-aJE-l7h7.js +11 -0
  110. package/dist/client/assets/index-aPVup1Re.js +51 -0
  111. package/dist/client/assets/infoDiagram-5YYISTIA-CO_BLfuW.js +2 -0
  112. package/dist/client/assets/init-Gi6I4Gst.js +1 -0
  113. package/dist/client/assets/ishikawaDiagram-YF4QCWOH-D4rSRnQA.js +70 -0
  114. package/dist/client/assets/journeyDiagram-JHISSGLW-GyHI6dB8.js +139 -0
  115. package/dist/client/assets/kanban-definition-UN3LZRKU-CrH33WLe.js +89 -0
  116. package/dist/client/assets/katex-CQk2-UhE.js +257 -0
  117. package/dist/client/assets/layout-DGIYPm2g.js +1 -0
  118. package/dist/client/assets/linear-Dh1OyvSm.js +1 -0
  119. package/dist/client/assets/mermaid.core-C45sMDhS.js +309 -0
  120. package/dist/client/assets/mindmap-definition-RKZ34NQL-Bgwb0vwA.js +96 -0
  121. package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
  122. package/dist/client/assets/pieDiagram-4H26LBE5-l9cCpVfG.js +30 -0
  123. package/dist/client/assets/quadrantDiagram-W4KKPZXB-BCPSUbC3.js +7 -0
  124. package/dist/client/assets/requirementDiagram-4Y6WPE33-TEGOe-vV.js +84 -0
  125. package/dist/client/assets/sankeyDiagram-5OEKKPKP-C69pv_7D.js +40 -0
  126. package/dist/client/assets/sequenceDiagram-3UESZ5HK-arinzeCk.js +162 -0
  127. package/dist/client/assets/stateDiagram-AJRCARHV-C2YENpmw.js +1 -0
  128. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CS6ocDH6.js +1 -0
  129. package/dist/client/assets/timeline-definition-PNZ67QCA-h5qtI99f.js +120 -0
  130. package/dist/client/assets/vennDiagram-CIIHVFJN-CnuK75Ut.js +34 -0
  131. package/dist/client/assets/wardley-L42UT6IY-B4bQ0Xyy.js +173 -0
  132. package/dist/client/assets/wardleyDiagram-YWT4CUSO-apV8olQc.js +78 -0
  133. package/dist/client/assets/xychartDiagram-2RQKCTM6-OTP6zeEy.js +7 -0
  134. package/dist/client/index.html +19 -0
  135. package/dist/server/config.d.ts +59 -0
  136. package/dist/server/config.js +211 -0
  137. package/dist/server/config.js.map +1 -0
  138. package/dist/server/core/plugin-host/cross-cutting.d.ts +8 -0
  139. package/dist/server/core/plugin-host/cross-cutting.js +14 -0
  140. package/dist/server/core/plugin-host/cross-cutting.js.map +1 -0
  141. package/dist/server/core/plugin-host/entities-router.d.ts +11 -0
  142. package/dist/server/core/plugin-host/entities-router.js +77 -0
  143. package/dist/server/core/plugin-host/entities-router.js.map +1 -0
  144. package/dist/server/core/plugin-host/host.d.ts +11 -0
  145. package/dist/server/core/plugin-host/host.js +128 -0
  146. package/dist/server/core/plugin-host/host.js.map +1 -0
  147. package/dist/server/core/plugin-host/legacy-adapter.d.ts +31 -0
  148. package/dist/server/core/plugin-host/legacy-adapter.js +88 -0
  149. package/dist/server/core/plugin-host/legacy-adapter.js.map +1 -0
  150. package/dist/server/core/plugin-host/serialization-engine.d.ts +35 -0
  151. package/dist/server/core/plugin-host/serialization-engine.js +132 -0
  152. package/dist/server/core/plugin-host/serialization-engine.js.map +1 -0
  153. package/dist/server/core/plugin-host/types.d.ts +143 -0
  154. package/dist/server/core/plugin-host/types.js +10 -0
  155. package/dist/server/core/plugin-host/types.js.map +1 -0
  156. package/dist/server/db/fixups/backfill-plan-titles.d.ts +2 -0
  157. package/dist/server/db/fixups/backfill-plan-titles.js +22 -0
  158. package/dist/server/db/fixups/backfill-plan-titles.js.map +1 -0
  159. package/dist/server/db/index.d.ts +6 -0
  160. package/dist/server/db/index.js +26 -0
  161. package/dist/server/db/index.js.map +1 -0
  162. package/dist/server/db/migrate.d.ts +2 -0
  163. package/dist/server/db/migrate.js +33 -0
  164. package/dist/server/db/migrate.js.map +1 -0
  165. package/dist/server/db/migrations/000_init.sql +7 -0
  166. package/dist/server/db/migrations/001_endpoint.sql +51 -0
  167. package/dist/server/db/migrations/002_dto.sql +23 -0
  168. package/dist/server/db/migrations/003_drop_endpoint_body.sql +5 -0
  169. package/dist/server/db/migrations/004_drop_module_and_status.sql +31 -0
  170. package/dist/server/db/migrations/005_chat.sql +23 -0
  171. package/dist/server/db/migrations/006_database_table.sql +10 -0
  172. package/dist/server/db/migrations/007_sections.sql +30 -0
  173. package/dist/server/db/migrations/008_subagent_task.sql +20 -0
  174. package/dist/server/db/migrations/009_chat_todo_snapshot.sql +4 -0
  175. package/dist/server/db/migrations/010_chat_plan_mode.sql +5 -0
  176. package/dist/server/db/migrations/011_chat_initial_system_prompt.sql +4 -0
  177. package/dist/server/db/migrations/012_chat_message_status.sql +5 -0
  178. package/dist/server/db/migrations/013_chat_usage_snapshot.sql +7 -0
  179. package/dist/server/db/migrations/014_plans.sql +33 -0
  180. package/dist/server/db/migrations/015_dto_examples.sql +4 -0
  181. package/dist/server/db/migrations/016_ui_view.sql +10 -0
  182. package/dist/server/db/migrations/017_entity_version_m17.sql +23 -0
  183. package/dist/server/db/migrations/018_page_version.sql +20 -0
  184. package/dist/server/db/migrations/019_spec_release.sql +13 -0
  185. package/dist/server/db/migrations/020_drop_plan_status.sql +10 -0
  186. package/dist/server/db/migrations/021_plans_n1.sql +36 -0
  187. package/dist/server/db/migrations/022_brief_chat_columns.sql +23 -0
  188. package/dist/server/db/migrations/023_page_version_kind.sql +26 -0
  189. package/dist/server/db/migrations/024_chat_context_size.sql +10 -0
  190. package/dist/server/db/migrations/025_ac.sql +19 -0
  191. package/dist/server/db/migrations/026_ac_seed.sql +75 -0
  192. package/dist/server/db/migrations/027_page_version_change_summary.sql +10 -0
  193. package/dist/server/db/readonly.d.ts +12 -0
  194. package/dist/server/db/readonly.js +32 -0
  195. package/dist/server/db/readonly.js.map +1 -0
  196. package/dist/server/domain/raw-entity-reader.d.ts +76 -0
  197. package/dist/server/domain/raw-entity-reader.js +240 -0
  198. package/dist/server/domain/raw-entity-reader.js.map +1 -0
  199. package/dist/server/entities/ac/mcp-server.d.ts +10 -0
  200. package/dist/server/entities/ac/mcp-server.js +154 -0
  201. package/dist/server/entities/ac/mcp-server.js.map +1 -0
  202. package/dist/server/entities/ac/plugin.d.ts +2 -0
  203. package/dist/server/entities/ac/plugin.js +33 -0
  204. package/dist/server/entities/ac/plugin.js.map +1 -0
  205. package/dist/server/entities/ac/routes.d.ts +4 -0
  206. package/dist/server/entities/ac/routes.js +92 -0
  207. package/dist/server/entities/ac/routes.js.map +1 -0
  208. package/dist/server/entities/ac/serializer.d.ts +13 -0
  209. package/dist/server/entities/ac/serializer.js +124 -0
  210. package/dist/server/entities/ac/serializer.js.map +1 -0
  211. package/dist/server/entities/ac/services.d.ts +35 -0
  212. package/dist/server/entities/ac/services.js +261 -0
  213. package/dist/server/entities/ac/services.js.map +1 -0
  214. package/dist/server/entities/ac/system-prompt.d.ts +2 -0
  215. package/dist/server/entities/ac/system-prompt.js +18 -0
  216. package/dist/server/entities/ac/system-prompt.js.map +1 -0
  217. package/dist/server/entities/database-table/mcp-server.d.ts +10 -0
  218. package/dist/server/entities/database-table/mcp-server.js +184 -0
  219. package/dist/server/entities/database-table/mcp-server.js.map +1 -0
  220. package/dist/server/entities/database-table/plugin.d.ts +2 -0
  221. package/dist/server/entities/database-table/plugin.js +33 -0
  222. package/dist/server/entities/database-table/plugin.js.map +1 -0
  223. package/dist/server/entities/database-table/routes.d.ts +5 -0
  224. package/dist/server/entities/database-table/routes.js +86 -0
  225. package/dist/server/entities/database-table/routes.js.map +1 -0
  226. package/dist/server/entities/database-table/serializer.d.ts +12 -0
  227. package/dist/server/entities/database-table/serializer.js +192 -0
  228. package/dist/server/entities/database-table/serializer.js.map +1 -0
  229. package/dist/server/entities/database-table/services.d.ts +45 -0
  230. package/dist/server/entities/database-table/services.js +323 -0
  231. package/dist/server/entities/database-table/services.js.map +1 -0
  232. package/dist/server/entities/database-table/system-prompt.d.ts +2 -0
  233. package/dist/server/entities/database-table/system-prompt.js +11 -0
  234. package/dist/server/entities/database-table/system-prompt.js.map +1 -0
  235. package/dist/server/entities/dto/mcp-server.d.ts +10 -0
  236. package/dist/server/entities/dto/mcp-server.js +141 -0
  237. package/dist/server/entities/dto/mcp-server.js.map +1 -0
  238. package/dist/server/entities/dto/plugin.d.ts +2 -0
  239. package/dist/server/entities/dto/plugin.js +33 -0
  240. package/dist/server/entities/dto/plugin.js.map +1 -0
  241. package/dist/server/entities/dto/routes.d.ts +4 -0
  242. package/dist/server/entities/dto/routes.js +74 -0
  243. package/dist/server/entities/dto/routes.js.map +1 -0
  244. package/dist/server/entities/dto/serializer.d.ts +12 -0
  245. package/dist/server/entities/dto/serializer.js +184 -0
  246. package/dist/server/entities/dto/serializer.js.map +1 -0
  247. package/dist/server/entities/dto/services.d.ts +30 -0
  248. package/dist/server/entities/dto/services.js +242 -0
  249. package/dist/server/entities/dto/services.js.map +1 -0
  250. package/dist/server/entities/dto/system-prompt.d.ts +2 -0
  251. package/dist/server/entities/dto/system-prompt.js +11 -0
  252. package/dist/server/entities/dto/system-prompt.js.map +1 -0
  253. package/dist/server/entities/endpoint/mcp-server.d.ts +10 -0
  254. package/dist/server/entities/endpoint/mcp-server.js +156 -0
  255. package/dist/server/entities/endpoint/mcp-server.js.map +1 -0
  256. package/dist/server/entities/endpoint/plugin.d.ts +2 -0
  257. package/dist/server/entities/endpoint/plugin.js +36 -0
  258. package/dist/server/entities/endpoint/plugin.js.map +1 -0
  259. package/dist/server/entities/endpoint/routes.d.ts +4 -0
  260. package/dist/server/entities/endpoint/routes.js +107 -0
  261. package/dist/server/entities/endpoint/routes.js.map +1 -0
  262. package/dist/server/entities/endpoint/serializer.d.ts +17 -0
  263. package/dist/server/entities/endpoint/serializer.js +217 -0
  264. package/dist/server/entities/endpoint/serializer.js.map +1 -0
  265. package/dist/server/entities/endpoint/services.d.ts +30 -0
  266. package/dist/server/entities/endpoint/services.js +260 -0
  267. package/dist/server/entities/endpoint/services.js.map +1 -0
  268. package/dist/server/entities/endpoint/system-prompt.d.ts +2 -0
  269. package/dist/server/entities/endpoint/system-prompt.js +11 -0
  270. package/dist/server/entities/endpoint/system-prompt.js.map +1 -0
  271. package/dist/server/entities/ui-view/mcp-server.d.ts +10 -0
  272. package/dist/server/entities/ui-view/mcp-server.js +161 -0
  273. package/dist/server/entities/ui-view/mcp-server.js.map +1 -0
  274. package/dist/server/entities/ui-view/plugin.d.ts +2 -0
  275. package/dist/server/entities/ui-view/plugin.js +33 -0
  276. package/dist/server/entities/ui-view/plugin.js.map +1 -0
  277. package/dist/server/entities/ui-view/routes.d.ts +5 -0
  278. package/dist/server/entities/ui-view/routes.js +82 -0
  279. package/dist/server/entities/ui-view/routes.js.map +1 -0
  280. package/dist/server/entities/ui-view/serializer.d.ts +12 -0
  281. package/dist/server/entities/ui-view/serializer.js +262 -0
  282. package/dist/server/entities/ui-view/serializer.js.map +1 -0
  283. package/dist/server/entities/ui-view/services.d.ts +35 -0
  284. package/dist/server/entities/ui-view/services.js +255 -0
  285. package/dist/server/entities/ui-view/services.js.map +1 -0
  286. package/dist/server/entities/ui-view/system-prompt.d.ts +7 -0
  287. package/dist/server/entities/ui-view/system-prompt.js +15 -0
  288. package/dist/server/entities/ui-view/system-prompt.js.map +1 -0
  289. package/dist/server/external-skills/brief-implementer-template.d.ts +2 -0
  290. package/dist/server/external-skills/brief-implementer-template.js +123 -0
  291. package/dist/server/external-skills/brief-implementer-template.js.map +1 -0
  292. package/dist/server/external-skills/external-skills-service.d.ts +3 -0
  293. package/dist/server/external-skills/external-skills-service.js +47 -0
  294. package/dist/server/external-skills/external-skills-service.js.map +1 -0
  295. package/dist/server/external-skills/spec-reader-template.d.ts +2 -0
  296. package/dist/server/external-skills/spec-reader-template.js +47 -0
  297. package/dist/server/external-skills/spec-reader-template.js.map +1 -0
  298. package/dist/server/fs/watcher.d.ts +26 -0
  299. package/dist/server/fs/watcher.js +64 -0
  300. package/dist/server/fs/watcher.js.map +1 -0
  301. package/dist/server/index.d.ts +18 -0
  302. package/dist/server/index.js +474 -0
  303. package/dist/server/index.js.map +1 -0
  304. package/dist/server/mcp/brief-tools.d.ts +19 -0
  305. package/dist/server/mcp/brief-tools.js +189 -0
  306. package/dist/server/mcp/brief-tools.js.map +1 -0
  307. package/dist/server/mcp/c4s-reader.d.ts +12 -0
  308. package/dist/server/mcp/c4s-reader.js +263 -0
  309. package/dist/server/mcp/c4s-reader.js.map +1 -0
  310. package/dist/server/mcp/database-tools.d.ts +10 -0
  311. package/dist/server/mcp/database-tools.js +184 -0
  312. package/dist/server/mcp/database-tools.js.map +1 -0
  313. package/dist/server/mcp/dependency-tools.d.ts +12 -0
  314. package/dist/server/mcp/dependency-tools.js +205 -0
  315. package/dist/server/mcp/dependency-tools.js.map +1 -0
  316. package/dist/server/mcp/dto-tools.d.ts +10 -0
  317. package/dist/server/mcp/dto-tools.js +141 -0
  318. package/dist/server/mcp/dto-tools.js.map +1 -0
  319. package/dist/server/mcp/endpoint-tools.d.ts +10 -0
  320. package/dist/server/mcp/endpoint-tools.js +156 -0
  321. package/dist/server/mcp/endpoint-tools.js.map +1 -0
  322. package/dist/server/mcp/ensure-mcp-json.d.ts +6 -0
  323. package/dist/server/mcp/ensure-mcp-json.js +30 -0
  324. package/dist/server/mcp/ensure-mcp-json.js.map +1 -0
  325. package/dist/server/mcp/index.d.ts +29 -0
  326. package/dist/server/mcp/index.js +40 -0
  327. package/dist/server/mcp/index.js.map +1 -0
  328. package/dist/server/mcp/plan-tools.d.ts +7 -0
  329. package/dist/server/mcp/plan-tools.js +105 -0
  330. package/dist/server/mcp/plan-tools.js.map +1 -0
  331. package/dist/server/mcp/reference-tools.d.ts +17 -0
  332. package/dist/server/mcp/reference-tools.js +630 -0
  333. package/dist/server/mcp/reference-tools.js.map +1 -0
  334. package/dist/server/mcp/release-tools/index.d.ts +21 -0
  335. package/dist/server/mcp/release-tools/index.js +140 -0
  336. package/dist/server/mcp/release-tools/index.js.map +1 -0
  337. package/dist/server/mcp/release-tools/projection.d.ts +32 -0
  338. package/dist/server/mcp/release-tools/projection.js +278 -0
  339. package/dist/server/mcp/release-tools/projection.js.map +1 -0
  340. package/dist/server/mcp/release-tools/types.d.ts +91 -0
  341. package/dist/server/mcp/release-tools/types.js +11 -0
  342. package/dist/server/mcp/release-tools/types.js.map +1 -0
  343. package/dist/server/mcp/release-tools.d.ts +14 -0
  344. package/dist/server/mcp/release-tools.js +83 -0
  345. package/dist/server/mcp/release-tools.js.map +1 -0
  346. package/dist/server/mcp/ui-view-tools.d.ts +10 -0
  347. package/dist/server/mcp/ui-view-tools.js +161 -0
  348. package/dist/server/mcp/ui-view-tools.js.map +1 -0
  349. package/dist/server/routes/briefs.d.ts +8 -0
  350. package/dist/server/routes/briefs.js +178 -0
  351. package/dist/server/routes/briefs.js.map +1 -0
  352. package/dist/server/routes/chat.d.ts +29 -0
  353. package/dist/server/routes/chat.js +604 -0
  354. package/dist/server/routes/chat.js.map +1 -0
  355. package/dist/server/routes/database-tables.d.ts +5 -0
  356. package/dist/server/routes/database-tables.js +86 -0
  357. package/dist/server/routes/database-tables.js.map +1 -0
  358. package/dist/server/routes/dependencies.d.ts +6 -0
  359. package/dist/server/routes/dependencies.js +164 -0
  360. package/dist/server/routes/dependencies.js.map +1 -0
  361. package/dist/server/routes/dtos.d.ts +4 -0
  362. package/dist/server/routes/dtos.js +74 -0
  363. package/dist/server/routes/dtos.js.map +1 -0
  364. package/dist/server/routes/endpoints.d.ts +4 -0
  365. package/dist/server/routes/endpoints.js +107 -0
  366. package/dist/server/routes/endpoints.js.map +1 -0
  367. package/dist/server/routes/entities.d.ts +8 -0
  368. package/dist/server/routes/entities.js +84 -0
  369. package/dist/server/routes/entities.js.map +1 -0
  370. package/dist/server/routes/errors.d.ts +2 -0
  371. package/dist/server/routes/errors.js +37 -0
  372. package/dist/server/routes/errors.js.map +1 -0
  373. package/dist/server/routes/page-links.d.ts +3 -0
  374. package/dist/server/routes/page-links.js +40 -0
  375. package/dist/server/routes/page-links.js.map +1 -0
  376. package/dist/server/routes/pages.d.ts +5 -0
  377. package/dist/server/routes/pages.js +142 -0
  378. package/dist/server/routes/pages.js.map +1 -0
  379. package/dist/server/routes/plans.d.ts +3 -0
  380. package/dist/server/routes/plans.js +192 -0
  381. package/dist/server/routes/plans.js.map +1 -0
  382. package/dist/server/routes/references.d.ts +3 -0
  383. package/dist/server/routes/references.js +34 -0
  384. package/dist/server/routes/references.js.map +1 -0
  385. package/dist/server/routes/releases.d.ts +4 -0
  386. package/dist/server/routes/releases.js +122 -0
  387. package/dist/server/routes/releases.js.map +1 -0
  388. package/dist/server/routes/sections.d.ts +3 -0
  389. package/dist/server/routes/sections.js +32 -0
  390. package/dist/server/routes/sections.js.map +1 -0
  391. package/dist/server/routes/tags.d.ts +4 -0
  392. package/dist/server/routes/tags.js +56 -0
  393. package/dist/server/routes/tags.js.map +1 -0
  394. package/dist/server/routes/threads.d.ts +3 -0
  395. package/dist/server/routes/threads.js +78 -0
  396. package/dist/server/routes/threads.js.map +1 -0
  397. package/dist/server/routes/todos.d.ts +3 -0
  398. package/dist/server/routes/todos.js +28 -0
  399. package/dist/server/routes/todos.js.map +1 -0
  400. package/dist/server/routes/ui-views.d.ts +5 -0
  401. package/dist/server/routes/ui-views.js +82 -0
  402. package/dist/server/routes/ui-views.js.map +1 -0
  403. package/dist/server/serialization/auto-schema.d.ts +3 -0
  404. package/dist/server/serialization/auto-schema.js +55 -0
  405. package/dist/server/serialization/auto-schema.js.map +1 -0
  406. package/dist/server/serialization/fallback.d.ts +4 -0
  407. package/dist/server/serialization/fallback.js +27 -0
  408. package/dist/server/serialization/fallback.js.map +1 -0
  409. package/dist/server/serialization/inline-renderer.d.ts +4 -0
  410. package/dist/server/serialization/inline-renderer.js +151 -0
  411. package/dist/server/serialization/inline-renderer.js.map +1 -0
  412. package/dist/server/serialization/registerAll.d.ts +6 -0
  413. package/dist/server/serialization/registerAll.js +7 -0
  414. package/dist/server/serialization/registerAll.js.map +1 -0
  415. package/dist/server/serialization/registry.d.ts +26 -0
  416. package/dist/server/serialization/registry.js +121 -0
  417. package/dist/server/serialization/registry.js.map +1 -0
  418. package/dist/server/serialization/resolve-page.d.ts +24 -0
  419. package/dist/server/serialization/resolve-page.js +192 -0
  420. package/dist/server/serialization/resolve-page.js.map +1 -0
  421. package/dist/server/serialization/serializers/database-table.d.ts +1 -0
  422. package/dist/server/serialization/serializers/database-table.js +46 -0
  423. package/dist/server/serialization/serializers/database-table.js.map +1 -0
  424. package/dist/server/serialization/serializers/dto.d.ts +1 -0
  425. package/dist/server/serialization/serializers/dto.js +48 -0
  426. package/dist/server/serialization/serializers/dto.js.map +1 -0
  427. package/dist/server/serialization/serializers/endpoint.d.ts +1 -0
  428. package/dist/server/serialization/serializers/endpoint.js +93 -0
  429. package/dist/server/serialization/serializers/endpoint.js.map +1 -0
  430. package/dist/server/serialization/serializers/section.d.ts +1 -0
  431. package/dist/server/serialization/serializers/section.js +24 -0
  432. package/dist/server/serialization/serializers/section.js.map +1 -0
  433. package/dist/server/serialization/serializers/ui-view.d.ts +1 -0
  434. package/dist/server/serialization/serializers/ui-view.js +124 -0
  435. package/dist/server/serialization/serializers/ui-view.js.map +1 -0
  436. package/dist/server/serialization/snapshot.d.ts +22 -0
  437. package/dist/server/serialization/snapshot.js +102 -0
  438. package/dist/server/serialization/snapshot.js.map +1 -0
  439. package/dist/server/serialization/types.d.ts +70 -0
  440. package/dist/server/serialization/types.js +7 -0
  441. package/dist/server/serialization/types.js.map +1 -0
  442. package/dist/server/serialization/writer.d.ts +41 -0
  443. package/dist/server/serialization/writer.js +13 -0
  444. package/dist/server/serialization/writer.js.map +1 -0
  445. package/dist/server/services/brief.d.ts +86 -0
  446. package/dist/server/services/brief.js +218 -0
  447. package/dist/server/services/brief.js.map +1 -0
  448. package/dist/server/services/chat-context.d.ts +26 -0
  449. package/dist/server/services/chat-context.js +434 -0
  450. package/dist/server/services/chat-context.js.map +1 -0
  451. package/dist/server/services/chat.d.ts +50 -0
  452. package/dist/server/services/chat.js +309 -0
  453. package/dist/server/services/chat.js.map +1 -0
  454. package/dist/server/services/database-table.d.ts +36 -0
  455. package/dist/server/services/database-table.js +303 -0
  456. package/dist/server/services/database-table.js.map +1 -0
  457. package/dist/server/services/dependencies.d.ts +45 -0
  458. package/dist/server/services/dependencies.js +302 -0
  459. package/dist/server/services/dependencies.js.map +1 -0
  460. package/dist/server/services/dto.d.ts +22 -0
  461. package/dist/server/services/dto.js +222 -0
  462. package/dist/server/services/dto.js.map +1 -0
  463. package/dist/server/services/endpoint.d.ts +22 -0
  464. package/dist/server/services/endpoint.js +239 -0
  465. package/dist/server/services/endpoint.js.map +1 -0
  466. package/dist/server/services/entity-writer.d.ts +46 -0
  467. package/dist/server/services/entity-writer.js +137 -0
  468. package/dist/server/services/entity-writer.js.map +1 -0
  469. package/dist/server/services/page-serializer.d.ts +109 -0
  470. package/dist/server/services/page-serializer.js +359 -0
  471. package/dist/server/services/page-serializer.js.map +1 -0
  472. package/dist/server/services/page-version.d.ts +75 -0
  473. package/dist/server/services/page-version.js +159 -0
  474. package/dist/server/services/page-version.js.map +1 -0
  475. package/dist/server/services/pages-frontmatter-indexer.d.ts +51 -0
  476. package/dist/server/services/pages-frontmatter-indexer.js +138 -0
  477. package/dist/server/services/pages-frontmatter-indexer.js.map +1 -0
  478. package/dist/server/services/pages-link-indexer.d.ts +36 -0
  479. package/dist/server/services/pages-link-indexer.js +474 -0
  480. package/dist/server/services/pages-link-indexer.js.map +1 -0
  481. package/dist/server/services/pages.d.ts +16 -0
  482. package/dist/server/services/pages.js +149 -0
  483. package/dist/server/services/pages.js.map +1 -0
  484. package/dist/server/services/plan.d.ts +59 -0
  485. package/dist/server/services/plan.js +459 -0
  486. package/dist/server/services/plan.js.map +1 -0
  487. package/dist/server/services/references.d.ts +17 -0
  488. package/dist/server/services/references.js +175 -0
  489. package/dist/server/services/references.js.map +1 -0
  490. package/dist/server/services/release.d.ts +146 -0
  491. package/dist/server/services/release.js +602 -0
  492. package/dist/server/services/release.js.map +1 -0
  493. package/dist/server/services/section-indexer.d.ts +20 -0
  494. package/dist/server/services/section-indexer.js +276 -0
  495. package/dist/server/services/section-indexer.js.map +1 -0
  496. package/dist/server/services/sections.d.ts +34 -0
  497. package/dist/server/services/sections.js +136 -0
  498. package/dist/server/services/sections.js.map +1 -0
  499. package/dist/server/services/skill-registry.d.ts +38 -0
  500. package/dist/server/services/skill-registry.js +171 -0
  501. package/dist/server/services/skill-registry.js.map +1 -0
  502. package/dist/server/services/slug.d.ts +7 -0
  503. package/dist/server/services/slug.js +41 -0
  504. package/dist/server/services/slug.js.map +1 -0
  505. package/dist/server/services/tags.d.ts +27 -0
  506. package/dist/server/services/tags.js +153 -0
  507. package/dist/server/services/tags.js.map +1 -0
  508. package/dist/server/services/todos-indexer.d.ts +21 -0
  509. package/dist/server/services/todos-indexer.js +123 -0
  510. package/dist/server/services/todos-indexer.js.map +1 -0
  511. package/dist/server/services/ui-view.d.ts +26 -0
  512. package/dist/server/services/ui-view.js +235 -0
  513. package/dist/server/services/ui-view.js.map +1 -0
  514. package/dist/server/services/versions.d.ts +59 -0
  515. package/dist/server/services/versions.js +181 -0
  516. package/dist/server/services/versions.js.map +1 -0
  517. package/dist/server/skills/brief-author/SKILL.md +117 -0
  518. package/dist/server/skills/layered-vertical-slices/SKILL.md +135 -0
  519. package/dist/server/skills/layered-vertical-slices/templates/index.md +97 -0
  520. package/dist/server/skills/layered-vertical-slices/templates/layer.md +42 -0
  521. package/dist/server/skills/layered-vertical-slices/templates/module.md +52 -0
  522. package/dist/server/skills/layered-vertical-slices/workflows/bootstrap.md +116 -0
  523. package/dist/server/skills/layered-vertical-slices/workflows/brief.md +154 -0
  524. package/dist/server/skills/layered-vertical-slices/workflows/daily.md +77 -0
  525. package/dist/server/ws/gateway.d.ts +10 -0
  526. package/dist/server/ws/gateway.js +35 -0
  527. package/dist/server/ws/gateway.js.map +1 -0
  528. package/dist/shared/anchor-pattern.d.ts +15 -0
  529. package/dist/shared/anchor-pattern.js +16 -0
  530. package/dist/shared/anchor-pattern.js.map +1 -0
  531. package/dist/shared/diagram-source-escape.d.ts +2 -0
  532. package/dist/shared/diagram-source-escape.js +19 -0
  533. package/dist/shared/diagram-source-escape.js.map +1 -0
  534. package/dist/shared/entities.d.ts +622 -0
  535. package/dist/shared/entities.js +9 -0
  536. package/dist/shared/entities.js.map +1 -0
  537. package/dist/shared/page-links.d.ts +40 -0
  538. package/dist/shared/page-links.js +2 -0
  539. package/dist/shared/page-links.js.map +1 -0
  540. package/dist/shared/plugin-host/types.d.ts +66 -0
  541. package/dist/shared/plugin-host/types.js +11 -0
  542. package/dist/shared/plugin-host/types.js.map +1 -0
  543. package/dist/shared/reference-extensions.d.ts +13 -0
  544. package/dist/shared/reference-extensions.js +17 -0
  545. package/dist/shared/reference-extensions.js.map +1 -0
  546. package/dist/shared/types.d.ts +86 -0
  547. package/dist/shared/types.js +2 -0
  548. package/dist/shared/types.js.map +1 -0
  549. package/dist/shared/xml-tags.d.ts +16 -0
  550. package/dist/shared/xml-tags.js +101 -0
  551. package/dist/shared/xml-tags.js.map +1 -0
  552. package/package.json +110 -0
@@ -0,0 +1,135 @@
1
+ ---
2
+ title: Layered Vertical Slices
3
+ description: "Conventions for layered, vertical-slice specifications — module/layer structure, file layout, two workflows (bootstrap and daily), and quality rules. TRIGGER when the active writing style is this slug — editing a spec page, drafting plans, creating modules or layers, answering structural questions."
4
+ version: 1
5
+ language: en
6
+ ---
7
+
8
+ # Layered Specification Meta-Prompt
9
+
10
+ When the active writing style is Layered Vertical Slices, the conventions below shape every spec edit in this thread.
11
+
12
+ ## 1. Your role
13
+
14
+ You are a **specification architect**. You co-design a layered, modular specification with the user — you do not write or audit code. The spec is a single source of truth for architecture, consumed by humans and by other AI agents to understand, plan, and implement the system.
15
+
16
+ Your default mode is to **translate user needs into specification language**. When the user surfaces an idea, edit, or problem, your first move is to *understand the underlying user need* — and only then map it onto modules, layers, and files. Work interactively: ask, summarize, confirm, advance. The artifacts you produce are specification artifacts: Markdown files (modules, layers, index) and — when the project models entities — the entity records and references that the spec embeds (created via the project's MCP tools, not by hand-editing storage). You do **not** write source code, tests, or build configuration; that's a separate implementation pass.
17
+
18
+ ## 2. Core concepts
19
+
20
+ The spec is a 2-axis grid: vertical slices (modules) crossed with horizontal cross-cuts (layers).
21
+
22
+ ### Vertical slices — modules
23
+
24
+ A *module* is a coherent **domain slice** — a vertical slice of the system organized around one user job or one bundle of related logic. It cuts through several layers, has its own file in `modules/`, and owns everything specific to it: data shape, behavior, interfaces, UI, integrations.
25
+
26
+ A module groups *all* logic for one concern, regardless of how many entities back it — a single entity, several entities reasoned about together, or none at all. Whether the slice is entity-backed is a property of the domain, not a defining trait of the module.
27
+
28
+ ### Horizontal cross-cuts — layers
29
+
30
+ A *layer* is a **convention** — it does not enumerate which modules exist; it fixes the *shape* in which each module describes its use of this layer. Two levels:
31
+
32
+ 1. **Layer-level convention** — what a module's section for this layer looks like: headings, required fields, the form (prose, fenced schema, table, embeds, references to project entities). Owned by the layer file, in its `## Module slice schema` section.
33
+ 2. **Module-level description** — the concrete content the module writes inside that section, following the layer's convention. Owned by the module file.
34
+
35
+ The layer chooses the form. If the project models entities, a layer may say "every endpoint in this module's L3 section is described as an `endpoint` entity"; if the project doesn't, the layer can mandate a fenced schema, a table, or plain prose. This is a per-spec decision.
36
+
37
+ **Two reading modes of the same schema.** The `## Module slice schema` is read differently depending on the module's role toward the layer:
38
+
39
+ - **Consumer module** (the common case) — answers the schema's fields with *what we declare*: our tables, our endpoints, our entities, our fields.
40
+ - **Implementor module** (the cross-cutting framework case) — when one module *implements* a layer for the rest of the system (e.g. a References & Tags framework, a plugin host, an event bus, an auth provider), its section for that layer answers the *same* schema fields in **how-mode**: how the registry works, how runtime hooks fire, how internal tables back the framework, what other modules can rely on. Same fields, inverted reading.
41
+
42
+ Most layers have only consumer modules (persistence, HTTP API — pure description conventions). Framework-shaped layers typically have exactly one implementor module plus N consumers; mark the implementor explicitly in the layer file's `Implementor module:` slot so readers don't confuse the two roles. If the layer's implementor is external or obvious — a database engine, HTTP framework, agent SDK — don't invent a module for it; name it in prose in the layer file and set the `Implementor module:` slot to `external — <name>`.
43
+
44
+ **Where cross-cutting content lives — two disciplines.** A layer file is **radically thin**: Purpose + Role (1–2 orientational sentences) + Module slice schema. Nothing else — no separate `## Conventions` / `## Patterns` / `## Contracts` / `## Shared utilities` prose buckets. Two disciplines drive this:
45
+
46
+ 1. **Anything that's a rule about filling the module's section** — naming, allowed values, validation, gating, embed shape, "tables in snake_case", "action gated on optional binary" — **is expressed as a requirement *inside* the slice schema**, as a field-level rule, not as separate prose.
47
+ 2. **Anything that's framework runtime behavior** — registry semantics, event dedup, hook firing order, contract guarantees consumers can rely on, shared utilities — **lives in the implementor module's file**, in its section for that layer (read in how-mode). The layer file does not duplicate it.
48
+
49
+ For a layer **without** an implementor (pure description convention — persistence, HTTP API): every rule must still fit inside the slice schema. If a rule cannot be expressed as a per-module schema requirement, that's a signal — either the rule isn't truly cross-cutting (move it into a specific module), or the rule belongs to an implementor's runtime behavior. Add an implementor *module* only when that implementor is part of *our* spec; if it's external (DB engine, HTTP framework, SDK), document the contract in the layer file's prose without inventing a module.
50
+
51
+ **Design tip — preferred when applicable.** If the project's domain admits clean entities, design layers so that their module-slice schema can be expressed as **entities embedded via XML tags** (e.g. `<tagged_list type="endpoint" tags="M03"/>`). The canonical list lives as entities; module prose explains *why*, not *which*. This is the most ergonomic path — modules stay short, listings stay live, drift is impossible. Recommend this shape when the user is designing layers and the domain fits, but do not require it.
52
+
53
+ ### Deciding module vs layer
54
+
55
+ - **Has its own entity, own table, own identity?** → module.
56
+ - **Is it a rule or convention shared by multiple modules?** → layer.
57
+ - **Does the user create/delete instances at runtime?** → module.
58
+ - **Is it one coherent bundle of behavior owned by a single user job, even without persistent records of its own?** → module.
59
+
60
+ **Anti-pattern — "Domain" is not a layer.** Every module has its own domain (operations, validations, lifecycle, edge cases, acceptance criteria) — that's the module's *substance*, totally specific to it, not a cross-cutting concern. The module file's `Purpose` / `Edge cases` / `Acceptance criteria` sections, plus its sections for the layers it touches, **already are** its domain. Do not create an "L2 Domain" layer to hold "what each module does"; that's a category mistake — it produces a layer whose content collapses to one paragraph per module, every paragraph dies if its module is removed (layer-purity test fails), and the layer's slice schema can't be defined because every module's "domain" is unique. If multiple modules genuinely share a *convention* (e.g. error envelope shape, audit columns naming) name the layer after that specific convention — `L2 Error model`, `L2 Audit conventions` — not "Domain".
61
+
62
+ Edge case — agents and LLMs: by default an agent (chat, MCP tool host, prompt assembly) is a **module**, even when central to the UX. Treat the agent as a layer **only** when multiple feature modules each export their own agent-facing tools and share conventions for tool registration / streaming / error model.
63
+
64
+ ## 3. File organization
65
+
66
+ The spec lives in the directory where the agent is invoked (CWD). The subdirectory layout is fixed; the absolute path is not the skill's concern.
67
+
68
+ **Index file name.** Default: `index.md`. If the spec also doubles as a Claude Code skill (its root directory is a skill directory), use `SKILL.md` instead so the harness picks it up. Pick one at bootstrap; the rest of this document writes `<index>` to mean "whichever name you chose".
69
+
70
+ ```
71
+ <root>/ ← CWD where the agent runs
72
+ ├── <index> ← index.md (default) or SKILL.md
73
+ ├── modules/
74
+ │ ├── M01-<slug>.md ← small module, single file
75
+ │ ├── M02-<slug>.md
76
+ │ └── M03-<slug>/ ← M03 was split — directory replaces the single file
77
+ │ ├── M03-<slug>.md ← module substance (Purpose, Edge cases, AC, inlined small layer sections)
78
+ │ ├── L1-<slug>.md ← M03's L1 slice (filename matches layers/L1-<slug>.md)
79
+ │ └── L5-<slug>.md ← M03's L5 slice (filename matches layers/L5-<slug>.md)
80
+ └── layers/
81
+ ├── L1-<slug>.md
82
+ └── L2-<slug>.md
83
+ ```
84
+
85
+ **Naming rules:**
86
+ - Modules: `M{NN}-{kebab-slug}.md`, numbered sequentially. Numbers are stable — if you delete a module, leave a gap.
87
+ - Layers: `L{N}-{kebab-slug}.md`, numbered sequentially in the order layers are introduced. Numbers are stable — if you delete a layer, leave a gap. Do not renumber survivors when a deeper-concern layer is added later; just append the next number. Usually 3–7 layers.
88
+ - Split modules: when a module file outgrows the ~250-line budget, replace `modules/MXX-<slug>.md` with a directory `modules/MXX-<slug>/`. Inside it: the module's own substance lives in `MXX-<slug>.md` (same slug as the directory); each extracted layer slice goes to `LY-<slug>.md` whose filename **matches the layer file** in `layers/`. So `layers/L1-db.md` ↔ `modules/MXX-<slug>/L1-db.md`. Filename equality makes the layer link unambiguous.
89
+ - Slugs are `kebab-case`, short, noun-based. The filename slug must match the `name` in front matter if any.
90
+ - Pick one entity-vs-table casing early (e.g. entity types in `kebab-case`, DB tables in `snake_case`), state it in the persistence layer, enforce everywhere.
91
+
92
+ **When to split a module file:** only when keeping it as a single file hurts readability. Rule of thumb: if the module heads past ~250 lines, or any single layer slice runs more than ~30 lines and dominates the file, split that slice out into `modules/MXX-<slug>/LY-<slug>.md`. Otherwise keep it inline. Cross-cutting content (rules shared across modules) does **not** go into per-module subdirs — it belongs in the layer file or the implementor module per §6.2.
93
+
94
+ ## 4. Workflows
95
+
96
+ There are three workflows. **Pick the right one before doing anything else:**
97
+
98
+ - **Active context is a brief thread** (system prompt indicates `BRIEF mode` and loads `brief-author` alongside this skill) → follow `workflows/brief.md`. You are not editing the spec; you are composing a self-contained release brief. The workflow defines what counts as feature substance vs. spec-format convention in this style's `RawDelta`, plus inlining patterns and the "For implementers" structure specific to this style. Brief workflow takes precedence over the two below — do not also run daily / bootstrap.
99
+ - **No `<index>` file in CWD?** → follow `workflows/bootstrap.md`. The spec does not yet exist; you'll discover the project, propose layers and modules, then generate skeleton and content over six phases.
100
+ - **`<index>` file already in CWD?** → follow `workflows/daily.md`. The spec exists; you are extending or editing it. Hear the user's intent first, classify the request (explicit edit / idea / inconsistency), translate, edit, drift-check, stop.
101
+
102
+ Never run bootstrap on top of an existing spec. If the user wants a clean restart, ask them to move the existing spec aside first. Read the relevant workflow file before starting; do not improvise the phases or steps from memory.
103
+
104
+ ## 5. Templates
105
+
106
+ Templates ship as files inside this skill, in `templates/`. Copy them when bootstrapping or when adding a new file in daily work. Replace placeholders only — do not reorder sections or invent new ones.
107
+
108
+ - `templates/index.md` → `<root>/<index>`. Header, key concepts, layer table, module table, key-relations diagram, optional layer-specific index, tech stack, acceptance criteria, open questions.
109
+ - `templates/layer.md` → `<root>/layers/LX-<slug>.md`. **Radically thin**: purpose, role, **module slice schema** (the only substantive section — shape of each consumer module's slice + the implementor-module slot). Nothing else: no `## Conventions` / `## Patterns` / `## Contracts` / `## Shared utilities` sections. Per-module rules (naming, validation, gating) are expressed as schema requirements; runtime / framework behavior lives in the implementor module's file when one exists.
110
+ - `templates/module.md` → `<root>/modules/MXX-<slug>.md`. Hook, purpose, dependencies table, one section per touched layer (drop the rest), edge cases, acceptance criteria. A module's section for a layer reads two ways: as a *consumer* (fill the layer's slice schema) or as the *implementor* (document runtime / conventions / patterns / contracts for that layer).
111
+
112
+ ## 6. Quality rules
113
+
114
+ 1. **Index stays in sync with files.** The layer table and module table in `<index>` should reflect what's actually in `layers/` and `modules/`. When you add or rename, update the table in the same edit. If you spot drift later, fix it at the next convenient edit — surface it to the user first.
115
+
116
+ 2. **One home for every piece of content — two tests.** The layer file owns the consumer-facing slice schema (and nothing else); the implementor module (when one exists) owns runtime, conventions, patterns, registry, and "what consumers can rely on"; consumer modules own their declared slice. Before placing content, ask both:
117
+
118
+ - *Layer-purity:* "would this still be accurate if we deleted module MXX?" If no → it belongs in a module's file, not the layer.
119
+ - *Filling vs behavior:* "is this a rule about **filling the module's section** (naming, validation, gating, allowed values, embed shape) or about **framework runtime behavior** (registry semantics, hook order, contract guarantees, shared utilities)?" Filling → bake it into the slice schema as a field requirement. Behavior → put it in the implementor module's file (how-mode). Neither test alone is enough — content that passes layer-purity may still belong in the implementor module if it's about runtime, not filling.
120
+
121
+ 3. **Every module lists every layer it touches.** In the module file, there's a section per touched layer with at minimum a 2-line note. Each section follows the schema declared in that layer's `## Module slice schema`.
122
+
123
+ 4. **Ask, don't assume.** When the user's answer is ambiguous, stop and ask one short clarification. Do not invent column names, endpoint paths, or business rules. **Special case — user-need rationale:** if the *why* behind a module or change is unclear, that is a hard stop. Name your gap and ask before authoring. Do not infer the user-need from technical context alone.
124
+
125
+ 5. **Bounded scope per file.** If a module file heads past ~250 lines, propose splitting one or more layer slices out into a per-module subdirectory: convert `modules/MXX-<slug>.md` into `modules/MXX-<slug>/`, with the module's own substance in `MXX-<slug>.md` and each extracted layer slice in `LY-<slug>.md` (filename matches the corresponding `layers/LY-<slug>.md`).
126
+
127
+ 6. **No code, no tests, no build config.** You are writing specification. If the user asks for code, stay in-role: "This prompt is scoped to the spec — I can describe behavior; a separate implementation pass writes the code."
128
+
129
+ 7. **Version-safe numbering.** Module *and layer* numbers are stable. If a module or layer is deleted mid-design, leave the number retired rather than renumbering survivors. Layers are appended in introduction order — do not reshuffle when a deeper-concern layer is added later. Mark in `<index>`: `M04 — (retired)` or `L3 — (retired)`.
130
+
131
+ 8. **Acceptance criteria are observable.** Each criterion in a module's "Acceptance criteria" checklist must be something a reader could verify by using the system, not a vague goal.
132
+
133
+ 9. **No historical breadcrumbs in spec prose.** When you move content between files, **just move it**. Do not leave behind prose like *"(moved to M20)"*, *"see M07 for new location"*, or empty stub files that only redirect. Anchors (`<!-- anchor: xxxxxxxx -->`) are stable identifiers; the page/entity versioning subsystem owns move history.
134
+
135
+ *Distinguish from referential cross-links, which stay:* sentences like *"M04 plugs into L6"* or *"see M03 for the endpoint contract"* describe architecture, not history — keep them. Only forbid prose whose sole purpose is to tell a reader *"this used to live somewhere else."* Tabular state markers like `M04 — (retired)` are fine.
@@ -0,0 +1,97 @@
1
+ <!--
2
+ Template for the index file of a layered-vertical-slices spec.
3
+ Copy this file, rename it (default `index.md`, or `SKILL.md` if the spec is also a Claude Code skill), and replace placeholders.
4
+ See SKILL.md §5 and §6 for guidance.
5
+ -->
6
+
7
+ # Specification: <Project Name>
8
+
9
+ <2–4 sentences describing what the project is and who uses it.>
10
+
11
+ > **Spec target:** <Research prototype | MVP | Feature-complete | Production-hardened>.
12
+ > <1 sentence on what this scope includes and what it explicitly defers to a later spec.>
13
+
14
+ ## Core principle
15
+
16
+ <One sentence that captures the architectural soul of the system. E.g.:
17
+ "Markdown is the source of truth for content; SQLite is the source of truth for entities; XML tags are the bridge.">
18
+
19
+ ## High-level architecture
20
+
21
+ <Optional: an ASCII diagram or a brief prose description of the main components and data flow. Skip if the system is simple.>
22
+
23
+ ## Key concepts
24
+
25
+ <3–5 foundational truths the system is designed around — stated from the project's worldview, not as a tour of how this spec organizes them. Each concept names *what is true about the system as designed* (a principle, an invariant, a stance the project takes); it is not a description of how the concept is later realized across modules, layers, files, or anchors.
26
+
27
+ Write so a reader can grasp the concept before opening any module or layer file. Do not cross-reference MXX / LY / filenames / anchors here — those belong in the modules table, layer table, and key-relations diagram below. If a concept can only be explained by pointing at where it lives in the spec, it isn't a key concept yet; it's spec mechanics — drop it or rephrase it as the underlying principle.>
28
+
29
+ ### <Concept 1>
30
+ <1 paragraph: state the principle/invariant, then a concrete intuition for what it means in practice — without naming spec internals (no MXX, no LY, no file paths).>
31
+
32
+ ### <Concept 2>
33
+ <1 paragraph.>
34
+
35
+ ## Jobs this spec serves
36
+
37
+ *Optional — recommended for Feature-complete and Production-hardened targets; usually skipped for Research prototype and MVP. Distilled from Phase 1 topic 1 ("Users & jobs"). Modules are checked against this table — every module should serve at least one job; jobs without modules are gaps.*
38
+
39
+ | Job | Primary user | Modules involved | Success looks like |
40
+ | --- | --- | --- | --- |
41
+ | J1 | … | M01, M03 | … |
42
+ | J2 | … | M02 | … |
43
+
44
+ ## Layers
45
+
46
+ Conventions shared across modules live in `layers/`:
47
+
48
+ | Layer | File | Purpose |
49
+ | --- | --- | --- |
50
+ | **L1 — <name>** | `layers/L1-<slug>.md` | <1 line> |
51
+ | **L2 — <name>** | `layers/L2-<slug>.md` | <1 line> |
52
+ | … | … | … |
53
+
54
+ ## Modules
55
+
56
+ Each module is a vertical slice through the layers. Modules skip layers they don't touch.
57
+
58
+ | # | Module | Complexity | Layers | Scope | File |
59
+ | --- | --- | --- | --- | --- | --- |
60
+ | M01 | **<name>** | simple | L1, L2 | <1 line> | `modules/M01-<slug>.md` |
61
+ | M02 | **<name>** | medium | L1, L2, L4, L5 | <1 line> | `modules/M02-<slug>.md` |
62
+ | … | … | … | … | … | … |
63
+
64
+ ### Key relations
65
+
66
+ <ASCII or prose diagram showing module → layer registrations, module ↔ module relations, and what-feeds-what. Example lines:
67
+
68
+ M03 Endpoint -- registers in --> L6 References (rendering, tags)
69
+ M03 Endpoint <-- relation --> M04 DTO (request/response)
70
+ M05 Agent -- consumes --> M03, M04 MCP tools
71
+ M01 Project -- infrastructure --> all modules
72
+ >
73
+
74
+ ## [Optional] <Layer-specific index>
75
+ <Only if at least one module has been split into a per-module subdirectory. Cross-list extracted slices for one layer across modules — e.g. "DB schemas" listing every `modules/*/L1-<slug>.md`, "Agent tools" listing every `modules/*/L4-<slug>.md`.>
76
+
77
+ | File | Module / Layer | Description |
78
+ | --- | --- | --- |
79
+ | `modules/M01-<slug>/L1-<slug>.md` | M01 / L1 | … |
80
+
81
+ ## Tech stack
82
+
83
+ | Concern | Choice |
84
+ | --- | --- |
85
+ | Language | … |
86
+ | Persistence | … |
87
+ | … | … |
88
+
89
+ ## Acceptance criteria
90
+
91
+ - [ ] <high-level outcome 1>
92
+ - [ ] <high-level outcome 2>
93
+ - [ ] …
94
+
95
+ ## Open questions
96
+
97
+ 1. <question — mark resolved with ~~strikethrough~~ + short note when answered>
@@ -0,0 +1,42 @@
1
+ <!--
2
+ Template for a layer file (`layers/LX-<slug>.md`) in a layered-vertical-slices spec.
3
+ Copy this file, rename it, and replace placeholders.
4
+
5
+ A layer file is **radically thin**: Purpose + Role + Module slice schema. Nothing else.
6
+ For the rules driving that — what belongs in the slice schema vs. the implementor module,
7
+ how to handle external/no implementor — see SKILL.md §2 (concepts), §5 (templates), §6 (quality rules).
8
+ -->
9
+
10
+ # LX — <Layer Name>
11
+
12
+ > <1–2 sentence purpose statement.>
13
+
14
+ ## Role in the system
15
+
16
+ <1–2 sentences, purely orientational: where this layer sits, what it enables, what it explicitly is NOT responsible for. Do not turn this into a conventions dump.>
17
+
18
+ ## Module slice schema
19
+
20
+ <This is the only substantive section of a layer file. Define here the *shape* a consumer module's section for this layer takes — and bake every per-module rule (naming, validation, allowed values, gating, embed shape, required fields) into the schema as a requirement.>
21
+
22
+ **Each module that touches this layer fills its `## <Layer name> (LX)` section with:**
23
+
24
+ ```
25
+ <Concrete schema. Pick a form that fits your project — pick one or mix:
26
+ - prose with required headings,
27
+ - a fenced block (Zod / TypeScript type / SQL / table-of-fields),
28
+ - an embed of project entities,
29
+ - a table the module fills,
30
+ - or any combination.
31
+
32
+ Encode rules as schema requirements, not separate prose. Examples:
33
+ - "tables in snake_case" → field `Table name (snake_case)`
34
+ - "action gated by optional binary" → field `Gate (binary present? required field; absent? omit)`
35
+ - "validation: positive int" → field `Retries: positive int (default 3)`>
36
+ ```
37
+
38
+ *Recommended shape when the project models entities:* declare the slice as an entity type and embed the live list via `<tagged_list type="<entity-type>" tags="MNN"/>`. Module prose then explains *why*; the canonical list stays in entities, drift becomes impossible. Skip this shape if the project has no entity machinery or the slice doesn't warrant it.
39
+
40
+ > **Implementor module:** `MNN — <name>` *(or "external — <name>" when the implementor lives outside our spec, e.g. PostgreSQL, Express; or "none — pure description convention")*
41
+
42
+ *If an implementor module is named*: it owns the **runtime, framework conventions, registry, hooks, and the "what consumers can rely on" half of the contract** for this layer — document them in its file's section for this layer (how-mode), not here.
@@ -0,0 +1,52 @@
1
+ <!--
2
+ Template for a module file (`modules/MXX-<slug>.md`) in a layered-vertical-slices spec.
3
+ Copy this file, rename it, and replace placeholders. See SKILL.md §5 and §6 for guidance.
4
+ -->
5
+
6
+ # MXX — <Module Name>
7
+
8
+ > <1-sentence hook — what is this module, in the voice of the spec.>
9
+
10
+ ## Purpose
11
+
12
+ <First sentence: name the user job this module enables — who does what, to what end. Avoid tautology ("M03 manages endpoints"); name the value ("Endpoint authors can describe HTTP contracts once and have them stay consistent across docs, code, and the running system"). If you cannot write this sentence without circularity, the module is premature — defer it to `<index>`'s "Open questions" until the user job is clear.>
13
+
14
+ <2–4 more sentences: how this module realizes that job — entity shape, scope boundary, what it explicitly does NOT do.>
15
+
16
+ ## Dependencies
17
+
18
+ | Module / Layer | Relation |
19
+ | --- | --- |
20
+ | L<X> | <what this module takes from the layer> |
21
+ | M<YY> | <what this module relates to in another module> |
22
+
23
+ ## <Layer 1 name> (L1)
24
+
25
+ <Only include sections for layers this module touches.>
26
+
27
+ **If this module is a *consumer* of the layer** (the common case): fill the section using the layer's `## Module slice schema` — declare *what* this module contributes (tables, endpoints, entities, fields).
28
+
29
+ **If this module is the *implementor* of the layer** (named in the layer file's `Implementor module:` slot): use this section to document *how* the layer is backed — runtime, registry, hooks, cross-cutting conventions (naming, error handling, structure), patterns consumers copy, the "what consumers can rely on" half of the contract, and any shared utilities. Everything that does not depend on a specific consumer module living lives here.
30
+
31
+ <Content for how this module realizes L1. Example for a consumer:
32
+ - Tables / file layout / schema link (e.g. "See `modules/M03-endpoint/L1-db.md` for full schema")
33
+ - Key columns / fields
34
+ - Constraints and indexes>
35
+
36
+ ## <Layer 2 name> (L2)
37
+
38
+ <E.g. operations, lifecycle, validation rules, edge cases during operations.>
39
+
40
+ ## <Layer N name> (LN)
41
+
42
+
43
+
44
+ ## Edge cases
45
+
46
+ - <edge case 1: situation → expected behavior>
47
+ - <edge case 2>
48
+
49
+ ## Acceptance criteria
50
+
51
+ - [ ] <criterion 1>
52
+ - [ ] <criterion 2>
@@ -0,0 +1,116 @@
1
+ # Bootstrap workflow (greenfield spec)
2
+
3
+ Use this when **no `<index>` file exists in the CWD** — the spec does not yet exist. If an index file is already present, use `workflows/daily.md` instead. Never run bootstrap on top of an existing spec; if the user wants a clean restart, ask them to move the existing spec aside first.
4
+
5
+ Announce the phase at the start of each one ("**Phase 2: Layer proposal**") so the user can see progress. Do not skip phases. Do not write files before Phase 4.
6
+
7
+ ## Phase 1 — Project discovery
8
+
9
+ Ask the following topics as **one-at-a-time** questions. Summarize the user's answer in 1–2 sentences before moving to the next. Skip a topic if clearly not applicable.
10
+
11
+ Topic #1 (Users & jobs) is the foundation — the rest of the discovery flows from it. *Do not skip or compress it.* If the user pushes you toward stack or persistence first, redirect: "I'd like to hear who uses this and what jobs they're doing first — those choices should serve users, not the other way around."
12
+
13
+ 1. **Users & jobs.** Who uses this system, and what 2–4 jobs are they hiring it to do? For each job: what triggers it (the user's situation right before they reach for the system), and what would "done well" look like from their perspective? If there are multiple distinct user roles, list jobs per role. *Stay until the answer is concrete — vague answers like "manage data" or "configure things" produce specs that are about themselves. Push for verbs and outcomes.*
14
+ 2. **What is the system?** In 2–3 sentences, what does it do? (You already heard *who* and *what jobs* in topic 1; this question now answers itself in terms of the jobs above.)
15
+ 3. **Spec target.** What is the maturity target of *this* spec (not the eventual product)? Options:
16
+ - **Research prototype** — exploring feasibility; spec captures intent + open questions, minimal rigor, broken edges OK.
17
+ - **MVP** — smallest useful cut; only core modules, only core layers, deferrals explicit.
18
+ - **Feature-complete** — all planned functionality; full module set; edge cases and acceptance criteria rigorous.
19
+ - **Production-hardened** — feature-complete plus cross-cutting concerns: observability, auth, feature flags, i18n, versioning, migrations.
20
+
21
+ The answer **gates subsequent phases**:
22
+ - *Research / MVP* → skip or soft-ask topic #9 below (observability, feature flags, i18n rarely apply); aim for 3–5 modules in Phase 3; shorter acceptance criteria lists.
23
+ - *Feature-complete* → ask all topics; aim for 5–10 modules.
24
+ - *Production-hardened* → ask all topics with extra probing on observability, auth, and migrations; expect a dedicated cross-cutting layer for each; 8–15 modules is plausible.
25
+
26
+ Also note that a project can have multiple specs over its lifetime (MVP spec → feature-complete spec → hardening spec). If the user signals a future spec, add it as an item in `<index>`'s "Open questions" or a "Future scope" section.
27
+ 4. **Primary nouns.** What entities (things the user creates, reads, updates, deletes at runtime) live in the system? *Cross-check against topic 1 — every primary noun should map to at least one job; nouns without a job are usually scope creep.*
28
+ 5. **Stack & runtime.** Language, framework, deployment target (desktop app, web, CLI, library, service).
29
+ 6. **Persistence.** Database, files on disk, in-memory only, external API — and is there a preferred technology?
30
+ 7. **Interface surfaces.** How do users (and other agents) interact? UI, HTTP API, CLI, MCP tools, library exports — possibly several.
31
+ 8. **Agent/LLM involvement.** Is there an LLM agent in the loop? If yes, what does it do (read state, mutate state, converse, stream)?
32
+ 9. **Cross-cutting concerns.** Auth, i18n, versioning, events/hooks, observability, feature flags, background jobs. *(Skip or compress for Research / MVP targets.)*
33
+ 10. **Scope boundary.** What is explicitly *out of scope* for this spec? (Prevents scope creep later.) Encourage the user to name concrete things that are tempting but deferred — easier to enforce later.
34
+
35
+ At the end of Phase 1, restate what you heard as a **project brief**. The brief opens with a *Users & jobs heard:* paragraph — 3–5 bullets capturing whom the spec serves and the jobs they're hiring it to do (distilled from topic 1). The spec target follows on its own line (e.g. *"Target: MVP"*), then the rest of the brief (system, primary nouns, stack, etc.) in 5–10 more lines. Subsequent phases — layer proposal, module identification, module fill-in — will be checked against the *Users & jobs heard* bullets: every layer should serve at least one job (transitively, through its modules), and every module should serve at least one job directly. Ask the user to correct the brief. Do not proceed until they confirm.
36
+
37
+ ## Phase 2 — Layer proposal
38
+
39
+ Based on the brief, propose a concrete set of layers specific to this project. Example shapes:
40
+ - A CLI + library: `L1 Persistence`, `L2 CLI`, `L3 Library API`.
41
+ - A web service with an agent in the loop: `L1 DB`, `L2 HTTP API`, `L3 UI`, `L4 Cross-entity Framework`. *(The agent — chat, MCP tool host, prompt/context handling — is typically a **module** in this shape, e.g. `M05 Chat & Agent`, not a layer. Make agent a layer only if multiple feature modules each ship their own agent-facing tools and share conventions for tool registration / streaming / error model.)*
42
+ - An agent platform where every feature exposes agent tools: `L1 DB`, `L2 Agent Toolset Conventions`, `L3 HTTP API`, `L4 UI`.
43
+ - A static content generator: `L1 Sources`, `L2 Transform`, `L3 Output`.
44
+
45
+ **Do not propose `L2 Domain` (or `L Domain`, `Business Logic`, etc.).** Every module's domain — its operations, validations, lifecycle, edge cases — is the module's substance, not a layer (see SKILL.md §2 anti-pattern). If multiple modules share a specific cross-cutting *convention* (error envelope shape, audit columns, validation framework), name the layer after that convention precisely (`L2 Error model`, `L2 Audit conventions`) rather than the catch-all "Domain".
46
+
47
+ Present as a table:
48
+
49
+ | # | Layer | Purpose (1 line) |
50
+ |---|-------|------------------|
51
+ | L1 | … | … |
52
+
53
+ Then ask:
54
+ > Confirm this layer set, or suggest additions / renames / removals. Layers should be few enough to keep in your head (3–7) and generic enough that any module can declare which ones it touches.
55
+
56
+ Iterate until the user confirms.
57
+
58
+ ## Phase 3 — Module identification
59
+
60
+ From the entities + features, propose modules. For each, list which layers it touches. Present as a table:
61
+
62
+ | # | Module | Complexity | Layers | Scope (1 line) | File |
63
+ |---|--------|-----------|--------|----------------|------|
64
+ | M01 | … | simple/medium/complex | L1, L2, L5 | … | `modules/M01-….md` |
65
+
66
+ Guidance:
67
+ - Each **entity type** from Phase 1 is a candidate module — sometimes one entity per module, sometimes several related entities (versioning, history, lookup tables) cluster into one domain slice. Decide per cluster, guided by user job rather than table count.
68
+ - Non-entity features can also be modules (config, agent, sync) — see SKILL.md §2 "Vertical slices — modules".
69
+ - Bootstrap/project-config is usually the first module (`M01`).
70
+ - Modules can skip layers they don't touch (e.g. a pure-UI module might not touch L1).
71
+ - Aim for 3–10 modules. If you're heading toward 15+, suggest merging related ones or deferring scope.
72
+
73
+ Ask the user to confirm, reorder, add, or remove. Iterate until confirmed.
74
+
75
+ ## Phase 4 — Skeleton generation
76
+
77
+ Now, and only now, write files. Create in this order:
78
+ 1. `<index>` (copy from `templates/index.md`) with the concepts, the confirmed layer table, the confirmed module table, and a *relations placeholder* section.
79
+ 2. One empty `layers/LX-<slug>.md` per layer (copy from `templates/layer.md`). Fill in *only* the title and purpose line; leave other sections as section headers with a one-line TODO.
80
+ 3. One empty `modules/MXX-<slug>.md` per module (copy from `templates/module.md`). Keep the per-layer section headers only for layers the module actually touches; delete the rest.
81
+ 4. Do **not** create per-module subdirectories up front. They are introduced lazily in Phase 5 only when a specific module's file outgrows the budget — at that point `modules/MXX-<slug>.md` is converted into `modules/MXX-<slug>/` with the slice extracted to `LY-<slug>.md` inside.
82
+
83
+ After writing, list the created files back to the user and ask: *"Skeleton is in place. Ready to fill modules in order M01 → MNN, or a different order?"*
84
+
85
+ ## Phase 5 — Module-by-module fill-in
86
+
87
+ For each module (in the chosen order), fill its file in two parts:
88
+
89
+ 1. **Module's own substance** (its domain — *not* a layer): `Purpose`, `Edge cases`, `Acceptance criteria`. Ask the user about the module's operations, validations, lifecycle, and edge cases here. This is the module file's heart and does not belong to any layer section.
90
+ 2. **Per-layer sections** — for each layer the module touches, ask a layer-scoped question and write the section following that layer's `## Module slice schema`. For example, for a module that touches L1 (persistence) and L3 (HTTP API):
91
+ - *"M03 persistence (L1): what columns does the entity have? Any unique constraints? Any relations?"* → write the L1 section per the layer's schema (or, if it dominates the module file, split M03 into `modules/M03-<slug>/` and move the slice to `modules/M03-<slug>/L1-<slug>.md`).
92
+ - *"M03 HTTP API (L3): what endpoints expose this entity?"* → write the L3 section per the layer's schema.
93
+
94
+ Do not ask "what does this module do at the domain level" as a separate per-layer question — that's already covered by the module's `Purpose` and `Edge cases`. If the user starts describing operations and validations, capture them in the module's own substance, not in a "domain layer" section.
95
+
96
+ After finishing a module, summarize what you captured and ask the user to confirm before moving to the next.
97
+
98
+ ## Phase 6 — Layer fill-in
99
+
100
+ After all modules are written, fill each `layers/LX-<slug>.md`. Layer files are **radically thin** — only three things:
101
+
102
+ - The layer's role in the system (1–2 orientational sentences).
103
+ - **Module slice schema** — the only substantive section. The form in which each consumer module declares its slice (headings, fields, fenced schema, embeds, references to project entities). **Bake every per-module rule into the schema as a field-level requirement** — naming ("table name in snake_case"), validation ("retries: positive int"), gating ("required if optional binary present, omitted otherwise"), allowed values, embed shape. No separate `## Conventions` / `## Patterns` / `## Contracts` sections. When the project models entities and the layer's slice is enumerable, prefer entities embedded via XML tags (e.g. `<tagged_list type="<entity-type>" tags="MNN"/>`) — modules stay short, listings stay live, drift becomes impossible.
104
+ - **Implementor module slot** — name the module that implements this layer, or write `external — <name>` when the implementor lives outside our spec (DB engine, HTTP framework, SDK), or `none — pure description convention`. See SKILL.md §2 for when each applies.
105
+
106
+ If a per-module rule won't fit inside the schema, that's a signal — see SKILL.md §2 ("Where cross-cutting content lives") for how to resolve it. Reflect on the layer instead of adding a prose bucket to the layer file.
107
+
108
+ **Implementor modules — second pass.** For every layer that names an *internal* implementor module, go to that module's file and expand its section for the layer to cover everything implementation-side: cross-cutting conventions (naming, error handling, structure), patterns consumers copy, contracts ("what consumers can rely on" / "what consumers must provide"), runtime registry, hooks, and shared utilities. The layer file does not duplicate any of this. Skip layers whose implementor is `external — <name>` or `none` — there is no in-spec module to expand.
109
+
110
+ Apply the layer-purity rule (see SKILL.md §6) as you go: every line in a layer file must stay true if any single module is removed. If a sentence only makes sense because of M03, it belongs in M03, not here.
111
+
112
+ After all layers are written, update `<index>`:
113
+ - Fill in the *Key relations / dependencies* diagram (which modules depend on which, which modules register into which framework layers).
114
+ - Add a final top-of-file paragraph summarizing the system.
115
+
116
+ Announce completion and offer: *"Spec skeleton and contents are complete. Want me to (a) do a coverage review, (b) generate a one-page summary for onboarding, or (c) stop here?"*
@@ -0,0 +1,154 @@
1
+ # Brief workflow (release brief generation)
2
+
3
+ Use this when **the active context is a brief thread** and you have just been called via `Skill("layered-vertical-slices")`.
4
+
5
+ The brief artifact is consumed by **two audiences** — a human in the claude4spec UI, and a coding agent in another terminal that has only the raw bytes of the file. The second audience is load-bearing: everything below serves it.
6
+
7
+ ## A. Spec-format vs feature substance
8
+
9
+ This is the most consequential filter in this workflow. In `layered-vertical-slices` the spec contains **two kinds of content** that look superficially similar in a `RawDelta`:
10
+
11
+ 1. **Feature substance** — what the *system* does, has, constrains. Lives mostly in `modules/MXX-*.md` per-layer sections, in entity records (DTO, Endpoint, Database Table, UI View), and in the `## Modules` row of `<index>` when a new module appears.
12
+ 2. **Spec-format conventions** — rules about *how to write the spec itself*. Lives in `layers/LX-*.md` files (`## Module slice schema` defines the *shape* a consumer module's section takes; `Implementor module:` slot names which module backs this layer; `## Role in the system` is orientational prose).
13
+
14
+ A coding agent in another terminal cannot act on (2). Telling them "L3 API uses `<tagged_list type="endpoint" tags="MXX"/>` to embed live endpoint lists" is a rule for the *spec author*, not for the implementer. If a brief inlines such content as if it were a requirement, the implementer wastes effort matching the spec's authoring grammar instead of building the system.
15
+
16
+ **Recognition table:**
17
+
18
+ | `RawDelta` entry | Classification | Action in brief |
19
+ | --- | --- | --- |
20
+ | Diff inside `layers/LX-*.md` § `## Module slice schema` | spec-format | **Drop.** Exception: if the schema change implies new runtime behavior (e.g. a new required field that any module must now declare → the system must validate it somewhere), describe the *runtime consequence*, not the schema text. |
21
+ | Diff inside `layers/LX-*.md` § `Implementor module:` slot | spec-format | **Drop.** This only renames who-implements-what in the spec; the system is unchanged. |
22
+ | Diff inside `layers/LX-*.md` § `## Role in the system` | spec-format | **Drop.** Orientational prose for spec readers. |
23
+ | New `layers/LX-*.md` file (whole file added) | mostly spec-format | Mention briefly that "the spec gained a new layer LX — \<name\> — which structures how modules describe \<topic\>" and stop. Do not transcribe the schema. The implementer cares only when modules start using this layer. |
24
+ | Diff inside `modules/MXX-*.md` § per-layer (e.g. `## Database (L1)`, `## API (L3)`) | substantive | **Translate** to a system-level statement; inline the entities/fields/endpoints. |
25
+ | Diff inside `modules/MXX-*.md` § `Purpose` / `Edge cases` / `Acceptance criteria` | substantive | **Translate** to system behavior. |
26
+ | New `modules/MXX-*.md` file | substantive | Open with the module's purpose in one sentence, then walk its per-layer sections. |
27
+ | Entity changes (DTO/Endpoint/Database Table/UI View — create/update/delete) | substantive | **Inline with full content.** See §B. |
28
+ | Anchor injection (`<!-- anchor: xxxxxxxx -->`), heading rename, section reorder, typo fix, prose smoothing, comment edit | editorial | **Drop.** Editorial mechanics belong in version history, not in the brief. |
29
+ | Diff in `<index>` § `## Modules` table (new row) | substantive | New module appeared — name it, give purpose. |
30
+ | Diff in `<index>` § `## Layers` table (new row) | mostly spec-format | Same as "new layer file" — one-line mention. |
31
+ | Diff in `<index>` § `## Open questions` | usually drop | Open questions are workshop notes, not commitments. Include only if the user explicitly asks for "spec status" framing. |
32
+ | Diff in `<index>` § `## Tech stack` | substantive | A real change to runtime/dependencies — translate to "the system now runs on \<X\>". |
33
+ | Diff in `<index>` § `## Acceptance criteria` (project-level) | substantive | Translate to observable behavior. |
34
+
35
+ **Heuristic in one question:** *"Could a coding agent in another repo, with only this brief, do something concrete in response to this?"* If no — drop it.
36
+
37
+ If after filtering nothing substantive remains in a release, say so explicitly: *"This release contains only editorial cleanup of the specification — no system behaviour changes."* Do not pad.
38
+
39
+ ## B. Inlining patterns (binding — the self-contained invariant)
40
+
41
+ The reader has only this file. Every "see X" is a failure. Use plain prose to name things, then inline the substance.
42
+
43
+ **DTO change** — write the field table:
44
+
45
+ ```
46
+ The `User` DTO gained an `emailVerifiedAt` field:
47
+
48
+ | field | type | required |
49
+ |-------------------|-----------------------|----------|
50
+ | emailVerifiedAt | string \| null (ISO) | no |
51
+
52
+ Existing rows are backfilled to `null`; the field becomes required-on-write only after the rollout in v0.4.
53
+ ```
54
+
55
+ **Endpoint change** — write method, path, request/response DTOs, status codes, tags:
56
+
57
+ ```
58
+ New endpoint `POST /api/auth/verify-email`. Request: `{ token: string }`. Responses: 204 (success), 400 `INVALID_TOKEN`, 410 `TOKEN_EXPIRED`. Tagged `auth`.
59
+ ```
60
+
61
+ **Database table / migration** — show the SQL fragment verbatim:
62
+
63
+ ````
64
+ New column on `user`:
65
+
66
+ ```sql
67
+ ALTER TABLE user ADD COLUMN email_verified_at TEXT;
68
+ ```
69
+ ````
70
+
71
+ **UI View change** — name the route, the data it loads, key interactions:
72
+
73
+ ```
74
+ New view at `/auth/verify` (component `VerifyEmailPage`): reads `?token=…` from the URL, calls `POST /api/auth/verify-email`, redirects to `/login` on success.
75
+ ```
76
+
77
+ **Behavior change documented on a spec page** — translate the page edit into a system-level statement, then quote the substantive content (not the page mechanics):
78
+
79
+ ```
80
+ The signup flow now requires email verification before login is allowed:
81
+
82
+ > After signup the user receives a token by email and must call `POST /api/auth/verify-email`
83
+ > with `{ token }`. Until that call succeeds, attempts to log in return 403 with code
84
+ > `EMAIL_NOT_VERIFIED`.
85
+
86
+ The previous magic-link fallback is removed; password + optional TOTP is the only login path.
87
+ ```
88
+
89
+ NOT: *"The page `pages/auth/flow.md` lost a 12-line subsection and gained a 'Verify email' heading between `## Login` and `## Logout`."* — that describes the spec edit, not the system.
90
+
91
+ ## C. Forbidden grammar
92
+
93
+ Never use these in a brief — they are claude4spec **UI grammar**, only resolvable inside the running app:
94
+
95
+ - `<single_element type="…" slug="…"/>`
96
+ - `<inline_mention type="…" slug="…">…</inline_mention>`
97
+ - `<element_list type="…">…</element_list>`
98
+ - `<tagged_list type="…" tags="…"/>`
99
+ - `<tagged_list_mixed types="…" tags="…"/>`
100
+ - `@page.md` mentions
101
+ - Any reference like *"see release diff"* or *"per the spec"* without inlining the content
102
+
103
+ In a terminal that does not have claude4spec running, these resolve to literal XML/markdown noise that confuses rather than helps. Whenever the source spec uses one of them, **resolve it inline**: read the entity content (DTO fields, endpoint shape, table columns) and paste the substance into the brief.
104
+
105
+ ## D. "For implementers" section
106
+
107
+ This is the section a coding agent reads to act. It must be:
108
+
109
+ - A bulleted or numbered list of **concrete edit targets** — file paths, function names, SQL/migration snippets, env var names.
110
+ - Self-contained: the agent should be able to start editing immediately without opening any other file.
111
+ - Ordered roughly by dependency (migrations before code that uses them, types before consumers, etc.).
112
+ - Anchored to **modules and layers** when useful — e.g. "this lives in M03's L1 (database) section" — but the path/snippet is what the agent acts on, not the module reference.
113
+
114
+ Example:
115
+
116
+ ```
117
+ ## For implementers
118
+
119
+ 1. Migration: add `migrations/0042_email_verified_at.sql` with `ALTER TABLE user ADD COLUMN email_verified_at TEXT;`. (Belongs to M07 / L1.)
120
+ 2. Update the `User` type in `shared/types.ts` — add `emailVerifiedAt: string | null`.
121
+ 3. New endpoint handler `server/routes/auth/verify-email.ts` — schema `z.object({ token: z.string() })`, returns 204 on success, 400/410 on failure (codes `INVALID_TOKEN`, `TOKEN_EXPIRED`). (M07 / L3.)
122
+ 4. Update the signup flow in `server/routes/auth/signup.ts:46` to call `sendVerificationEmail(user.id)` after user insert.
123
+ 5. UI: render a "Verify your email" banner in `client/components/AppShell.tsx` when `user.emailVerifiedAt === null`. (M07 / L5.)
124
+ ```
125
+
126
+ NOT a "for implementers" section: bullet points like "implement email verification" or "add migration" — those are restatements, not edit targets.
127
+
128
+ ## E. Branch A / Branch B specifics for this style
129
+
130
+ `brief-author` defines the two operating branches (A: initial generation, B: editorial). Apply this style's filters inside them.
131
+
132
+ ### Branch A — initial generation (this writing style)
133
+
134
+ After `get_brief` and `get_release_diff(...)`:
135
+
136
+ 1. **Filter** every `RawDelta` entry through §A's recognition table. Drop spec-format and editorial entries up front; keep only feature substance.
137
+ 2. **Mine** the kept entries: pull entity shapes (DTO fields, endpoint method+path+DTOs, table columns, view URL/params) from `RawDelta.entities[].raw` and `.changes`. For module-section diffs, extract the substantive added lines.
138
+ 3. **Compose** the narrative:
139
+ - Open with a 2–4 sentence summary describing the *intent* of the release — the user-job the changes enable. The reader should learn *why* the release happened in the first paragraph.
140
+ - Group changes by user-visible theme (new capabilities, breaking changes, internal refactors), not by entity type or by spec page. Module/layer references stay as anchors *within* themes, not as the primary axis.
141
+ - For each theme: state what the system now does in plain prose, **inline the change content** per §B, avoid forbidden grammar per §C.
142
+ - Close with `## For implementers` per §D.
143
+ 4. **Initial brief detection** — if `frontmatter.from_release === null`, the release diff is synthetic (every entry is `op: 'create'`). Drop "what changed" framing entirely; describe what the system *is* at this point. Open with `# Initial brief: <to_release>` (already pre-filled by the system).
144
+
145
+ ### Branch B — editorial (this writing style)
146
+
147
+ When the brief already has body content and the user asks for a change:
148
+
149
+ - **"Make it shorter"** → tighten prose, never drop inlined entity shapes / file paths / signatures. The second audience needs facts intact.
150
+ - **"Add X"** → use `insert_after_section({ anchor: '<8char>', content })`; pull the anchor from the body's `<!-- anchor: ... -->` comments. Prefer `anchor` over `heading`.
151
+ - **"Fix the inlined endpoint shape"** → re-read `release-tools.get_release_diff(...)` for that entity; never paraphrase from memory.
152
+ - **"Reframe for a different audience"** (e.g. "rewrite for a junior") → keep §B/§C/§D rules; only the prose register changes.
153
+
154
+ If the user request would force you to break §C (forbidden grammar) — e.g. "just paste the `<tagged_list>` from the spec" — explain why that fails the second audience and offer the inlined alternative.