aw-spec-cli 0.1.4 → 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 (254) hide show
  1. package/assets/.agents/agent.json +28 -0
  2. package/assets/.agents/skills/aw-spec-orch/SKILL.md +56 -0
  3. package/assets/.agents/skills/aw-spec-orch-demo/SKILL.md +59 -0
  4. package/assets/.aw-spec/DESIGN-FORMAT.md +151 -0
  5. package/assets/.aw-spec/ORCH-DIALECT.md +156 -0
  6. package/assets/.aw-spec/RULE-PARTITION.md +126 -0
  7. package/assets/.aw-spec/extensions/agent-context/extension.yml +12 -9
  8. package/assets/.aw-spec/extensions.yml +12 -19
  9. package/assets/.aw-spec/integrations/aw-spec.manifest.json +1 -9
  10. package/assets/.aw-spec/interpreter/run-skill.py +1158 -0
  11. package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +94 -0
  12. package/assets/.aw-spec/orchestrator/README.md +300 -0
  13. package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +74 -0
  14. package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +74 -0
  15. package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +105 -0
  16. package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +79 -0
  17. package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +81 -0
  18. package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +75 -0
  19. package/assets/.aw-spec/orchestrator/orchestrator.py +1721 -0
  20. package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  21. package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +59 -0
  22. package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +97 -0
  23. package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +61 -0
  24. package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  25. package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  26. package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  27. package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  28. package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +160 -0
  29. package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +244 -0
  30. package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +775 -0
  31. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +248 -0
  32. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +261 -0
  33. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +425 -0
  34. package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +188 -0
  35. package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +474 -0
  36. package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  37. package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +284 -0
  38. package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +103 -0
  39. package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  40. package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  41. package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  42. package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +382 -0
  43. package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +246 -0
  44. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +231 -0
  45. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +258 -0
  46. package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +236 -0
  47. package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +949 -0
  48. package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  49. package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +177 -0
  50. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +79 -0
  51. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  52. package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +412 -0
  53. package/assets/.aw-spec/scripts/bash/aw-inventory.sh +14 -0
  54. package/assets/.aw-spec/scripts/bash/aw-parity.sh +13 -0
  55. package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +13 -0
  56. package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +1899 -0
  57. package/assets/.aw-spec/scripts/bash/aw-xref.sh +15 -0
  58. package/assets/.aw-spec/scripts/bash/common.sh +11 -60
  59. package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +14 -0
  60. package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +13 -0
  61. package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  62. package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +1563 -0
  63. package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +15 -0
  64. package/assets/.aw-spec/scripts/python/aw-inventory.py +683 -0
  65. package/assets/.aw-spec/scripts/python/aw-parity.py +380 -0
  66. package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +312 -0
  67. package/assets/.aw-spec/scripts/python/aw-xref.py +1330 -0
  68. package/assets/.aw-spec/scripts/python/validate_okf.py +349 -0
  69. package/assets/.aw-spec/templates/constitution-domain-template.md +75 -0
  70. package/assets/.aw-spec/templates/constitution-technical-template.md +70 -0
  71. package/assets/.aw-spec/templates/delta-design-template.md +69 -0
  72. package/assets/.aw-spec/templates/delta-spec-template.md +60 -0
  73. package/assets/.aw-spec/templates/design-template.md +383 -0
  74. package/assets/.aw-spec/templates/okf-concept-template.md +103 -0
  75. package/assets/.aw-spec/templates/parity-manifest-template.json +49 -0
  76. package/assets/.aw-spec/templates/source-map-template.md +85 -0
  77. package/assets/.aw-spec/templates/spec-template.md +192 -71
  78. package/assets/.claude/agent.json +27 -0
  79. package/assets/.claude/skills/aw-spec-orch/SKILL.md +55 -0
  80. package/assets/.claude/skills/aw-spec-orch-demo/SKILL.md +59 -0
  81. package/assets/.kilocode/agent.json +28 -0
  82. package/assets/.kilocode/workflows/aw-spec-orch-demo.md +59 -0
  83. package/assets/.kilocode/workflows/aw-spec-orch.md +55 -0
  84. package/assets/docs/architecture/clean-architecture.md +1 -1
  85. package/assets/docs/architecture/cqrs.md +1 -1
  86. package/assets/docs/architecture/eventing.md +1 -1
  87. package/assets/docs/architecture/folder-structure.md +1 -1
  88. package/assets/docs/architecture/modular-monolith.md +1 -1
  89. package/assets/docs/architecture/persistence.md +1 -1
  90. package/assets/docs/architecture/testing.md +1 -1
  91. package/assets/docs/architecture/vertical-slices.md +1 -1
  92. package/assets/docs/components/Email/README.md +1 -1
  93. package/assets/docs/components/Jobs/README.md +1 -1
  94. package/assets/docs/components/QrGenerator/README.md +1 -1
  95. package/assets/docs/components/README.md +1 -1
  96. package/assets/docs/domain/domain-driven-design.md +1 -1
  97. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +1 -1
  98. package/assets/docs/domainspecs/healthcare/auditing.domain.md +86 -18
  99. package/assets/docs/domainspecs/healthcare/authorization.domain.md +1 -1
  100. package/assets/docs/domainspecs/healthcare/clinical-terms.md +1 -1
  101. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +1 -1
  102. package/assets/docs/domainspecs/healthcare/comandrulemap.md +58 -124
  103. package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +119 -0
  104. package/assets/docs/domainspecs/healthcare/consent.md +1 -1
  105. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +1 -1
  106. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +1 -1
  107. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +1 -1
  108. package/assets/docs/domainspecs/healthcare/dicom.md +1 -1
  109. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +1 -1
  110. package/assets/docs/domainspecs/healthcare/eventing.domain.md +1 -1
  111. package/assets/docs/domainspecs/healthcare/fhir.md +1 -1
  112. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +1 -1
  113. package/assets/docs/domainspecs/healthcare/hipaa.md +1 -1
  114. package/assets/docs/domainspecs/healthcare/hl7.md +1 -1
  115. package/assets/docs/domainspecs/healthcare/integration-terms.md +1 -1
  116. package/assets/docs/domainspecs/healthcare/persistence.domain.md +1 -1
  117. package/assets/docs/domainspecs/healthcare/terminology.md +1 -1
  118. package/assets/docs/domainspecs/healthcare/testing.domain.md +1 -1
  119. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +1 -1
  120. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +1 -1
  121. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +1 -1
  122. package/assets/docs/domainspecs/pharma/atc.md +1 -1
  123. package/assets/docs/domainspecs/pharma/auditing.domain.md +80 -16
  124. package/assets/docs/domainspecs/pharma/authorization.domain.md +1 -1
  125. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +1 -1
  126. package/assets/docs/domainspecs/pharma/comandrulemap.md +64 -142
  127. package/assets/docs/domainspecs/pharma/commandtechrulemap.md +119 -0
  128. package/assets/docs/domainspecs/pharma/cqrs.domain.md +1 -1
  129. package/assets/docs/domainspecs/pharma/data-classification.domain.md +1 -1
  130. package/assets/docs/domainspecs/pharma/data-provenance.md +1 -1
  131. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +1 -1
  132. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +1 -1
  133. package/assets/docs/domainspecs/pharma/eventing.domain.md +1 -1
  134. package/assets/docs/domainspecs/pharma/fhir.md +1 -1
  135. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +1 -1
  136. package/assets/docs/domainspecs/pharma/hl7.md +1 -1
  137. package/assets/docs/domainspecs/pharma/idmp.md +1 -1
  138. package/assets/docs/domainspecs/pharma/integration-terms.md +1 -1
  139. package/assets/docs/domainspecs/pharma/ndc.md +1 -1
  140. package/assets/docs/domainspecs/pharma/persistence.domain.md +1 -1
  141. package/assets/docs/domainspecs/pharma/pharma-terms.md +1 -1
  142. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +1 -1
  143. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +1 -1
  144. package/assets/docs/domainspecs/pharma/terminology.md +1 -1
  145. package/assets/docs/domainspecs/pharma/testing.domain.md +1 -1
  146. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +1 -1
  147. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +1 -1
  148. package/assets/docs/governance/api-versioning.md +1 -1
  149. package/assets/docs/governance/coding-standards.md +1 -1
  150. package/assets/docs/governance/dependency-policy.md +1 -1
  151. package/assets/docs/requirement-spec.txt +27 -0
  152. package/assets/docs/security/auditing.md +54 -11
  153. package/assets/docs/security/authorization.md +1 -1
  154. package/assets/docs/security/data-classification.md +1 -1
  155. package/assets/docs/security/zero-trust.md +1 -1
  156. package/dist/commands/init.d.ts.map +1 -1
  157. package/dist/commands/init.js +7 -54
  158. package/dist/commands/init.js.map +1 -1
  159. package/dist/index.js +0 -2
  160. package/dist/index.js.map +1 -1
  161. package/dist/utils/paths.js +2 -2
  162. package/dist/utils/paths.js.map +1 -1
  163. package/package.json +1 -1
  164. package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
  165. package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  166. package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
  167. package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
  168. package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
  169. package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
  170. package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
  171. package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
  172. package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
  173. package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  174. package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
  175. package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
  176. package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
  177. package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
  178. package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  179. package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
  180. package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
  181. package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
  182. package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
  183. package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
  184. package/assets/.aw-spec/templates/checklist-template.md +0 -40
  185. package/assets/.aw-spec/templates/constitution-template.md +0 -57
  186. package/assets/.aw-spec/templates/plan-template.md +0 -113
  187. package/assets/.aw-spec/templates/tasks-template.md +0 -252
  188. package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
  189. package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
  190. package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
  191. package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  192. package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
  193. package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
  194. package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
  195. package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
  196. package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
  197. package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
  198. package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
  199. package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  200. package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
  201. package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
  202. package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
  203. package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
  204. package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  205. package/assets/.kilocode/rules/specify-rules.md +0 -4
  206. package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
  207. package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
  208. package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
  209. package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
  210. package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
  211. package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
  212. package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
  213. package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
  214. package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
  215. package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
  216. package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
  217. package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
  218. package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
  219. package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
  220. package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
  221. package/assets/docs/UI.Visualization/PACKAGING.md +0 -191
  222. package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +0 -11768
  223. package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +0 -11214
  224. package/assets/docs/UI.Visualization/pack-foundation.ps1 +0 -165
  225. package/assets/docs/UI.Visualization/pack-foundation.sh +0 -206
  226. package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +0 -159
  227. package/assets/docs/UI.Visualization/pack-reference-foundation.sh +0 -205
  228. package/assets/docs/UI.Visualization/unpack-foundation.ps1 +0 -126
  229. package/assets/docs/UI.Visualization/unpack-foundation.sh +0 -217
  230. package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +0 -129
  231. package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +0 -218
  232. package/assets/docs/command.txt +0 -295
  233. package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +0 -70
  234. package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +0 -58
  235. package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +0 -62
  236. package/assets/docs/domainspecs/UIVisualization/chart-network.md +0 -69
  237. package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +0 -75
  238. package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +0 -66
  239. package/assets/docs/domainspecs/UIVisualization/chart-survival.md +0 -69
  240. package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +0 -68
  241. package/assets/docs/domainspecs/UIVisualization/chart-violin.md +0 -61
  242. package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +0 -63
  243. package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +0 -80
  244. package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +0 -87
  245. package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +0 -47
  246. package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +0 -130
  247. package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +0 -67
  248. package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +0 -68
  249. package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +0 -110
  250. package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +0 -55
  251. package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +0 -67
  252. package/assets/docs/domainspecs/UIVisualization/testing.domain.md +0 -52
  253. package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +0 -39
  254. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -1,218 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # unpack-reference-foundation.sh — bash/macOS port of unpack-reference-foundation.ps1
4
- #
5
- # SYNOPSIS
6
- # Unpack an AW-Spec reference pack file into a target project, renaming the
7
- # sentinel app name to the caller's app name.
8
- #
9
- # DESCRIPTION
10
- # Reads --pack-file (produced by pack-reference-foundation.sh/.ps1), takes the sentinel
11
- # from its header (override with --sentinel), derives four case forms of the target app
12
- # name, and writes every file block to --out-dir with the sentinel rewritten in both file
13
- # CONTENTS and file/dir PATHS. Text blocks are rewritten and written as UTF-8; base64
14
- # blocks are decoded as-is. Refuses to overwrite existing files unless --force.
15
- #
16
- # EXAMPLE
17
- # ./unpack-reference-foundation.sh \
18
- # --pack-file ./UI.Visualization.Reference.pack.txt \
19
- # --target-app-name MyApp \
20
- # --out-dir ../../
21
- #
22
- set -euo pipefail
23
-
24
- # ------------------------------------------------------------------ defaults ---
25
- PACK_FILE=''
26
- TARGET_APP_NAME=''
27
- OUT_DIR='.'
28
- SENTINEL=''
29
- FORCE=0
30
- DRYRUN=0
31
-
32
- usage() {
33
- cat >&2 <<'EOF'
34
- Usage: unpack-reference-foundation.sh --pack-file <file> --target-app-name <name>
35
- [--out-dir <dir>] [--sentinel <name>]
36
- [--force] [--dry-run]
37
-
38
- -p, --pack-file <file> Reference pack file to unpack (required)
39
- -t, --target-app-name <name> New app name to rename the sentinel into (required)
40
- -o, --out-dir <dir> Output root (default: .)
41
- --sentinel <name> Override the sentinel from the pack header
42
- --force Overwrite files that already exist
43
- --dry-run List what would be written, write nothing
44
- -h, --help Show this help
45
-
46
- Positional fallback: unpack-reference-foundation.sh <pack-file> <target-app-name> [out-dir]
47
- EOF
48
- }
49
-
50
- # -------------------------------------------------------------- arg parsing ---
51
- while [ $# -gt 0 ]; do
52
- case "$1" in
53
- -p|--pack-file) PACK_FILE="${2:?--pack-file needs a value}"; shift 2 ;;
54
- -t|--target-app-name) TARGET_APP_NAME="${2:?--target-app-name needs a value}"; shift 2 ;;
55
- -o|--out-dir) OUT_DIR="${2:?--out-dir needs a value}"; shift 2 ;;
56
- --sentinel) SENTINEL="${2:?--sentinel needs a value}"; shift 2 ;;
57
- --force) FORCE=1; shift ;;
58
- --dry-run) DRYRUN=1; shift ;;
59
- -h|--help) usage; exit 0 ;;
60
- --) shift; break ;;
61
- -*) echo "Error: unknown option: $1" >&2; usage; exit 2 ;;
62
- *)
63
- if [ -z "$PACK_FILE" ]; then PACK_FILE="$1"
64
- elif [ -z "$TARGET_APP_NAME" ]; then TARGET_APP_NAME="$1"
65
- else OUT_DIR="$1"
66
- fi
67
- shift ;;
68
- esac
69
- done
70
-
71
- [ -n "$PACK_FILE" ] || { echo "Error: --pack-file is required." >&2; usage; exit 2; }
72
- [ -n "$TARGET_APP_NAME" ] || { echo "Error: --target-app-name is required." >&2; usage; exit 2; }
73
- [ -f "$PACK_FILE" ] || { echo "Error: pack file not found: $PACK_FILE" >&2; exit 1; }
74
-
75
- case "$TARGET_APP_NAME" in
76
- *[!A-Za-z0-9._-]*)
77
- echo "Error: --target-app-name may contain only letters, digits, '.', '_' or '-': $TARGET_APP_NAME" >&2
78
- exit 2 ;;
79
- esac
80
-
81
- # ------------------------------------------------ sentinel from header --------
82
- if [ -z "$SENTINEL" ]; then
83
- SENTINEL="$(LC_ALL=C sed -n 's/^#[[:space:]]*sentinel:[[:space:]]*\(.*[^[:space:]]\)[[:space:]]*$/\1/p' "$PACK_FILE" | head -n1)"
84
- fi
85
- [ -n "$SENTINEL" ] || { echo "Error: Sentinel not found in pack header; supply it with --sentinel." >&2; exit 1; }
86
-
87
- # ------------------------------------------------ derive case forms -----------
88
- to_lower() { printf '%s' "$1" | LC_ALL=C tr '[:upper:]' '[:lower:]'; }
89
-
90
- S_DOT="$SENTINEL"; T_DOT="$TARGET_APP_NAME"
91
- S_UND="${SENTINEL//./_}"; T_UND="${TARGET_APP_NAME//./_}"
92
- s_low="$(to_lower "$SENTINEL")"; t_low="$(to_lower "$TARGET_APP_NAME")"
93
- S_HYP="${s_low//./-}"; T_HYP="${t_low//./-}"
94
- S_LDOT="$s_low"; T_LDOT="$t_low"
95
-
96
- FROM=(); TO=()
97
- add_form() {
98
- local from="$1" to="$2" e
99
- [ -n "$from" ] || return 0
100
- [ "$from" = "$to" ] && return 0
101
- if [ "${#FROM[@]}" -gt 0 ]; then
102
- for e in "${FROM[@]}"; do [ "$e" = "$from" ] && return 0; done
103
- fi
104
- FROM+=("$from"); TO+=("$to")
105
- }
106
- add_form "$S_DOT" "$T_DOT"
107
- add_form "$S_UND" "$T_UND"
108
- add_form "$S_HYP" "$T_HYP"
109
- add_form "$S_LDOT" "$T_LDOT"
110
-
111
- # Sort indices by FROM length descending
112
- ORDER=()
113
- {
114
- local_n="${#FROM[@]}"
115
- used=(); for ((k = 0; k < local_n; k++)); do used[$k]=0; done
116
- for ((pass = 0; pass < local_n; pass++)); do
117
- best=-1; bestlen=-1
118
- for ((j = 0; j < local_n; j++)); do
119
- if [ "${used[$j]}" -eq 0 ] && [ "${#FROM[$j]}" -gt "$bestlen" ]; then
120
- bestlen="${#FROM[$j]}"; best="$j"
121
- fi
122
- done
123
- used[$best]=1; ORDER+=("$best")
124
- done
125
- }
126
-
127
- REPL_OUT=''
128
- apply_repl() {
129
- local text="$1" idx from to
130
- if [ "${#ORDER[@]}" -gt 0 ]; then
131
- for idx in "${ORDER[@]}"; do
132
- from="${FROM[$idx]}"; to="${TO[$idx]}"
133
- text="${text//"$from"/$to}"
134
- done
135
- fi
136
- REPL_OUT="$text"
137
- }
138
-
139
- # ------------------------------------------------ output root ----------------
140
- [ -d "$OUT_DIR" ] || mkdir -p "$OUT_DIR"
141
- OUT_ROOT="$(cd "$OUT_DIR" && pwd -P)"
142
-
143
- # ------------------------------------------------ base64 decoder (portable) --
144
- B64D=()
145
- if printf 'aGk=' | base64 -d >/dev/null 2>&1; then B64D=(base64 -d)
146
- elif printf 'aGk=' | base64 -D >/dev/null 2>&1; then B64D=(base64 -D)
147
- elif printf 'aGk=' | base64 --decode >/dev/null 2>&1; then B64D=(base64 --decode)
148
- else B64D=(openssl base64 -d -A)
149
- fi
150
-
151
- # ------------------------------------------------ parse file blocks ----------
152
- rels=(); encs=(); contents=()
153
- in_block=0; cur_rel=''; cur_enc=''; cur_content=''; first_line=1
154
- file_re='^<<<FILE path="([^"]+)"( encoding="([^"]+)")?>>>[[:space:]]*$'
155
-
156
- while IFS= read -r line || [ -n "$line" ]; do
157
- line="${line%$'\r'}"
158
- if [ "$in_block" -eq 0 ]; then
159
- if [[ "$line" =~ $file_re ]]; then
160
- cur_rel="${BASH_REMATCH[1]}"
161
- cur_enc="${BASH_REMATCH[3]:-}"
162
- in_block=1; first_line=1; cur_content=''
163
- fi
164
- else
165
- if [ "$line" = '<<<ENDFILE>>>' ]; then
166
- rels+=("$cur_rel"); encs+=("$cur_enc"); contents+=("$cur_content")
167
- in_block=0
168
- elif [ "$first_line" -eq 1 ]; then
169
- cur_content="$line"; first_line=0
170
- else
171
- cur_content="$cur_content"$'\n'"$line"
172
- fi
173
- fi
174
- done < "$PACK_FILE"
175
-
176
- [ "${#rels[@]}" -gt 0 ] || { echo "Error: No <<<FILE>>> blocks found in pack: $PACK_FILE" >&2; exit 1; }
177
-
178
- # ------------------------------------------------ resolve destinations -------
179
- dests=()
180
- for ((i = 0; i < ${#rels[@]}; i++)); do
181
- apply_repl "${rels[$i]}"
182
- dests+=("$OUT_ROOT/$REPL_OUT")
183
- done
184
-
185
- # ------------------------------------------------ conflict guard -------------
186
- if [ "$FORCE" -eq 0 ] && [ "$DRYRUN" -eq 0 ]; then
187
- conflicts=()
188
- for d in "${dests[@]}"; do [ -e "$d" ] && conflicts+=("$d"); done
189
- if [ "${#conflicts[@]}" -gt 0 ]; then
190
- echo "Error: Refusing to overwrite existing files (re-run with --force):" >&2
191
- printf ' %s\n' "${conflicts[@]}" >&2
192
- exit 1
193
- fi
194
- fi
195
-
196
- # ------------------------------------------------ write ----------------------
197
- written=0
198
- for ((i = 0; i < ${#rels[@]}; i++)); do
199
- rel="${rels[$i]}"; enc="${encs[$i]}"; dest="${dests[$i]}"
200
- if [ "$DRYRUN" -eq 1 ]; then
201
- echo "WOULD WRITE $rel -> $dest"
202
- continue
203
- fi
204
- mkdir -p "$(dirname "$dest")"
205
- if [ "$enc" = 'base64' ]; then
206
- printf '%s' "${contents[$i]}" | tr -d '[:space:]' | "${B64D[@]}" > "$dest"
207
- else
208
- apply_repl "${contents[$i]}"
209
- printf '%s' "$REPL_OUT" > "$dest"
210
- fi
211
- written=$((written + 1))
212
- done
213
-
214
- if [ "$DRYRUN" -eq 1 ]; then
215
- echo "DryRun: ${#rels[@]} file(s) would be written to $OUT_ROOT (sentinel '$SENTINEL' -> '$TARGET_APP_NAME')."
216
- else
217
- echo "Unpacked $written file(s) to $OUT_ROOT (sentinel '$SENTINEL' -> '$TARGET_APP_NAME')."
218
- fi
@@ -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,70 +0,0 @@
1
- # BubbleChart — Chart Rule
2
-
3
- > Load **only when "Bubble" (or "all plots") is in the selection** (see [[domain-requirements]]).
4
- > Component: `BubbleChart` in `components/charts/generic/BubbleChart.tsx`. Built on [[charting-standards.domain]].
5
-
6
- ## Purpose
7
- Multi-dimensional scatter — each point encodes **x, y, size, colour, label** (up to 5 dimensions).
8
- Use for potency vs MW, portfolio risk/return, effort vs impact, market mapping.
9
-
10
- ## Props contract
11
- ```ts
12
- interface BubblePoint { x: number; y: number; size: number; label: string; meta?: Record<string, string|number> }
13
- interface BubbleSeries { seriesLabel: string; color?: string; points: BubblePoint[] }
14
-
15
- interface BubbleChartProps {
16
- series: BubbleSeries[] // REQUIRED — one series per colour/category
17
- xLabel: string // REQUIRED
18
- yLabel: string // REQUIRED
19
- sizeLabel?: string // shown as "Bubble size ∝ …" annotation
20
- title?: string
21
- xAxisType?: 'linear' | 'log'
22
- yAxisType?: 'linear' | 'log'
23
- sizeRange?: [number, number] // [minPx, maxPx] bubble diameter (default [8,40])
24
- xRefLine?: number; xRefLabel?: string // optional vertical reference line
25
- yRefLine?: number; yRefLabel?: string // optional horizontal reference line
26
- height?: number
27
- showLabels?: boolean // annotate points with their label
28
- }
29
- ```
30
-
31
- ## Rules
32
- - Bubble sizes are **normalised across the whole dataset** to `sizeRange` — pass raw magnitudes;
33
- the chart scales them. Don't pre-scale to pixels.
34
- - Group points into **series by the categorical dimension** (target, region, product line) so
35
- colour + legend come for free.
36
- - Use `xAxisType="log"` / `yAxisType="log"` or pre-`log10` the value (e.g. IC₅₀) — pick one,
37
- document it in the axis label.
38
-
39
- ## Adapter example (agent reference)
40
- ```tsx
41
- 'use client'
42
- import { BubbleChart } from '@/components/charts/generic'
43
- import type { Compound } from '@/lib/types/pharma'
44
-
45
- export function compoundsToBubbleSeries(compounds: Compound[]) {
46
- const targets = [...new Set(compounds.map(c => c.target))]
47
- return targets.map(t => ({
48
- seriesLabel: t,
49
- points: compounds.filter(c => c.target === t).map(c => ({
50
- x: c.molecularWeight, y: Math.log10(c.ic50_nM),
51
- size: c.selectivityRatio, label: c.name,
52
- meta: { Status: c.status, 'IC₅₀': `${c.ic50_nM} nM` },
53
- })),
54
- }))
55
- }
56
-
57
- export default function CompoundScatterPlot({ compounds, height }: { compounds: Compound[]; height?: number }) {
58
- return (
59
- <BubbleChart series={compoundsToBubbleSeries(compounds)}
60
- xLabel="Molecular Weight (Da)" yLabel="log₁₀(IC₅₀, nM)" sizeLabel="Selectivity Ratio"
61
- xRefLine={500} xRefLabel="Ro5 MW limit" sizeRange={[7, 28]} height={height} />
62
- )
63
- }
64
- ```
65
-
66
- ## Scaffolds when selected
67
- - generic `BubbleChart` + `app/bubble/page.tsx` + nav tab + optional adapter.
68
-
69
- ## Related
70
- - [[charting-standards.domain]] · [[component-contracts.domain]] · [[clean-architecture.domain]]
@@ -1,58 +0,0 @@
1
- # DimRedPlot — Chart Rule
2
-
3
- > Load **only when "Dim. Reduction / PCA / t-SNE / UMAP" (or "all plots") is selected** (see [[domain-requirements]]).
4
- > Component: `DimRedPlot` in `components/charts/generic/DimRedPlot.tsx`. Built on [[charting-standards.domain]].
5
-
6
- ## Purpose
7
- 2-D scatter of **pre-computed** dimensionality-reduction coordinates, coloured by group, with
8
- optional cluster-centroid labels and density contours. Use for single-cell clustering, customer
9
- segments, NLP embeddings, chemical-space maps, anomaly scatter.
10
-
11
- ## Props contract
12
- ```ts
13
- interface DimRedPoint {
14
- x: number; y: number // reduced coordinates (caller ran PCA/t-SNE/UMAP)
15
- label: string
16
- group: string // category → colour + legend entry
17
- meta?: Record<string, string|number>
18
- }
19
- interface DimRedPlotProps {
20
- points: DimRedPoint[] // REQUIRED
21
- method?: string // badge: "PCA", "t-SNE", "UMAP" (default "DR")
22
- xLabel?: string; yLabel?: string // e.g. "PC1 (34.2% var)", "UMAP 1"
23
- colorByLabel?: string // legend header / tooltip ("Cell type", "Segment")
24
- showClusterLabels?: boolean // centroid label per group (default true)
25
- showDensityContours?: boolean // KDE contour per group (default false)
26
- markerSize?: number // default 5
27
- title?: string; height?: number
28
- }
29
- ```
30
-
31
- ## Rules
32
- - The chart **does not run** PCA/t-SNE/UMAP — coordinates are computed upstream (Python,
33
- backend, or a JS lib) and passed in. Document the method in `method` + axis labels.
34
- - `group` drives colour and the legend; keep group count modest (≤ ~12) for distinct colours.
35
- - Turn on `showDensityContours` for large, overlapping point clouds; off for small datasets.
36
-
37
- ## Page/adapter example (agent reference)
38
- ```tsx
39
- 'use client'
40
- import { DimRedPlot } from '@/components/charts/generic'
41
-
42
- // cells already have umap1/umap2 + cellType from the pipeline
43
- export default function CellUmap({ cells }: { cells: { id: string; umap1: number; umap2: number; cellType: string }[] }) {
44
- return (
45
- <DimRedPlot
46
- points={cells.map(c => ({ x: c.umap1, y: c.umap2, label: c.id, group: c.cellType }))}
47
- method="UMAP" xLabel="UMAP 1" yLabel="UMAP 2" colorByLabel="Cell type" showClusterLabels
48
- />
49
- )
50
- }
51
- ```
52
-
53
- ## Scaffolds when selected
54
- - generic `DimRedPlot` + `app/dimred/page.tsx` + nav tab + optional adapter (+ a place to compute
55
- or fetch coordinates).
56
-
57
- ## Related
58
- - [[charting-standards.domain]] · [[component-contracts.domain]] · [[clean-architecture.domain]]