@tailor-platform/erp-kit 0.8.0 → 0.9.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 (159) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/skills/erp-kit-app-1-requirements/SKILL.md +6 -0
  4. package/skills/erp-kit-app-2-requirements-review/SKILL.md +6 -0
  5. package/skills/erp-kit-app-3-plan/SKILL.md +6 -0
  6. package/skills/erp-kit-app-4-plan-review/SKILL.md +6 -0
  7. package/skills/erp-kit-app-5-impl-backend/SKILL.md +7 -0
  8. package/skills/erp-kit-app-6-impl-frontend/SKILL.md +6 -0
  9. package/skills/erp-kit-app-7-impl-review/SKILL.md +6 -0
  10. package/skills/erp-kit-app-shared/SKILL.md +2 -0
  11. package/skills/erp-kit-mock-scenario/SKILL.md +6 -0
  12. package/skills/erp-kit-module-1-requirements/SKILL.md +6 -0
  13. package/skills/erp-kit-module-2-requirements-review/SKILL.md +6 -0
  14. package/skills/erp-kit-module-3-plan/SKILL.md +6 -0
  15. package/skills/erp-kit-module-3-update-plan/SKILL.md +6 -0
  16. package/skills/erp-kit-module-4-plan-review/SKILL.md +6 -0
  17. package/skills/erp-kit-module-5-impl/SKILL.md +6 -0
  18. package/skills/erp-kit-module-6-impl-review/SKILL.md +6 -0
  19. package/skills/erp-kit-module-shared/SKILL.md +2 -0
  20. package/skills/erp-kit-module-shared/references/commands.md +3 -0
  21. package/skills/erp-kit-update/SKILL.md +6 -0
  22. package/src/modules/accounting/command/assignProfitCenterToHierarchyNode.test.ts +3 -3
  23. package/src/modules/accounting/command/assignProfitCenterToHierarchyNode.ts +1 -1
  24. package/src/modules/accounting/command/createCostCenterHierarchyNode.test.ts +3 -3
  25. package/src/modules/accounting/command/createCostCenterHierarchyNode.ts +1 -1
  26. package/src/modules/accounting/command/moveCostCenterHierarchyNode.test.ts +2 -2
  27. package/src/modules/accounting/command/moveCostCenterHierarchyNode.ts +1 -1
  28. package/src/modules/accounting/module.ts +1 -0
  29. package/src/modules/business-partner/command/createPartnerBankAccount.test.ts +3 -3
  30. package/src/modules/business-partner/command/createPartnerBankAccount.ts +1 -1
  31. package/src/modules/business-partner/module.ts +1 -0
  32. package/src/modules/coa-management/command/activateAccount.test.ts +0 -15
  33. package/src/modules/coa-management/command/activateAccount.ts +1 -42
  34. package/src/modules/coa-management/command/activateChartOfAccounts.test.ts +2 -31
  35. package/src/modules/coa-management/command/activateChartOfAccounts.ts +1 -37
  36. package/src/modules/coa-management/command/createAccount.test.ts +0 -28
  37. package/src/modules/coa-management/command/createAccount.ts +0 -43
  38. package/src/modules/coa-management/command/createAccountGroup.test.ts +2 -51
  39. package/src/modules/coa-management/command/createAccountGroup.ts +1 -56
  40. package/src/modules/coa-management/command/createChartOfAccounts.test.ts +1 -49
  41. package/src/modules/coa-management/command/createChartOfAccounts.ts +0 -51
  42. package/src/modules/coa-management/command/deactivateAccount.test.ts +0 -15
  43. package/src/modules/coa-management/command/deactivateAccount.ts +1 -53
  44. package/src/modules/coa-management/command/deactivateChartOfAccounts.test.ts +2 -29
  45. package/src/modules/coa-management/command/deactivateChartOfAccounts.ts +1 -37
  46. package/src/modules/coa-management/command/deleteAccount.test.ts +0 -13
  47. package/src/modules/coa-management/command/deleteAccount.ts +1 -42
  48. package/src/modules/coa-management/command/deleteAccountGroup.test.ts +0 -19
  49. package/src/modules/coa-management/command/deleteAccountGroup.ts +1 -42
  50. package/src/modules/coa-management/command/deleteChartOfAccounts.test.ts +2 -58
  51. package/src/modules/coa-management/command/deleteChartOfAccounts.ts +4 -88
  52. package/src/modules/coa-management/command/moveAccountGroup.test.ts +0 -27
  53. package/src/modules/coa-management/command/moveAccountGroup.ts +1 -48
  54. package/src/modules/coa-management/command/reactivateAccount.test.ts +0 -15
  55. package/src/modules/coa-management/command/reactivateAccount.ts +1 -53
  56. package/src/modules/coa-management/command/updateAccount.test.ts +0 -15
  57. package/src/modules/coa-management/command/updateAccount.ts +0 -92
  58. package/src/modules/coa-management/command/updateAccountGroup.test.ts +0 -20
  59. package/src/modules/coa-management/command/updateAccountGroup.ts +1 -61
  60. package/src/modules/coa-management/command/updateChartOfAccounts.test.ts +2 -31
  61. package/src/modules/coa-management/command/updateChartOfAccounts.ts +1 -50
  62. package/src/modules/coa-management/docs/commands/ActivateAccount.md +1 -4
  63. package/src/modules/coa-management/docs/commands/ActivateChartOfAccounts.md +1 -4
  64. package/src/modules/coa-management/docs/commands/CreateAccount.md +1 -4
  65. package/src/modules/coa-management/docs/commands/CreateAccountGroup.md +2 -5
  66. package/src/modules/coa-management/docs/commands/CreateChartOfAccounts.md +2 -6
  67. package/src/modules/coa-management/docs/commands/DeactivateAccount.md +1 -4
  68. package/src/modules/coa-management/docs/commands/DeactivateChartOfAccounts.md +1 -4
  69. package/src/modules/coa-management/docs/commands/DeleteAccount.md +1 -4
  70. package/src/modules/coa-management/docs/commands/DeleteAccountGroup.md +1 -4
  71. package/src/modules/coa-management/docs/commands/DeleteChartOfAccounts.md +1 -6
  72. package/src/modules/coa-management/docs/commands/MoveAccountGroup.md +1 -4
  73. package/src/modules/coa-management/docs/commands/ReactivateAccount.md +1 -4
  74. package/src/modules/coa-management/docs/commands/UpdateAccount.md +1 -4
  75. package/src/modules/coa-management/docs/commands/UpdateAccountGroup.md +2 -5
  76. package/src/modules/coa-management/docs/commands/UpdateChartOfAccounts.md +1 -4
  77. package/src/modules/coa-management/module.ts +16 -27
  78. package/src/modules/finance-ledger/module.ts +1 -0
  79. package/src/modules/inventory/command/approveInventoryAdjustment.test.ts +1 -1
  80. package/src/modules/inventory/command/approveInventoryAdjustment.ts +1 -1
  81. package/src/modules/inventory/command/cancelStockMovement.test.ts +2 -2
  82. package/src/modules/inventory/command/cancelStockMovement.ts +1 -1
  83. package/src/modules/inventory/command/confirmInventoryAdjustment.test.ts +4 -4
  84. package/src/modules/inventory/command/confirmInventoryAdjustment.ts +1 -1
  85. package/src/modules/inventory/command/confirmStockMovement.test.ts +1 -1
  86. package/src/modules/inventory/command/confirmStockMovement.ts +1 -1
  87. package/src/modules/inventory/command/createInventoryAdjustment.test.ts +6 -6
  88. package/src/modules/inventory/command/createInventoryAdjustment.ts +1 -1
  89. package/src/modules/inventory/command/createStockMovement.test.ts +3 -3
  90. package/src/modules/inventory/command/createStockMovement.ts +1 -1
  91. package/src/modules/inventory/command/executeStockMovement.test.ts +5 -5
  92. package/src/modules/inventory/command/executeStockMovement.ts +1 -1
  93. package/src/modules/inventory/command/rejectInventoryAdjustment.test.ts +1 -1
  94. package/src/modules/inventory/command/rejectInventoryAdjustment.ts +1 -1
  95. package/src/modules/inventory/command/reviseInventoryAdjustment.test.ts +2 -2
  96. package/src/modules/inventory/command/reviseInventoryAdjustment.ts +1 -1
  97. package/src/modules/inventory/command/submitInventoryAdjustment.test.ts +1 -1
  98. package/src/modules/inventory/command/submitInventoryAdjustment.ts +1 -1
  99. package/src/modules/inventory/command/updateStockMovement.test.ts +4 -4
  100. package/src/modules/inventory/command/updateStockMovement.ts +2 -2
  101. package/src/modules/inventory/module.ts +1 -0
  102. package/src/modules/item-management/command/createTaxonomyNode.test.ts +4 -4
  103. package/src/modules/item-management/command/createTaxonomyNode.ts +1 -1
  104. package/src/modules/item-management/command/moveTaxonomyNode.test.ts +2 -2
  105. package/src/modules/item-management/command/moveTaxonomyNode.ts +2 -2
  106. package/src/modules/item-management/command/updateTaxonomyNode.test.ts +2 -2
  107. package/src/modules/item-management/command/updateTaxonomyNode.ts +1 -1
  108. package/src/modules/item-management/module.ts +1 -0
  109. package/src/modules/manufacturing/command/createRouting.ts +1 -1
  110. package/src/modules/manufacturing/command/recordInventoryIssueOutcome.test.ts +1 -1
  111. package/src/modules/manufacturing/command/recordInventoryIssueOutcome.ts +1 -1
  112. package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.test.ts +1 -1
  113. package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.ts +1 -1
  114. package/src/modules/manufacturing/command/reviewManufacturingCostSummary.test.ts +1 -1
  115. package/src/modules/manufacturing/command/reviewManufacturingCostSummary.ts +1 -1
  116. package/src/modules/manufacturing/command/updateRouting.ts +1 -1
  117. package/src/modules/manufacturing/module.ts +1 -0
  118. package/src/modules/organization/module.ts +1 -0
  119. package/src/modules/primitives/module.ts +1 -0
  120. package/src/modules/product-management/command/assignProductToCategory.test.ts +2 -2
  121. package/src/modules/product-management/command/assignProductToCategory.ts +2 -2
  122. package/src/modules/product-management/command/createProductAttribute.test.ts +1 -1
  123. package/src/modules/product-management/command/createProductAttribute.ts +1 -1
  124. package/src/modules/product-management/command/createProductAttributeValue.test.ts +1 -1
  125. package/src/modules/product-management/command/createProductAttributeValue.ts +1 -1
  126. package/src/modules/product-management/command/createProductCategory.test.ts +2 -2
  127. package/src/modules/product-management/command/createProductCategory.ts +1 -1
  128. package/src/modules/product-management/command/setProductAttributeAssignment.test.ts +3 -3
  129. package/src/modules/product-management/command/setProductAttributeAssignment.ts +2 -2
  130. package/src/modules/product-management/module.ts +1 -0
  131. package/src/modules/purchase/command/activatePurchasePaymentTerm.test.ts +4 -4
  132. package/src/modules/purchase/command/activatePurchasePaymentTerm.ts +2 -2
  133. package/src/modules/purchase/command/deactivatePurchasePaymentTerm.test.ts +4 -4
  134. package/src/modules/purchase/command/deactivatePurchasePaymentTerm.ts +2 -2
  135. package/src/modules/purchase/command/updatePurchasePaymentTerm.test.ts +2 -2
  136. package/src/modules/purchase/command/updatePurchasePaymentTerm.ts +1 -1
  137. package/src/modules/purchase/module.ts +1 -0
  138. package/src/modules/sales/command/createSalesOrder.ts +1 -1
  139. package/src/modules/sales/module.ts +1 -0
  140. package/templates/scaffold/app/backend/eslint.config.js +17 -0
  141. package/templates/scaffold/app/backend/package.json +1 -0
  142. package/templates/scaffold/app/backend/src/tests/stories/audit-log/user--view-audit-log-detail.test.ts +3 -3
  143. package/templates/scaffold/app/backend/src/tests/stories/role-management/user--assign-role-to-user.test.ts +4 -4
  144. package/templates/scaffold/app/backend/src/tests/stories/role-management/user--remove-role-from-user.test.ts +4 -4
  145. package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--toggle-user-status.test.ts +6 -6
  146. package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--update-own-profile.test.ts +13 -13
  147. package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--update-user-profile.test.ts +16 -17
  148. package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--view-user-detail.test.ts +3 -3
  149. package/templates/scaffold/app/backend/tailor.config.ts +15 -1
  150. package/templates/scaffold/app/backend/tsconfig.json +1 -1
  151. package/templates/scaffold/app/frontend/src/App.tsx +57 -16
  152. package/templates/scaffold/module/eslint.config.js +24 -0
  153. package/templates/scaffold/module/module.ts +1 -0
  154. package/templates/scaffold/module/package.json +3 -1
  155. package/templates/scaffold/module/vitest.config.ts +11 -0
  156. /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/[id]/components/audit-entry-detail.tsx +0 -0
  157. /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/[id]/page.tsx +0 -0
  158. /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/components/audit-entries-table.tsx +0 -0
  159. /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/page.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @tailor-platform/erp-kit
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - afa2455: - Add seed:validate script and skill step to scaffold template
8
+ - Add vitest to module scaffold template
9
+ - Add version self-checking to all erp-kit skills
10
+ - Fix command return properties to use full model names across all modules
11
+ - Fix tree-shaking by adding sideEffects annotations to all module defineModule exports
12
+ - Fix scaffold app integration tests
13
+ - Fix inactive users being able to access the scaffold app
14
+ - Fix skills CLI version check, remove erp-kit-shared dependency
15
+ - Refactor audit pages out of user-management directory into standalone location
16
+ - Remove audit dependency from coa-management module
17
+
3
18
  ## 0.8.0
4
19
 
5
20
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/erp-kit",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Opinionated ERP toolkit for building business applications on Tailor Platform",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-1-requirements
3
3
  description: Create Tier 1-2 documentation (requirements, actors, business-flow) for an application. Use when starting a new application or documenting high-level requirements and workflows.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Application Requirement Analysis Workflow
7
9
 
8
10
  Create Tier 1-2 documentation: Requirements, Actors, and Business Flows.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-2-requirements-review
3
3
  description: Review requirements quality and documentation consistency for applications. Use after creating Tier 1-2 documentation (requirements, actors, business-flow) with erp-kit-app-1-requirements.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Requirements Review
7
9
 
8
10
  Review **requirements quality** and **documentation consistency** for an application's Tier 1-2 documentation.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-3-plan
3
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
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Business Flow Breakdown to Stories, Screens, and Resolvers
7
9
 
8
10
  Convert Tier 2 business flows and stories into Tier 3 (screens) and Tier 4 (resolvers) documentation using parallel extraction agents.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-4-plan-review
3
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
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Documentation Parity Review
7
9
 
8
10
  Review **documentation consistency** across Tier 2 (business flows, actors, stories), Tier 3 (screens), and Tier 4 (resolvers) documentation.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-5-impl-backend
3
3
  description: Implement backend code for applications using erp-kit modules. Use after completing plan review with erp-kit-app-4-plan-review. Triggers when implementing backend resolvers, wiring modules, configuring applications, or when the user mentions implementing backend, writing resolvers, or connecting erp-kit modules.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Application Backend Implementation
7
9
 
8
10
  Implement backend resolvers and application configuration for an application, driven by Tier 1-4 documentation (actors, business flows, stories, screens, resolvers).
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -117,6 +123,7 @@ After resolvers are done, implement the story integration test stubs generated i
117
123
  - **Seed data** (`seed/`) — `exec.mjs` runner + `data/*.jsonl` (records) and `data/*.schema.ts` (validation).
118
124
  1. **Module seed** — Run `pnpm erp-kit app generate seed -p <app-path>` to generate module-provided defaults (currencies, units, UoM categories, exchange rates). This writes JSONL files to `seed/data/`, skipping files that already exist.
119
125
  2. **App-specific seed** — Manually create seed records for permissions, roles, test users, and domain-specific data. Seeded users must have concrete permission keys required by the wired modules.
126
+ 3. **Validate seed** — Run `pnpm run seed:validate` and fix any errors before proceeding.
120
127
 
121
128
  ### Phase 6: Deploy Backend & Next Steps
122
129
 
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-6-impl-frontend
3
3
  description: Implement frontend code for applications. Use after deploying the backend with erp-kit-app-5-impl-backend. Triggers when implementing frontend pages, creating React components from screen specs, or when the user mentions implementing frontend, creating pages, or building UI for an application.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Application Frontend Implementation
7
9
 
8
10
  Implement frontend pages for an application, driven by screen spec documentation and a deployed backend.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-app-7-impl-review
3
3
  description: Review implementation parity between documentation and code for applications. Use after frontend implementation (step 6) to validate code matches documentation.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Implementation Parity Review
7
9
 
8
10
  Review **implementation consistency** between Tier 3-4 documentation and actual backend/frontend code.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Progress Logging
11
17
 
12
18
  Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: erp-kit-app-shared
3
3
  description: Shared references for erp-kit app skills. Not invoked directly — referenced by erp-kit-app-1 through erp-kit-app-7.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # erp-kit-app-shared
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-mock-scenario
3
3
  description: Scaffold a new Mockoon mock scenario with CRUD routes, error scenarios, and registry updates
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Mock Scenario Scaffolder
7
9
 
8
10
  Generate a complete Mockoon mock API config for a new provider scenario and wire it into the registry.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Workflow
11
17
 
12
18
  ### Step 1: Identify target API
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-1-requirements
3
3
  description: Create ERP module requirements and feature documentation. Use when starting a new module, defining requirements, scoping features, or designing module architecture. Guides collaborative research, scoping, and iterative feature breakdown.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Module Requirements Workflow
7
9
 
8
10
  Autonomous workflow for creating ERP module requirements. Uses parallel agents for research, then automatically decides scope based on recommendations.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Workflow
11
17
 
12
18
  ```
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-2-requirements-review
3
3
  description: Review requirements quality and module boundary consistency. Use after creating requirements (step 1) to validate best practices and cross-module boundaries.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Requirements Review
7
9
 
8
10
  Review **requirements quality** and **module boundary consistency** for a module.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - After writing module requirements and feature documentation (step 1)
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-3-plan
3
3
  description: Create implementation plan by breaking down feature specs into model, command, and query documentation. Use after requirements review (step 2) to plan the implementation structure.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Feature Breakdown to Model/Command/Query Docs
7
9
 
8
10
  Convert feature specifications into structured model, command, and query documentation. The main agent creates the plan and populates scaffolded docs, then parallel subagents refine each doc type.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - User has feature specs (e.g., `docs/features/*.md`) and wants implementation docs
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-3-update-plan
3
3
  description: Update model/command/query documentation based on plan review (step 4) feedback. Use after erp-kit-module-4-plan-review returns NEEDS CHANGES to apply targeted fixes without re-creating existing docs.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Fix Plan Documentation from Review Feedback
7
9
 
8
10
  Apply targeted fixes to model, command, and query documentation based on plan review feedback. Unlike erp-kit-module-3-plan which creates docs from scratch, this skill reads the review report and applies only the necessary changes.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - After erp-kit-module-4-plan-review returns **NEEDS CHANGES**
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-4-plan-review
3
3
  description: Review parity between feature documentation and command/model/query documentation. Use after creating implementation plan (step 3) to validate completeness.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Feature Parity Review
7
9
 
8
10
  Review **documentation consistency** between feature specs and command/model/query docs.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - After writing feature documentation, check for gaps in command/model/query documentation
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-5-impl
3
3
  description: Implement features in modules using TDD. Use after plan review (step 4) to implement database models, commands, and queries with test-driven development.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # TDD Implementation for Module Development
7
9
 
8
10
  Implement features in modules using Test-Driven Development with per-item agent delegation.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - Implementing new domain commands in any module
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-module-6-impl-review
3
3
  description: Review implementation parity between documentation and code. Use after TDD implementation (step 5) to validate code matches documentation.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Implementation Parity Review
7
9
 
8
10
  Review **implementation consistency** between documentation and actual code.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## When to Use
11
17
 
12
18
  - After TDD implementation (step 4), verify it matches documentation
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: erp-kit-module-shared
3
3
  description: Shared references for erp-kit module skills. Not invoked directly — referenced by erp-kit-module-1 through erp-kit-module-6.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # erp-kit-module-shared
@@ -179,6 +179,9 @@ const units = await db
179
179
 
180
180
  - **Error handling**: Use `ok()` / `err()` from `@tailor-platform/erp-kit/module` — do not throw
181
181
  - **Validation**: Check referenced entities exist before operating, return `err()` if not found
182
+ - **Return property naming**: Use the full model name in camelCase as the return property key — never abbreviate. This keeps property names unambiguous across modules.
183
+ - `return ok({ stockMovement: ... })` — not `movement`
184
+ - `return ok({ inventoryAdjustment: ... })` — not `adjustment`
182
185
 
183
186
  ## Update Command Input Type
184
187
 
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: erp-kit-update
3
3
  description: Route requirements changes to the correct erp-kit skill. Use when requirements change midway — adding features, modifying business flows, updating screens, changing module specs, or when unsure which erp-kit skill to re-run after a change.
4
+ metadata:
5
+ erp-kit-version: "0.9.0"
4
6
  ---
5
7
 
6
8
  # Requirements Update Router
7
9
 
8
10
  Route mid-workflow changes to the correct erp-kit skill. Dynamically discovers available skills — no hardcoded routing tables.
9
11
 
12
+ ## Version Check
13
+
14
+ Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
15
+
10
16
  ## Workflow
11
17
 
12
18
  ```
@@ -29,7 +29,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
29
29
  );
30
30
 
31
31
  const value = expectOk(result);
32
- expect(value.assignment).toEqual(baseProfitCenterHierarchyAssignment);
32
+ expect(value.profitCenterHierarchyAssignment).toEqual(baseProfitCenterHierarchyAssignment);
33
33
  expect(spies.insert).toHaveBeenCalled();
34
34
  expect(spies.update).not.toHaveBeenCalled();
35
35
  });
@@ -56,7 +56,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
56
56
  );
57
57
 
58
58
  const value = expectOk(result);
59
- expect(value.assignment.hierarchyNodeId).toBe(childProfitCenterNode.id);
59
+ expect(value.profitCenterHierarchyAssignment.hierarchyNodeId).toBe(childProfitCenterNode.id);
60
60
  expect(spies.update).toHaveBeenCalled();
61
61
  expect(spies.insert).not.toHaveBeenCalled();
62
62
  });
@@ -90,7 +90,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
90
90
  );
91
91
 
92
92
  const value = expectOk(result);
93
- expect(value.assignment.hierarchyNodeId).toBe(secondHierarchyNode.id);
93
+ expect(value.profitCenterHierarchyAssignment.hierarchyNodeId).toBe(secondHierarchyNode.id);
94
94
  expect(spies.insert).toHaveBeenCalled();
95
95
  expect(spies.update).not.toHaveBeenCalled();
96
96
  });
@@ -67,5 +67,5 @@ export async function run(
67
67
  .returningAll()
68
68
  .executeTakeFirstOrThrow();
69
69
 
70
- return ok({ assignment });
70
+ return ok({ profitCenterHierarchyAssignment: assignment });
71
71
  }
@@ -83,7 +83,7 @@ describe("createCostCenterHierarchyNode", () => {
83
83
  );
84
84
 
85
85
  const value = expectOk(result);
86
- expect(value.node).toEqual(rootCostCenterNode);
86
+ expect(value.costCenterHierarchyNode).toEqual(rootCostCenterNode);
87
87
  });
88
88
 
89
89
  it("creates child node with correct computed level", async () => {
@@ -105,8 +105,8 @@ describe("createCostCenterHierarchyNode", () => {
105
105
  );
106
106
 
107
107
  const value = expectOk(result);
108
- expect(value.node).toEqual(childCostCenterNode);
109
- expect(value.node.level).toBe(1);
108
+ expect(value.costCenterHierarchyNode).toEqual(childCostCenterNode);
109
+ expect(value.costCenterHierarchyNode.level).toBe(1);
110
110
  });
111
111
 
112
112
  it("returns error when node references itself as parent", async () => {
@@ -113,5 +113,5 @@ export async function run(
113
113
  .returningAll()
114
114
  .executeTakeFirst();
115
115
 
116
- return ok({ node: node! });
116
+ return ok({ costCenterHierarchyNode: node! });
117
117
  }
@@ -104,7 +104,7 @@ describe("moveCostCenterHierarchyNode", () => {
104
104
  );
105
105
 
106
106
  const value = expectOk(result);
107
- expect(value.node).toEqual(movedNode);
107
+ expect(value.costCenterHierarchyNode).toEqual(movedNode);
108
108
  });
109
109
 
110
110
  it("updates level based on new parent level", async () => {
@@ -130,6 +130,6 @@ describe("moveCostCenterHierarchyNode", () => {
130
130
  );
131
131
 
132
132
  const value = expectOk(result);
133
- expect(value.node.level).toBe(1);
133
+ expect(value.costCenterHierarchyNode.level).toBe(1);
134
134
  });
135
135
  });
@@ -77,5 +77,5 @@ export async function run(
77
77
  .returningAll()
78
78
  .executeTakeFirst();
79
79
 
80
- return ok({ node: updatedNode! });
80
+ return ok({ costCenterHierarchyNode: updatedNode! });
81
81
  }
@@ -190,6 +190,7 @@ export interface DefineModuleParams<
190
190
  };
191
191
  }
192
192
 
193
+ /* @__NO_SIDE_EFFECTS__ */
193
194
  export const defineModule = <
194
195
  const CeF extends Record<string, TailorAnyDBField> = EmptyFields,
195
196
  const CcF extends Record<string, TailorAnyDBField> = EmptyFields,
@@ -67,7 +67,7 @@ describe("createPartnerBankAccount", () => {
67
67
 
68
68
  expect(result.ok).toBe(true);
69
69
  if (result.ok) {
70
- expect(result.value.bankAccount).toEqual(baseDefaultBankAccount);
70
+ expect(result.value.partnerBankAccount).toEqual(baseDefaultBankAccount);
71
71
  }
72
72
  });
73
73
 
@@ -204,7 +204,7 @@ describe("createPartnerBankAccount", () => {
204
204
 
205
205
  expect(result.ok).toBe(true);
206
206
  if (result.ok) {
207
- expect(result.value.bankAccount.partnerId).toBe("partner-1");
207
+ expect(result.value.partnerBankAccount.partnerId).toBe("partner-1");
208
208
  }
209
209
  });
210
210
 
@@ -221,7 +221,7 @@ describe("createPartnerBankAccount", () => {
221
221
 
222
222
  expect(result.ok).toBe(true);
223
223
  if (result.ok) {
224
- expect(result.value.bankAccount.partnerId).toBe("partner-3");
224
+ expect(result.value.partnerBankAccount.partnerId).toBe("partner-3");
225
225
  }
226
226
  });
227
227
 
@@ -110,5 +110,5 @@ export async function run<CF extends Record<string, unknown>>(
110
110
  .returningAll()
111
111
  .executeTakeFirstOrThrow();
112
112
 
113
- return ok({ bankAccount });
113
+ return ok({ partnerBankAccount: bankAccount });
114
114
  }
@@ -92,6 +92,7 @@ export interface DefineModuleParams<
92
92
  };
93
93
  }
94
94
 
95
+ /* @__NO_SIDE_EFFECTS__ */
95
96
  export const defineModule = <
96
97
  const BPF extends Record<string, TailorAnyDBField> = EmptyFields,
97
98
  const PRF extends Record<string, TailorAnyDBField> = EmptyFields,
@@ -107,19 +107,4 @@ describe("activateAccount", () => {
107
107
  expect(result.value.account.status).toBe("ACTIVE");
108
108
  }
109
109
  });
110
-
111
- it("emits audit event recording status transition from DRAFT to ACTIVE", async () => {
112
- const { db, spies } = createMockDb<Transaction>();
113
- const activated = { ...baseDraftAccount, status: "ACTIVE" };
114
- spies.select.mockReturnValueOnce(baseDraftAccount).mockReturnValueOnce(baseActiveCoa);
115
- spies.update.mockReturnValue(activated);
116
-
117
- const result = await run(db, { id: baseDraftAccount.id }, ctx);
118
-
119
- // Audit event is emitted as part of successful activation
120
- expect(result.ok).toBe(true);
121
- if (result.ok) {
122
- expect(result.value.account.status).toBe("ACTIVE");
123
- }
124
- });
125
110
  });
@@ -1,4 +1,3 @@
1
- import { randomUUID } from "node:crypto";
2
1
  import type { Transaction } from "../generated/kysely-tailordb";
3
2
  import {
4
3
  AccountNotFoundError,
@@ -12,35 +11,13 @@ export interface ActivateAccountInput {
12
11
  from?: string[];
13
12
  }
14
13
 
15
- export interface AuditCommands {
16
- logAuditEvent: (
17
- db: Transaction,
18
- input: {
19
- eventId: string;
20
- actorType: string;
21
- actorId: string;
22
- entityType: string;
23
- entityId: string;
24
- operationType: string;
25
- companyId?: string;
26
- changes: { fieldName: string; oldValue?: unknown; newValue?: unknown }[];
27
- },
28
- ctx: CommandContext,
29
- ) => Promise<{ ok: true; value: unknown }>;
30
- }
31
-
32
14
  /**
33
15
  * Function: activateAccount
34
16
  *
35
17
  * Transitions a GL account from DRAFT to ACTIVE status, making it eligible
36
18
  * to receive journal postings from downstream modules.
37
19
  */
38
- export async function run(
39
- db: Transaction,
40
- input: ActivateAccountInput,
41
- ctx: CommandContext,
42
- auditCommands?: AuditCommands,
43
- ) {
20
+ export async function run(db: Transaction, input: ActivateAccountInput, _ctx: CommandContext) {
44
21
  const { id, from = ["DRAFT"] } = input;
45
22
 
46
23
  // 1. Find account with forUpdate
@@ -83,23 +60,5 @@ export async function run(
83
60
  .returningAll()
84
61
  .executeTakeFirst();
85
62
 
86
- // 6. Emit audit event
87
- if (auditCommands) {
88
- await auditCommands.logAuditEvent(
89
- db,
90
- {
91
- eventId: randomUUID(),
92
- actorType: "USER",
93
- actorId: ctx.actorId,
94
- entityType: "Account",
95
- entityId: id,
96
- operationType: "UPDATE",
97
- companyId: coa.companyId,
98
- changes: [{ fieldName: "status", oldValue: account.status, newValue: "ACTIVE" }],
99
- },
100
- ctx,
101
- );
102
- }
103
-
104
63
  return ok({ account: updated! });
105
64
  }