aw-spec-cli 0.1.3 → 0.1.5

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 (230) hide show
  1. package/README.md +291 -0
  2. package/assets/.agents/agent.json +28 -0
  3. package/assets/.agents/skills/aw-spec-orch/SKILL.md +56 -0
  4. package/assets/.agents/skills/aw-spec-orch-demo/SKILL.md +59 -0
  5. package/assets/.aw-spec/DESIGN-FORMAT.md +151 -0
  6. package/assets/.aw-spec/ORCH-DIALECT.md +156 -0
  7. package/assets/.aw-spec/RULE-PARTITION.md +126 -0
  8. package/assets/.aw-spec/extensions/agent-context/extension.yml +12 -9
  9. package/assets/.aw-spec/extensions.yml +12 -19
  10. package/assets/.aw-spec/integrations/aw-spec.manifest.json +1 -9
  11. package/assets/.aw-spec/interpreter/run-skill.py +1158 -0
  12. package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +94 -0
  13. package/assets/.aw-spec/orchestrator/README.md +300 -0
  14. package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +74 -0
  15. package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +74 -0
  16. package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +105 -0
  17. package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +79 -0
  18. package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +81 -0
  19. package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +75 -0
  20. package/assets/.aw-spec/orchestrator/orchestrator.py +1721 -0
  21. package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  22. package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +59 -0
  23. package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +97 -0
  24. package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +61 -0
  25. package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  26. package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  27. package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  28. package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  29. package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +160 -0
  30. package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +244 -0
  31. package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +775 -0
  32. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +248 -0
  33. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +261 -0
  34. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +425 -0
  35. package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +188 -0
  36. package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +474 -0
  37. package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  38. package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +284 -0
  39. package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +103 -0
  40. package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  41. package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  42. package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  43. package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +382 -0
  44. package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +246 -0
  45. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +231 -0
  46. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +258 -0
  47. package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +236 -0
  48. package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +949 -0
  49. package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  50. package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +177 -0
  51. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +79 -0
  52. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  53. package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +412 -0
  54. package/assets/.aw-spec/scripts/bash/aw-inventory.sh +14 -0
  55. package/assets/.aw-spec/scripts/bash/aw-parity.sh +13 -0
  56. package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +13 -0
  57. package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +1899 -0
  58. package/assets/.aw-spec/scripts/bash/aw-xref.sh +15 -0
  59. package/assets/.aw-spec/scripts/bash/common.sh +11 -60
  60. package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +14 -0
  61. package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +13 -0
  62. package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  63. package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +1563 -0
  64. package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +15 -0
  65. package/assets/.aw-spec/scripts/python/aw-inventory.py +683 -0
  66. package/assets/.aw-spec/scripts/python/aw-parity.py +380 -0
  67. package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +312 -0
  68. package/assets/.aw-spec/scripts/python/aw-xref.py +1330 -0
  69. package/assets/.aw-spec/scripts/python/validate_okf.py +349 -0
  70. package/assets/.aw-spec/templates/constitution-domain-template.md +75 -0
  71. package/assets/.aw-spec/templates/constitution-technical-template.md +70 -0
  72. package/assets/.aw-spec/templates/delta-design-template.md +69 -0
  73. package/assets/.aw-spec/templates/delta-spec-template.md +60 -0
  74. package/assets/.aw-spec/templates/design-template.md +383 -0
  75. package/assets/.aw-spec/templates/okf-concept-template.md +103 -0
  76. package/assets/.aw-spec/templates/parity-manifest-template.json +49 -0
  77. package/assets/.aw-spec/templates/source-map-template.md +85 -0
  78. package/assets/.aw-spec/templates/spec-template.md +192 -71
  79. package/assets/.claude/agent.json +27 -0
  80. package/assets/.claude/skills/aw-spec-orch/SKILL.md +55 -0
  81. package/assets/.claude/skills/aw-spec-orch-demo/SKILL.md +59 -0
  82. package/assets/.kilocode/agent.json +28 -0
  83. package/assets/.kilocode/workflows/aw-spec-orch-demo.md +59 -0
  84. package/assets/.kilocode/workflows/aw-spec-orch.md +55 -0
  85. package/assets/docs/architecture/clean-architecture.md +1 -1
  86. package/assets/docs/architecture/cqrs.md +1 -1
  87. package/assets/docs/architecture/eventing.md +1 -1
  88. package/assets/docs/architecture/folder-structure.md +1 -1
  89. package/assets/docs/architecture/modular-monolith.md +1 -1
  90. package/assets/docs/architecture/persistence.md +1 -1
  91. package/assets/docs/architecture/testing.md +1 -1
  92. package/assets/docs/architecture/vertical-slices.md +1 -1
  93. package/assets/docs/components/Email/README.md +1 -1
  94. package/assets/docs/components/Jobs/README.md +1 -1
  95. package/assets/docs/components/QrGenerator/README.md +1 -1
  96. package/assets/docs/components/README.md +1 -1
  97. package/assets/docs/domain/domain-driven-design.md +1 -1
  98. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +1 -1
  99. package/assets/docs/domainspecs/healthcare/auditing.domain.md +86 -18
  100. package/assets/docs/domainspecs/healthcare/authorization.domain.md +1 -1
  101. package/assets/docs/domainspecs/healthcare/clinical-terms.md +1 -1
  102. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +1 -1
  103. package/assets/docs/domainspecs/healthcare/comandrulemap.md +58 -124
  104. package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +119 -0
  105. package/assets/docs/domainspecs/healthcare/consent.md +1 -1
  106. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +1 -1
  107. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +1 -1
  108. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +1 -1
  109. package/assets/docs/domainspecs/healthcare/dicom.md +1 -1
  110. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +1 -1
  111. package/assets/docs/domainspecs/healthcare/eventing.domain.md +1 -1
  112. package/assets/docs/domainspecs/healthcare/fhir.md +1 -1
  113. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +1 -1
  114. package/assets/docs/domainspecs/healthcare/hipaa.md +1 -1
  115. package/assets/docs/domainspecs/healthcare/hl7.md +1 -1
  116. package/assets/docs/domainspecs/healthcare/integration-terms.md +1 -1
  117. package/assets/docs/domainspecs/healthcare/persistence.domain.md +1 -1
  118. package/assets/docs/domainspecs/healthcare/terminology.md +1 -1
  119. package/assets/docs/domainspecs/healthcare/testing.domain.md +1 -1
  120. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +1 -1
  121. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +1 -1
  122. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +1 -1
  123. package/assets/docs/domainspecs/pharma/atc.md +1 -1
  124. package/assets/docs/domainspecs/pharma/auditing.domain.md +80 -16
  125. package/assets/docs/domainspecs/pharma/authorization.domain.md +1 -1
  126. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +1 -1
  127. package/assets/docs/domainspecs/pharma/comandrulemap.md +64 -142
  128. package/assets/docs/domainspecs/pharma/commandtechrulemap.md +119 -0
  129. package/assets/docs/domainspecs/pharma/cqrs.domain.md +1 -1
  130. package/assets/docs/domainspecs/pharma/data-classification.domain.md +1 -1
  131. package/assets/docs/domainspecs/pharma/data-provenance.md +1 -1
  132. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +1 -1
  133. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +1 -1
  134. package/assets/docs/domainspecs/pharma/eventing.domain.md +1 -1
  135. package/assets/docs/domainspecs/pharma/fhir.md +1 -1
  136. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +1 -1
  137. package/assets/docs/domainspecs/pharma/hl7.md +1 -1
  138. package/assets/docs/domainspecs/pharma/idmp.md +1 -1
  139. package/assets/docs/domainspecs/pharma/integration-terms.md +1 -1
  140. package/assets/docs/domainspecs/pharma/ndc.md +1 -1
  141. package/assets/docs/domainspecs/pharma/persistence.domain.md +1 -1
  142. package/assets/docs/domainspecs/pharma/pharma-terms.md +1 -1
  143. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +1 -1
  144. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +1 -1
  145. package/assets/docs/domainspecs/pharma/terminology.md +1 -1
  146. package/assets/docs/domainspecs/pharma/testing.domain.md +1 -1
  147. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +1 -1
  148. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +1 -1
  149. package/assets/docs/governance/api-versioning.md +1 -1
  150. package/assets/docs/governance/coding-standards.md +1 -1
  151. package/assets/docs/governance/dependency-policy.md +1 -1
  152. package/assets/docs/requirement-spec.txt +13 -1
  153. package/assets/docs/security/auditing.md +54 -11
  154. package/assets/docs/security/authorization.md +1 -1
  155. package/assets/docs/security/data-classification.md +1 -1
  156. package/assets/docs/security/zero-trust.md +1 -1
  157. package/dist/commands/update.d.ts +3 -0
  158. package/dist/commands/update.d.ts.map +1 -0
  159. package/dist/commands/update.js +142 -0
  160. package/dist/commands/update.js.map +1 -0
  161. package/dist/utils/manifest.d.ts +31 -0
  162. package/dist/utils/manifest.d.ts.map +1 -0
  163. package/dist/utils/manifest.js +91 -0
  164. package/dist/utils/manifest.js.map +1 -0
  165. package/dist/utils/paths.js +2 -2
  166. package/dist/utils/paths.js.map +1 -1
  167. package/dist/utils/update-engine.d.ts +52 -0
  168. package/dist/utils/update-engine.d.ts.map +1 -0
  169. package/dist/utils/update-engine.js +203 -0
  170. package/dist/utils/update-engine.js.map +1 -0
  171. package/package.json +1 -1
  172. package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
  173. package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  174. package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
  175. package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
  176. package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
  177. package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
  178. package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
  179. package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
  180. package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
  181. package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  182. package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
  183. package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
  184. package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
  185. package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
  186. package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  187. package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
  188. package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
  189. package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
  190. package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
  191. package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
  192. package/assets/.aw-spec/templates/checklist-template.md +0 -40
  193. package/assets/.aw-spec/templates/constitution-template.md +0 -57
  194. package/assets/.aw-spec/templates/plan-template.md +0 -113
  195. package/assets/.aw-spec/templates/tasks-template.md +0 -252
  196. package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
  197. package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
  198. package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
  199. package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  200. package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
  201. package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
  202. package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
  203. package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
  204. package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
  205. package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
  206. package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
  207. package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  208. package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
  209. package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
  210. package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
  211. package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
  212. package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  213. package/assets/.kilocode/rules/specify-rules.md +0 -4
  214. package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
  215. package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
  216. package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
  217. package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
  218. package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
  219. package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
  220. package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
  221. package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
  222. package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
  223. package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
  224. package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
  225. package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
  226. package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
  227. package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
  228. package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
  229. package/assets/docs/command.txt +0 -295
  230. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -1,107 +0,0 @@
1
- ---
2
- name: "aw-spec-taskstoissues"
3
- description: "Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts."
4
- argument-hint: "Optional filter or label for GitHub issues"
5
- compatibility: "Requires aw-spec project structure with .aw-spec/ directory"
6
- metadata:
7
- author: "github-aw-spec"
8
- source: "templates/commands/taskstoissues.md"
9
- user-invocable: true
10
- disable-model-invocation: false
11
- ---
12
-
13
-
14
- ## User Input
15
-
16
- ```text
17
- $ARGUMENTS
18
- ```
19
-
20
- You **MUST** consider the user input before proceeding (if not empty).
21
-
22
- ## Pre-Execution Checks
23
-
24
- **Check for extension hooks (before tasks-to-issues conversion)**:
25
- - Check if `.aw-spec/extensions.yml` exists in the project root.
26
- - If it exists, read it and look for entries under the `hooks.before_taskstoissues` key
27
- - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
- - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
- - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
- - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
- - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
- - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
33
- - For each executable hook, output the following based on its `optional` flag:
34
- - **Optional hook** (`optional: true`):
35
- ```
36
- ## Extension Hooks
37
-
38
- **Optional Pre-Hook**: {extension}
39
- Command: `/{command}`
40
- Description: {description}
41
-
42
- Prompt: {prompt}
43
- To execute: `/{command}`
44
- ```
45
- - **Mandatory hook** (`optional: false`):
46
- ```
47
- ## Extension Hooks
48
-
49
- **Automatic Pre-Hook**: {extension}
50
- Executing: `/{command}`
51
- EXECUTE_COMMAND: {command}
52
-
53
- Wait for the result of the hook command before proceeding to the Outline.
54
- ```
55
- - If no hooks are registered or `.aw-spec/extensions.yml` does not exist, skip silently
56
-
57
- ## Outline
58
-
59
- 1. Run `.aw-spec/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
60
- 1. **IF EXISTS**: Load `.aw-spec/memory/constitution.md` for project principles and governance constraints.
61
- 1. From the executed script, extract the path to **tasks**.
62
- 1. Get the Git remote by running:
63
-
64
- ```bash
65
- git config --get remote.origin.url
66
- ```
67
-
68
- > [!CAUTION]
69
- > ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
70
-
71
- 1. For each task in the list, use the GitHub MCP server to create a new issue in the repository that is representative of the Git remote.
72
-
73
- > [!CAUTION]
74
- > UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
75
-
76
- ## Post-Execution Checks
77
-
78
- **Check for extension hooks (after tasks-to-issues conversion)**:
79
- Check if `.aw-spec/extensions.yml` exists in the project root.
80
- - If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
81
- - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
82
- - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
83
- - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
84
- - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
85
- - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
86
- - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
87
- - For each executable hook, output the following based on its `optional` flag:
88
- - **Optional hook** (`optional: true`):
89
- ```
90
- ## Extension Hooks
91
-
92
- **Optional Hook**: {extension}
93
- Command: `/{command}`
94
- Description: {description}
95
-
96
- Prompt: {prompt}
97
- To execute: `/{command}`
98
- ```
99
- - **Mandatory hook** (`optional: false`):
100
- ```
101
- ## Extension Hooks
102
-
103
- **Automatic Hook**: {extension}
104
- Executing: `/{command}`
105
- EXECUTE_COMMAND: {command}
106
- ```
107
- - If no hooks are registered or `.aw-spec/extensions.yml` does not exist, skip silently
@@ -1,295 +0,0 @@
1
- ================================================================================
2
- AW-SPEC COMMAND SHEET — Feature: Patient Registration (Patient / RegisterPatient)
3
- ================================================================================
4
- Run these in order, one per turn, from /aw-spec-specify to /aw-spec-implement.
5
- All six numbered steps are REQUIRED for this feature — clarify and analyze are
6
- correctness gates, not optional extras (see their sections for why).
7
-
8
- CONVENTIONS USED BELOW
9
- - @paths are Claude Code file mentions; they are inlined as context. Paths are
10
- relative to the workspace root (e:\Work\Company\Project), so they start with `docs/...`.
11
- - "MANUAL TEXT" = the plain prompt you type as part of the command.
12
- - The spec folder convention is specs/<Aggregate>/<Feature>; starting the feature
13
- description with the token `Patient/RegisterPatient` makes /aw-spec-specify create
14
- specs/Patient/RegisterPatient/ and pin it in .aw-spec/feature.json. Every later
15
- command (clarify/plan/tasks/analyze/implement) auto-resolves that folder from
16
- feature.json — you do NOT pass the aggregate/feature token again.
17
- - The constitution (.aw-spec/memory/constitution.md) AND the domain-agnostic technical
18
- standards are AUTO-LOADED by each command (see each SKILL.md) — you
19
- do NOT pass those with @.
20
- - The DOMAIN-SPECIFIC files shown per step come from the active domain's comandrulemap.md
21
- (active domain = .aw-spec/domain.json, set via /aw-spec-select-domain). Each command offers
22
- them in a selection box (Select all / Pick a subset / None); the @ mentions below are an
23
- equivalent, OPTIONAL shortcut and are always loaded in addition to the auto-loaded set.
24
-
25
- INTEROPERABILITY SCOPE FOR THIS FEATURE
26
- Patient registration is an interoperability-heavy feature. It MUST support:
27
- - Inbound HL7 v2 ADT^A04 (Register a Patient) via an Interop/Hl7v2 adapter that
28
- converts the message to the RegisterPatientCommand (never writes to the aggregate
29
- directly), over MLLP, with ACK handling.
30
- - Outbound ADT emission on PatientRegisteredEvent (egress adapter).
31
- - External FHIR R4 Patient projection + PIX/PDQ identity cross-reference.
32
- Therefore docs/domainspecs/healthcare/hl7.md and the eventing docs are part of the context from
33
- specify through implement.
34
-
35
- SETUP (one-time per project) — set the active domain
36
- /aw-spec-select-domain (lists docs/domainspecs/ folders; writes .aw-spec/domain.json)
37
- /aw-spec-select-domain healthcare (or set it directly)
38
- -> For this demo the domain is `healthcare` (already set). If the domain is unset or its
39
- comandrulemap.md is missing, every command first asks "Continue without domain rules?
40
- (Continue / Exit)" before running.
41
-
42
- PREREQUISITE (one-time, only if the constitution has not been ratified yet)
43
- /aw-spec-constitution @docs/healthcare-constitution.md @docs/domainspecs/healthcare/domain-requirements.md
44
- -> docs/technology-constitution.md auto-loads (technology base); pass only the domain addenda.
45
- -> Ratifies .aw-spec/memory/constitution.md. Not part of the per-feature loop.
46
-
47
-
48
- ================================================================================
49
- STEP 1 — /aw-spec-specify (create the feature spec)
50
- ================================================================================
51
- PURPOSE
52
- Create specs/Patient/RegisterPatient/spec.md (WHAT/WHY, no implementation detail)
53
- and pin the folder in .aw-spec/feature.json. A git feature branch is created by the
54
- before_specify hook.
55
-
56
- CONTEXT FILES TO ADD
57
- docs/domainspecs/healthcare/domain-requirements.md (bounded contexts: Patient aggregates)
58
- docs/domainspecs/healthcare/clinical-terms.md (MRN, Encounter, Coverage, ...)
59
- docs/domainspecs/healthcare/integration-terms.md (FHIR, HL7, PIX/PDQ, ATNA, ADT)
60
- docs/domainspecs/healthcare/domain-driven-design.domain.md (Patient invariants)
61
- docs/domainspecs/healthcare/fhir.md (Patient FHIR projection)
62
- docs/domainspecs/healthcare/hl7.md (HL7 v2 ADT ingestion/egress) <-- HL7
63
- docs/domainspecs/healthcare/dicom.md (imaging identifiers; optional for registration)
64
- docs/domainspecs/healthcare/terminology.md (coded fields)
65
- docs/domainspecs/healthcare/hipaa.md (PHI / minimum-necessary)
66
- docs/domainspecs/healthcare/consent.md (Consent at registration)
67
- docs/domainspecs/healthcare/data-classification.domain.md (PHI/PII categories)
68
- docs/domainspecs/healthcare/ai-rules.domain.md (PHI masking, no invented codes)
69
-
70
- COMMAND (copy-paste, single line)
71
- /aw-spec-specify Patient/RegisterPatient Register a new patient into the master patient index. Capture demographics (legal HumanName, date of birth, administrative sex, contact points, address) and assign a tenant-unique MRN. Invariants: MRN is unique per tenant; date-of-birth must not be in the future; minimum-necessary projection by role/scope. Interoperability: inbound HL7 v2 ADT^A04 (Register a Patient) messages MUST be ingested through an Interop/Hl7v2 adapter that converts to the RegisterPatientCommand (no direct aggregate writes) over MLLP with ACK handling, and an outbound ADT emitter fires on PatientRegisteredEvent; also expose an external FHIR R4 Patient projection and PIX/PDQ identity cross-reference. Surfaces: internal REST POST /patients returning the created Patient, the FHIR R4 Patient endpoint, and the HL7 v2 ADT ingress channel. Every PHI read/write must produce an ATNA audit record. Out of scope: patient merge, portal self-registration. @docs/domainspecs/healthcare/domain-requirements.md @docs/domainspecs/healthcare/clinical-terms.md @docs/domainspecs/healthcare/integration-terms.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/dicom.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/domainspecs/healthcare/ai-rules.domain.md
72
-
73
- MANUAL TEXT (the prompt portion, for reference)
74
- Patient/RegisterPatient Register a new patient into the master patient index. Capture
75
- demographics (legal HumanName, date of birth, administrative sex, contact points,
76
- address) and assign a tenant-unique MRN. Optionally link an insurance Coverage and
77
- capture initial patient Consent. Invariants: MRN is unique per tenant; date-of-birth
78
- must not be in the future; minimum-necessary projection by role/scope.
79
- Interoperability: inbound HL7 v2 ADT^A04 (Register a Patient) messages MUST be ingested
80
- through an Interop/Hl7v2 adapter that converts to the RegisterPatientCommand (no direct
81
- aggregate writes) over MLLP with ACK handling, and an outbound ADT emitter fires on
82
- PatientRegisteredEvent; also expose an external FHIR R4 Patient projection and PIX/PDQ
83
- identity cross-reference. Surfaces: internal REST POST /patients returning the created
84
- PatientDto with an ETag, the FHIR R4 Patient endpoint, and the HL7 v2 ADT ingress
85
- channel. Every PHI read/write must produce an ATNA audit record. Out of scope: patient
86
- merge, portal self-registration.
87
-
88
- NOTES
89
- - The leading `Patient/RegisterPatient` token sets the spec folder; keep PascalCase.
90
- - Expect output: SPEC_FILE = specs/Patient/RegisterPatient/spec.md.
91
-
92
-
93
- ================================================================================
94
- STEP 2 — /aw-spec-clarify (REQUIRED — feature-correctness gate)
95
- ================================================================================
96
- WHY THIS MATTERS (do not skip)
97
- Clarify finds underspecified areas and asks up to 5 targeted questions, then writes the
98
- answers back into spec.md. Building plan/tasks/code on an ambiguous spec is the most
99
- expensive mistake in the pipeline — for a PHI + HL7 feature the ambiguities have real
100
- cost. Resolve at least:
101
- - HL7 scope: only ADT^A04, or also A28 (add person) / A31 (update) / A08 (update info)?
102
- Which MSH sending/receiving apps? MLLP vs file drop? ACK mode (AA/AE/AR) and NAK on
103
- duplicate MRN?
104
- - Identity: who assigns the MRN (this system vs source)? PIX/PDQ matching rules and
105
- duplicate/merge-candidate handling on inbound ADT.
106
- - Consent: is Consent mandatory at registration or optional? purpose-of-use default.
107
- - Demographics: required vs optional fields; terminology bindings (administrative sex,
108
- marital status); multiple-birth/aliases.
109
- - Coverage: required at registration or deferred.
110
- Re-run until no high-impact (scope/PHI/interop) ambiguity remains.
111
-
112
- CONTEXT FILES TO ADD
113
- docs/domainspecs/healthcare/domain-driven-design.domain.md
114
- docs/domainspecs/healthcare/hl7.md (HL7 ADT clarifications) <-- HL7
115
- docs/domainspecs/healthcare/hipaa.md
116
- docs/domainspecs/healthcare/consent.md
117
- docs/domainspecs/healthcare/clinical-terms.md
118
- docs/domainspecs/healthcare/integration-terms.md
119
-
120
- COMMAND
121
- /aw-spec-clarify @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/domainspecs/healthcare/clinical-terms.md @docs/domainspecs/healthcare/integration-terms.md
122
-
123
- MANUAL TEXT
124
- (none — answer the questions it asks; the answers are written back into spec.md)
125
-
126
-
127
- ================================================================================
128
- STEP 3 — /aw-spec-plan (create the implementation plan / design)
129
- ================================================================================
130
- PURPOSE
131
- Produce plan.md (+ research/data-model/contracts) under specs/Patient/RegisterPatient/.
132
- This is where the engineering standards matter most — load the architecture stack,
133
- the HL7 adapter rules, and the eventing rules for inbound feeds.
134
-
135
- CONTEXT FILES TO ADD
136
- Architecture (technology):
137
- docs/architecture/folder-structure.md
138
- docs/architecture/clean-architecture.md
139
- docs/architecture/modular-monolith.md
140
- docs/architecture/cqrs.md
141
- docs/architecture/vertical-slices.md
142
- docs/architecture/persistence.md
143
- docs/architecture/eventing.md
144
- docs/domainspecs/healthcare/eventing.domain.md (HL7/FHIR inbound feeds) <-- HL7
145
- docs/architecture/testing.md
146
- Domain (healthcare, this slice):
147
- docs/domain/domain-driven-design.md
148
- docs/domainspecs/healthcare/domain-driven-design.domain.md
149
- docs/domainspecs/healthcare/fhir.md
150
- docs/domainspecs/healthcare/hl7.md (HL7 v2 adapter pattern) <-- HL7
151
- docs/domainspecs/healthcare/dicom.md (imaging identifiers; optional for registration)
152
- docs/domainspecs/healthcare/terminology.md
153
- docs/domainspecs/healthcare/hipaa.md
154
- docs/domainspecs/healthcare/consent.md
155
- Security:
156
- docs/security/authorization.md + .domain.md
157
- docs/security/auditing.md + .domain.md
158
- docs/domainspecs/healthcare/data-classification.domain.md
159
- Governance + AI rules:
160
- docs/governance/coding-standards.md + .domain.md
161
- docs/glossary/ai-rules.md + .domain.md
162
-
163
- COMMAND (copy-paste, single line)
164
- /aw-spec-plan Implement RegisterPatient as a complete vertical slice in the Patients module following the loaded standards: Patient aggregate root (Vogen PatientId, MRN value object, HumanName/Address/ContactPoint value objects), RegisterPatientCommand + handler (transaction + PatientRegisteredEvent), SecureFastEndpoint POST /patients with ETag, PatientDto + hand-written ToDto, EF configuration + migration, FHIR R4 Patient projector, and the PHI-access audit behavior. Interop: an Interop/Hl7v2 inbound adapter that parses ADT^A04 and dispatches RegisterPatientCommand via IMediator (no direct aggregate writes), MLLP transport + ACK, and an outbound ADT emitter subscribed to PatientRegisteredEvent; plan PIX/PDQ identity cross-reference. Use AppWeaver.Mediator/Repository/ServiceDefaults per the docs; PostgreSQL prod / SQLite dev; no MediatR/AutoMapper. @docs/architecture/folder-structure.md @docs/architecture/clean-architecture.md @docs/architecture/modular-monolith.md @docs/architecture/cqrs.md @docs/architecture/vertical-slices.md @docs/architecture/persistence.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/architecture/testing.md @docs/domain/domain-driven-design.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/dicom.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
165
-
166
- MANUAL TEXT (the prompt portion, for reference)
167
- Implement RegisterPatient as a complete vertical slice in the Patients module following
168
- the loaded standards: Patient aggregate root (Vogen PatientId, MRN value object,
169
- HumanName/Address/ContactPoint value objects), RegisterPatientCommand + handler
170
- (transaction + PatientRegisteredEvent), SecureFastEndpoint POST /patients with ETag,
171
- PatientDto + hand-written ToDto, EF configuration + migration, FHIR R4 Patient projector,
172
- and the PHI-access audit behavior. Interop: an Interop/Hl7v2 inbound adapter that parses
173
- ADT^A04 and dispatches RegisterPatientCommand via IMediator (no direct aggregate writes),
174
- MLLP transport + ACK, and an outbound ADT emitter subscribed to PatientRegisteredEvent;
175
- plan PIX/PDQ identity cross-reference. Use AppWeaver.Mediator/Repository/ServiceDefaults
176
- per the docs; PostgreSQL prod / SQLite dev; no MediatR/AutoMapper.
177
-
178
- NOTES
179
- - No aggregate/feature token here — the folder is resolved from feature.json.
180
-
181
-
182
- ================================================================================
183
- STEP 4 — /aw-spec-tasks (generate the dependency-ordered task list)
184
- ================================================================================
185
- PURPOSE
186
- Produce tasks.md from plan.md under specs/Patient/RegisterPatient/.
187
-
188
- CONTEXT FILES TO ADD
189
- docs/architecture/folder-structure.md
190
- docs/architecture/vertical-slices.md (+ .domain.md)
191
- docs/architecture/cqrs.md (+ .domain.md)
192
- docs/architecture/persistence.md (+ .domain.md)
193
- docs/architecture/testing.md (+ .domain.md)
194
- docs/architecture/eventing.md (+ .domain.md)
195
- docs/domainspecs/healthcare/domain-driven-design.domain.md
196
- docs/domainspecs/healthcare/fhir.md
197
- docs/domainspecs/healthcare/hl7.md (HL7 adapter tasks) <-- HL7
198
- docs/security/authorization.md (+ .domain.md)
199
- docs/security/auditing.md (+ .domain.md)
200
- docs/governance/coding-standards.md (+ .domain.md)
201
- docs/glossary/ai-rules.md (+ .domain.md)
202
-
203
- COMMAND (copy-paste, single line)
204
- /aw-spec-tasks Break the plan into ordered, testable tasks for the RegisterPatient slice: value objects + tests, Patient aggregate + invariant tests, EF config + migration, RegisterPatientCommand/Validator/Handler + handler tests (happy/validation/not-found/conflict), SecureFastEndpoint + integration test, FHIR Patient projector + round-trip test, HL7 v2 ADT^A04 inbound parser + outbound emitter with HL7 conformance tests against an internal corpus, PatientRegisteredEvent + publish, PHI-audit wiring. Tests precede implementation. @docs/architecture/folder-structure.md @docs/architecture/vertical-slices.md @docs/domainspecs/healthcare/vertical-slices.domain.md @docs/architecture/cqrs.md @docs/domainspecs/healthcare/cqrs.domain.md @docs/architecture/persistence.md @docs/domainspecs/healthcare/persistence.domain.md @docs/architecture/testing.md @docs/domainspecs/healthcare/testing.domain.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
205
-
206
- MANUAL TEXT (the prompt portion, for reference)
207
- Break the plan into ordered, testable tasks for the RegisterPatient slice: value objects
208
- + tests, Patient aggregate + invariant tests, EF config + migration,
209
- RegisterPatientCommand/Validator/Handler + handler tests
210
- (happy/validation/not-found/conflict), SecureFastEndpoint + integration test, FHIR
211
- Patient projector + round-trip test, HL7 v2 ADT^A04 inbound parser + outbound emitter
212
- with HL7 conformance tests against an internal corpus, PatientRegisteredEvent + publish,
213
- PHI-audit wiring. Tests precede implementation.
214
-
215
-
216
- ================================================================================
217
- STEP 5 — /aw-spec-analyze (REQUIRED — cross-artifact correctness gate)
218
- ================================================================================
219
- WHY THIS MATTERS (do not skip)
220
- Analyze is a non-destructive consistency/quality check across spec.md, plan.md, and
221
- tasks.md, run AFTER tasks and BEFORE implement. It is the last gate before code, and for
222
- a regulated, interoperable feature it catches exactly the failures that are most costly
223
- after implementation:
224
- - Requirements in the spec with no covering task (e.g. ADT^A04 ingest, PIX/PDQ, Consent
225
- capture, audit on every PHI write).
226
- - Tasks with no basis in the spec (scope creep).
227
- - Constitution NON-NEGOTIABLE gaps: missing ATNA audit task, hard-delete instead of
228
- soft-delete, missing ETag/If-Match concurrency, PHI in logs, free-text where a coded
229
- value object is required, a second FHIR write path, banned packages.
230
- - Terminology / naming drift between artifacts.
231
- Fix everything it flags by amending spec/plan/tasks, then re-run until clean.
232
-
233
- CONTEXT FILES TO ADD
234
- docs/domainspecs/healthcare/hl7.md (verify HL7 coverage) <-- HL7
235
- docs/domainspecs/healthcare/hipaa.md
236
- docs/domainspecs/healthcare/auditing.domain.md
237
- docs/governance/coding-standards.md (+ .domain.md)
238
- docs/domainspecs/healthcare/ai-rules.domain.md
239
-
240
- COMMAND
241
- /aw-spec-analyze @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/auditing.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/domainspecs/healthcare/ai-rules.domain.md
242
-
243
- MANUAL TEXT
244
- (none — review the report, then amend spec/plan/tasks for any finding and re-run)
245
-
246
-
247
- ================================================================================
248
- STEP 6 — /aw-spec-implement (execute the tasks / write the code)
249
- ================================================================================
250
- PURPOSE
251
- Execute tasks.md and produce the actual source under src/ following the standards.
252
- Add the full implementation context: tasks-set + HL7 + dependency/versioning +
253
- FHIR/terminology + data-classification/zero-trust.
254
-
255
- CONTEXT FILES TO ADD
256
- (everything from STEP 4) PLUS:
257
- docs/domainspecs/healthcare/hl7.md (already in step 4 — keep) <-- HL7
258
- docs/governance/dependency-policy.md (+ .domain.md)
259
- docs/governance/api-versioning.md (+ .domain.md)
260
- docs/domainspecs/healthcare/terminology.md
261
- docs/security/data-classification.md (+ .domain.md)
262
- docs/security/zero-trust.md (+ .domain.md)
263
-
264
- COMMAND (copy-paste, single line)
265
- /aw-spec-implement Implement the RegisterPatient tasks exactly per the loaded standards. Generate the complete vertical slice (Domain/Persistence/Features/Shared), the Interop/Hl7v2 ADT^A04 inbound adapter + outbound ADT emitter (MLLP + ACK, no direct aggregate writes), the FHIR R4 Patient projector, unit + integration + FHIR-validator + HL7-conformance tests, and the EF migration. Honor every NON-NEGOTIABLE: Result pattern, ETag/If-Match concurrency, soft-delete, ATNA audit, minimum-necessary, no PHI in logs, coded value objects, inbound feeds via adapters only, no banned packages. Do not run migrations against shared environments. @docs/architecture/folder-structure.md @docs/architecture/vertical-slices.md @docs/domainspecs/healthcare/vertical-slices.domain.md @docs/architecture/cqrs.md @docs/domainspecs/healthcare/cqrs.domain.md @docs/architecture/persistence.md @docs/domainspecs/healthcare/persistence.domain.md @docs/architecture/testing.md @docs/domainspecs/healthcare/testing.domain.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/domain/domain-driven-design.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/security/data-classification.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/security/zero-trust.md @docs/domainspecs/healthcare/zero-trust.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/governance/dependency-policy.md @docs/domainspecs/healthcare/dependency-policy.domain.md @docs/governance/api-versioning.md @docs/domainspecs/healthcare/api-versioning.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
266
-
267
- MANUAL TEXT (the prompt portion, for reference)
268
- Implement the RegisterPatient tasks exactly per the loaded standards. Generate the
269
- complete vertical slice (Domain/Persistence/Features/Shared), the Interop/Hl7v2 ADT^A04
270
- inbound adapter + outbound ADT emitter (MLLP + ACK, no direct aggregate writes), the
271
- FHIR R4 Patient projector, unit + integration + FHIR-validator + HL7-conformance tests,
272
- and the EF migration. Honor every NON-NEGOTIABLE: Result pattern, ETag/If-Match
273
- concurrency, soft-delete, ATNA audit, minimum-necessary, no PHI in logs, coded value
274
- objects, inbound feeds via adapters only, no banned packages. Do not run migrations
275
- against shared environments.
276
-
277
-
278
- ================================================================================
279
- QUICK REFERENCE — order of operations (all required for this feature)
280
- ================================================================================
281
- (0) /aw-spec-select-domain ... one-time: set active domain (healthcare) -> .aw-spec/domain.json
282
- (0b) /aw-spec-constitution ... one-time, if not yet ratified
283
- 1. /aw-spec-specify ... Patient/RegisterPatient + domain/glossary + HL7 context
284
- 2. /aw-spec-clarify ... correctness gate: resolve HL7/PHI/identity ambiguities
285
- 3. /aw-spec-plan ... architecture + domain + HL7/eventing + security + governance
286
- 4. /aw-spec-tasks ... tasks-set + HL7 adapter/conformance tasks
287
- 5. /aw-spec-analyze ... correctness gate: spec<->plan<->tasks + NON-NEGOTIABLE coverage
288
- 6. /aw-spec-implement ... full build: slice + HL7 adapters + FHIR + tests + migration
289
-
290
- All steps after /aw-spec-specify auto-resolve specs/Patient/RegisterPatient/ from
291
- .aw-spec/feature.json — do not repeat the Patient/RegisterPatient token.
292
-
293
- HL7 v2 is threaded through every step (docs/domainspecs/healthcare/hl7.md + docs/domainspecs/healthcare/eventing.domain.md) because inbound
294
- ADT^A04 ingestion and outbound ADT emission are first-class surfaces of this feature, not an
295
- afterthought — interoperability is a NON-NEGOTIABLE constitution principle (XIV).
@@ -1,86 +0,0 @@
1
- # Pharma Constitution — Domain Addenda
2
-
3
- > **Domain addenda to the technology constitution.** Not ratified on its own — compose it with
4
- > the technology base.
5
-
6
- ## How to use (compose-at-ratification)
7
-
8
- The technology base (`docs/technology-constitution.md`) **auto-loads** for `/aw-spec-constitution`,
9
- so you pass only this domain addenda:
10
-
11
- ```
12
- /aw-spec-constitution @docs/pharma-constitution.md
13
- ```
14
-
15
- This file supplies **only** the pharma deltas: project identity, regulatory posture, the pharma
16
- domain principles (which **continue** the technology numbering at **XVI**), folder additions,
17
- governance overrides, and the active-domain pointer. The reusable principles I–XV live in the
18
- technology base and are not repeated here.
19
-
20
- Active domain folder: `docs/domainspecs/pharma/` (set via `/aw-spec-select-domain pharma`).
21
-
22
- ## Project Identity (fills the technology base)
23
-
24
- - **Project name:** `<SampleProjectName>` — Medicinal Product Registry (Headless API).
25
- - **Mission:** maintain a centralized, authoritative registry of medicinal products in compliance with pharmaceutical industry standards, regulatory requirements, and healthcare interoperability specifications; exposed as a headless HTTP + FHIR API ready for integration with prescribing, dispensing, manufacturing, pharmacovigilance, and clinical systems.
26
- - **Bounded contexts (modules):** enumerated in `docs/domainspecs/pharma/domain-requirements.md` (project-specific).
27
- - **Architecture posture:** Modular Monolith with Clean Architecture + DDD; `MedicinalProduct` is the Aggregate Root; each module designed for clean extraction into an independent microservice. **HEADLESS.**
28
-
29
- ## Regulatory Posture
30
-
31
- Built for regulatory compliance **readiness** — auditability, traceability, data integrity, and
32
- provenance are designed in. Data-integrity expectations follow **ALCOA+** for GxP-relevant
33
- product records. Identifier standards (NDC), substance identity (UNII), classification (WHO
34
- ATC), and ISO IDMP concept alignment are first-class. Data residency configurable per deployment.
35
-
36
- ## Domain Principles
37
-
38
- > Extend the technology Core Principles; numbering **continues from XV**.
39
-
40
- ### XVI — Pharmaceutical Product Identification (NON-NEGOTIABLE)
41
- NDC modeled as a Value Object with discrete Labeler/Product/Package segments; NDC uniqueness enforced (aggregate + persistence constraint); NDC validation rules configurable; no invented NDC/Labeler codes. The domain model aligns with ISO IDMP concepts (Medicinal Product, Manufactured Item, Pharmaceutical Product, Substance, MAH, Packaging, Strength, Route of Administration).
42
- → `docs/domainspecs/pharma/ndc.md`, `idmp.md`
43
-
44
- ### XVII — Pharma Terminology & Classification (NON-NEGOTIABLE)
45
- Coded data uses standard terminologies — UNII (substances), RxNorm (clinical drug), SNOMED CT (dose form / route / classification), UCUM (units), and WHO ATC (therapeutic classification). Every coded field is a Codeable value object; lookup/validation via the Terminology module; ATC codes validated against configured code sets (multiple ATC per product allowed); no invented or free-text codes.
46
- → `docs/domainspecs/pharma/terminology.md`, `atc.md`
47
-
48
- ### XVIII — Regulatory Compliance: Audit, Provenance & Versioning (NON-NEGOTIABLE)
49
- Immutable audit records (User, Timestamp, Action, Previous Value, New Value) for product creation, modification, retirement, identifier changes, and classification changes; `AuditRecord` is append-only. Provenance captured for externally sourced product data (source, method, agent, timestamp). Full version history of product information; historical versions remain queryable. Extends technology **X** and **XIV** with pharma compliance controls.
50
- → `docs/domainspecs/pharma/regulatory-compliance.md`, `data-provenance.md`, `auditing.domain.md`, `persistence.domain.md`
51
-
52
- ### XIX — Medicinal Product Lifecycle Integrity (NON-NEGOTIABLE)
53
- MedicinalProduct lifecycle (Draft → Under Review → Approved → Active → Discontinued/Withdrawn) is a guarded state machine; only valid transitions are permitted; registration completeness (required attributes, ≥ 1 active ingredient, ≥ 1 packaging, valid NDC/dosage-form/route/ATC) is enforced before leaving Draft; retirement is a logical state change, never a hard delete. Each transition emits a domain event and is audit-mandatory.
54
- → `docs/domainspecs/pharma/product-lifecycle.domain.md`, `domain-driven-design.domain.md`, `eventing.domain.md`
55
-
56
- ### XX — Healthcare Interoperability Readiness
57
- The model maps to FHIR Medication / MedicationKnowledge / Substance / Organization (projections, not the system of record); product identifiers map to FHIR Identifier; coded fields map to CodeableConcept/Coding; the solution supports future HL7-based integration via Interop adapters. Extends technology **XII** and **XIV** with the FHIR contract.
58
- → `docs/domainspecs/pharma/fhir.md`, `hl7.md`
59
-
60
- ## Folder Structure Additions
61
-
62
- - Pharma additions (Interop/Fhir + Hl7v2 adapters, InteropTests, terminology seed fixtures, provenance/version-history stores): `docs/domainspecs/pharma/folder-structure.domain.md`
63
-
64
- ## Security & Governance Addenda
65
-
66
- - **Change authority** (who may register / approve / retire products, and change identifiers or classification): `docs/domainspecs/pharma/authorization.domain.md`
67
- - **Data classification** (public vs commercially-sensitive / pre-market / externally-sourced; GxP/ALCOA+ integrity): `docs/domainspecs/pharma/data-classification.domain.md`
68
- - **Zero-trust posture** (transport, scope/trace propagation, change-authority enforcement): `docs/domainspecs/pharma/zero-trust.domain.md`
69
- - **Coding standards** (forbidden patterns, quality gates): `docs/domainspecs/pharma/coding-standards.domain.md`
70
- - **API/contract versioning** (FHIR + NDC identifier stability): `docs/domainspecs/pharma/api-versioning.domain.md`
71
- - **Dependency policy** (FHIR SDK, terminology libraries, regulatory suitability): `docs/domainspecs/pharma/dependency-policy.domain.md`
72
-
73
- ## AI Rules Addenda
74
-
75
- - Identifier/code safety (no invented NDC/UNII/RxNorm/SNOMED/ATC), projection discipline, lifecycle/audit edit limits, pharma refusal conditions: `docs/domainspecs/pharma/ai-rules.domain.md` (extends `docs/glossary/ai-rules.md`)
76
-
77
- ## Governance Overrides
78
-
79
- - Mandatory approver for any identifier (NDC), classification (ATC), or lifecycle-rule change: Regulatory/Compliance Officer (in addition to a Principal Engineer and a Domain Owner). Change-authority roles are defined in `docs/domainspecs/pharma/authorization.domain.md`.
80
- - Additional review required after every relevant regulatory or terminology-release update (e.g. WHO ATC annual update, FDA NDC directory changes).
81
- - **Versioning note:** any change to NDC identity rules, the lifecycle state machine, the audit-record shape, or the canonical FHIR interoperability surface is a MAJOR bump.
82
-
83
- ## Domain Requirements Pointer
84
-
85
- → `docs/domainspecs/pharma/domain-requirements.md`
86
- (`[DOMAIN: Bounded Contexts / Modules]`, per-subsection pointers, `[DOMAIN: Platform Topology]`, `[DOMAIN: Governance Overrides]`).