aw-spec-cli 0.1.7 → 0.1.9

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 (261) hide show
  1. package/assets/.appweaver/DESIGN-FORMAT.md +200 -0
  2. package/assets/.appweaver/ORCH-DIALECT.md +156 -0
  3. package/assets/.appweaver/RULE-PARTITION.md +175 -0
  4. package/assets/.appweaver/STACK-PROFILES.md +461 -0
  5. package/assets/.appweaver/ai-rules.md +180 -0
  6. package/assets/.appweaver/domain.json +1 -0
  7. package/assets/.appweaver/extensions/.registry +19 -0
  8. package/assets/.appweaver/extensions/agent-context/README.md +57 -0
  9. package/assets/.appweaver/extensions/agent-context/agent-context-config.yml +4 -0
  10. package/assets/.appweaver/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
  11. package/assets/.appweaver/extensions/agent-context/extension.yml +37 -0
  12. package/assets/.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
  13. package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  14. package/assets/.appweaver/extensions.yml +16 -0
  15. package/assets/.appweaver/feature.json +3 -0
  16. package/assets/.appweaver/init-options.json +9 -0
  17. package/assets/.appweaver/integration.json +15 -0
  18. package/assets/.appweaver/integrations/aw-spec.manifest.json +9 -0
  19. package/assets/.appweaver/interpreter/run-skill.py +1176 -0
  20. package/assets/.appweaver/memory/constitution.md +50 -0
  21. package/assets/.appweaver/orchestrator/.smoke-out/smoke.md +6 -0
  22. package/assets/.appweaver/orchestrator/AGENT-PROFILE.md +94 -0
  23. package/assets/.appweaver/orchestrator/README.md +300 -0
  24. package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +74 -0
  25. package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +74 -0
  26. package/assets/.appweaver/orchestrator/modules/delta-design.orch.yaml +105 -0
  27. package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +101 -0
  28. package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +90 -0
  29. package/assets/.appweaver/orchestrator/modules/lane-gate.orch.yaml +126 -0
  30. package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +123 -0
  31. package/assets/.appweaver/orchestrator/orchestrator.py +1721 -0
  32. package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  33. package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +101 -0
  34. package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +245 -0
  35. package/assets/.appweaver/orchestrator/rev-templates/domain-constitution.skeleton.md +63 -0
  36. package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  37. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +59 -0
  38. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  39. package/assets/.appweaver/orchestrator/rev-templates/frontend-rule-file.skeleton.md +63 -0
  40. package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +116 -0
  41. package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  42. package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  43. package/assets/.appweaver/orchestrator/rev-templates/ui-constitution.skeleton.md +125 -0
  44. package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +123 -0
  45. package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +294 -0
  46. package/assets/.appweaver/orchestrator/workflows/_smoke.orch.yaml +160 -0
  47. package/assets/.appweaver/orchestrator/workflows/aw-spec-add-component.orch.yaml +270 -0
  48. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +934 -0
  49. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +251 -0
  50. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +265 -0
  51. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +437 -0
  52. package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +197 -0
  53. package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +475 -0
  54. package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  55. package/assets/.appweaver/orchestrator/workflows/aw-spec-constitution.orch.yaml +727 -0
  56. package/assets/.appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml +100 -0
  57. package/assets/.appweaver/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  58. package/assets/.appweaver/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  59. package/assets/.appweaver/orchestrator/workflows/aw-spec-design-ui.orch.yaml +386 -0
  60. package/assets/.appweaver/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  61. package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +462 -0
  62. package/assets/.appweaver/orchestrator/workflows/aw-spec-foundation.orch.yaml +265 -0
  63. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +253 -0
  64. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-ui.orch.yaml +267 -0
  65. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +287 -0
  66. package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +238 -0
  67. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1822 -0
  68. package/assets/.appweaver/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  69. package/assets/.appweaver/orchestrator/workflows/aw-spec-run.orch.yaml +194 -0
  70. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-domain.orch.yaml +83 -0
  71. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  72. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +296 -0
  73. package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +439 -0
  74. package/assets/.appweaver/scripts/bash/aw-inventory.sh +17 -0
  75. package/assets/.appweaver/scripts/bash/aw-parity.sh +13 -0
  76. package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +13 -0
  77. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +2626 -0
  78. package/assets/.appweaver/scripts/bash/aw-xref.sh +15 -0
  79. package/assets/.appweaver/scripts/bash/common.sh +533 -0
  80. package/assets/.appweaver/scripts/powershell/aw-inventory.ps1 +17 -0
  81. package/assets/.appweaver/scripts/powershell/aw-parity.ps1 +13 -0
  82. package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  83. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +2232 -0
  84. package/assets/.appweaver/scripts/powershell/aw-xref.ps1 +15 -0
  85. package/assets/.appweaver/scripts/python/aw-component-catalog.py +121 -0
  86. package/assets/.appweaver/scripts/python/aw-inventory.py +1180 -0
  87. package/assets/.appweaver/scripts/python/aw-parity.py +380 -0
  88. package/assets/.appweaver/scripts/python/aw-rev-constitution.py +329 -0
  89. package/assets/.appweaver/scripts/python/aw-stack.py +1251 -0
  90. package/assets/.appweaver/scripts/python/aw-xref.py +1330 -0
  91. package/assets/.appweaver/scripts/python/validate_okf.py +352 -0
  92. package/assets/.appweaver/stack-profiles/angular.json +16 -0
  93. package/assets/.appweaver/stack-profiles/blazor-wasm.json +17 -0
  94. package/assets/.appweaver/stack-profiles/dotnet-webapi.json +15 -0
  95. package/assets/.appweaver/stack-profiles/go-chi.json +14 -0
  96. package/assets/.appweaver/stack-profiles/java-spring.json +16 -0
  97. package/assets/.appweaver/stack-profiles/nextjs.json +16 -0
  98. package/assets/.appweaver/stack-profiles/node-express.json +15 -0
  99. package/assets/.appweaver/stack-profiles/python-fastapi.json +16 -0
  100. package/assets/.appweaver/stack-profiles/react-vite.json +17 -0
  101. package/assets/.appweaver/stack-profiles/sveltekit.json +16 -0
  102. package/assets/.appweaver/stack-profiles/vue-vite.json +17 -0
  103. package/assets/.appweaver/stacks.json +3 -0
  104. package/assets/.appweaver/templates/constitution-domain-template.md +116 -0
  105. package/assets/.appweaver/templates/constitution-technical-template.md +108 -0
  106. package/assets/.appweaver/templates/constitution-ui-template.md +116 -0
  107. package/assets/.appweaver/templates/delta-design-template.md +69 -0
  108. package/assets/.appweaver/templates/delta-spec-template.md +63 -0
  109. package/assets/.appweaver/templates/design-template.md +383 -0
  110. package/assets/.appweaver/templates/okf-concept-template.md +114 -0
  111. package/assets/.appweaver/templates/parity-manifest-template.json +49 -0
  112. package/assets/.appweaver/templates/source-map-template.md +85 -0
  113. package/assets/.appweaver/templates/spec-template.md +309 -0
  114. package/assets/.appweaver/templates/ui-design-template.md +273 -0
  115. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
  116. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.pack.txt +5726 -0
  117. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.ps1 +145 -0
  118. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.sh +196 -0
  119. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.ps1 +157 -0
  120. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.sh +209 -0
  121. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.ps1 +126 -0
  122. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.sh +217 -0
  123. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
  124. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.sh +218 -0
  125. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
  126. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.pack.txt +2833 -0
  127. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.ps1 +145 -0
  128. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.sh +196 -0
  129. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.ps1 +157 -0
  130. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.sh +209 -0
  131. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.ps1 +126 -0
  132. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.sh +217 -0
  133. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
  134. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.sh +218 -0
  135. package/assets/foundations/dotnet/components/Email/README.md +119 -0
  136. package/assets/foundations/dotnet/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
  137. package/assets/foundations/dotnet/components/Email/integration.md +300 -0
  138. package/assets/foundations/dotnet/components/Jobs/README.md +113 -0
  139. package/assets/foundations/dotnet/components/Jobs/integration.md +259 -0
  140. package/assets/foundations/dotnet/components/QrGenerator/README.md +85 -0
  141. package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
  142. package/assets/foundations/dotnet/components/QrGenerator/integration.md +230 -0
  143. package/assets/foundations/dotnet/components/README.md +74 -0
  144. package/assets/guardrails/README.md +222 -0
  145. package/assets/guardrails/domain/healthcare/ai-rules.domain.md +34 -0
  146. package/assets/guardrails/domain/healthcare/api-versioning.domain.md +17 -0
  147. package/assets/guardrails/domain/healthcare/auditing.domain.md +97 -0
  148. package/assets/guardrails/domain/healthcare/authorization.domain.md +26 -0
  149. package/assets/guardrails/domain/healthcare/clinical-terms.md +20 -0
  150. package/assets/guardrails/domain/healthcare/coding-standards.domain.md +26 -0
  151. package/assets/guardrails/domain/healthcare/consent.md +19 -0
  152. package/assets/guardrails/domain/healthcare/cqrs.domain.md +12 -0
  153. package/assets/guardrails/domain/healthcare/data-classification.domain.md +28 -0
  154. package/assets/guardrails/domain/healthcare/dependency-policy.domain.md +11 -0
  155. package/assets/guardrails/domain/healthcare/dicom.md +15 -0
  156. package/assets/guardrails/domain/healthcare/domain-constitution.md +119 -0
  157. package/assets/guardrails/domain/healthcare/domain-driven-design.domain.md +28 -0
  158. package/assets/guardrails/domain/healthcare/eventing.domain.md +18 -0
  159. package/assets/guardrails/domain/healthcare/fhir.md +36 -0
  160. package/assets/guardrails/domain/healthcare/folder-structure.domain.md +25 -0
  161. package/assets/guardrails/domain/healthcare/hipaa.md +34 -0
  162. package/assets/guardrails/domain/healthcare/hl7.md +15 -0
  163. package/assets/guardrails/domain/healthcare/ihe-conformance.md +31 -0
  164. package/assets/guardrails/domain/healthcare/integration-terms.md +21 -0
  165. package/assets/guardrails/domain/healthcare/persistence.domain.md +20 -0
  166. package/assets/guardrails/domain/healthcare/terminology.md +30 -0
  167. package/assets/guardrails/domain/healthcare/testing.domain.md +15 -0
  168. package/assets/guardrails/domain/healthcare/ux/accessibility-standards.md +36 -0
  169. package/assets/guardrails/domain/healthcare/ux/content-design.md +32 -0
  170. package/assets/guardrails/domain/healthcare/ux/interaction-states.md +44 -0
  171. package/assets/guardrails/domain/healthcare/ux/journey-mapping.md +40 -0
  172. package/assets/guardrails/domain/healthcare/vertical-slices.domain.md +18 -0
  173. package/assets/guardrails/domain/healthcare/zero-trust.domain.md +12 -0
  174. package/assets/guardrails/domain/pharma/ai-rules.domain.md +32 -0
  175. package/assets/guardrails/domain/pharma/api-versioning.domain.md +20 -0
  176. package/assets/guardrails/domain/pharma/atc.md +22 -0
  177. package/assets/guardrails/domain/pharma/auditing.domain.md +90 -0
  178. package/assets/guardrails/domain/pharma/authorization.domain.md +25 -0
  179. package/assets/guardrails/domain/pharma/coding-standards.domain.md +28 -0
  180. package/assets/guardrails/domain/pharma/cqrs.domain.md +16 -0
  181. package/assets/guardrails/domain/pharma/data-classification.domain.md +24 -0
  182. package/assets/guardrails/domain/pharma/data-provenance.md +21 -0
  183. package/assets/guardrails/domain/pharma/dependency-policy.domain.md +11 -0
  184. package/assets/guardrails/domain/pharma/domain-constitution.md +113 -0
  185. package/assets/guardrails/domain/pharma/domain-driven-design.domain.md +36 -0
  186. package/assets/guardrails/domain/pharma/domain-requirements.sample.md +103 -0
  187. package/assets/guardrails/domain/pharma/eventing.domain.md +18 -0
  188. package/assets/guardrails/domain/pharma/fhir.md +31 -0
  189. package/assets/guardrails/domain/pharma/folder-structure.domain.md +26 -0
  190. package/assets/guardrails/domain/pharma/hl7.md +17 -0
  191. package/assets/guardrails/domain/pharma/idmp.md +26 -0
  192. package/assets/guardrails/domain/pharma/integration-terms.md +21 -0
  193. package/assets/guardrails/domain/pharma/ndc.md +28 -0
  194. package/assets/guardrails/domain/pharma/persistence.domain.md +23 -0
  195. package/assets/guardrails/domain/pharma/pharma-terms.md +27 -0
  196. package/assets/guardrails/domain/pharma/product-lifecycle.domain.md +30 -0
  197. package/assets/guardrails/domain/pharma/regulatory-compliance.md +19 -0
  198. package/assets/guardrails/domain/pharma/terminology.md +32 -0
  199. package/assets/guardrails/domain/pharma/testing.domain.md +19 -0
  200. package/assets/guardrails/domain/pharma/vertical-slices.domain.md +17 -0
  201. package/assets/guardrails/domain/pharma/zero-trust.domain.md +12 -0
  202. package/assets/guardrails/projects/dotnet-default-project/domain/domain-requirements.md +58 -0
  203. package/assets/guardrails/projects/dotnet-default-project/domain-rule-bindings.md +113 -0
  204. package/assets/guardrails/projects/dotnet-default-project/frontend/ui-requirements.md +43 -0
  205. package/assets/guardrails/projects/dotnet-default-project/service/technical-requirements.md +40 -0
  206. package/assets/guardrails/projects/dotnet-default-project/tech-rule-bindings.md +263 -0
  207. package/assets/guardrails/requirement-spec.txt +27 -0
  208. package/assets/guardrails/technology/dotnet-webapi/PACKAGING.md +184 -0
  209. package/assets/guardrails/technology/dotnet-webapi/api-versioning.md +44 -0
  210. package/assets/guardrails/technology/dotnet-webapi/auditing.md +96 -0
  211. package/assets/guardrails/technology/dotnet-webapi/authorization-matrix.md +14 -0
  212. package/assets/guardrails/technology/dotnet-webapi/authorization.md +39 -0
  213. package/assets/guardrails/technology/dotnet-webapi/clean-architecture.md +54 -0
  214. package/assets/guardrails/technology/dotnet-webapi/coding-standards.md +87 -0
  215. package/assets/guardrails/technology/dotnet-webapi/cqrs.md +63 -0
  216. package/assets/guardrails/technology/dotnet-webapi/data-classification.md +38 -0
  217. package/assets/guardrails/technology/dotnet-webapi/dependency-policy.md +40 -0
  218. package/assets/guardrails/technology/dotnet-webapi/domain-driven-design.md +91 -0
  219. package/assets/guardrails/technology/dotnet-webapi/eventing.md +57 -0
  220. package/assets/guardrails/technology/dotnet-webapi/examples/api-versioning.md +75 -0
  221. package/assets/guardrails/technology/dotnet-webapi/examples/auditing.md +84 -0
  222. package/assets/guardrails/technology/dotnet-webapi/examples/authorization.md +68 -0
  223. package/assets/guardrails/technology/dotnet-webapi/examples/clean-architecture.md +37 -0
  224. package/assets/guardrails/technology/dotnet-webapi/examples/cqrs.md +97 -0
  225. package/assets/guardrails/technology/dotnet-webapi/examples/domain-driven-design.md +141 -0
  226. package/assets/guardrails/technology/dotnet-webapi/examples/eventing.md +46 -0
  227. package/assets/guardrails/technology/dotnet-webapi/examples/persistence.md +207 -0
  228. package/assets/guardrails/technology/dotnet-webapi/examples/vertical-slices.md +151 -0
  229. package/assets/guardrails/technology/dotnet-webapi/examples/zero-trust.md +48 -0
  230. package/assets/guardrails/technology/dotnet-webapi/folder-structure.md +61 -0
  231. package/assets/guardrails/technology/dotnet-webapi/modular-monolith.md +47 -0
  232. package/assets/guardrails/technology/dotnet-webapi/persistence.md +82 -0
  233. package/assets/guardrails/technology/dotnet-webapi/technology-constitution.md +162 -0
  234. package/assets/guardrails/technology/dotnet-webapi/testing.md +55 -0
  235. package/assets/guardrails/technology/dotnet-webapi/vertical-slices.md +70 -0
  236. package/assets/guardrails/technology/dotnet-webapi/zero-trust.md +48 -0
  237. package/assets/guardrails/technology/java-spring/README.md +62 -0
  238. package/assets/guardrails/technology/nextjs/accessibility-implementation.md +56 -0
  239. package/assets/guardrails/technology/nextjs/api-client.md +56 -0
  240. package/assets/guardrails/technology/nextjs/api-integration.dotnet-webapi.md +174 -0
  241. package/assets/guardrails/technology/nextjs/api-integration.java-spring.md +203 -0
  242. package/assets/guardrails/technology/nextjs/auth-session.md +68 -0
  243. package/assets/guardrails/technology/nextjs/client-security.md +69 -0
  244. package/assets/guardrails/technology/nextjs/component-architecture.md +60 -0
  245. package/assets/guardrails/technology/nextjs/component-conventions.md +58 -0
  246. package/assets/guardrails/technology/nextjs/design-system.md +60 -0
  247. package/assets/guardrails/technology/nextjs/error-handling.md +72 -0
  248. package/assets/guardrails/technology/nextjs/forms-and-validation.md +75 -0
  249. package/assets/guardrails/technology/nextjs/frontend-testing.md +94 -0
  250. package/assets/guardrails/technology/nextjs/i18n.md +57 -0
  251. package/assets/guardrails/technology/nextjs/observability.md +67 -0
  252. package/assets/guardrails/technology/nextjs/performance-budgets.md +66 -0
  253. package/assets/guardrails/technology/nextjs/routing-navigation.md +52 -0
  254. package/assets/guardrails/technology/nextjs/state-management.md +70 -0
  255. package/assets/guardrails/technology/nextjs/ui-constitution.md +166 -0
  256. package/dist/commands/init.js +2 -2
  257. package/dist/commands/init.js.map +1 -1
  258. package/dist/utils/copy-assets.js +8 -8
  259. package/dist/utils/copy-assets.js.map +1 -1
  260. package/package.json +1 -1
  261. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -0,0 +1,222 @@
1
+ # Guardrails — Index & Rule-Loading Map
2
+
3
+ Rules live in **shared corpora**, keyed on the one thing that makes them differ: a technical rule
4
+ varies by **stack**, a domain rule varies by **industry**. A **project** owns neither corpus. It
5
+ owns two maps that say which files it loads, plus the handful of files its own team authors.
6
+
7
+ ```
8
+ guardrails/
9
+ ├── technology/<stack>/ technical rules — vary by stack, never by industry
10
+ │ ├── dotnet-webapi/ the reference corpus (+ examples/)
11
+ │ ├── nextjs/ the frontend lane's corpus
12
+ │ └── java-spring/ unauthored — the extension point, worked
13
+ ├── domain/<industry>/ domain rules — vary by industry, never by stack
14
+ │ ├── healthcare/
15
+ │ └── pharma/
16
+ └── projects/<project>/ what a project SELECTS
17
+ └── dotnet-default-project/
18
+ ├── tech-rule-bindings.md → technology/dotnet-webapi/ + technology/nextjs/
19
+ ├── domain-rule-bindings.md → domain/healthcare/
20
+ ├── service/technical-requirements.md PROJECT-SUPPLIED
21
+ ├── frontend/ui-requirements.md PROJECT-SUPPLIED
22
+ └── domain/domain-requirements.md PROJECT-SUPPLIED
23
+ ```
24
+
25
+ `/appweaver select-domain` selects a **project** folder and stores it in `.appweaver/domain.json`;
26
+ `resolve-tech` and `resolve-domain` read that project's two maps. **To change what a command loads,
27
+ edit the map — never a workflow.** The folder names `technology/` and `domain/` are the only
28
+ vocabulary here: a project's maps may point anywhere, in any combination.
29
+
30
+ **A directory under `projects/` is a project only if it carries a rule map.** Both shells'
31
+ `list-domains` enforces that, exactly as `foundations/` requires a `*.pack.txt`. Either map
32
+ qualifies, because `onboard` writes the domain map several steps before the technical one.
33
+
34
+ **A brownfield project owns its rules outright.** `dotnet-default-project` above holds only three
35
+ files because it maps the rest from the shared corpora. A project `onboard` reverse-engineers —
36
+ `projects/brf-<name>/` — holds everything: the domain set in `domain/`, the technical set in
37
+ `service/`, the lane set in `frontend/`, and its own charter at `domain/domain-constitution.md`,
38
+ named the way an industry corpus names its charter. Both maps still sit at the project root, and
39
+ nothing a project owns is written outside its own folder — which is what lets two onboarded
40
+ projects share one workspace.
41
+
42
+ ## Why the corpora are shared
43
+
44
+ Until 2026-08-18 every rule lived inside a per-industry pack, so the technical corpus was stored
45
+ once per industry. The two shipped packs were measured against each other before the split:
46
+ **31 technical files, ~2455 lines, and after normalising the industry word and line wrapping, all
47
+ 31 were the same file.** `technology-constitution.md`'s 40 differing lines were 100% name
48
+ substitution; the Next.js `ui-constitution.md` differed by two. The corpus never varied by
49
+ industry — the storage layout only claimed it did, and the cost was paid on every edit and would
50
+ have been paid again by every new industry.
51
+
52
+ The split makes the corpus **O(stack + industry)** instead of O(stack × industry). Adding Java
53
+ touches one folder. Adding an industry touches one folder. Neither touches the other, and neither
54
+ touches a workflow.
55
+
56
+ Nothing about *loading* changed. `resolve-tech` and `resolve-domain` collect the `- ` bullets under
57
+ `## /<command>` and return them verbatim; they never inspected where a path pointed. Only the map's
58
+ own location moved.
59
+
60
+ ## The three tiers
61
+
62
+ | Set | Mapped under | In | Ratified into |
63
+ |---|---|---|---|
64
+ | technical | `## /aw-spec-constitution` | `tech-rule-bindings.md` | `constitution.technical.md` |
65
+ | frontend | `## /aw-spec-ui-constitution` | `tech-rule-bindings.md` | `constitution.ui.md` |
66
+ | domain | `## /aw-spec-constitution` | `domain-rule-bindings.md` | `constitution.domain.md` |
67
+
68
+ Every set has the same shape: **the tier's constitution, then the standard rules the corpus shares,
69
+ then the one file the project team authors** — `service/technical-requirements.md`,
70
+ `frontend/ui-requirements.md`, `domain/domain-requirements.md`. Those three are the only mapped
71
+ files expected to differ between two projects on the same corpora, and their mapping is optional: a
72
+ project that has not authored one ratifies the standard set alone.
73
+
74
+ The constitution is the authority layer; these files are the detail layer it cites.
75
+
76
+ **Rules and samples are mapped separately.** A rule file states the rule; `technology/<stack>/examples/`
77
+ holds its worked `<SampleProjectName>` sample. The code-generating phases map both. The three
78
+ constitution headings map the rules alone — a ratified half is one declarative line and a `→`
79
+ pointer per principle, so sample code is weight without a reader.
80
+
81
+ **A file's tier is set by the map that lists it, not by the folder it lives in.**
82
+ `domain/healthcare/ihe-conformance.md` is the live proof: it sits in the domain corpus because IHE
83
+ is a healthcare standard, and it is on the **technical** tier because `tech-rule-bindings.md`
84
+ is what lists it. Infer the tier from the folder and the fold breaks.
85
+
86
+ ## Adding to the tree
87
+
88
+ - **A stack** — create `technology/<stack-id>/`, author the rules domain-free, map them from a
89
+ project. See [technology/java-spring/README.md](technology/java-spring/README.md), which is that
90
+ procedure written out. Use the stack id from `.appweaver/stack-profiles/`, so a lane in
91
+ `stacks.json` and a rule folder are the same word.
92
+ - **An industry** — create `domain/<industry>/`, author the overlays, point a project's
93
+ `domain-rule-bindings.md` at it. The technical map needs no edit.
94
+ - **A project** — copy `projects/dotnet-default-project/`, repoint the bullets, replace the three
95
+ project-supplied files. Nothing outside that folder changes.
96
+
97
+ ## Files — technical (`technology/dotnet-webapi/`)
98
+
99
+ **Architecture**
100
+ - [clean-architecture.md](technology/dotnet-webapi/clean-architecture.md) — dependency rule, layers, infra boundaries
101
+ - [modular-monolith.md](technology/dotnet-webapi/modular-monolith.md) — module boundaries, cross-module rules, extraction
102
+ - [vertical-slices.md](technology/dotnet-webapi/vertical-slices.md) — feature & folder structure
103
+ - [folder-structure.md](technology/dotnet-webapi/folder-structure.md) — mandatory `src/tests/helm/docs` tree
104
+ - [cqrs.md](technology/dotnet-webapi/cqrs.md) — mediator, Result pattern, transactions
105
+ - [persistence.md](technology/dotnet-webapi/persistence.md) — EF Core, specs, concurrency, tenancy
106
+ - [eventing.md](technology/dotnet-webapi/eventing.md) — CloudEvents, versioning, broker
107
+ - [testing.md](technology/dotnet-webapi/testing.md) — unit/integration/Testcontainers/coverage
108
+
109
+ **Security**
110
+ - [zero-trust.md](technology/dotnet-webapi/zero-trust.md) — TLS, identity, secrets
111
+ - [authorization.md](technology/dotnet-webapi/authorization.md) — role+scope model, cache policy
112
+ - [authorization-matrix.md](technology/dotnet-webapi/authorization-matrix.md) — role/scope matrix
113
+ - [auditing.md](technology/dotnet-webapi/auditing.md) — observability, structured logging, immutable audit
114
+ - [data-classification.md](technology/dotnet-webapi/data-classification.md) — classification framework, encryption
115
+
116
+ **Governance**
117
+ - [coding-standards.md](technology/dotnet-webapi/coding-standards.md) — naming, forbidden patterns, CI gates
118
+ - [dependency-policy.md](technology/dotnet-webapi/dependency-policy.md) — package governance, banned packages
119
+ - [api-versioning.md](technology/dotnet-webapi/api-versioning.md) — REST versioning, ETag, OpenAPI/AsyncAPI
120
+
121
+ **Modelling and packaging**
122
+ - [domain-driven-design.md](technology/dotnet-webapi/domain-driven-design.md) — generic DDD tactical patterns; the one file `specify` may load from this tier
123
+ - [PACKAGING.md](technology/dotnet-webapi/PACKAGING.md) — foundation pack/unpack conventions
124
+
125
+ **Constitution**
126
+ - [technology-constitution.md](technology/dotnet-webapi/technology-constitution.md) — the ratified technology base, principles I–XV
127
+
128
+ Each rule file's worked sample sits at [examples/](technology/dotnet-webapi/examples/) under the
129
+ same name.
130
+
131
+ ## Files — frontend (`technology/nextjs/`)
132
+
133
+ - [ui-constitution.md](technology/nextjs/ui-constitution.md) — the Next.js frontend base, UX-\* principles
134
+
135
+ Mapping `## /aw-spec-ui-*` in a project's `tech-rule-bindings.md` is what declares that the project
136
+ *has* a frontend lane. With no such heading, `constitution` skips the UI half and creates no file.
137
+
138
+ ## Files — healthcare domain (`domain/healthcare/`)
139
+
140
+ **Constitution**
141
+ - [domain-constitution.md](domain/healthcare/domain-constitution.md) — the ratified industry base, principles XVI+
142
+
143
+ **Architecture overlays** — each extends the `technology/<stack>/` file of the same name
144
+ - [folder-structure.domain.md](domain/healthcare/folder-structure.domain.md) — Interop, conformance tests, PHI fixtures
145
+ - [cqrs.domain.md](domain/healthcare/cqrs.domain.md) — PHI-audit behavior
146
+ - [vertical-slices.domain.md](domain/healthcare/vertical-slices.domain.md) — FHIR-HL7-DICOM Interop slice
147
+ - [persistence.domain.md](domain/healthcare/persistence.domain.md) — PHI retention & encryption-at-rest
148
+ - [testing.domain.md](domain/healthcare/testing.domain.md) — FHIR validation & synthetic PHI
149
+ - [eventing.domain.md](domain/healthcare/eventing.domain.md) — healthcare feeds & protocol tracing
150
+
151
+ **Domain (clinical)**
152
+ - [domain-driven-design.domain.md](domain/healthcare/domain-driven-design.domain.md) — canonical aggregates & invariants
153
+ - [fhir.md](domain/healthcare/fhir.md) — projectors, CapabilityStatement, profiles, Bundle/search, SMART, Bulk Data
154
+ - [terminology.md](domain/healthcare/terminology.md) — ICD/LOINC/SNOMED/RxNorm, coded value objects, terminology service
155
+ - [hl7.md](domain/healthcare/hl7.md) — HL7 v2 ingestion/egress, adapters, MLLP
156
+ - [dicom.md](domain/healthcare/dicom.md) — DICOMweb, PACS/VNA boundary, metadata-only persistence
157
+ - [consent.md](domain/healthcare/consent.md) — consent enforcement, break-the-glass, FHIR Consent
158
+ - [hipaa.md](domain/healthcare/hipaa.md) — PHI handling, audit, retention, minimum-necessary, breach handling
159
+ - [ihe-conformance.md](domain/healthcare/ihe-conformance.md) — interoperability conformance profiles; on the **technical** tier
160
+
161
+ **Security overlays**
162
+ - [zero-trust.domain.md](domain/healthcare/zero-trust.domain.md) — PHI transport, SMART tokens, ATNA node auth
163
+ - [authorization.domain.md](domain/healthcare/authorization.domain.md) — clinical roles, SMART scopes, consent, break-the-glass
164
+ - [auditing.domain.md](domain/healthcare/auditing.domain.md) — ATNA, FHIR AuditEvent, PHI audit
165
+ - [data-classification.domain.md](domain/healthcare/data-classification.domain.md) — PHI/PII/PCI taxonomy, de-identification
166
+
167
+ **Governance overlays**
168
+ - [coding-standards.domain.md](domain/healthcare/coding-standards.domain.md) — FHIR & PHI patterns and gates
169
+ - [dependency-policy.domain.md](domain/healthcare/dependency-policy.domain.md) — HIPAA suitability, healthcare libs
170
+ - [api-versioning.domain.md](domain/healthcare/api-versioning.domain.md) — FHIR versioning, CapabilityStatement
171
+
172
+ **Experience (`ux/`)** — mapped under `## /aw-spec-specify` on the **technical** tier, like
173
+ `ihe-conformance.md`: they govern how `specify` states the experience, and the spec's Experience
174
+ Scope + Experience Standards (`UX-`) are what `prototype`, `ui-design` and `ui-implement` author
175
+ and verify against. Each carries a "What must NOT appear" section — that is what keeps screens,
176
+ pages and components out of the spec.
177
+ - [ux/journey-mapping.md](domain/healthcare/ux/journey-mapping.md) — a journey is a `US-n`; outcome not click-path; interruption and hand-off
178
+ - [ux/interaction-states.md](domain/healthcare/ux/interaction-states.md) — which states must be handled; the `UX-` standard vs the EARS `FR-` behaviour
179
+ - [ux/accessibility-standards.md](domain/healthcare/ux/accessibility-standards.md) — conformance target, AT floor, keyboard-completable `US-n`, waiver discipline
180
+ - [ux/content-design.md](domain/healthcare/ux/content-design.md) — ubiquitous language, actionable errors, verbatim regulated wording, units and provenance
181
+
182
+ **Glossary**
183
+ - [clinical-terms.md](domain/healthcare/clinical-terms.md) — MRN, Encounter, Observation, Coverage, etc.
184
+ - [integration-terms.md](domain/healthcare/integration-terms.md) — HL7, FHIR, DICOM, PIX/PDQ, ATNA, MHD, XDS
185
+ - [ai-rules.domain.md](domain/healthcare/ai-rules.domain.md) — PHI masking, codes, FHIR, security-edit limits
186
+
187
+ ## Files — pharma domain (`domain/pharma/`)
188
+
189
+ The same shape with its own files — NDC/IDMP/ATC identity, product lifecycle, data provenance,
190
+ regulatory compliance. **No shipped project maps it**, so it is the second corpus a reader can
191
+ compare against, and the one to repoint a `domain-rule-bindings.md` at to see the swap work.
192
+ [domain-requirements.sample.md](domain/pharma/domain-requirements.sample.md) is the
193
+ Medicinal-Product-Registration enumeration a pharma project would copy into its own
194
+ `domain/domain-requirements.md`; it is a sample, not a rule, and no map lists it.
195
+
196
+ ## Naming convention
197
+
198
+ - **`technology/<stack>/<name>.md`** — technical rules: architecture, security, governance,
199
+ conventions, code generation. Domain-free, and on the **technical** tier because
200
+ `tech-rule-bindings.md` is what lists them.
201
+ - **`domain/<industry>/<name>.domain.md`** — a domain overlay extending the `technology/` file of
202
+ the same name.
203
+ - **`domain/<industry>/<name>.md`** — inherently domain (FHIR, HIPAA, NDC, terminology…).
204
+
205
+ ## What is not here
206
+
207
+ The universal AI operating rules are the kit's own, at `.appweaver/ai-rules.md`, and belong to no
208
+ project — a project that could switch them off is a project the kit can make no promise about.
209
+ The pre-pack seed the brownfield flows once read is deleted: `inventory`, `onboard` and `adopt` run
210
+ against a repository that has no project yet, and each carries the vocabulary it needs in its own
211
+ prompt rather than reading one project's house style as the shape to look for.
212
+
213
+ Everything this tree once held that governance does not load left it on 2026-08-18, for
214
+ `foundations/<stack>/`:
215
+
216
+ - **Scaffold corpora** — `foundations/dotnet/ModularMonolith/` and `foundations/dotnet/VerticalSlice/`:
217
+ a `<Name>.pack.txt` payload and the scripts that pack and unpack it, read by
218
+ `/appweaver foundation`.
219
+ - **Framework component runbooks** — `foundations/dotnet/components/`: the integration contracts
220
+ `/appweaver add-component` follows when wiring an opt-in component into a scaffolded project.
221
+
222
+ Both describe code to write, which is the opposite of a rule constraining what may be written.
@@ -0,0 +1,34 @@
1
+ # AI Operational Rules — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[ai-rules]]. Commands: **ALL**.
4
+
5
+ ## Context & codes
6
+ - FHIR types: use the **official FHIR .NET SDK**, version-matched (R4/R5) to the endpoint (see [[fhir]]).
7
+ - Confirm coded values against the Terminology module's value sets; never invent ICD/SNOMED/LOINC/CPT codes (see [[terminology]]).
8
+
9
+ ## Generation
10
+ - A complete slice adds a FHIR projector + FHIR-validator test when applicable (see [[fhir]], [[testing.domain]]).
11
+ - Generated FHIR resources MUST honor declared IG profiles and pass the FHIR validator (see [[fhir]]).
12
+ - Comments are reserved for clinical intent (generic rule in [[ai-rules]]).
13
+
14
+ ## PHI masking
15
+ - MUST NOT log, echo, or commit any field of `Patient`/`Encounter`/`Observation`/`MedicationRequest`/`ClinicalNote`/`DiagnosticReport`/`Claim`/`Coverage` other than the strongly-typed ID.
16
+ - Apply field-level redaction in every generated example payload (see [[data-classification.domain]], [[hipaa]]).
17
+
18
+ ## Tests
19
+ - MUST use the synthetic-PHI fixture library (`<SampleProjectName>.TestFixtures`); never inline fabricated PHI.
20
+ - Never invent ICD/SNOMED/LOINC/CPT/HCPCS/RxNorm/CVX codes — use a sentinel constant (see [[testing.domain]], [[terminology]]).
21
+
22
+ ## Security-touching code
23
+ - MUST NOT modify authorization handlers, scope evaluators, consent checks, audit emitters, or encryption code without an explicit security-reviewer-attached prompt (see [[authorization.domain]], [[auditing.domain]], [[consent]]).
24
+ - FHIR profile changes: regenerate the IG artifacts + CapabilityStatement in the **same commit** (see [[fhir]], [[api-versioning.domain]]).
25
+
26
+ ## Refusal conditions — extend [[ai-rules]]; refuse to:
27
+ - Embed any PHI test fixture in code/config.
28
+ - Disable a consent check globally.
29
+ - Bypass Interop adapters by writing aggregates directly from an external feed (see [[hl7]], [[eventing.domain]]).
30
+ - Generate de-identification logic without a documented method (Safe Harbor / Expert Determination) (see [[hipaa]]).
31
+ - Return PHI in error messages, logs, or trace attributes (see [[data-classification.domain]]).
32
+
33
+ ## Related
34
+ - [[ai-rules]] · [[fhir]] · [[terminology]] · [[hipaa]] · [[consent]] · [[data-classification.domain]] · [[auditing.domain]] · [[authorization.domain]] · [[testing.domain]]
@@ -0,0 +1,17 @@
1
+ # API Versioning — Healthcare Domain Addenda (FHIR)
2
+
3
+ > Technology base: [[api-versioning]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
+
5
+ ## FHIR versioning
6
+ - R4 default; R5 is **additive** under a versioned path (`/fhir/R5/...`).
7
+ - Breaking FHIR changes require a **new version path** + a published CapabilityStatement diff (see [[fhir]]).
8
+ - FHIR list endpoints use Bundle/searchset semantics (`_count`, `_offset`/`_page`, `_total`).
9
+
10
+ ## Concurrency at the edge
11
+ - FHIR resources honor `If-Match` via the aggregate's concurrency token → FHIR **weak** ETag at the projection boundary (see [[persistence.domain]]).
12
+
13
+ ## CapabilityStatement
14
+ - Published for FHIR (beyond generic OpenAPI/AsyncAPI); regenerates cleanly in CI; diff reviewed for breaking changes (see [[fhir]], [[coding-standards.domain]]).
15
+
16
+ ## Related
17
+ - [[api-versioning]] · [[fhir]] · [[persistence.domain]] · [[coding-standards.domain]]
@@ -0,0 +1,97 @@
1
+ # Auditing — Healthcare Domain Addenda (ATNA)
2
+
3
+ > Technology base: [[auditing]]. NON-NEGOTIABLE. Consumed by `/aw-spec-specify` (LIFTS the
4
+ > auditing requirement into the spec) and `/aw-spec-gate` (VALIDATES the spec/design realise it).
5
+ > `/aw-spec-design` and `/aw-spec-implement` never load this file — auditing reaches them through
6
+ > the spec's **declared audit level per aggregate**, and the enablement mechanics live in the
7
+ > technical base [[auditing]]. Keep this file technology-agnostic (levels + rules, **no code**).
8
+
9
+ ## Two auditing levels (framework-supported)
10
+
11
+ AppWeaver auditing has exactly **two levels** for entity state-change auditing; the framework's
12
+ audit interceptor populates every audit field automatically (handlers NEVER assign audit fields):
13
+
14
+ | Level | Captures | Depth |
15
+ |---|---|---|
16
+ | **Basic** | who/when lifecycle — created / modified / (soft-)deleted, by whom and when; one audit entry per aggregate root per save (who · action · resource type · resource id · timestamp · correlation) | entity-level (Created/Updated/Deleted) — **no** before/after values |
17
+ | **Advanced** | everything Basic captures **plus field-level before/after** — each changed property's previous → new value | entity-level **+ property-level previous/new value** |
18
+
19
+ - **Advanced is REQUIRED whenever the spec asks for "previous value / new value"** — before/after
20
+ values exist ONLY at the Advanced tier.
21
+ - Child entities fold their changes into the owning aggregate root's audit entry.
22
+ - Beyond state-change auditing, healthcare additionally requires **PHI access (read) auditing** —
23
+ a separate mandatory concern (see below), not one of the two write-levels.
24
+
25
+ > Code realisation — marker interfaces (Basic = `IAuditedObject` / `IFullAuditedObject`; Advanced =
26
+ > `+ IFieldAudited`), the one-time composition, and the audit query API — lives in the technical
27
+ > base. See [[auditing]]; `/aw-spec-design` and `/aw-spec-implement` get the HOW from there.
28
+
29
+ ## Aggregate assignment rule (how specify decides the level)
30
+
31
+ `/aw-spec-specify` MUST assign an audit level to every aggregate it models and LIFT it into the
32
+ spec as an explicit, developer-editable declaration:
33
+
34
+ - Every **PHI-bearing main aggregate** of the requirement → **Advanced** (regulated PHI change
35
+ history requires field-level before/after).
36
+ - **Supporting aggregates** (collaborating/referenced roots, no PHI) → **Basic** by default.
37
+ - A developer MAY raise or lower a level afterwards by editing the spec declaration — the level is
38
+ a **spec** decision, never a design or implementation one. `/aw-spec-design` then follows the
39
+ declared level.
40
+
41
+ Lift it as one line the gate can check, e.g. under Constraints:
42
+
43
+ > **CN-0xx**: Auditing level — `<PHIAggregate>` uses **Advanced** (field-level before/after)
44
+ > auditing; `<SupportingAggregate…>` use **Basic** (lifecycle) auditing; all PHI access and change
45
+ > is audit-mandatory and append-only. — lifted from auditing.domain.
46
+
47
+ Declare the **level** — do NOT enumerate the audit record's field shape in the spec (next section).
48
+
49
+ ## PHI access auditing (ATNA — mandatory)
50
+
51
+ Distinct from state-change auditing: every PHI **read/access**, authentication, consent change,
52
+ export, and break-the-glass MUST emit an audit event (a PHI-access-audit pipeline behavior runs on
53
+ every mediator request). Audit-mandatory triggers:
54
+
55
+ - Every PHI **read** and **write**; every authentication; every consent change; every export
56
+ (`$export`, bulk / report download); every **break-the-glass**; every privileged admin action;
57
+ every IdP / role change. See [[authorization.domain]].
58
+
59
+ ## Spec-required vs framework-emitted (what the gate checks)
60
+
61
+ The audit record's field shape is **framework-emitted** — the interceptor populates it; it is NOT
62
+ spec-authored content. Fields the platform always supplies:
63
+
64
+ - `timestamp`, acting `subjectId` (user), `action`, `resourceType`, `resourceId`, `sourceIp`,
65
+ `correlationId`, `tenantId`, and the physical record layout.
66
+
67
+ Split for the gate:
68
+
69
+ - **Spec-required** (specify lifts it; the gate checks the spec + design carry it): the **audit
70
+ level per aggregate**; that PHI access/change is **audit-mandatory** and **append-only**; and the
71
+ ATNA business capture — **patientId** (whose PHI), **subjectRole**, **outcome** (grant/deny),
72
+ **reason** (break-the-glass justification), and **Previous Value / New Value** (Advanced).
73
+ - **Framework-emitted** (NEVER a spec/design gap — always populated by the platform): the fields
74
+ listed above. The gate MUST NOT raise a LIFT-FAILURE for them; they are guaranteed by the
75
+ framework, not authored in the spec.
76
+
77
+ ## Queryable audit (framework-provided)
78
+
79
+ The audit store is queryable out of the box (by resource identity, by user/subject, by tenant, and
80
+ by action/time with paging — see [[auditing]]). A spec "queryable audit trail for compliance /
81
+ ATNA review" success criterion is therefore satisfied by the framework's audit query API; design
82
+ references it and does **NOT** need a bespoke audit read port/model.
83
+
84
+ ## Retention & format
85
+
86
+ - **Append-only**; retained **>= 6 years**; exportable as FHIR `AuditEvent` (see
87
+ [[domain-driven-design.domain]], [[persistence.domain]]).
88
+
89
+ ## Telemetry & breach
90
+
91
+ - **PHI, full SSN, payment-card numbers, government IDs MUST NEVER** appear in logs, metric labels,
92
+ exception messages, or traces (see [[data-classification.domain]]).
93
+ - Anomalous PHI access (volume spikes, off-hours mass reads, repeated denials) emits **Critical**
94
+ alerts (see [[hipaa]]).
95
+
96
+ ## Related
97
+ - [[auditing]] · [[hipaa]] · [[data-classification.domain]] · [[authorization.domain]] · [[consent]] · [[fhir]] · [[cqrs.domain]] · [[persistence.domain]] · [[domain-driven-design.domain]]
@@ -0,0 +1,26 @@
1
+ # Authorization — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[authorization]]. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
+
5
+ ## Roles
6
+ `SystemAdmin`, `ComplianceOfficer`, `Physician`, `Nurse`, `LabTechnician`, `Radiologist`, `Pharmacist`, `BillingClerk`, `FrontDesk`, `Patient`, `ExternalSystem`, `ResearchAnalyst` (de-identified scope only). Per-route matrix: `guardrails/technology/dotnet-webapi/authorization-matrix.md`.
7
+
8
+ ## SMART-on-FHIR scopes
9
+ - Scopes (`patient/*.read`, `user/Observation.read`, `system/*.write`, `launch/patient`) MUST be enforced on **every FHIR endpoint**.
10
+ - App launch (EHR + standalone): **PKCE mandatory; implicit flow FORBIDDEN** (see [[fhir]]).
11
+
12
+ ## PHI minimum-necessary
13
+ - The PHI-access pipeline returns only fields the caller's role + scopes authorize; field-level redaction lives in projection extensions (see [[hipaa]], [[data-classification.domain]]).
14
+
15
+ ## Consent & break-the-glass
16
+ - Pipeline checks **consent state** before releasing PHI outside the treating-provider context (see [[consent]]).
17
+ - Break-the-glass = explicit emergency-access command: documented reason + high-priority audit + real-time alert (see [[consent]], [[auditing.domain]]).
18
+
19
+ ## Audit-mandatory
20
+ Every PHI read/write, authentication, consent change, export, break-the-glass, privileged admin action, IdP/role change (see [[auditing.domain]]).
21
+
22
+ ## Anonymous allowlist
23
+ - Adds `/metadata` (FHIR CapabilityStatement) to the generic allowlist (see [[fhir]]).
24
+
25
+ ## Related
26
+ - [[authorization]] · [[hipaa]] · [[consent]] · [[auditing.domain]] · [[data-classification.domain]] · [[fhir]]
@@ -0,0 +1,20 @@
1
+ # Glossary — Clinical Terms
2
+
3
+ > Ubiquitous language for clinical aggregates. Commands: `/aw-spec-constitution`, `/aw-spec-specify`. See [[domain-driven-design.domain]] (modeling) + [[terminology]] (coding).
4
+
5
+ | Term | Definition |
6
+ |---|---|
7
+ | **MRN** | Patient identifier, **unique per tenant** on `Patient` (Patients); cross-referenced via PIX/PDQ (see [[integration-terms]]). |
8
+ | **Encounter** | Clinical interaction (inpatient/outpatient/emergency); owns Admission/Transfer/Discharge; not Closeable with open Orders/Results/ChargeItems/unsigned ClinicalNotes (Encounters). |
9
+ | **Observation** | A discrete measurement/finding — vitals/social history (EMR) or lab result (Lab); coded LOINC/SNOMED (see [[terminology]]). |
10
+ | **Coverage** | Patient insurance record (Insurance); required (or documented self-pay) before admission. |
11
+ | **PractitionerRole** | A Practitioner's role within an Organization/Location (Identity) — drives role-based auth (see [[authorization.domain]]). |
12
+ | **CarePlan** | A planned set of clinical activities (EMR). |
13
+ | **DiagnosticReport** | A finalized result set with interpretation — radiology (Radiology) or lab (Lab). |
14
+ | **ClinicalNote** | Documentation entry; once **Signed** immutable; corrections are addenda; deletion forbidden (supersede via Amend). |
15
+ | **ProblemList / AllergyIntolerance / MedicationStatement / Immunization / Procedure / ServiceRequest** | EMR aggregates; coded SNOMED/ICD/RxNorm/CVX as applicable. |
16
+ | **MedicationRequest / MedicationDispense / MedicationAdministration** | Pharmacy aggregates; dispense blocked on allergy/interaction/contraindication without documented override. |
17
+ | **Consent** | First-class aggregate governing PHI disclosure; withdrawal blocks disclosure immediately (see [[consent]]). |
18
+
19
+ ## Related
20
+ - [[integration-terms]] · [[domain-driven-design.domain]] · [[terminology]] · [[fhir]]
@@ -0,0 +1,26 @@
1
+ # Coding Standards — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[coding-standards]]. Commands: `/aw-spec-gate`.
4
+
5
+ ## Coded value objects
6
+ - Follow the FHIR pattern: `Codeable`, `Coding`, `Quantity`, `Period`, `Range`, `Ratio`, `Identifier`, `HumanName`, `Address`, `ContactPoint` (see [[terminology]]).
7
+ - The Domain may additionally throw `ConsentDeniedException` (see [[consent]]).
8
+
9
+ ## Forbidden patterns — extend [[coding-standards]]
10
+ - **H1.** Hard delete of any clinical/financial/audit/PHI-bearing aggregate (see [[persistence.domain]]).
11
+ - **H2.** Hard-coded IdP issuer / FHIR server / HL7 endpoint URLs, or PHI test fixtures, in source.
12
+ - **H3.** Logging/emitting any PHI element, full SSN/government ID (see [[data-classification.domain]]).
13
+ - **H4.** Storing patient data (names, MRNs, DOBs, diagnoses, meds, labs, imaging) as free text when a coded vocabulary applies (see [[terminology]]).
14
+ - **H5.** A second FHIR write path bypassing the canonical aggregate (see [[fhir]]).
15
+ - **H6.** Storing/transmitting PHI to any non-production environment (see [[hipaa]]).
16
+ - **H7.** FHIR errors not using `OperationOutcome` with HTTP 422 (see [[fhir]]).
17
+
18
+ ## Quality gates — extend [[coding-standards]]
19
+ - **HG1.** FHIR CapabilityStatement regenerates cleanly; diff reviewed (see [[fhir]]).
20
+ - **HG2.** FHIR validator passes for every modified resource/profile/example.
21
+ - **HG3.** Grep: no PHI string literals in tests outside sanctioned fixtures; no MediatR/AutoMapper.
22
+ - **HG4.** PHI-logging analyzer passes — no Patient/Encounter/Observation/MedicationRequest field logged except the ID (see [[data-classification.domain]]).
23
+ - **HG5.** Security-reviewer sign-off for any PHI-access change.
24
+
25
+ ## Related
26
+ - [[coding-standards]] · [[terminology]] · [[fhir]] · [[hipaa]] · [[consent]] · [[data-classification.domain]] · [[persistence.domain]]
@@ -0,0 +1,19 @@
1
+ # Consent Standards
2
+
3
+ > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
+
5
+ ## First-class aggregate
6
+ - Consent is a **first-class aggregate** (Patients module). A **withdrawn consent MUST block downstream PHI disclosure** for the purpose-of-use **immediately**; state changes emit `ConsentChangedEvent` (see [[eventing]]).
7
+ - The access-control pipeline **MUST check consent before releasing PHI** outside the treating-provider context. Denial surfaces as `ConsentDeniedException` from the Domain (see [[domain-driven-design.domain]], [[authorization.domain]]).
8
+
9
+ ## Break-the-glass
10
+ - Explicit **emergency-access command**: documented reason + high-priority audit + real-time alert; audit-mandatory (see [[auditing.domain]]).
11
+
12
+ ## Restriction-of-processing
13
+ - GDPR restriction (Art. 18) + erasure (Art. 17) are first-class audited commands. Where law forbids erasing medical records, **restriction-of-processing is the fallback** (see [[hipaa]], [[persistence.domain]]).
14
+
15
+ ## FHIR mapping
16
+ - **BPPC** + **FHIR Consent** profiles honored; Consent projects to the FHIR `Consent` resource (see [[fhir]]).
17
+
18
+ ## Related
19
+ - [[hipaa]] · [[authorization.domain]] · [[auditing.domain]] · [[fhir]] · [[domain-driven-design.domain]]
@@ -0,0 +1,12 @@
1
+ # CQRS — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[cqrs]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
+
5
+ ## Pipeline
6
+ - Append a **PHI-access-audit behavior** to the mediator pipeline (beyond generic logging + FluentValidation): emit an audit record for every command/query touching PHI (see [[auditing.domain]]).
7
+
8
+ ## Error codes
9
+ Dot-namespaced slugs (see [[cqrs]]). Examples: `patient.not_found` · `claim.duplicate_submission` · `consent.denied` · `concurrency.conflict`.
10
+
11
+ ## Related
12
+ - [[cqrs]] · [[auditing.domain]] · [[hipaa]] · [[domain-driven-design.domain]]
@@ -0,0 +1,28 @@
1
+ # Data Classification — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[data-classification]]. NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
+
5
+ ## Categories
6
+ | Class | Extra rules |
7
+ |---|---|
8
+ | **PHI** (clinical, demographic, identifiers) | Minimum-necessary; audited; encrypted |
9
+ | **PII** (non-clinical identifiers) | Encrypted; minimum-necessary |
10
+ | **PCI** (payment) | **Out of scope** — route to a PCI-DSS processor |
11
+ | **Behavioral Health** (42 CFR Part 2) | Extra-sensitive; field-level encryption |
12
+ | **Genetic** (GINA) | Extra-sensitive |
13
+ | **Pediatric** (minors) | Extended retention; heightened protection |
14
+
15
+ ## Field-level encryption (required)
16
+ SSN, government IDs, payment-card data, behavioral-health flags (see [[hipaa]], [[persistence.domain]]).
17
+
18
+ ## Logging
19
+ - **NEVER** log/emit any PHI element, full SSN, government ID, or full payment-card data.
20
+ - PHI-logging analyzer (CI gate): no Patient/Encounter/Observation/MedicationRequest field logged except the ID (see [[coding-standards.domain]]).
21
+
22
+ ## Export
23
+ - Analytics/research/non-prod exports MUST pass **Safe-Harbor or Expert-Determination** de-identification.
24
+ - **Production PHI in non-production is FORBIDDEN** (see [[hipaa]], [[testing.domain]]).
25
+ - Bulk `$export` gated by authorization + de-identification (see [[fhir]]).
26
+
27
+ ## Related
28
+ - [[data-classification]] · [[hipaa]] · [[auditing.domain]] · [[authorization.domain]] · [[persistence.domain]] · [[coding-standards.domain]]
@@ -0,0 +1,11 @@
1
+ # Dependency Policy — Healthcare Domain Addenda
2
+
3
+ > Technology base: [[dependency-policy]]. Commands: `/aw-spec-gate`.
4
+
5
+ ## Reviews & libraries
6
+ - Every new dependency gets a **HIPAA-suitability** review beyond the generic license/supply-chain check — e.g. reject a logging package that ships analytics by default (PHI-exfiltration risk) (see [[hipaa]], [[data-classification.domain]]).
7
+ - FHIR: the **official FHIR .NET SDK**, version-matched to the endpoint (R4/R5; see [[fhir]]).
8
+ - HL7 v2 / DICOM libraries are added **only** on explicit developer request — no AI-introduced healthcare-protocol dependencies (see [[hl7]], [[dicom]], [[ai-rules.domain]]).
9
+
10
+ ## Related
11
+ - [[dependency-policy]] · [[fhir]] · [[hl7]] · [[dicom]] · [[hipaa]] · [[ai-rules.domain]]
@@ -0,0 +1,15 @@
1
+ # DICOM Standards
2
+
3
+ > Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
+
5
+ ## DICOMweb façade
6
+ - Supported via a **DICOMweb façade** — **QIDO-RS** (query), **WADO-RS** (retrieve), **STOW-RS** (store) — fronting a separately deployed PACS/VNA. Adapters live in `{Module}/Interop/Dicom/` (Radiology only).
7
+ - The PACS/VNA endpoint is an Aspire resource referenced via `.WithReference(...)`; hosts/ports discovered through Aspire, never hard-coded.
8
+
9
+ ## Metadata only
10
+ - **Only DICOM METADATA is persisted here** — pixel data lives in the PACS/VNA, referenced by study/series/instance UIDs.
11
+ - Radiology aggregates: `ImagingOrder`, `ImagingStudy` (metadata), `DiagnosticReport`; results surface via FHIR projections (`ImagingStudy`, `DiagnosticReport`; see [[fhir]]).
12
+ - Trace context propagates across DICOM outbound calls (see [[auditing]]).
13
+
14
+ ## Related
15
+ - [[fhir]] · [[integration-terms]] · [[domain-driven-design]]