aw-spec-cli 0.1.0 → 0.1.2

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 (173) hide show
  1. package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +129 -0
  2. package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +31 -0
  3. package/assets/.agents/skills/aw-spec-analyze/SKILL.md +296 -0
  4. package/assets/.agents/skills/aw-spec-checklist/SKILL.md +374 -0
  5. package/assets/.agents/skills/aw-spec-clarify/SKILL.md +320 -0
  6. package/assets/.agents/skills/aw-spec-constitution/SKILL.md +194 -0
  7. package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +268 -0
  8. package/assets/.agents/skills/aw-spec-foundation/SKILL.md +358 -0
  9. package/assets/.agents/skills/aw-spec-implement/SKILL.md +279 -0
  10. package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
  11. package/assets/.agents/skills/aw-spec-plan/SKILL.md +221 -0
  12. package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +73 -0
  13. package/assets/.agents/skills/aw-spec-specify/SKILL.md +382 -0
  14. package/assets/.agents/skills/aw-spec-tasks/SKILL.md +259 -0
  15. package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +107 -0
  16. package/assets/.aw-spec/domain.json +3 -0
  17. package/assets/.aw-spec/extensions/.registry +19 -0
  18. package/assets/.aw-spec/extensions/agent-context/README.md +57 -0
  19. package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +4 -0
  20. package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
  21. package/assets/.aw-spec/extensions/agent-context/extension.yml +34 -0
  22. package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
  23. package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  24. package/assets/.aw-spec/extensions.yml +23 -0
  25. package/assets/.aw-spec/feature.json +3 -0
  26. package/assets/.aw-spec/init-options.json +9 -0
  27. package/assets/.aw-spec/integration.json +15 -0
  28. package/assets/.aw-spec/integrations/aw-spec.manifest.json +17 -0
  29. package/assets/.aw-spec/integrations/claude.manifest.json +17 -0
  30. package/assets/.aw-spec/memory/constitution.md +50 -0
  31. package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +189 -0
  32. package/assets/.aw-spec/scripts/bash/common.sh +582 -0
  33. package/assets/.aw-spec/scripts/bash/create-new-feature.sh +299 -0
  34. package/assets/.aw-spec/scripts/bash/setup-plan.sh +84 -0
  35. package/assets/.aw-spec/scripts/bash/setup-tasks.sh +91 -0
  36. package/assets/.aw-spec/templates/checklist-template.md +40 -0
  37. package/assets/.aw-spec/templates/constitution-template.md +57 -0
  38. package/assets/.aw-spec/templates/plan-template.md +113 -0
  39. package/assets/.aw-spec/templates/spec-template.md +131 -0
  40. package/assets/.aw-spec/templates/tasks-template.md +252 -0
  41. package/assets/.aw-spec/workflows/aw-spec/workflow.yml +77 -0
  42. package/assets/.aw-spec/workflows/workflow-registry.json +13 -0
  43. package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +129 -0
  44. package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +31 -0
  45. package/assets/.claude/skills/aw-spec-analyze/SKILL.md +296 -0
  46. package/assets/.claude/skills/aw-spec-checklist/SKILL.md +374 -0
  47. package/assets/.claude/skills/aw-spec-clarify/SKILL.md +320 -0
  48. package/assets/.claude/skills/aw-spec-constitution/SKILL.md +194 -0
  49. package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +268 -0
  50. package/assets/.claude/skills/aw-spec-foundation/SKILL.md +358 -0
  51. package/assets/.claude/skills/aw-spec-implement/SKILL.md +279 -0
  52. package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
  53. package/assets/.claude/skills/aw-spec-plan/SKILL.md +221 -0
  54. package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +73 -0
  55. package/assets/.claude/skills/aw-spec-specify/SKILL.md +382 -0
  56. package/assets/.claude/skills/aw-spec-tasks/SKILL.md +259 -0
  57. package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +107 -0
  58. package/assets/.kilocode/rules/specify-rules.md +4 -0
  59. package/assets/.kilocode/workflows/aw-spec-addcomponent.md +129 -0
  60. package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +31 -0
  61. package/assets/.kilocode/workflows/aw-spec-analyze.md +296 -0
  62. package/assets/.kilocode/workflows/aw-spec-checklist.md +374 -0
  63. package/assets/.kilocode/workflows/aw-spec-clarify.md +320 -0
  64. package/assets/.kilocode/workflows/aw-spec-constitution.md +194 -0
  65. package/assets/.kilocode/workflows/aw-spec-fast-implement.md +263 -0
  66. package/assets/.kilocode/workflows/aw-spec-foundation.md +358 -0
  67. package/assets/.kilocode/workflows/aw-spec-implement.md +279 -0
  68. package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +204 -0
  69. package/assets/.kilocode/workflows/aw-spec-plan.md +221 -0
  70. package/assets/.kilocode/workflows/aw-spec-select-domain.md +73 -0
  71. package/assets/.kilocode/workflows/aw-spec-specify.md +382 -0
  72. package/assets/.kilocode/workflows/aw-spec-tasks.md +259 -0
  73. package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +107 -0
  74. package/assets/docs/README.md +106 -0
  75. package/assets/docs/VerticalSlice/PACKAGING.md +185 -0
  76. package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +2833 -0
  77. package/assets/docs/VerticalSlice/pack-foundation.ps1 +145 -0
  78. package/assets/docs/VerticalSlice/pack-foundation.sh +196 -0
  79. package/assets/docs/VerticalSlice/unpack-foundation.ps1 +126 -0
  80. package/assets/docs/VerticalSlice/unpack-foundation.sh +217 -0
  81. package/assets/docs/architecture/clean-architecture.md +71 -0
  82. package/assets/docs/architecture/cqrs.md +141 -0
  83. package/assets/docs/architecture/eventing.md +83 -0
  84. package/assets/docs/architecture/folder-structure.md +61 -0
  85. package/assets/docs/architecture/modular-monolith.md +47 -0
  86. package/assets/docs/architecture/persistence.md +269 -0
  87. package/assets/docs/architecture/testing.md +55 -0
  88. package/assets/docs/architecture/vertical-slices.md +201 -0
  89. package/assets/docs/command.txt +295 -0
  90. package/assets/docs/components/Email/README.md +112 -0
  91. package/assets/docs/components/Email/integration.md +260 -0
  92. package/assets/docs/components/Jobs/README.md +113 -0
  93. package/assets/docs/components/Jobs/integration.md +245 -0
  94. package/assets/docs/components/QrGenerator/README.md +78 -0
  95. package/assets/docs/components/QrGenerator/integration.md +185 -0
  96. package/assets/docs/components/README.md +57 -0
  97. package/assets/docs/domain/domain-driven-design.md +212 -0
  98. package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +34 -0
  99. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +17 -0
  100. package/assets/docs/domainspecs/healthcare/auditing.domain.md +29 -0
  101. package/assets/docs/domainspecs/healthcare/authorization.domain.md +26 -0
  102. package/assets/docs/domainspecs/healthcare/clinical-terms.md +20 -0
  103. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +26 -0
  104. package/assets/docs/domainspecs/healthcare/comandrulemap.md +119 -0
  105. package/assets/docs/domainspecs/healthcare/consent.md +19 -0
  106. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +12 -0
  107. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +28 -0
  108. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +11 -0
  109. package/assets/docs/domainspecs/healthcare/dicom.md +15 -0
  110. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +28 -0
  111. package/assets/docs/domainspecs/healthcare/domain-requirements.md +55 -0
  112. package/assets/docs/domainspecs/healthcare/eventing.domain.md +18 -0
  113. package/assets/docs/domainspecs/healthcare/fhir.md +36 -0
  114. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +23 -0
  115. package/assets/docs/domainspecs/healthcare/hipaa.md +34 -0
  116. package/assets/docs/domainspecs/healthcare/hl7.md +15 -0
  117. package/assets/docs/domainspecs/healthcare/integration-terms.md +21 -0
  118. package/assets/docs/domainspecs/healthcare/persistence.domain.md +20 -0
  119. package/assets/docs/domainspecs/healthcare/terminology.md +30 -0
  120. package/assets/docs/domainspecs/healthcare/testing.domain.md +15 -0
  121. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +18 -0
  122. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +12 -0
  123. package/assets/docs/domainspecs/pharma/ai-rules.domain.md +32 -0
  124. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +20 -0
  125. package/assets/docs/domainspecs/pharma/atc.md +22 -0
  126. package/assets/docs/domainspecs/pharma/auditing.domain.md +26 -0
  127. package/assets/docs/domainspecs/pharma/authorization.domain.md +25 -0
  128. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +28 -0
  129. package/assets/docs/domainspecs/pharma/comandrulemap.md +136 -0
  130. package/assets/docs/domainspecs/pharma/cqrs.domain.md +16 -0
  131. package/assets/docs/domainspecs/pharma/data-classification.domain.md +24 -0
  132. package/assets/docs/domainspecs/pharma/data-provenance.md +21 -0
  133. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +11 -0
  134. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +36 -0
  135. package/assets/docs/domainspecs/pharma/domain-requirements.md +99 -0
  136. package/assets/docs/domainspecs/pharma/eventing.domain.md +18 -0
  137. package/assets/docs/domainspecs/pharma/fhir.md +31 -0
  138. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +24 -0
  139. package/assets/docs/domainspecs/pharma/hl7.md +17 -0
  140. package/assets/docs/domainspecs/pharma/idmp.md +26 -0
  141. package/assets/docs/domainspecs/pharma/integration-terms.md +21 -0
  142. package/assets/docs/domainspecs/pharma/ndc.md +28 -0
  143. package/assets/docs/domainspecs/pharma/persistence.domain.md +23 -0
  144. package/assets/docs/domainspecs/pharma/pharma-terms.md +27 -0
  145. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +30 -0
  146. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +19 -0
  147. package/assets/docs/domainspecs/pharma/terminology.md +32 -0
  148. package/assets/docs/domainspecs/pharma/testing.domain.md +19 -0
  149. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +17 -0
  150. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +12 -0
  151. package/assets/docs/glossary/ai-rules.md +59 -0
  152. package/assets/docs/governance/api-versioning.md +99 -0
  153. package/assets/docs/governance/coding-standards.md +87 -0
  154. package/assets/docs/governance/dependency-policy.md +40 -0
  155. package/assets/docs/interop/ihe-conformance.md +31 -0
  156. package/assets/docs/pharma-constitution.my-ref.md +86 -0
  157. package/assets/docs/requirement-spec.txt +15 -0
  158. package/assets/docs/security/auditing.md +117 -0
  159. package/assets/docs/security/authorization-matrix.md +14 -0
  160. package/assets/docs/security/authorization.md +87 -0
  161. package/assets/docs/security/data-classification.md +38 -0
  162. package/assets/docs/security/zero-trust.md +76 -0
  163. package/assets/docs/technology-constitution.md +172 -0
  164. package/dist/commands/init.d.ts.map +1 -1
  165. package/dist/commands/init.js +3 -2
  166. package/dist/commands/init.js.map +1 -1
  167. package/dist/utils/copy-assets.d.ts +8 -1
  168. package/dist/utils/copy-assets.d.ts.map +1 -1
  169. package/dist/utils/copy-assets.js +1 -0
  170. package/dist/utils/copy-assets.js.map +1 -1
  171. package/dist/utils/paths.js +1 -1
  172. package/dist/utils/paths.js.map +1 -1
  173. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ # Testing Standards
2
+
3
+ > Pure technology (domain-agnostic) — domain additions in [[testing.domain]]. Commands: `/aw-spec-tasks`, `/aw-spec-implement`.
4
+
5
+ ## Test-first engineering
6
+
7
+ - Generated tests follow Test-First Engineering and **MUST fail before** the production
8
+ change is in place.
9
+ - Any change to an aggregate invariant, endpoint contract, or error code **MUST** include
10
+ the corresponding test update **in the same commit**.
11
+
12
+ ## Unit test conventions
13
+
14
+ - Unit tests are required for **every** aggregate behavior, value object, and specification.
15
+ - Tests are **deterministic** — time, randomness, and IDs are injected
16
+ (use the framework-provided `IClock` / `IGuidGenerator`). Never `DateTime.UtcNow` /
17
+ `Guid.NewGuid()` in the system under test.
18
+ - Tests **MUST NOT** reach into module internals; they exercise the public endpoint or
19
+ `IMediator` surface.
20
+
21
+ ## Handler tests
22
+
23
+ Required for **every** Command/Query handler and MUST cover:
24
+
25
+ - happy path
26
+ - validation failure
27
+ - not-found
28
+ - (for writes) concurrency conflict
29
+
30
+ ## Integration testing
31
+
32
+ - Required for **every** endpoint; run against **PostgreSQL via Testcontainers** or Aspire.
33
+ - Test database engine: Testcontainers PostgreSQL for integration; in-memory fixtures for
34
+ unit tests.
35
+
36
+ ## Testcontainers usage
37
+
38
+ - Integration and contract tests spin up real PostgreSQL (and other backing services)
39
+ via Testcontainers / Aspire — no faked persistence in integration tests.
40
+
41
+ ## Test data hygiene
42
+
43
+ - Tests use a **shared fixture library** rather than inlining fabricated data.
44
+ - Production data MUST NOT be used in development, test, demo, or shared CI.
45
+ (Domain specifics — synthetic fixtures + terminology sentinels — in [[testing.domain]].)
46
+
47
+ ## Coverage rules
48
+
49
+ - Minimum **85% line coverage** on Application + Domain.
50
+ - **100%** on aggregate behaviors and value objects.
51
+ - Code coverage on changed files must meet the threshold (CI gate).
52
+
53
+ ## Related
54
+
55
+ - [[domain-driven-design]] · [[persistence]] · [[testing.domain]]
@@ -0,0 +1,201 @@
1
+ # Vertical Slice Standards
2
+
3
+ > Pure technology (domain-agnostic) — domain additions in [[vertical-slices.domain]]. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
4
+
5
+ ## Feature organization
6
+
7
+ - Each feature is a **self-contained vertical slice**: Command/Query, Handler, Endpoint,
8
+ Validator co-located in **one folder**.
9
+ - No horizontal "Services/Managers" layers spanning slices.
10
+
11
+ ## Folder structure (per module)
12
+
13
+ ```
14
+ <Module>/
15
+ Domain/
16
+ <Aggregate>.cs
17
+ <ChildEntity>.cs
18
+ <ValueObject>.cs
19
+ <Aggregate>Id.cs [ValueObject<Guid>] partial struct
20
+ Events/ DomainEventBase descendants
21
+ Specifications/
22
+ Persistence/<Aggregate>Configuration.cs
23
+ Features/<FeatureName>/ Command/Query + Handler + Endpoint + Validator
24
+ Interop/ external-protocol adapters (see [[vertical-slices.domain]])
25
+ Shared/ module-public DTOs + ToDto extensions
26
+ ```
27
+
28
+ ## Endpoint conventions
29
+
30
+ - One endpoint **per file**. Endpoints inherit `SecureFastEndpoint<TRequest, TResponse>`.
31
+ - Kebab-case routes; resources are plural nouns; verbs map to intent
32
+ (POST create, GET list/fetch, PUT full update, PATCH partial update, DELETE logical delete).
33
+ - GUID route ids **MUST** use the `:guid` constraint.
34
+ - Tagged via `Options(o => o.WithTags("NN - <Module> - (FastEndpoints)"))` and **MUST**
35
+ provide a `Summary`.
36
+ - HTTP request classes are declared **inside the same file as the Endpoint** and contain
37
+ **primitive types only**.
38
+ - Endpoints **MUST NOT** swallow exceptions — the central exception handler owns the contract.
39
+ - See [[authorization]] for security cache policy on endpoints.
40
+
41
+ ## Validator placement
42
+
43
+ - Validators live in the **feature folder** alongside the Command/Query they validate.
44
+ - Validators check **request shape only**; aggregate invariants are enforced in the Domain.
45
+
46
+ ## DTO placement (immutable contracts)
47
+
48
+ - DTOs live in `{Module}/Shared/` and are mapped with **hand-written** `ToDto()` /
49
+ `ToDtoList()` extension methods. AutoMapper-style reflection mappers are FORBIDDEN.
50
+ - `record EntityDto { public required Guid Id { get; init; } ... }` — no setters;
51
+ required init for non-nullable members.
52
+ - Every DTO **MUST** include a base64 `RowVersionBase64` when the aggregate implements
53
+ `IConcurrencyTracked`.
54
+ - Paged results **MUST** use the standard `PagedResult<T>` shape
55
+ (`Items, TotalCount, PageNumber, PageSize`, computed `TotalPages`) with required init props.
56
+
57
+ ## Specification placement
58
+
59
+ - Query composition lives in the **Domain**, under `{Module}/Domain/Specifications/`.
60
+ See [[persistence]] for specification rules.
61
+
62
+ ## Canonical example (agent reference — `<SampleProjectName>` sample)
63
+
64
+ A complete slice: Endpoint (+ request class in the same file), Validator, DTO, and mapping.
65
+
66
+ ```csharp
67
+ // <SampleProjectName>.Service/Projects/Features/CreateProject/CreateProjectEndpoint.cs
68
+ public class CreateProjectEndpoint(IMediator _mediator)
69
+ : SecureFastEndpoint<CreateProjectRequest, ProjectDto>
70
+ {
71
+ public override void Configure()
72
+ {
73
+ Post("/projects"); // kebab-case, plural noun
74
+ Summary(s => s.Summary = "Create a new project");
75
+ Options(o => o.WithTags("02 - Project - (FastEndpoints)"));
76
+ }
77
+
78
+ protected override SecurityCachePolicy GetSecurityCachePolicy() => new()
79
+ {
80
+ SecurityLevel = SecurityLevel.Internal,
81
+ CachePolicy = CachePolicy.NoStore // mutating endpoint
82
+ };
83
+
84
+ protected override async Task<Result<ProjectDto>> ExecuteAsync(
85
+ CreateProjectRequest req, CancellationToken ct)
86
+ {
87
+ var result = await _mediator.Send(new CreateProjectCommand( // IMediator only
88
+ req.Code, req.Name, req.Description, req.StartDate, req.EndDate, req.OwnerId), ct);
89
+
90
+ if (result.IsSuccess && !string.IsNullOrWhiteSpace(result.Value?.RowVersionBase64))
91
+ HttpContext.Response.SetETagFromBase64(result.Value!.RowVersionBase64);
92
+ return result;
93
+ }
94
+ }
95
+
96
+ // Request lives in the SAME file — primitive types only
97
+ public class CreateProjectRequest
98
+ {
99
+ public string Code { get; set; } = string.Empty;
100
+ public string Name { get; set; } = string.Empty;
101
+ public string? Description { get; set; }
102
+ public DateOnly StartDate { get; set; }
103
+ public DateOnly? EndDate { get; set; }
104
+ public Guid? OwnerId { get; set; }
105
+ }
106
+ ```
107
+
108
+ ```csharp
109
+ // .../CreateProject/CreateProjectValidator.cs — request shape only
110
+ public class CreateProjectValidator : AbstractValidator<CreateProjectCommand>
111
+ {
112
+ public CreateProjectValidator()
113
+ {
114
+ RuleFor(x => x.Code).NotEmpty().MaximumLength(20).Matches(@"^[A-Z0-9\-]+$");
115
+ RuleFor(x => x.Name).NotEmpty().MaximumLength(200);
116
+ RuleFor(x => x.EndDate)
117
+ .GreaterThanOrEqualTo(x => x.StartDate).When(x => x.EndDate.HasValue);
118
+ }
119
+ }
120
+ ```
121
+
122
+ ```csharp
123
+ // {Module}/Shared/ProjectDto.cs — includes RowVersionBase64 (IConcurrencyTracked)
124
+ public record ProjectDto
125
+ {
126
+ public Guid Id { get; set; }
127
+ public string Code { get; set; } = string.Empty;
128
+ public string Name { get; set; } = string.Empty;
129
+ public string Status { get; set; } = string.Empty;
130
+ public Guid? OwnerId { get; set; }
131
+ public List<ProjectTaskDto> Tasks { get; set; } = new();
132
+ public string RowVersionBase64 { get; set; } = string.Empty;
133
+ }
134
+
135
+ // {Module}/Shared/ProjectMappingExtensions.cs — hand-written, zero reflection
136
+ public static class ProjectMappingExtensions
137
+ {
138
+ public static ProjectDto ToDto(this Project e) => new()
139
+ {
140
+ Id = e.Id.Value, Code = e.Code.Value, Name = e.Name,
141
+ Status = e.Status.ToString(), OwnerId = e.OwnerId?.Value,
142
+ Tasks = e.Tasks.Select(t => t.ToDto()).ToList(),
143
+ RowVersionBase64 = e.RowVersion is { Length: > 0 } rv
144
+ ? Convert.ToBase64String(rv) : string.Empty
145
+ };
146
+
147
+ public static List<ProjectDto> ToDtoList(this IEnumerable<Project> es)
148
+ => es.Select(e => e.ToDto()).ToList();
149
+ }
150
+ ```
151
+
152
+ Sub-resource endpoint for a distinct operation on a child — nested route, multiple route
153
+ params, `EmptyResponse` when there is no body to return:
154
+
155
+ ```csharp
156
+ // .../Features/AssignTask/AssignTaskEndpoint.cs
157
+ public class AssignTaskEndpoint(IMediator _mediator)
158
+ : SecureFastEndpoint<AssignTaskRequest, EmptyResponse>
159
+ {
160
+ public override void Configure()
161
+ {
162
+ Put("/projects/{projectId:guid}/tasks/{taskId:guid}/assignee"); // sub-resource
163
+ Summary(s => s.Summary = "Assign a task to a TaskUser");
164
+ Options(o => o.WithTags("02 - Project - (FastEndpoints)"));
165
+ }
166
+
167
+ protected override SecurityCachePolicy GetSecurityCachePolicy() => new()
168
+ { SecurityLevel = SecurityLevel.Internal, CachePolicy = CachePolicy.NoStore };
169
+
170
+ protected override async Task<Result<EmptyResponse>> ExecuteAsync(
171
+ AssignTaskRequest req, CancellationToken ct)
172
+ {
173
+ var projectId = Route<Guid>("projectId");
174
+ var taskId = Route<Guid>("taskId");
175
+ var result = await _mediator.Send(new AssignTaskCommand(projectId, taskId, req.AssigneeId), ct);
176
+ return result.IsSuccess
177
+ ? Result<EmptyResponse>.Ok(new EmptyResponse())
178
+ : Result<EmptyResponse>.Failure([.. result.Errors]);
179
+ }
180
+ }
181
+
182
+ public class AssignTaskRequest { public Guid AssigneeId { get; set; } }
183
+ ```
184
+
185
+ Standard `PagedResult<T>` contract (required init props, computed `TotalPages`):
186
+
187
+ ```csharp
188
+ // {Module}/Common/PagedResult.cs
189
+ public sealed class PagedResult<T>
190
+ {
191
+ public required IReadOnlyList<T> Items { get; init; }
192
+ public required int TotalCount { get; init; }
193
+ public required int PageNumber { get; init; }
194
+ public required int PageSize { get; init; }
195
+ public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
196
+ }
197
+ ```
198
+
199
+ ## Related
200
+
201
+ - [[clean-architecture]] · [[cqrs]] · [[persistence]] · [[authorization]] · [[vertical-slices.domain]]
@@ -0,0 +1,295 @@
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).