@tailor-platform/erp-kit 0.4.0 → 0.4.1

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 (488) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cli.mjs +9 -9
  3. package/package.json +1 -1
  4. package/skills/erp-kit-app-1-requirements/SKILL.md +31 -3
  5. package/skills/{erp-kit-app-3-plan → erp-kit-app-1-requirements}/references/story-extraction.md +3 -9
  6. package/skills/erp-kit-app-2-requirements-review/SKILL.md +29 -5
  7. package/skills/erp-kit-app-2-requirements-review/references/story-quality-check.md +67 -0
  8. package/skills/erp-kit-app-3-plan/SKILL.md +33 -32
  9. package/skills/erp-kit-app-3-plan/references/resolver-extraction.md +4 -2
  10. package/skills/erp-kit-app-3-plan/references/screen-extraction.md +5 -3
  11. package/skills/erp-kit-app-4-plan-review/SKILL.md +16 -13
  12. package/skills/erp-kit-app-5-impl-backend/SKILL.md +10 -0
  13. package/skills/erp-kit-app-6-impl-frontend/SKILL.md +11 -0
  14. package/skills/erp-kit-app-7-impl-review/SKILL.md +18 -14
  15. package/skills/erp-kit-module-2-requirements-review/SKILL.md +16 -8
  16. package/skills/erp-kit-module-4-plan-review/SKILL.md +19 -12
  17. package/skills/erp-kit-module-shared/references/commands.md +1 -1
  18. package/skills/erp-kit-module-shared/references/queries.md +5 -6
  19. package/src/generator/generate-code-boilerplate.test.ts +0 -1
  20. package/src/generator/generate-code.test.ts +10 -6
  21. package/src/generator/generate-errors.ts +1 -1
  22. package/src/generator/generate-permissions.ts +1 -1
  23. package/src/generator/generate-shells.ts +2 -2
  24. package/src/generator/stub-templates.ts +5 -5
  25. package/src/module.ts +3 -0
  26. package/src/modules/audit/command/activateAuditPolicy.generated.ts +1 -1
  27. package/src/modules/audit/command/activateAuditPolicy.test.ts +1 -1
  28. package/src/modules/audit/command/activateAuditPolicy.ts +1 -1
  29. package/src/modules/audit/command/createAuditPolicy.generated.ts +1 -1
  30. package/src/modules/audit/command/createAuditPolicy.test.ts +1 -1
  31. package/src/modules/audit/command/createAuditPolicy.ts +1 -1
  32. package/src/modules/audit/command/deactivateAuditPolicy.generated.ts +1 -1
  33. package/src/modules/audit/command/deactivateAuditPolicy.test.ts +2 -2
  34. package/src/modules/audit/command/deactivateAuditPolicy.ts +1 -1
  35. package/src/modules/audit/command/deleteAuditPolicy.generated.ts +1 -1
  36. package/src/modules/audit/command/deleteAuditPolicy.test.ts +1 -1
  37. package/src/modules/audit/command/deleteAuditPolicy.ts +1 -1
  38. package/src/modules/audit/command/logAuditEvent.generated.ts +1 -1
  39. package/src/modules/audit/command/logAuditEvent.test.ts +1 -1
  40. package/src/modules/audit/command/logAuditEvent.ts +1 -1
  41. package/src/modules/audit/command/reactivateAuditPolicy.generated.ts +1 -1
  42. package/src/modules/audit/command/reactivateAuditPolicy.test.ts +2 -2
  43. package/src/modules/audit/command/reactivateAuditPolicy.ts +1 -1
  44. package/src/modules/audit/command/registerAuditableEntity.generated.ts +1 -1
  45. package/src/modules/audit/command/registerAuditableEntity.test.ts +1 -1
  46. package/src/modules/audit/command/registerAuditableEntity.ts +1 -1
  47. package/src/modules/audit/command/replaceAuditPolicy.generated.ts +1 -1
  48. package/src/modules/audit/command/replaceAuditPolicy.test.ts +1 -1
  49. package/src/modules/audit/command/replaceAuditPolicy.ts +1 -1
  50. package/src/modules/audit/command/updateAuditPolicy.generated.ts +1 -1
  51. package/src/modules/audit/command/updateAuditPolicy.test.ts +1 -1
  52. package/src/modules/audit/command/updateAuditPolicy.ts +1 -1
  53. package/src/modules/audit/lib/errors.generated.ts +1 -1
  54. package/src/modules/audit/lib/permissions.generated.ts +1 -1
  55. package/src/modules/audit/lib/types.ts +6 -1
  56. package/src/modules/audit/permissions.ts +1 -1
  57. package/src/modules/audit/query/getAuditEntry.generated.ts +1 -1
  58. package/src/modules/audit/query/getAuditEntry.test.ts +2 -2
  59. package/src/modules/audit/query/getAuditEntry.ts +7 -1
  60. package/src/modules/audit/query/getAuditPolicy.generated.ts +1 -1
  61. package/src/modules/audit/query/getAuditPolicy.test.ts +2 -2
  62. package/src/modules/audit/query/getAuditPolicy.ts +7 -1
  63. package/src/modules/audit/query/getAuditSummary.generated.ts +1 -1
  64. package/src/modules/audit/query/getAuditSummary.test.ts +2 -2
  65. package/src/modules/audit/query/getAuditSummary.ts +7 -1
  66. package/src/modules/audit/query/getChangeDetails.generated.ts +1 -1
  67. package/src/modules/audit/query/getChangeDetails.test.ts +2 -2
  68. package/src/modules/audit/query/getChangeDetails.ts +7 -1
  69. package/src/modules/audit/query/listAuditPolicies.generated.ts +1 -1
  70. package/src/modules/audit/query/listAuditPolicies.test.ts +2 -2
  71. package/src/modules/audit/query/listAuditPolicies.ts +3 -3
  72. package/src/modules/audit/query/searchAuditEntries.generated.ts +1 -1
  73. package/src/modules/audit/query/searchAuditEntries.test.ts +2 -2
  74. package/src/modules/audit/query/searchAuditEntries.ts +7 -7
  75. package/src/modules/business-partner/command/activatePartner.generated.ts +1 -1
  76. package/src/modules/business-partner/command/activatePartner.ts +1 -1
  77. package/src/modules/business-partner/command/assignRoleToPartner.generated.ts +1 -1
  78. package/src/modules/business-partner/command/assignRoleToPartner.test.ts +1 -1
  79. package/src/modules/business-partner/command/assignRoleToPartner.ts +1 -1
  80. package/src/modules/business-partner/command/createContactPerson.generated.ts +1 -1
  81. package/src/modules/business-partner/command/createContactPerson.ts +1 -1
  82. package/src/modules/business-partner/command/createPartner.generated.ts +1 -1
  83. package/src/modules/business-partner/command/createPartner.test.ts +1 -1
  84. package/src/modules/business-partner/command/createPartner.ts +3 -4
  85. package/src/modules/business-partner/command/createPartnerAddress.generated.ts +1 -1
  86. package/src/modules/business-partner/command/createPartnerAddress.ts +1 -1
  87. package/src/modules/business-partner/command/createPartnerBankAccount.generated.ts +1 -1
  88. package/src/modules/business-partner/command/createPartnerBankAccount.test.ts +1 -1
  89. package/src/modules/business-partner/command/createPartnerBankAccount.ts +1 -1
  90. package/src/modules/business-partner/command/createPartnerIdentification.generated.ts +1 -1
  91. package/src/modules/business-partner/command/createPartnerIdentification.test.ts +1 -1
  92. package/src/modules/business-partner/command/createPartnerIdentification.ts +1 -1
  93. package/src/modules/business-partner/command/deactivateContactPerson.generated.ts +1 -1
  94. package/src/modules/business-partner/command/deactivateContactPerson.ts +1 -1
  95. package/src/modules/business-partner/command/deactivatePartner.generated.ts +1 -1
  96. package/src/modules/business-partner/command/deactivatePartner.ts +1 -1
  97. package/src/modules/business-partner/command/deleteContactPerson.generated.ts +1 -1
  98. package/src/modules/business-partner/command/deleteContactPerson.ts +1 -1
  99. package/src/modules/business-partner/command/deletePartner.generated.ts +1 -1
  100. package/src/modules/business-partner/command/deletePartner.ts +1 -1
  101. package/src/modules/business-partner/command/deletePartnerAddress.generated.ts +1 -1
  102. package/src/modules/business-partner/command/deletePartnerAddress.test.ts +1 -1
  103. package/src/modules/business-partner/command/deletePartnerAddress.ts +1 -1
  104. package/src/modules/business-partner/command/deletePartnerBankAccount.generated.ts +1 -1
  105. package/src/modules/business-partner/command/deletePartnerBankAccount.test.ts +1 -1
  106. package/src/modules/business-partner/command/deletePartnerBankAccount.ts +1 -1
  107. package/src/modules/business-partner/command/deletePartnerIdentification.generated.ts +1 -1
  108. package/src/modules/business-partner/command/deletePartnerIdentification.test.ts +1 -1
  109. package/src/modules/business-partner/command/deletePartnerIdentification.ts +1 -1
  110. package/src/modules/business-partner/command/reactivateContactPerson.generated.ts +1 -1
  111. package/src/modules/business-partner/command/reactivateContactPerson.ts +1 -1
  112. package/src/modules/business-partner/command/reactivatePartner.generated.ts +1 -1
  113. package/src/modules/business-partner/command/reactivatePartner.ts +1 -1
  114. package/src/modules/business-partner/command/removeRoleFromPartner.generated.ts +1 -1
  115. package/src/modules/business-partner/command/removeRoleFromPartner.test.ts +1 -1
  116. package/src/modules/business-partner/command/removeRoleFromPartner.ts +1 -1
  117. package/src/modules/business-partner/command/setDefaultPartnerAddress.generated.ts +1 -1
  118. package/src/modules/business-partner/command/setDefaultPartnerAddress.ts +1 -1
  119. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.generated.ts +1 -1
  120. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.test.ts +1 -1
  121. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.ts +1 -1
  122. package/src/modules/business-partner/command/setPrimaryContactPerson.generated.ts +1 -1
  123. package/src/modules/business-partner/command/setPrimaryContactPerson.ts +1 -1
  124. package/src/modules/business-partner/command/updateContactPerson.generated.ts +1 -1
  125. package/src/modules/business-partner/command/updateContactPerson.ts +1 -1
  126. package/src/modules/business-partner/command/updatePartner.generated.ts +1 -1
  127. package/src/modules/business-partner/command/updatePartner.test.ts +1 -1
  128. package/src/modules/business-partner/command/updatePartner.ts +1 -1
  129. package/src/modules/business-partner/command/updatePartnerAddress.generated.ts +1 -1
  130. package/src/modules/business-partner/command/updatePartnerAddress.ts +1 -1
  131. package/src/modules/business-partner/command/updatePartnerBankAccount.generated.ts +1 -1
  132. package/src/modules/business-partner/command/updatePartnerBankAccount.test.ts +1 -1
  133. package/src/modules/business-partner/command/updatePartnerBankAccount.ts +1 -1
  134. package/src/modules/business-partner/command/updatePartnerIdentification.generated.ts +1 -1
  135. package/src/modules/business-partner/command/updatePartnerIdentification.test.ts +1 -1
  136. package/src/modules/business-partner/command/updatePartnerIdentification.ts +1 -1
  137. package/src/modules/business-partner/lib/errors.generated.ts +1 -1
  138. package/src/modules/business-partner/lib/permissions.generated.ts +1 -1
  139. package/src/modules/business-partner/lib/types.ts +6 -1
  140. package/src/modules/business-partner/module.ts +1 -1
  141. package/src/modules/business-partner/permissions.ts +1 -1
  142. package/src/modules/business-partner/query/getContactPerson.generated.ts +1 -1
  143. package/src/modules/business-partner/query/getContactPerson.ts +1 -1
  144. package/src/modules/business-partner/query/getDefaultPartnerAddress.generated.ts +1 -1
  145. package/src/modules/business-partner/query/getDefaultPartnerAddress.ts +1 -1
  146. package/src/modules/business-partner/query/getDefaultPartnerBankAccount.generated.ts +1 -1
  147. package/src/modules/business-partner/query/getDefaultPartnerBankAccount.ts +1 -1
  148. package/src/modules/business-partner/query/getPartner.generated.ts +1 -1
  149. package/src/modules/business-partner/query/getPartner.ts +1 -1
  150. package/src/modules/business-partner/query/getPartnerAddress.generated.ts +1 -1
  151. package/src/modules/business-partner/query/getPartnerAddress.ts +1 -1
  152. package/src/modules/business-partner/query/getPartnerBankAccount.generated.ts +1 -1
  153. package/src/modules/business-partner/query/getPartnerBankAccount.ts +1 -1
  154. package/src/modules/business-partner/query/getPartnerIdentification.generated.ts +1 -1
  155. package/src/modules/business-partner/query/getPartnerIdentification.ts +1 -1
  156. package/src/modules/business-partner/query/getPartnerRole.generated.ts +1 -1
  157. package/src/modules/business-partner/query/getPartnerRole.ts +1 -1
  158. package/src/modules/business-partner/query/getPrimaryContactPerson.generated.ts +1 -1
  159. package/src/modules/business-partner/query/getPrimaryContactPerson.ts +1 -1
  160. package/src/modules/business-partner/query/listContactPersonsByPartner.generated.ts +1 -1
  161. package/src/modules/business-partner/query/listContactPersonsByPartner.ts +2 -2
  162. package/src/modules/business-partner/query/listPartnerAddressesByPartner.generated.ts +1 -1
  163. package/src/modules/business-partner/query/listPartnerAddressesByPartner.ts +3 -3
  164. package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.generated.ts +1 -1
  165. package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.ts +2 -2
  166. package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.generated.ts +1 -1
  167. package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.ts +3 -3
  168. package/src/modules/business-partner/query/listPartnersByRole.generated.ts +1 -1
  169. package/src/modules/business-partner/query/listPartnersByRole.ts +4 -4
  170. package/src/modules/coa-management/command/activateAccount.generated.ts +1 -1
  171. package/src/modules/coa-management/command/activateAccount.test.ts +1 -1
  172. package/src/modules/coa-management/command/activateAccount.ts +1 -1
  173. package/src/modules/coa-management/command/activateChartOfAccounts.generated.ts +1 -1
  174. package/src/modules/coa-management/command/activateChartOfAccounts.test.ts +1 -1
  175. package/src/modules/coa-management/command/activateChartOfAccounts.ts +1 -1
  176. package/src/modules/coa-management/command/createAccount.generated.ts +1 -1
  177. package/src/modules/coa-management/command/createAccount.test.ts +1 -1
  178. package/src/modules/coa-management/command/createAccount.ts +1 -1
  179. package/src/modules/coa-management/command/createAccountGroup.generated.ts +1 -1
  180. package/src/modules/coa-management/command/createAccountGroup.test.ts +1 -1
  181. package/src/modules/coa-management/command/createAccountGroup.ts +1 -1
  182. package/src/modules/coa-management/command/createChartOfAccounts.generated.ts +1 -1
  183. package/src/modules/coa-management/command/createChartOfAccounts.test.ts +1 -1
  184. package/src/modules/coa-management/command/createChartOfAccounts.ts +1 -1
  185. package/src/modules/coa-management/command/deactivateAccount.generated.ts +1 -1
  186. package/src/modules/coa-management/command/deactivateAccount.test.ts +1 -1
  187. package/src/modules/coa-management/command/deactivateAccount.ts +1 -1
  188. package/src/modules/coa-management/command/deactivateChartOfAccounts.generated.ts +1 -1
  189. package/src/modules/coa-management/command/deactivateChartOfAccounts.test.ts +1 -1
  190. package/src/modules/coa-management/command/deactivateChartOfAccounts.ts +1 -1
  191. package/src/modules/coa-management/command/deleteAccount.generated.ts +1 -1
  192. package/src/modules/coa-management/command/deleteAccount.test.ts +1 -1
  193. package/src/modules/coa-management/command/deleteAccount.ts +1 -1
  194. package/src/modules/coa-management/command/deleteAccountGroup.generated.ts +1 -1
  195. package/src/modules/coa-management/command/deleteAccountGroup.test.ts +1 -1
  196. package/src/modules/coa-management/command/deleteAccountGroup.ts +1 -1
  197. package/src/modules/coa-management/command/deleteChartOfAccounts.generated.ts +1 -1
  198. package/src/modules/coa-management/command/deleteChartOfAccounts.test.ts +1 -1
  199. package/src/modules/coa-management/command/deleteChartOfAccounts.ts +1 -1
  200. package/src/modules/coa-management/command/moveAccountGroup.generated.ts +1 -1
  201. package/src/modules/coa-management/command/moveAccountGroup.test.ts +1 -1
  202. package/src/modules/coa-management/command/moveAccountGroup.ts +1 -1
  203. package/src/modules/coa-management/command/reactivateAccount.generated.ts +1 -1
  204. package/src/modules/coa-management/command/reactivateAccount.test.ts +1 -1
  205. package/src/modules/coa-management/command/reactivateAccount.ts +1 -1
  206. package/src/modules/coa-management/command/updateAccount.generated.ts +1 -1
  207. package/src/modules/coa-management/command/updateAccount.test.ts +1 -1
  208. package/src/modules/coa-management/command/updateAccount.ts +1 -1
  209. package/src/modules/coa-management/command/updateAccountGroup.generated.ts +1 -1
  210. package/src/modules/coa-management/command/updateAccountGroup.test.ts +1 -1
  211. package/src/modules/coa-management/command/updateAccountGroup.ts +1 -1
  212. package/src/modules/coa-management/command/updateChartOfAccounts.generated.ts +1 -1
  213. package/src/modules/coa-management/command/updateChartOfAccounts.test.ts +1 -1
  214. package/src/modules/coa-management/command/updateChartOfAccounts.ts +1 -1
  215. package/src/modules/coa-management/lib/errors.generated.ts +1 -1
  216. package/src/modules/coa-management/lib/permissions.generated.ts +1 -1
  217. package/src/modules/coa-management/lib/types.ts +6 -1
  218. package/src/modules/coa-management/module.ts +1 -1
  219. package/src/modules/coa-management/permissions.ts +1 -1
  220. package/src/modules/coa-management/query/detectCircularReference.generated.ts +1 -1
  221. package/src/modules/coa-management/query/detectCircularReference.ts +1 -1
  222. package/src/modules/coa-management/query/getAccount.generated.ts +1 -1
  223. package/src/modules/coa-management/query/getAccount.ts +1 -1
  224. package/src/modules/coa-management/query/getAccountGroup.generated.ts +1 -1
  225. package/src/modules/coa-management/query/getAccountGroup.ts +1 -1
  226. package/src/modules/coa-management/query/getChartOfAccounts.generated.ts +1 -1
  227. package/src/modules/coa-management/query/getChartOfAccounts.ts +1 -1
  228. package/src/modules/coa-management/query/listAccountGroups.generated.ts +1 -1
  229. package/src/modules/coa-management/query/listAccountGroups.ts +2 -2
  230. package/src/modules/coa-management/query/listAccounts.generated.ts +1 -1
  231. package/src/modules/coa-management/query/listAccounts.ts +3 -3
  232. package/src/modules/coa-management/query/listUnassignedAccounts.generated.ts +1 -1
  233. package/src/modules/coa-management/query/listUnassignedAccounts.ts +2 -2
  234. package/src/modules/item-management/command/activateItem.generated.ts +1 -1
  235. package/src/modules/item-management/command/activateItem.ts +1 -1
  236. package/src/modules/item-management/command/assignItemToTaxonomy.generated.ts +1 -1
  237. package/src/modules/item-management/command/assignItemToTaxonomy.ts +1 -1
  238. package/src/modules/item-management/command/createItem.generated.ts +1 -1
  239. package/src/modules/item-management/command/createItem.test.ts +1 -1
  240. package/src/modules/item-management/command/createItem.ts +1 -1
  241. package/src/modules/item-management/command/createTaxonomyNode.generated.ts +1 -1
  242. package/src/modules/item-management/command/createTaxonomyNode.test.ts +1 -1
  243. package/src/modules/item-management/command/createTaxonomyNode.ts +1 -1
  244. package/src/modules/item-management/command/deactivateItem.generated.ts +1 -1
  245. package/src/modules/item-management/command/deactivateItem.ts +1 -1
  246. package/src/modules/item-management/command/deleteItem.generated.ts +1 -1
  247. package/src/modules/item-management/command/deleteItem.ts +1 -1
  248. package/src/modules/item-management/command/deleteTaxonomyNode.generated.ts +1 -1
  249. package/src/modules/item-management/command/deleteTaxonomyNode.ts +1 -1
  250. package/src/modules/item-management/command/moveTaxonomyNode.generated.ts +1 -1
  251. package/src/modules/item-management/command/moveTaxonomyNode.test.ts +1 -1
  252. package/src/modules/item-management/command/moveTaxonomyNode.ts +1 -1
  253. package/src/modules/item-management/command/reactivateItem.generated.ts +1 -1
  254. package/src/modules/item-management/command/reactivateItem.ts +1 -1
  255. package/src/modules/item-management/command/removeItemFromTaxonomy.generated.ts +1 -1
  256. package/src/modules/item-management/command/removeItemFromTaxonomy.ts +1 -1
  257. package/src/modules/item-management/command/updateItem.generated.ts +1 -1
  258. package/src/modules/item-management/command/updateItem.test.ts +1 -1
  259. package/src/modules/item-management/command/updateItem.ts +1 -1
  260. package/src/modules/item-management/command/updateTaxonomyNode.generated.ts +1 -1
  261. package/src/modules/item-management/command/updateTaxonomyNode.ts +1 -1
  262. package/src/modules/item-management/lib/errors.generated.ts +1 -1
  263. package/src/modules/item-management/lib/permissions.generated.ts +1 -1
  264. package/src/modules/item-management/lib/types.ts +6 -1
  265. package/src/modules/item-management/module.ts +1 -1
  266. package/src/modules/item-management/query/calculateNodeDepth.generated.ts +1 -1
  267. package/src/modules/item-management/query/calculateNodeDepth.ts +1 -1
  268. package/src/modules/item-management/query/calculateSubtreeDepth.generated.ts +1 -1
  269. package/src/modules/item-management/query/calculateSubtreeDepth.ts +1 -1
  270. package/src/modules/item-management/query/detectCircularReference.generated.ts +1 -1
  271. package/src/modules/item-management/query/detectCircularReference.ts +1 -1
  272. package/src/modules/item-management/query/getItem.generated.ts +1 -1
  273. package/src/modules/item-management/query/getItem.ts +1 -1
  274. package/src/modules/item-management/query/getItemTaxonomyAssignment.generated.ts +1 -1
  275. package/src/modules/item-management/query/getItemTaxonomyAssignment.ts +1 -1
  276. package/src/modules/item-management/query/getTaxonomyNode.generated.ts +1 -1
  277. package/src/modules/item-management/query/getTaxonomyNode.ts +1 -1
  278. package/src/modules/item-management/query/getTaxonomyNodeAssignments.generated.ts +1 -1
  279. package/src/modules/item-management/query/getTaxonomyNodeAssignments.ts +1 -1
  280. package/src/modules/item-management/query/getTaxonomyNodeChildren.generated.ts +1 -1
  281. package/src/modules/item-management/query/getTaxonomyNodeChildren.ts +1 -1
  282. package/src/modules/organization/command/activateCompany.generated.ts +1 -1
  283. package/src/modules/organization/command/activateCompany.test.ts +1 -1
  284. package/src/modules/organization/command/activateCompany.ts +1 -1
  285. package/src/modules/organization/command/createCompany.generated.ts +1 -1
  286. package/src/modules/organization/command/createCompany.test.ts +1 -1
  287. package/src/modules/organization/command/createCompany.ts +1 -1
  288. package/src/modules/organization/command/createDepartment.generated.ts +1 -1
  289. package/src/modules/organization/command/createDepartment.ts +1 -1
  290. package/src/modules/organization/command/createSite.generated.ts +1 -1
  291. package/src/modules/organization/command/createSite.ts +1 -1
  292. package/src/modules/organization/command/deactivateCompany.generated.ts +1 -1
  293. package/src/modules/organization/command/deactivateCompany.ts +1 -1
  294. package/src/modules/organization/command/deactivateDepartment.generated.ts +1 -1
  295. package/src/modules/organization/command/deactivateDepartment.ts +1 -1
  296. package/src/modules/organization/command/deactivateSite.generated.ts +1 -1
  297. package/src/modules/organization/command/deactivateSite.ts +1 -1
  298. package/src/modules/organization/command/deleteCompany.generated.ts +1 -1
  299. package/src/modules/organization/command/deleteCompany.ts +1 -1
  300. package/src/modules/organization/command/reactivateCompany.generated.ts +1 -1
  301. package/src/modules/organization/command/reactivateCompany.ts +1 -1
  302. package/src/modules/organization/command/reactivateDepartment.generated.ts +1 -1
  303. package/src/modules/organization/command/reactivateDepartment.ts +1 -1
  304. package/src/modules/organization/command/reactivateSite.generated.ts +1 -1
  305. package/src/modules/organization/command/reactivateSite.ts +1 -1
  306. package/src/modules/organization/command/updateCompany.generated.ts +1 -1
  307. package/src/modules/organization/command/updateCompany.test.ts +1 -1
  308. package/src/modules/organization/command/updateCompany.ts +1 -1
  309. package/src/modules/organization/command/updateDepartment.generated.ts +1 -1
  310. package/src/modules/organization/command/updateDepartment.ts +1 -1
  311. package/src/modules/organization/command/updateSite.generated.ts +1 -1
  312. package/src/modules/organization/command/updateSite.ts +1 -1
  313. package/src/modules/organization/lib/errors.generated.ts +1 -1
  314. package/src/modules/organization/lib/permissions.generated.ts +1 -1
  315. package/src/modules/organization/lib/types.ts +6 -1
  316. package/src/modules/organization/module.ts +1 -1
  317. package/src/modules/organization/permissions.ts +1 -1
  318. package/src/modules/organization/query/detectDepartmentCircularReference.generated.ts +1 -1
  319. package/src/modules/organization/query/detectDepartmentCircularReference.ts +1 -1
  320. package/src/modules/organization/query/getCompany.generated.ts +1 -1
  321. package/src/modules/organization/query/getCompany.ts +1 -1
  322. package/src/modules/organization/query/getDepartment.generated.ts +1 -1
  323. package/src/modules/organization/query/getDepartment.ts +1 -1
  324. package/src/modules/organization/query/getDepartmentChildren.generated.ts +1 -1
  325. package/src/modules/organization/query/getDepartmentChildren.ts +1 -1
  326. package/src/modules/organization/query/getSite.generated.ts +1 -1
  327. package/src/modules/organization/query/getSite.ts +1 -1
  328. package/src/modules/organization/query/listDepartmentsByCompany.generated.ts +1 -1
  329. package/src/modules/organization/query/listDepartmentsByCompany.ts +2 -2
  330. package/src/modules/organization/query/listSitesByCompany.generated.ts +1 -1
  331. package/src/modules/organization/query/listSitesByCompany.ts +2 -2
  332. package/src/modules/primitives/command/activateCategory.generated.ts +1 -1
  333. package/src/modules/primitives/command/activateCategory.ts +1 -1
  334. package/src/modules/primitives/command/activateCurrency.generated.ts +1 -1
  335. package/src/modules/primitives/command/activateCurrency.ts +1 -1
  336. package/src/modules/primitives/command/activateUnit.generated.ts +1 -1
  337. package/src/modules/primitives/command/activateUnit.ts +1 -1
  338. package/src/modules/primitives/command/createCategory.generated.ts +1 -1
  339. package/src/modules/primitives/command/createCategory.ts +1 -1
  340. package/src/modules/primitives/command/createCurrency.generated.ts +1 -1
  341. package/src/modules/primitives/command/createCurrency.ts +1 -1
  342. package/src/modules/primitives/command/createExchangeRate.generated.ts +1 -1
  343. package/src/modules/primitives/command/createExchangeRate.ts +1 -1
  344. package/src/modules/primitives/command/createUnit.generated.ts +1 -1
  345. package/src/modules/primitives/command/createUnit.ts +1 -1
  346. package/src/modules/primitives/command/deactivateCategory.generated.ts +1 -1
  347. package/src/modules/primitives/command/deactivateCategory.ts +1 -1
  348. package/src/modules/primitives/command/deactivateCurrency.generated.ts +1 -1
  349. package/src/modules/primitives/command/deactivateCurrency.ts +1 -1
  350. package/src/modules/primitives/command/deactivateUnit.generated.ts +1 -1
  351. package/src/modules/primitives/command/deactivateUnit.ts +1 -1
  352. package/src/modules/primitives/command/setBaseCurrency.generated.ts +1 -1
  353. package/src/modules/primitives/command/setBaseCurrency.ts +1 -1
  354. package/src/modules/primitives/command/setReferenceUnit.generated.ts +1 -1
  355. package/src/modules/primitives/command/setReferenceUnit.ts +1 -1
  356. package/src/modules/primitives/lib/errors.generated.ts +1 -1
  357. package/src/modules/primitives/lib/permissions.generated.ts +1 -1
  358. package/src/modules/primitives/lib/types.ts +6 -1
  359. package/src/modules/primitives/module.ts +1 -1
  360. package/src/modules/primitives/query/convertAmount.generated.ts +1 -1
  361. package/src/modules/primitives/query/convertAmount.test.ts +1 -1
  362. package/src/modules/primitives/query/convertAmount.ts +1 -1
  363. package/src/modules/primitives/query/convertQuantity.generated.ts +1 -1
  364. package/src/modules/primitives/query/convertQuantity.test.ts +1 -1
  365. package/src/modules/primitives/query/convertQuantity.ts +1 -1
  366. package/src/modules/primitives/query/getBaseCurrency.generated.ts +1 -1
  367. package/src/modules/primitives/query/getBaseCurrency.test.ts +1 -1
  368. package/src/modules/primitives/query/getBaseCurrency.ts +1 -1
  369. package/src/modules/primitives/query/getCurrency.generated.ts +1 -1
  370. package/src/modules/primitives/query/getCurrency.ts +1 -1
  371. package/src/modules/primitives/query/getUnit.generated.ts +1 -1
  372. package/src/modules/primitives/query/getUnit.ts +1 -1
  373. package/src/modules/primitives/query/getUoMCategory.generated.ts +1 -1
  374. package/src/modules/primitives/query/getUoMCategory.ts +1 -1
  375. package/src/modules/primitives/query/listUnitsByCategory.generated.ts +1 -1
  376. package/src/modules/primitives/query/listUnitsByCategory.ts +2 -2
  377. package/src/modules/product-management/command/activateProduct.generated.ts +1 -1
  378. package/src/modules/product-management/command/activateProduct.ts +1 -1
  379. package/src/modules/product-management/command/assignProductToCategory.generated.ts +1 -1
  380. package/src/modules/product-management/command/assignProductToCategory.ts +1 -1
  381. package/src/modules/product-management/command/createProduct.generated.ts +1 -1
  382. package/src/modules/product-management/command/createProduct.test.ts +1 -1
  383. package/src/modules/product-management/command/createProduct.ts +1 -1
  384. package/src/modules/product-management/command/createProductAttribute.generated.ts +1 -1
  385. package/src/modules/product-management/command/createProductAttribute.ts +1 -1
  386. package/src/modules/product-management/command/createProductAttributeValue.generated.ts +1 -1
  387. package/src/modules/product-management/command/createProductAttributeValue.ts +1 -1
  388. package/src/modules/product-management/command/createProductCategory.generated.ts +1 -1
  389. package/src/modules/product-management/command/createProductCategory.test.ts +1 -1
  390. package/src/modules/product-management/command/createProductCategory.ts +1 -1
  391. package/src/modules/product-management/command/deactivateProduct.generated.ts +1 -1
  392. package/src/modules/product-management/command/deactivateProduct.ts +1 -1
  393. package/src/modules/product-management/command/deleteProduct.generated.ts +1 -1
  394. package/src/modules/product-management/command/deleteProduct.ts +1 -1
  395. package/src/modules/product-management/command/deleteProductAttribute.generated.ts +1 -1
  396. package/src/modules/product-management/command/deleteProductAttribute.ts +1 -1
  397. package/src/modules/product-management/command/deleteProductAttributeValue.generated.ts +1 -1
  398. package/src/modules/product-management/command/deleteProductAttributeValue.ts +1 -1
  399. package/src/modules/product-management/command/deleteProductCategory.generated.ts +1 -1
  400. package/src/modules/product-management/command/deleteProductCategory.ts +1 -1
  401. package/src/modules/product-management/command/generateVariants.generated.ts +1 -1
  402. package/src/modules/product-management/command/generateVariants.test.ts +1 -1
  403. package/src/modules/product-management/command/generateVariants.ts +1 -1
  404. package/src/modules/product-management/command/moveProductCategory.generated.ts +1 -1
  405. package/src/modules/product-management/command/moveProductCategory.test.ts +1 -1
  406. package/src/modules/product-management/command/moveProductCategory.ts +1 -1
  407. package/src/modules/product-management/command/reactivateProduct.generated.ts +1 -1
  408. package/src/modules/product-management/command/reactivateProduct.ts +1 -1
  409. package/src/modules/product-management/command/removeProductFromCategory.generated.ts +1 -1
  410. package/src/modules/product-management/command/removeProductFromCategory.ts +1 -1
  411. package/src/modules/product-management/command/setProductAttributeAssignment.generated.ts +1 -1
  412. package/src/modules/product-management/command/setProductAttributeAssignment.ts +1 -1
  413. package/src/modules/product-management/command/updateProduct.generated.ts +1 -1
  414. package/src/modules/product-management/command/updateProduct.test.ts +1 -1
  415. package/src/modules/product-management/command/updateProduct.ts +1 -1
  416. package/src/modules/product-management/command/updateProductAttribute.generated.ts +1 -1
  417. package/src/modules/product-management/command/updateProductAttribute.ts +1 -1
  418. package/src/modules/product-management/command/updateProductAttributeValue.generated.ts +1 -1
  419. package/src/modules/product-management/command/updateProductAttributeValue.ts +1 -1
  420. package/src/modules/product-management/command/updateProductCategory.generated.ts +1 -1
  421. package/src/modules/product-management/command/updateProductCategory.ts +1 -1
  422. package/src/modules/product-management/lib/errors.generated.ts +1 -1
  423. package/src/modules/product-management/lib/permissions.generated.ts +1 -1
  424. package/src/modules/product-management/lib/types.ts +6 -1
  425. package/src/modules/product-management/module.ts +1 -1
  426. package/src/modules/product-management/query/calculateCategoryDepth.generated.ts +1 -1
  427. package/src/modules/product-management/query/calculateCategoryDepth.ts +1 -1
  428. package/src/modules/product-management/query/detectCategoryCircularReference.generated.ts +1 -1
  429. package/src/modules/product-management/query/detectCategoryCircularReference.ts +1 -1
  430. package/src/modules/product-management/query/getProduct.generated.ts +1 -1
  431. package/src/modules/product-management/query/getProduct.ts +1 -1
  432. package/src/modules/product-management/query/getProductAttribute.generated.ts +1 -1
  433. package/src/modules/product-management/query/getProductAttribute.ts +1 -1
  434. package/src/modules/product-management/query/getProductAttributeAssignment.generated.ts +1 -1
  435. package/src/modules/product-management/query/getProductAttributeAssignment.ts +1 -1
  436. package/src/modules/product-management/query/getProductAttributeValue.generated.ts +1 -1
  437. package/src/modules/product-management/query/getProductAttributeValue.ts +1 -1
  438. package/src/modules/product-management/query/getProductCategory.generated.ts +1 -1
  439. package/src/modules/product-management/query/getProductCategory.ts +1 -1
  440. package/src/modules/product-management/query/getProductCategoryAssignment.generated.ts +1 -1
  441. package/src/modules/product-management/query/getProductCategoryAssignment.ts +1 -1
  442. package/src/modules/product-management/query/getProductVariant.generated.ts +1 -1
  443. package/src/modules/product-management/query/getProductVariant.ts +1 -1
  444. package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.generated.ts +1 -1
  445. package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.ts +1 -1
  446. package/src/modules/product-management/query/listCategoryAssignmentsByProduct.generated.ts +1 -1
  447. package/src/modules/product-management/query/listCategoryAssignmentsByProduct.ts +1 -1
  448. package/src/modules/product-management/query/listProductAttributeAssignments.generated.ts +1 -1
  449. package/src/modules/product-management/query/listProductAttributeAssignments.ts +1 -1
  450. package/src/modules/product-management/query/listProductAttributeValues.generated.ts +1 -1
  451. package/src/modules/product-management/query/listProductAttributeValues.ts +1 -1
  452. package/src/modules/product-management/query/listProductCategoryAssignments.generated.ts +1 -1
  453. package/src/modules/product-management/query/listProductCategoryAssignments.ts +1 -1
  454. package/src/modules/product-management/query/listProductCategoryChildren.generated.ts +1 -1
  455. package/src/modules/product-management/query/listProductCategoryChildren.ts +1 -1
  456. package/src/modules/product-management/query/listProductVariants.generated.ts +1 -1
  457. package/src/modules/product-management/query/listProductVariants.ts +1 -1
  458. package/src/modules/user-management/command/activateUser.generated.ts +1 -1
  459. package/src/modules/user-management/command/activateUser.ts +1 -1
  460. package/src/modules/user-management/command/assignPermissionToRole.generated.ts +1 -1
  461. package/src/modules/user-management/command/assignPermissionToRole.ts +1 -1
  462. package/src/modules/user-management/command/assignRoleToUser.generated.ts +1 -1
  463. package/src/modules/user-management/command/assignRoleToUser.ts +1 -1
  464. package/src/modules/user-management/command/createPermission.generated.ts +1 -1
  465. package/src/modules/user-management/command/createPermission.ts +1 -1
  466. package/src/modules/user-management/command/createRole.generated.ts +1 -1
  467. package/src/modules/user-management/command/createRole.ts +1 -1
  468. package/src/modules/user-management/command/createUser.generated.ts +1 -1
  469. package/src/modules/user-management/command/createUser.ts +1 -1
  470. package/src/modules/user-management/command/deactivateUser.generated.ts +1 -1
  471. package/src/modules/user-management/command/deactivateUser.ts +1 -1
  472. package/src/modules/user-management/command/reactivateUser.generated.ts +1 -1
  473. package/src/modules/user-management/command/reactivateUser.ts +1 -1
  474. package/src/modules/user-management/command/revokePermissionFromRole.generated.ts +1 -1
  475. package/src/modules/user-management/command/revokePermissionFromRole.ts +1 -1
  476. package/src/modules/user-management/command/revokeRoleFromUser.generated.ts +1 -1
  477. package/src/modules/user-management/command/revokeRoleFromUser.ts +1 -1
  478. package/src/modules/user-management/lib/errors.generated.ts +1 -1
  479. package/src/modules/user-management/lib/permissions.generated.ts +1 -1
  480. package/src/modules/user-management/lib/types.ts +6 -1
  481. package/src/modules/user-management/module.ts +1 -1
  482. package/templates/scaffold/module/lib/types.ts +6 -1
  483. package/templates/scaffold/module/permissions.ts +1 -1
  484. package/src/modules/audit/lib/errors.ts +0 -0
  485. package/src/modules/business-partner/lib/errors.ts +0 -2
  486. package/src/modules/coa-management/lib/errors.ts +0 -0
  487. package/src/modules/organization/lib/errors.ts +0 -1
  488. package/templates/scaffold/module/lib/errors.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @tailor-platform/erp-kit
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4aada62: - Fix relative shared imports to use package self-reference for consistent module resolution
8
+ - Fix priority calibration in requirements review skill to improve accuracy
9
+ - Fix severity validation in module-2 requirements review skill
10
+ - Update module-4-plan-review skill and regenerate .agents/skills
11
+
3
12
  ## 0.4.0
4
13
 
5
14
  ### Minor Changes
package/dist/cli.mjs CHANGED
@@ -863,7 +863,7 @@ function generateErrors(moduleName, docs) {
863
863
  }
864
864
  if (lines.length === 0) return "";
865
865
  return `// @generated — do not edit
866
- import { createDomainError } from "../../../shared";
866
+ import { createDomainError } from "@tailor-platform/erp-kit/module";
867
867
 
868
868
  ${lines.join("\n")}`;
869
869
  }
@@ -871,7 +871,7 @@ ${lines.join("\n")}`;
871
871
  //#region src/generator/generate-permissions.ts
872
872
  function generatePermissions(moduleName, commandNames) {
873
873
  return `// @generated — do not edit
874
- import { definePermissions } from "../../../shared";
874
+ import { definePermissions } from "@tailor-platform/erp-kit/module";
875
875
 
876
876
  export const { permissions, own, all } = definePermissions("${moduleName}", [
877
877
  ${[...commandNames].sort().map((name) => ` "${name}",`).join("\n")}
@@ -883,9 +883,9 @@ ${[...commandNames].sort().map((name) => ` "${name}",`).join("\n")}
883
883
  function generateCommandShell(doc) {
884
884
  return [
885
885
  `// @generated — do not edit`,
886
- `import { defineCommand } from "../../../shared";`,
887
886
  `import { permissions } from "../lib/permissions.generated";`,
888
887
  `import { run } from "./${doc.commandName}";`,
888
+ `import { defineCommand } from "@tailor-platform/erp-kit/module";`,
889
889
  ``,
890
890
  `export const ${doc.commandName} = defineCommand(permissions.${doc.commandName}, run);`,
891
891
  ``
@@ -894,8 +894,8 @@ function generateCommandShell(doc) {
894
894
  function generateQueryShell(doc) {
895
895
  return [
896
896
  `// @generated — do not edit`,
897
- `import { defineQuery } from "../../../shared";`,
898
897
  `import { run } from "./${doc.commandName}";`,
898
+ `import { defineQuery } from "@tailor-platform/erp-kit/module";`,
899
899
  ``,
900
900
  `export const ${doc.commandName} = defineQuery(run);`,
901
901
  ``
@@ -909,8 +909,8 @@ function toPascal(name) {
909
909
  const templates = {
910
910
  command: { render: (name) => {
911
911
  const inputType = `${toPascal(name)}Input`;
912
- return `import { ok, type CommandContext } from "../../../shared";
913
- import type { Transaction } from "../generated/kysely-tailordb";
912
+ return `import type { Transaction } from "../generated/kysely-tailordb";
913
+ import { ok, type CommandContext } from "@tailor-platform/erp-kit/module";
914
914
 
915
915
  export interface ${inputType} {
916
916
  // TODO: define input fields
@@ -926,9 +926,9 @@ export async function run(db: Transaction, input: ${inputType}, ctx: CommandCont
926
926
  const pascal = toPascal(name);
927
927
  return `import { describe, expect, it } from "vitest";
928
928
  import { createMockDb } from "../../../testing/index";
929
- import type { CommandContext } from "../../../shared";
930
929
  import type { Transaction } from "../generated/kysely-tailordb";
931
930
  import { run, ${pascal}Input } from "./${name}";
931
+ import type { CommandContext } from "@tailor-platform/erp-kit/module";
932
932
 
933
933
  describe("${name} - test scenario", () => {
934
934
  const ctx: CommandContext = {
@@ -946,8 +946,8 @@ describe("${name} - test scenario", () => {
946
946
  } },
947
947
  query: { render: (name) => {
948
948
  const inputType = `${toPascal(name)}Input`;
949
- return `import type { ReadonlyDB } from "../../../shared";
950
- import type { DB } from "../generated/kysely-tailordb";
949
+ return `import type { DB } from "../generated/kysely-tailordb";
950
+ import type { ReadonlyDB } from "@tailor-platform/erp-kit/module";
951
951
 
952
952
  export interface ${inputType} {
953
953
  // TODO: define input fields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/erp-kit",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Opinionated ERP toolkit for building business applications on Tailor Platform",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -10,7 +10,7 @@ Create Tier 1-2 documentation: Requirements, Actors, and Business Flows.
10
10
  ## Workflow Phases
11
11
 
12
12
  ```
13
- GATHER → CLARIFY → CREATE → VALIDATE
13
+ GATHER → CLARIFY → CREATE → STORY EXTRACTION → VALIDATE
14
14
  ```
15
15
 
16
16
  ### Phase 1: Gather
@@ -61,7 +61,9 @@ erp-kit app generate doc business-flow {FLOW_NAME} -p {APP_ROOT}/{APP_NAME}
61
61
  README.md ← Tier 1 (from app init)
62
62
  docs/
63
63
  actors/{actor-name}.md ← Tier 2 (from generate doc actors)
64
- business-flow/{flow-name}/README.md ← Tier 2 (from generate doc business-flow)
64
+ business-flow/{flow-name}/
65
+ README.md ← Tier 2 (from generate doc business-flow)
66
+ story/{actor}--{story-name}.md ← Tier 2 (from Phase 3b story extraction)
65
67
  ```
66
68
 
67
69
  **Schema constraints:** See [erp-kit-app-shared/references/schema-constraints.md](../erp-kit-app-shared/references/schema-constraints.md) for H1 heading rules, naming conventions, and requirements structure.
@@ -70,7 +72,32 @@ erp-kit app generate doc business-flow {FLOW_NAME} -p {APP_ROOT}/{APP_NAME}
70
72
 
71
73
  **Business flow `## Stories` section:**
72
74
 
73
- At Tier 2, story files do not exist yet. Use `- TBD` as a placeholder to avoid broken link violations. Replace with actual story links in `/erp-kit-app-3-plan`.
75
+ Use `- TBD` as a placeholder during flow creation. These will be replaced with actual story links in Phase 3b below.
76
+
77
+ ### Phase 3b: Story Extraction
78
+
79
+ After creating business flows, extract and create story documentation.
80
+
81
+ 1. **Collect** all business flow docs: glob `<APP_ROOT>/docs/business-flow/*/README.md`
82
+ 2. **Dispatch story extraction agents** — one Agent per business flow (parallelize if possible). Each agent:
83
+ - Reads the prompt template from [references/story-extraction.md](references/story-extraction.md)
84
+ - Replace `{{APP_NAME}}` with the resolved app name
85
+ - Replace `{{ACTOR_DOCS}}` with the actor doc file paths
86
+ - Replace `{{BUSINESS_FLOW_DOCS}}` with ONLY the single business flow doc for that agent
87
+ - Dispatch the agent with the filled prompt
88
+
89
+ 3. **Scaffold & populate** story docs from agent results:
90
+
91
+ ```bash
92
+ # For each story identified
93
+ erp-kit app generate doc story <flow>/<actor>--<story> -p {APP_ROOT}/{APP_NAME}
94
+ ```
95
+
96
+ 4. **Link stories** in business flow READMEs: replace `- TBD` placeholders in each flow's `## Stories` section with actual links:
97
+
98
+ ```markdown
99
+ - [Story Title](./story/<actor>--<story-name>.md)
100
+ ```
74
101
 
75
102
  ### Phase 4: Validate
76
103
 
@@ -87,6 +114,7 @@ See [schema-constraints.md](../erp-kit-app-shared/references/schema-constraints.
87
114
  | `requirements.yml` | 1 | `README.md` |
88
115
  | `actors.yml` | 2 | `docs/actors/<name>.md` |
89
116
  | `business-flow.yml` | 2 | `docs/business-flow/<flow>/README.md` |
117
+ | `story.yml` | 2 | `docs/business-flow/<flow>/story/<actor>--<name>.md` |
90
118
 
91
119
  ## Next Step
92
120
 
@@ -6,12 +6,6 @@ App: {{APP_NAME}}
6
6
  Actor docs: {{ACTOR_DOCS}}
7
7
  Business flow docs: {{BUSINESS_FLOW_DOCS}}
8
8
 
9
- ## Available Modules
10
-
11
- The following modules are available in erp-kit. Use this to determine whether a story needs custom resolvers or can rely on built-in queries.
12
-
13
- {{MODULE_OVERVIEW}}
14
-
15
9
  ## Instructions
16
10
 
17
11
  1. Read ALL actor docs at the paths above
@@ -55,10 +49,10 @@ For each story, extract:
55
49
 
56
50
  ### Resolver Classification
57
51
 
58
- For each story, determine using the module overview:
52
+ For each story, determine:
59
53
 
60
- - **Needs resolvers**: Story involves create/update/delete operations → mark as `- TBD` for resolvers
61
- - **Read-only**: Story only views/lists data and built-in queries suffice → mark as `None` for resolvers
54
+ - **Needs resolvers**: Story involves create/update/delete operations → mark as `TBD` for resolvers
55
+ - **Read-only**: Story only views/lists data → mark as `None` for resolvers
62
56
 
63
57
  ## Naming Convention
64
58
 
@@ -22,12 +22,13 @@ Define shared context for all agents:
22
22
  - `APP_README`: `<APP_ROOT>/README.md`
23
23
  - `BUSINESS_FLOW_DOCS`: glob `<APP_ROOT>/docs/business-flow/*/README.md`
24
24
  - `ACTOR_DOCS`: glob `<APP_ROOT>/docs/actors/*.md`
25
+ - `STORY_DOCS`: glob `<APP_ROOT>/docs/business-flow/*/story/*.md`
25
26
 
26
27
  Verify at least `APP_README` exists. If not, stop with: "No application README found at <APP_ROOT>. Run erp-kit-app-1-requirements first."
27
28
 
28
29
  ## Step 2: Dispatch Agents (parallelize if possible)
29
30
 
30
- Launch 2 Agent tool calls in parallel — one per review concern.
31
+ Launch 3 Agent tool calls in parallel — one per review concern.
31
32
  Each agent receives: APP_NAME, relevant doc file paths.
32
33
  Each agent returns: structured markdown per [references/requirements-report-format.md](references/requirements-report-format.md).
33
34
 
@@ -35,13 +36,15 @@ Each agent returns: structured markdown per [references/requirements-report-form
35
36
  | ----- | ------------------------------------------------------------------------------------ | ------------------------------------------ |
36
37
  | 1 | [references/best-practices-check.md](references/best-practices-check.md) | APP_README, ACTOR_DOCS, BUSINESS_FLOW_DOCS |
37
38
  | 2 | [references/boundary-consistency-check.md](references/boundary-consistency-check.md) | APP_README, ACTOR_DOCS, BUSINESS_FLOW_DOCS |
39
+ | 3 | [references/story-quality-check.md](references/story-quality-check.md) | APP_README, ACTOR_DOCS, BUSINESS_FLOW_DOCS, STORY_DOCS |
38
40
 
39
41
  For each agent:
40
42
 
41
43
  1. Read the prompt template file
42
44
  2. Replace `{{APP_NAME}}` with the resolved app name
43
45
  3. Replace `{{APP_README}}`, `{{ACTOR_DOCS}}`, `{{BUSINESS_FLOW_DOCS}}` with the actual file paths
44
- 4. Dispatch the agent with the filled prompt
46
+ 4. Replace `{{STORY_DOCS}}` with the story doc file paths (agent 3 only)
47
+ 5. Dispatch the agent with the filled prompt
45
48
 
46
49
  ## Step 3: Aggregate & Validate
47
50
 
@@ -52,7 +55,18 @@ After ALL agents return:
52
55
  3. Merge all `recommendations[]` arrays into a single list
53
56
  4. **Filter out** any recommendation that would violate `erp-kit app check` schema constraints (e.g., title-casing business flow H1 headings)
54
57
  5. Calculate totals across all summaries
55
- 6. Render the final report below
58
+
59
+ ## Step 4: Priority Validation
60
+
61
+ Subagents tend to over-classify. Before rendering the report, re-evaluate every non-pass finding:
62
+
63
+ - **"Is this even this application's responsibility?"** — If the concern belongs to a module or is out of scope, drop it from the report
64
+ - **"Does this block proceeding to planning?"** → `critical`
65
+ - **"Will this force Tier 3-4 rework (stories, screens, resolvers)?"** → `high`
66
+ - **"Is this a quality improvement with no rework risk?"** → `medium`
67
+ - All no → `low`, regardless of subagent label
68
+
69
+ ## Step 5: Render Report
56
70
 
57
71
  ## Report Format
58
72
 
@@ -82,14 +96,24 @@ Render the aggregated results as markdown:
82
96
 
83
97
  ---
84
98
 
85
- ### 3. Summary
99
+ ### 3. Story Quality
100
+
101
+ | Story/Flow | Check | Status | Detail |
102
+ | ---------- | ----- | ------ | ------ |
103
+
104
+ (Populated from agent 3 issues)
105
+
106
+ ---
107
+
108
+ ### 4. Summary
86
109
 
87
110
  | Aspect | Status | Details |
88
111
  | ------------------------- | ------ | ----------------- |
89
112
  | Best Practices | | X/Y checks passed |
90
113
  | Documentation Consistency | | X/Y checks passed |
114
+ | Story Quality | | X/Y checks passed |
91
115
 
92
- ### 4. Recommendations
116
+ ### 5. Recommendations
93
117
 
94
118
  Numbered list of actionable fixes, grouped by priority:
95
119
 
@@ -0,0 +1,67 @@
1
+ # Story Quality Check
2
+
3
+ ## Context
4
+
5
+ App: {{APP_NAME}}
6
+ Actor docs: {{ACTOR_DOCS}}
7
+ Business flow docs: {{BUSINESS_FLOW_DOCS}}
8
+ Story docs: {{STORY_DOCS}}
9
+
10
+ ## Instructions
11
+
12
+ 1. Read ALL actor docs at the paths above
13
+ 2. Read ALL business flow docs at the paths above
14
+ 3. Read ALL story docs at the paths above
15
+ 4. Validate story quality against the checks below
16
+ 5. Return results per the report format at the bottom
17
+
18
+ ## Checks
19
+
20
+ ### Story-to-Flow Parity
21
+
22
+ For each business flow:
23
+ - Every flow must have at least one story
24
+ - Every story must map to exactly one flow (via its directory location)
25
+ - The `## Stories` section in each flow README must link to all stories in its `story/` directory
26
+ - No broken links in `## Stories` sections
27
+
28
+ ### Naming Conventions
29
+
30
+ - Story filename must follow `<actor>--<story-name>.md` pattern (double-dash separator)
31
+ - Actor slug in filename must match an existing actor doc
32
+ - Story name portion must be kebab-case
33
+
34
+ ### Content Completeness
35
+
36
+ For each story:
37
+ - Must have scenario patterns (non-empty)
38
+ - Must have preconditions and postconditions
39
+ - Must have screen references (can be TBD at this stage)
40
+ - Must have resolver classification (TBD for mutations, None for read-only)
41
+
42
+ ### Actor Consistency
43
+
44
+ - Actor referenced in story filename must exist in `docs/actors/`
45
+ - Actor referenced in story content must match the filename actor
46
+
47
+ ## Output Format
48
+
49
+ Return findings as structured markdown:
50
+
51
+ ### Issues
52
+
53
+ For each issue found:
54
+
55
+ - **Check:** which check failed
56
+ - **Scope:** which file/story/flow is affected
57
+ - **Severity:** critical / high / medium / low
58
+ - **Detail:** what's wrong and how to fix it
59
+
60
+ ### Summary
61
+
62
+ | Check | Passed | Failed | Total |
63
+ | ----- | ------ | ------ | ----- |
64
+ | Story-to-Flow Parity | | | |
65
+ | Naming Conventions | | | |
66
+ | Content Completeness | | | |
67
+ | Actor Consistency | | | |
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: erp-kit-app-3-plan
3
- description: Create Tier 3-4 documentation (stories, screens, resolvers) by breaking down business flows. Use after completing requirements review with erp-kit-app-2-requirements-review.
3
+ description: Create Tier 3-4 documentation (screens, resolvers) by breaking down business flows and existing stories. Use after completing requirements review with erp-kit-app-2-requirements-review.
4
4
  ---
5
5
 
6
6
  # Business Flow Breakdown to Stories, Screens, and Resolvers
7
7
 
8
- Convert Tier 2 business flows into Tier 3 (stories, screens) and Tier 4 (resolvers) documentation using parallel extraction agents.
8
+ Convert Tier 2 business flows and stories into Tier 3 (screens) and Tier 4 (resolvers) documentation using parallel extraction agents.
9
9
 
10
10
  ## When to Use
11
11
 
@@ -20,6 +20,7 @@ Tier 1-2 documentation must exist:
20
20
  - `README.md` (requirements)
21
21
  - `docs/actors/*.md` (actor definitions)
22
22
  - `docs/business-flow/*/README.md` (business workflows)
23
+ - `docs/business-flow/<flow>/story/<actor>--<name>.md` (story definitions)
23
24
 
24
25
  ## Step 1: Setup
25
26
 
@@ -29,45 +30,55 @@ Define shared context for all agents:
29
30
  - `APP_NAME`: basename of APP_ROOT
30
31
  - `BUSINESS_FLOW_DOCS`: glob `<APP_ROOT>/docs/business-flow/*/README.md`
31
32
  - `ACTOR_DOCS`: glob `<APP_ROOT>/docs/actors/*.md`
33
+ - `STORY_DOCS`: glob `<APP_ROOT>/docs/business-flow/*/story/*.md`
32
34
  - `MODULE_OVERVIEW`: output of `erp-kit doc modules`
33
35
 
34
36
  Verify at least `BUSINESS_FLOW_DOCS` is non-empty. If no business flow docs exist, stop with: "No business flow docs found under <APP_ROOT>/docs/. Run erp-kit-app-1-requirements first."
35
37
 
38
+ Verify at least `STORY_DOCS` is non-empty. If no story docs exist, stop with: "No story docs found. Run erp-kit-app-1-requirements first to create stories."
39
+
36
40
  Collect module overview:
37
41
 
38
42
  ```bash
39
43
  erp-kit doc modules
40
44
  ```
41
45
 
42
- This returns each module's name, overview, command/query/model counts, and dependencies. Save the full output as `MODULE_OVERVIEW` — all three agents receive it.
46
+ This returns each module's name, overview, command/query/model counts, and dependencies. Save the full output as `MODULE_OVERVIEW` — both agents receive it.
47
+
48
+ > **Sync barrier:** `MODULE_OVERVIEW` must be collected before dispatching agents.
43
49
 
44
50
  ## Step 2: Dispatch Agents (parallelize if possible)
45
51
 
46
- Launch 3 Agent tool calls in parallel — one per extraction concern.
47
- Each agent receives: APP_NAME, relevant doc file paths, and MODULE_OVERVIEW.
52
+ For each business flow in BUSINESS_FLOW_DOCS, launch 2 Agent tool calls in parallel — one per extraction concern.
53
+
54
+ Each agent pair receives: APP_NAME, ACTOR_DOCS, the single business flow's STORY_DOCS, MODULE_OVERVIEW, and only that flow's BUSINESS_FLOW_DOC (singular).
48
55
 
49
- | Agent | Prompt Template | Inputs |
50
- | ----- | ---------------------------------------------------------------------- | --------------------------------------------------------- |
51
- | 1 | [references/story-extraction.md](references/story-extraction.md) | APP_NAME, ACTOR_DOCS, BUSINESS_FLOW_DOCS, MODULE_OVERVIEW |
52
- | 2 | [references/screen-extraction.md](references/screen-extraction.md) | APP_NAME, ACTOR_DOCS, BUSINESS_FLOW_DOCS, MODULE_OVERVIEW |
53
- | 3 | [references/resolver-extraction.md](references/resolver-extraction.md) | APP_NAME, ACTOR_DOCS, BUSINESS_FLOW_DOCS, MODULE_OVERVIEW |
56
+ | Agent | Prompt Template |
57
+ | ----- | ---------------------------------------------------------------------- |
58
+ | A | [references/screen-extraction.md](references/screen-extraction.md) |
59
+ | B | [references/resolver-extraction.md](references/resolver-extraction.md) |
54
60
 
55
61
  For each agent:
56
62
 
57
63
  1. Read the prompt template file
58
64
  2. Replace `{{APP_NAME}}` with the resolved app name
59
- 3. Replace `{{ACTOR_DOCS}}`, `{{BUSINESS_FLOW_DOCS}}` with the actual file paths
60
- 4. Replace `{{MODULE_OVERVIEW}}` with the output from `erp-kit doc modules`
61
- 5. Dispatch the agent with the filled prompt
65
+ 3. Replace `{{ACTOR_DOCS}}` with the actor doc file paths
66
+ 4. Replace `{{BUSINESS_FLOW_DOCS}}` with ONLY the single business flow doc for this iteration
67
+ 5. Replace `{{STORY_DOCS}}` with ONLY the stories under this flow's `story/` directory
68
+ 6. Replace `{{MODULE_OVERVIEW}}` with the output from `erp-kit doc modules`
69
+ 7. Dispatch the agent with the filled prompt
70
+
71
+ With N business flows, this produces N × 2 parallel agents.
62
72
 
63
73
  ## Step 3: Aggregate & Present Plan
64
74
 
65
75
  After ALL agents return:
66
76
 
67
- 1. Collect extraction results from each agent
68
- 2. Present consolidated plan to user:
69
- - Stories to create (with actor, flow, scenario patterns)
70
- - Screens to create (with type, fields, actions)
77
+ 1. Collect extraction results from each agent, grouped by business flow
78
+ 2. **Deduplicate screens**: Screens referenced by multiple flows should appear once — merge field lists and story references
79
+ 3. Present consolidated plan to user:
80
+ - Existing stories (from STORY_DOCS, for reference)
81
+ - Screens to create (deduplicated, with type, fields, actions)
71
82
  - Resolvers to create (with operation type, module mapping)
72
83
  ## Step 4: Resolve Module Gaps
73
84
 
@@ -88,9 +99,6 @@ For resolvers that reference erp-kit modules, use `MODULE_OVERVIEW` as the sourc
88
99
  Scaffold using `erp-kit` CLI:
89
100
 
90
101
  ```bash
91
- # Tier 3: Stories
92
- erp-kit app generate doc story <flow>/<actor>--<story> -p {APP_ROOT}/{APP_NAME}
93
-
94
102
  # Tier 3: Screens
95
103
  erp-kit app generate doc screen <screen-name> -p {APP_ROOT}/{APP_NAME}
96
104
 
@@ -100,12 +108,6 @@ erp-kit app generate doc resolver <resolver-name> -p {APP_ROOT}/{APP_NAME}
100
108
 
101
109
  Fill scaffolded docs with details from agent extraction results.
102
110
 
103
- **After creating stories**, replace `- TBD` placeholders in the `## Stories` section of each business flow README with actual links:
104
-
105
- ```markdown
106
- - [Story Title](./story/<actor>--<story-name>.md)
107
- ```
108
-
109
111
  **After creating resolvers**, replace `- TBD` placeholders in the `## Resolvers` section of each story with actual links:
110
112
 
111
113
  ```markdown
@@ -126,11 +128,10 @@ See [erp-kit-app-shared/references/naming-conventions.md](../erp-kit-app-shared/
126
128
 
127
129
  ## Schema Reference
128
130
 
129
- | Schema | Tier | Output Path |
130
- | -------------- | ---- | ---------------------------------------------------- |
131
- | `story.yml` | 3 | `docs/business-flow/<flow>/story/<actor>--<name>.md` |
132
- | `screen.yml` | 3 | `docs/screen/<name>.md` |
133
- | `resolver.yml` | 4 | `docs/resolver/<name>.md` |
131
+ | Schema | Tier | Output Path |
132
+ | -------------- | ---- | ------------------------- |
133
+ | `screen.yml` | 3 | `docs/screen/<name>.md` |
134
+ | `resolver.yml` | 4 | `docs/resolver/<name>.md` |
134
135
 
135
136
  ## Common Patterns
136
137
 
@@ -144,7 +145,7 @@ See [erp-kit-app-shared/references/naming-conventions.md](../erp-kit-app-shared/
144
145
 
145
146
  ## Tips
146
147
 
147
- - One business flow typically produces 3-8 stories
148
+ - Stories are created in step 1 (erp-kit-app-1-requirements) — this step consumes them
148
149
  - Stories should be completable in a single user session
149
150
  - Screens can be shared across multiple stories
150
151
  - Prefer built-in queries over custom resolvers for simple list/get operations
@@ -5,6 +5,7 @@
5
5
  App: {{APP_NAME}}
6
6
  Actor docs: {{ACTOR_DOCS}}
7
7
  Business flow docs: {{BUSINESS_FLOW_DOCS}}
8
+ Story docs: {{STORY_DOCS}}
8
9
 
9
10
  ## Available Modules
10
11
 
@@ -22,8 +23,9 @@ erp-kit doc module <module-name> command <command-name>
22
23
 
23
24
  1. Read ALL actor docs at the paths above
24
25
  2. Read ALL business flow docs at the paths above
25
- 3. Identify GraphQL resolvers needed for each business flow, using the module overview and `erp-kit doc module <name> command` for detail
26
- 4. Return results as a structured markdown report
26
+ 3. Read ALL story docs at the paths above
27
+ 4. Identify GraphQL resolvers needed for each business flow and story, using the module overview and `erp-kit doc module <name> command` for detail
28
+ 5. Return results as a structured markdown report
27
29
 
28
30
  ## Extraction Rules
29
31
 
@@ -5,6 +5,7 @@
5
5
  App: {{APP_NAME}}
6
6
  Actor docs: {{ACTOR_DOCS}}
7
7
  Business flow docs: {{BUSINESS_FLOW_DOCS}}
8
+ Story docs: {{STORY_DOCS}}
8
9
 
9
10
  ## Available Modules
10
11
 
@@ -22,9 +23,10 @@ erp-kit doc module <module-name> model <model-name>
22
23
 
23
24
  1. Read ALL actor docs at the paths above
24
25
  2. Read ALL business flow docs at the paths above
25
- 3. Identify screens needed for each business flow
26
- 4. For screens that display or edit module entities, use `erp-kit doc module <name> model` to understand the entity's domain
27
- 5. Return results as a structured markdown report
26
+ 3. Read ALL story docs at the paths above
27
+ 4. Identify screens needed for each business flow and story
28
+ 5. For screens that display or edit module entities, use `erp-kit doc module <name> model` to understand the entity's domain
29
+ 6. Return results as a structured markdown report
28
30
 
29
31
  ## Extraction Rules
30
32
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: erp-kit-app-4-plan-review
3
- description: Review parity between Tier 2 (business flows, actors) and Tier 3-4 (stories, screens, resolvers). Use after creating plan documentation with erp-kit-app-3-plan to validate completeness.
3
+ description: Review parity between Tier 2 (business flows, actors, stories) and Tier 3-4 (screens, resolvers). Use after creating plan documentation with erp-kit-app-3-plan to validate completeness.
4
4
  ---
5
5
 
6
6
  # Documentation Parity Review
7
7
 
8
- Review **documentation consistency** across Tier 2, 3, and 4 documentation.
8
+ Review **documentation consistency** across Tier 2 (business flows, actors, stories), Tier 3 (screens), and Tier 4 (resolvers) documentation.
9
9
 
10
10
  ## When to Use
11
11
 
@@ -29,26 +29,29 @@ Verify at least `BUSINESS_FLOW_DOCS` is non-empty. If no business flow docs exis
29
29
 
30
30
  ## Step 2: Dispatch Agents (parallelize if possible)
31
31
 
32
- Launch 5 Agent tool calls in parallel — one per parity check.
33
- Each agent receives: APP_NAME, relevant doc file paths.
32
+ Dispatch agents in parallel — one per item in each group. All groups are dispatched simultaneously.
33
+
34
+ Each agent receives: APP_NAME and the relevant doc file paths for its item.
34
35
  Each agent returns: structured JSON per [references/parity-report-format.md](references/parity-report-format.md).
35
36
  If a doc directory is empty, the agent reports "no docs found" and skips.
36
37
 
37
- | Agent | Prompt Template | Inputs |
38
- | ----- | ------------------------------------------------------------------------------------ | ------------------------------ |
39
- | 1 | [references/business-flow-story-parity.md](references/business-flow-story-parity.md) | BUSINESS_FLOW_DOCS, STORY_DOCS |
40
- | 2 | [references/actor-flow-parity.md](references/actor-flow-parity.md) | ACTOR_DOCS, BUSINESS_FLOW_DOCS |
41
- | 3 | [references/story-screen-parity.md](references/story-screen-parity.md) | STORY_DOCS, SCREEN_DOCS |
42
- | 4 | [references/story-resolver-parity.md](references/story-resolver-parity.md) | STORY_DOCS, RESOLVER_DOCS |
43
- | 5 | [references/orphan-detection.md](references/orphan-detection.md) | ALL doc paths |
38
+ | Group | Prompt Template | Per-item scope | Inputs per agent |
39
+ | ----- | ------------------------------------------------------------------------------------ | -------------------------- | --------------------------------------------- |
40
+ | A | [references/business-flow-story-parity.md](references/business-flow-story-parity.md) | One per business flow | Single BUSINESS_FLOW_DOC + its STORY_DOCS |
41
+ | B | [references/actor-flow-parity.md](references/actor-flow-parity.md) | One per actor | Single ACTOR_DOC + all BUSINESS_FLOW_DOCS |
42
+ | C | [references/story-screen-parity.md](references/story-screen-parity.md) | One per story | Single STORY_DOC + all SCREEN_DOCS |
43
+ | D | [references/story-resolver-parity.md](references/story-resolver-parity.md) | One per story | Single STORY_DOC + all RESOLVER_DOCS |
44
+ | E | [references/orphan-detection.md](references/orphan-detection.md) | One global agent | ALL doc paths |
44
45
 
45
46
  For each agent:
46
47
 
47
48
  1. Read the prompt template file
48
49
  2. Replace `{{APP_NAME}}` with the resolved app name
49
- 3. Replace doc path placeholders with the actual file paths
50
+ 3. Replace doc path placeholders with the actual file paths for that item
50
51
  4. Dispatch the agent with the filled prompt
51
52
 
53
+ With F flows, A actors, and S stories, this produces F + A + S + S + 1 parallel agents.
54
+
52
55
  ## Step 3: Aggregate Results
53
56
 
54
57
  After ALL agents return:
@@ -56,7 +59,7 @@ After ALL agents return:
56
59
  1. Collect the JSON results from each agent
57
60
  2. Merge all `gaps[]` arrays into a single list
58
61
  3. Merge all `inconsistencies[]` arrays into a single list
59
- 4. Deduplicate: if two gaps share the same `source + target + check`, keep only one
62
+ 4. Deduplicate: if two agents report the same gap (same `source + target + check`), keep only one
60
63
  5. Calculate totals across all summaries
61
64
  6. Render the final report below
62
65
 
@@ -44,6 +44,8 @@ Read all resolver and screen specs to build a complete picture:
44
44
 
45
45
  Classify resolvers per [erp-kit-app-shared/references/resolver-classification.md](../erp-kit-app-shared/references/resolver-classification.md).
46
46
 
47
+ > **Parallelize if possible:** Dispatch one agent per resolver spec to extract inputs, outputs, module mapping, and error scenarios. Each agent reads a single resolver doc and returns structured analysis.
48
+
47
49
  ### Phase 2: Wire Modules (`src/modules.ts`)
48
50
 
49
51
  Create the module wiring file that composes all required erp-kit modules.
@@ -67,6 +69,8 @@ Key points:
67
69
  - Auth with OAuth2, DPoP, and user profile mapping
68
70
  - Generators for Kysely types and seed data
69
71
 
72
+ > **Sync barrier:** Module wiring and configuration must complete before resolver implementation. These files are shared across all resolvers.
73
+
70
74
  ### Phase 4: Implement Backend Resolvers and Executors
71
75
 
72
76
  Write one file per resolver under `src/resolvers/`, one per executor under `executors/`.
@@ -77,6 +81,12 @@ For each resolver, check whether its spec (`docs/resolver/*.md`) documents error
77
81
 
78
82
  Do not directly mutate module-owned tables via Kysely — always use module commands.
79
83
 
84
+ > **Parallelize if possible:** Dispatch one agent per resolver. Each agent writes only to its own files:
85
+ > - `src/resolvers/<resolverName>.ts`
86
+ > - `src/executors/<resolverName>.ts`
87
+ >
88
+ > **Shared-file guard:** `src/modules.ts` and `tailor.config.ts` are written in the sync barrier phase above. Resolver agents must NOT modify these files.
89
+
80
90
  ### Phase 5: Generated Files
81
91
 
82
92
  - **Kysely types** (`src/generated/kysely-tailordb.ts`) — Auto-generated by `pnpm generate` after deployment. Before deployment, create a minimal placeholder so the codebase typechecks.
@@ -33,6 +33,8 @@ ANALYZE SCREENS → GENERATE GRAPHQL SCHEMA → IMPLEMENT PAGES → VERIFY
33
33
 
34
34
  Read all screen specs (`docs/screen/*.md`) to build a complete picture:
35
35
 
36
+ > **Parallelize if possible:** Dispatch one agent per screen spec to extract page structure, fields, actions, and navigation. Each agent reads a single screen doc and returns structured analysis.
37
+
36
38
  1. **Screen types** — Identify each screen as ListView, Form (create/edit), or DetailView
37
39
  2. **Fields and columns** — Map required columns (ListView), form fields (Form), and detail fields (DetailView) from each spec
38
40
  3. **Actions** — Identify navigation actions (create, edit, back-to-list) and mutation actions (save, delete, activate/deactivate)
@@ -41,12 +43,21 @@ Read all screen specs (`docs/screen/*.md`) to build a complete picture:
41
43
 
42
44
  Run `pnpm generate` in the frontend directory to fetch the GraphQL schema from the deployed backend.
43
45
 
46
+ > **Sync barrier:** Schema generation must complete before page implementation. Generated types are shared across all pages.
47
+
44
48
  ### Phase 3: Implement Frontend Pages
45
49
 
50
+ > **Barrier step:** Write shared layout and router files before dispatching page agents. These files are shared across all pages and must not be modified by individual page agents.
51
+
46
52
  Run `pnpm lint`, `pnpm typecheck`, and `pnpm gql-tada:check` regularly during implementation. Fix errors before moving on.
47
53
 
48
54
  Create pages driven by screen spec docs. Each screen type has a standard implementation pattern.
49
55
 
56
+ > **Parallelize if possible:** Dispatch one agent per screen. Each agent writes only to its own directory:
57
+ > - `src/pages/<screen-name>/`
58
+ >
59
+ > **Shared-file guard:** Layout files, router configuration, and generated types are written before dispatch. Page agents must NOT modify shared files.
60
+
50
61
  **Read [pages reference](references/pages.md) for the full pattern catalog.**
51
62
 
52
63
  Page types and their file structure: