aw-spec-cli 0.1.4 → 0.1.6
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.
- package/assets/.agents/agent.json +28 -0
- package/assets/.agents/skills/appweaver/SKILL.md +56 -0
- package/assets/.agents/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.claude/agent.json +27 -0
- package/assets/.claude/skills/appweaver/SKILL.md +55 -0
- package/assets/.claude/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.kilocode/agent.json +28 -0
- package/assets/.kilocode/workflows/appweaver-demo.md +59 -0
- package/assets/.kilocode/workflows/appweaver.md +55 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -54
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -34
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -23
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -17
- package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
- package/assets/.aw-spec/scripts/bash/common.sh +0 -582
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
- package/assets/.aw-spec/templates/checklist-template.md +0 -40
- package/assets/.aw-spec/templates/constitution-template.md +0 -57
- package/assets/.aw-spec/templates/plan-template.md +0 -113
- package/assets/.aw-spec/templates/spec-template.md +0 -131
- package/assets/.aw-spec/templates/tasks-template.md +0 -252
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
- package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.kilocode/rules/specify-rules.md +0 -4
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
- package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
- package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
- package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
- package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
- package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
- package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
- package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
- package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
- package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/UI.Visualization/PACKAGING.md +0 -191
- package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +0 -11768
- package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +0 -11214
- package/assets/docs/UI.Visualization/pack-foundation.ps1 +0 -165
- package/assets/docs/UI.Visualization/pack-foundation.sh +0 -206
- package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +0 -159
- package/assets/docs/UI.Visualization/pack-reference-foundation.sh +0 -205
- package/assets/docs/UI.Visualization/unpack-foundation.ps1 +0 -126
- package/assets/docs/UI.Visualization/unpack-foundation.sh +0 -217
- package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +0 -218
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/command.txt +0 -295
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +0 -70
- package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +0 -58
- package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +0 -62
- package/assets/docs/domainspecs/UIVisualization/chart-network.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +0 -75
- package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +0 -66
- package/assets/docs/domainspecs/UIVisualization/chart-survival.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/chart-violin.md +0 -61
- package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +0 -63
- package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +0 -80
- package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +0 -87
- package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +0 -47
- package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +0 -130
- package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +0 -110
- package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +0 -55
- package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/testing.domain.md +0 -52
- package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +0 -39
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -29
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -166
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -26
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -186
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/security/auditing.md +0 -117
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
package/assets/docs/command.txt
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
AW-SPEC COMMAND SHEET — Feature: Patient Registration (Patient / RegisterPatient)
|
|
3
|
-
================================================================================
|
|
4
|
-
Run these in order, one per turn, from /aw-spec-specify to /aw-spec-implement.
|
|
5
|
-
All six numbered steps are REQUIRED for this feature — clarify and analyze are
|
|
6
|
-
correctness gates, not optional extras (see their sections for why).
|
|
7
|
-
|
|
8
|
-
CONVENTIONS USED BELOW
|
|
9
|
-
- @paths are Claude Code file mentions; they are inlined as context. Paths are
|
|
10
|
-
relative to the workspace root (e:\Work\Company\Project), so they start with `docs/...`.
|
|
11
|
-
- "MANUAL TEXT" = the plain prompt you type as part of the command.
|
|
12
|
-
- The spec folder convention is specs/<Aggregate>/<Feature>; starting the feature
|
|
13
|
-
description with the token `Patient/RegisterPatient` makes /aw-spec-specify create
|
|
14
|
-
specs/Patient/RegisterPatient/ and pin it in .aw-spec/feature.json. Every later
|
|
15
|
-
command (clarify/plan/tasks/analyze/implement) auto-resolves that folder from
|
|
16
|
-
feature.json — you do NOT pass the aggregate/feature token again.
|
|
17
|
-
- The constitution (.aw-spec/memory/constitution.md) AND the domain-agnostic technical
|
|
18
|
-
standards are AUTO-LOADED by each command (see each SKILL.md) — you
|
|
19
|
-
do NOT pass those with @.
|
|
20
|
-
- The DOMAIN-SPECIFIC files shown per step come from the active domain's comandrulemap.md
|
|
21
|
-
(active domain = .aw-spec/domain.json, set via /aw-spec-select-domain). Each command offers
|
|
22
|
-
them in a selection box (Select all / Pick a subset / None); the @ mentions below are an
|
|
23
|
-
equivalent, OPTIONAL shortcut and are always loaded in addition to the auto-loaded set.
|
|
24
|
-
|
|
25
|
-
INTEROPERABILITY SCOPE FOR THIS FEATURE
|
|
26
|
-
Patient registration is an interoperability-heavy feature. It MUST support:
|
|
27
|
-
- Inbound HL7 v2 ADT^A04 (Register a Patient) via an Interop/Hl7v2 adapter that
|
|
28
|
-
converts the message to the RegisterPatientCommand (never writes to the aggregate
|
|
29
|
-
directly), over MLLP, with ACK handling.
|
|
30
|
-
- Outbound ADT emission on PatientRegisteredEvent (egress adapter).
|
|
31
|
-
- External FHIR R4 Patient projection + PIX/PDQ identity cross-reference.
|
|
32
|
-
Therefore docs/domainspecs/healthcare/hl7.md and the eventing docs are part of the context from
|
|
33
|
-
specify through implement.
|
|
34
|
-
|
|
35
|
-
SETUP (one-time per project) — set the active domain
|
|
36
|
-
/aw-spec-select-domain (lists docs/domainspecs/ folders; writes .aw-spec/domain.json)
|
|
37
|
-
/aw-spec-select-domain healthcare (or set it directly)
|
|
38
|
-
-> For this demo the domain is `healthcare` (already set). If the domain is unset or its
|
|
39
|
-
comandrulemap.md is missing, every command first asks "Continue without domain rules?
|
|
40
|
-
(Continue / Exit)" before running.
|
|
41
|
-
|
|
42
|
-
PREREQUISITE (one-time, only if the constitution has not been ratified yet)
|
|
43
|
-
/aw-spec-constitution @docs/healthcare-constitution.md @docs/domainspecs/healthcare/domain-requirements.md
|
|
44
|
-
-> docs/technology-constitution.md auto-loads (technology base); pass only the domain addenda.
|
|
45
|
-
-> Ratifies .aw-spec/memory/constitution.md. Not part of the per-feature loop.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
================================================================================
|
|
49
|
-
STEP 1 — /aw-spec-specify (create the feature spec)
|
|
50
|
-
================================================================================
|
|
51
|
-
PURPOSE
|
|
52
|
-
Create specs/Patient/RegisterPatient/spec.md (WHAT/WHY, no implementation detail)
|
|
53
|
-
and pin the folder in .aw-spec/feature.json. A git feature branch is created by the
|
|
54
|
-
before_specify hook.
|
|
55
|
-
|
|
56
|
-
CONTEXT FILES TO ADD
|
|
57
|
-
docs/domainspecs/healthcare/domain-requirements.md (bounded contexts: Patient aggregates)
|
|
58
|
-
docs/domainspecs/healthcare/clinical-terms.md (MRN, Encounter, Coverage, ...)
|
|
59
|
-
docs/domainspecs/healthcare/integration-terms.md (FHIR, HL7, PIX/PDQ, ATNA, ADT)
|
|
60
|
-
docs/domainspecs/healthcare/domain-driven-design.domain.md (Patient invariants)
|
|
61
|
-
docs/domainspecs/healthcare/fhir.md (Patient FHIR projection)
|
|
62
|
-
docs/domainspecs/healthcare/hl7.md (HL7 v2 ADT ingestion/egress) <-- HL7
|
|
63
|
-
docs/domainspecs/healthcare/dicom.md (imaging identifiers; optional for registration)
|
|
64
|
-
docs/domainspecs/healthcare/terminology.md (coded fields)
|
|
65
|
-
docs/domainspecs/healthcare/hipaa.md (PHI / minimum-necessary)
|
|
66
|
-
docs/domainspecs/healthcare/consent.md (Consent at registration)
|
|
67
|
-
docs/domainspecs/healthcare/data-classification.domain.md (PHI/PII categories)
|
|
68
|
-
docs/domainspecs/healthcare/ai-rules.domain.md (PHI masking, no invented codes)
|
|
69
|
-
|
|
70
|
-
COMMAND (copy-paste, single line)
|
|
71
|
-
/aw-spec-specify Patient/RegisterPatient Register a new patient into the master patient index. Capture demographics (legal HumanName, date of birth, administrative sex, contact points, address) and assign a tenant-unique MRN. Invariants: MRN is unique per tenant; date-of-birth must not be in the future; minimum-necessary projection by role/scope. Interoperability: inbound HL7 v2 ADT^A04 (Register a Patient) messages MUST be ingested through an Interop/Hl7v2 adapter that converts to the RegisterPatientCommand (no direct aggregate writes) over MLLP with ACK handling, and an outbound ADT emitter fires on PatientRegisteredEvent; also expose an external FHIR R4 Patient projection and PIX/PDQ identity cross-reference. Surfaces: internal REST POST /patients returning the created Patient, the FHIR R4 Patient endpoint, and the HL7 v2 ADT ingress channel. Every PHI read/write must produce an ATNA audit record. Out of scope: patient merge, portal self-registration. @docs/domainspecs/healthcare/domain-requirements.md @docs/domainspecs/healthcare/clinical-terms.md @docs/domainspecs/healthcare/integration-terms.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/dicom.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/domainspecs/healthcare/ai-rules.domain.md
|
|
72
|
-
|
|
73
|
-
MANUAL TEXT (the prompt portion, for reference)
|
|
74
|
-
Patient/RegisterPatient Register a new patient into the master patient index. Capture
|
|
75
|
-
demographics (legal HumanName, date of birth, administrative sex, contact points,
|
|
76
|
-
address) and assign a tenant-unique MRN. Optionally link an insurance Coverage and
|
|
77
|
-
capture initial patient Consent. Invariants: MRN is unique per tenant; date-of-birth
|
|
78
|
-
must not be in the future; minimum-necessary projection by role/scope.
|
|
79
|
-
Interoperability: inbound HL7 v2 ADT^A04 (Register a Patient) messages MUST be ingested
|
|
80
|
-
through an Interop/Hl7v2 adapter that converts to the RegisterPatientCommand (no direct
|
|
81
|
-
aggregate writes) over MLLP with ACK handling, and an outbound ADT emitter fires on
|
|
82
|
-
PatientRegisteredEvent; also expose an external FHIR R4 Patient projection and PIX/PDQ
|
|
83
|
-
identity cross-reference. Surfaces: internal REST POST /patients returning the created
|
|
84
|
-
PatientDto with an ETag, the FHIR R4 Patient endpoint, and the HL7 v2 ADT ingress
|
|
85
|
-
channel. Every PHI read/write must produce an ATNA audit record. Out of scope: patient
|
|
86
|
-
merge, portal self-registration.
|
|
87
|
-
|
|
88
|
-
NOTES
|
|
89
|
-
- The leading `Patient/RegisterPatient` token sets the spec folder; keep PascalCase.
|
|
90
|
-
- Expect output: SPEC_FILE = specs/Patient/RegisterPatient/spec.md.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
================================================================================
|
|
94
|
-
STEP 2 — /aw-spec-clarify (REQUIRED — feature-correctness gate)
|
|
95
|
-
================================================================================
|
|
96
|
-
WHY THIS MATTERS (do not skip)
|
|
97
|
-
Clarify finds underspecified areas and asks up to 5 targeted questions, then writes the
|
|
98
|
-
answers back into spec.md. Building plan/tasks/code on an ambiguous spec is the most
|
|
99
|
-
expensive mistake in the pipeline — for a PHI + HL7 feature the ambiguities have real
|
|
100
|
-
cost. Resolve at least:
|
|
101
|
-
- HL7 scope: only ADT^A04, or also A28 (add person) / A31 (update) / A08 (update info)?
|
|
102
|
-
Which MSH sending/receiving apps? MLLP vs file drop? ACK mode (AA/AE/AR) and NAK on
|
|
103
|
-
duplicate MRN?
|
|
104
|
-
- Identity: who assigns the MRN (this system vs source)? PIX/PDQ matching rules and
|
|
105
|
-
duplicate/merge-candidate handling on inbound ADT.
|
|
106
|
-
- Consent: is Consent mandatory at registration or optional? purpose-of-use default.
|
|
107
|
-
- Demographics: required vs optional fields; terminology bindings (administrative sex,
|
|
108
|
-
marital status); multiple-birth/aliases.
|
|
109
|
-
- Coverage: required at registration or deferred.
|
|
110
|
-
Re-run until no high-impact (scope/PHI/interop) ambiguity remains.
|
|
111
|
-
|
|
112
|
-
CONTEXT FILES TO ADD
|
|
113
|
-
docs/domainspecs/healthcare/domain-driven-design.domain.md
|
|
114
|
-
docs/domainspecs/healthcare/hl7.md (HL7 ADT clarifications) <-- HL7
|
|
115
|
-
docs/domainspecs/healthcare/hipaa.md
|
|
116
|
-
docs/domainspecs/healthcare/consent.md
|
|
117
|
-
docs/domainspecs/healthcare/clinical-terms.md
|
|
118
|
-
docs/domainspecs/healthcare/integration-terms.md
|
|
119
|
-
|
|
120
|
-
COMMAND
|
|
121
|
-
/aw-spec-clarify @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/domainspecs/healthcare/clinical-terms.md @docs/domainspecs/healthcare/integration-terms.md
|
|
122
|
-
|
|
123
|
-
MANUAL TEXT
|
|
124
|
-
(none — answer the questions it asks; the answers are written back into spec.md)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
================================================================================
|
|
128
|
-
STEP 3 — /aw-spec-plan (create the implementation plan / design)
|
|
129
|
-
================================================================================
|
|
130
|
-
PURPOSE
|
|
131
|
-
Produce plan.md (+ research/data-model/contracts) under specs/Patient/RegisterPatient/.
|
|
132
|
-
This is where the engineering standards matter most — load the architecture stack,
|
|
133
|
-
the HL7 adapter rules, and the eventing rules for inbound feeds.
|
|
134
|
-
|
|
135
|
-
CONTEXT FILES TO ADD
|
|
136
|
-
Architecture (technology):
|
|
137
|
-
docs/architecture/folder-structure.md
|
|
138
|
-
docs/architecture/clean-architecture.md
|
|
139
|
-
docs/architecture/modular-monolith.md
|
|
140
|
-
docs/architecture/cqrs.md
|
|
141
|
-
docs/architecture/vertical-slices.md
|
|
142
|
-
docs/architecture/persistence.md
|
|
143
|
-
docs/architecture/eventing.md
|
|
144
|
-
docs/domainspecs/healthcare/eventing.domain.md (HL7/FHIR inbound feeds) <-- HL7
|
|
145
|
-
docs/architecture/testing.md
|
|
146
|
-
Domain (healthcare, this slice):
|
|
147
|
-
docs/domain/domain-driven-design.md
|
|
148
|
-
docs/domainspecs/healthcare/domain-driven-design.domain.md
|
|
149
|
-
docs/domainspecs/healthcare/fhir.md
|
|
150
|
-
docs/domainspecs/healthcare/hl7.md (HL7 v2 adapter pattern) <-- HL7
|
|
151
|
-
docs/domainspecs/healthcare/dicom.md (imaging identifiers; optional for registration)
|
|
152
|
-
docs/domainspecs/healthcare/terminology.md
|
|
153
|
-
docs/domainspecs/healthcare/hipaa.md
|
|
154
|
-
docs/domainspecs/healthcare/consent.md
|
|
155
|
-
Security:
|
|
156
|
-
docs/security/authorization.md + .domain.md
|
|
157
|
-
docs/security/auditing.md + .domain.md
|
|
158
|
-
docs/domainspecs/healthcare/data-classification.domain.md
|
|
159
|
-
Governance + AI rules:
|
|
160
|
-
docs/governance/coding-standards.md + .domain.md
|
|
161
|
-
docs/glossary/ai-rules.md + .domain.md
|
|
162
|
-
|
|
163
|
-
COMMAND (copy-paste, single line)
|
|
164
|
-
/aw-spec-plan Implement RegisterPatient as a complete vertical slice in the Patients module following the loaded standards: Patient aggregate root (Vogen PatientId, MRN value object, HumanName/Address/ContactPoint value objects), RegisterPatientCommand + handler (transaction + PatientRegisteredEvent), SecureFastEndpoint POST /patients with ETag, PatientDto + hand-written ToDto, EF configuration + migration, FHIR R4 Patient projector, and the PHI-access audit behavior. Interop: an Interop/Hl7v2 inbound adapter that parses ADT^A04 and dispatches RegisterPatientCommand via IMediator (no direct aggregate writes), MLLP transport + ACK, and an outbound ADT emitter subscribed to PatientRegisteredEvent; plan PIX/PDQ identity cross-reference. Use AppWeaver.Mediator/Repository/ServiceDefaults per the docs; PostgreSQL prod / SQLite dev; no MediatR/AutoMapper. @docs/architecture/folder-structure.md @docs/architecture/clean-architecture.md @docs/architecture/modular-monolith.md @docs/architecture/cqrs.md @docs/architecture/vertical-slices.md @docs/architecture/persistence.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/architecture/testing.md @docs/domain/domain-driven-design.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/dicom.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
|
|
165
|
-
|
|
166
|
-
MANUAL TEXT (the prompt portion, for reference)
|
|
167
|
-
Implement RegisterPatient as a complete vertical slice in the Patients module following
|
|
168
|
-
the loaded standards: Patient aggregate root (Vogen PatientId, MRN value object,
|
|
169
|
-
HumanName/Address/ContactPoint value objects), RegisterPatientCommand + handler
|
|
170
|
-
(transaction + PatientRegisteredEvent), SecureFastEndpoint POST /patients with ETag,
|
|
171
|
-
PatientDto + hand-written ToDto, EF configuration + migration, FHIR R4 Patient projector,
|
|
172
|
-
and the PHI-access audit behavior. Interop: an Interop/Hl7v2 inbound adapter that parses
|
|
173
|
-
ADT^A04 and dispatches RegisterPatientCommand via IMediator (no direct aggregate writes),
|
|
174
|
-
MLLP transport + ACK, and an outbound ADT emitter subscribed to PatientRegisteredEvent;
|
|
175
|
-
plan PIX/PDQ identity cross-reference. Use AppWeaver.Mediator/Repository/ServiceDefaults
|
|
176
|
-
per the docs; PostgreSQL prod / SQLite dev; no MediatR/AutoMapper.
|
|
177
|
-
|
|
178
|
-
NOTES
|
|
179
|
-
- No aggregate/feature token here — the folder is resolved from feature.json.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
================================================================================
|
|
183
|
-
STEP 4 — /aw-spec-tasks (generate the dependency-ordered task list)
|
|
184
|
-
================================================================================
|
|
185
|
-
PURPOSE
|
|
186
|
-
Produce tasks.md from plan.md under specs/Patient/RegisterPatient/.
|
|
187
|
-
|
|
188
|
-
CONTEXT FILES TO ADD
|
|
189
|
-
docs/architecture/folder-structure.md
|
|
190
|
-
docs/architecture/vertical-slices.md (+ .domain.md)
|
|
191
|
-
docs/architecture/cqrs.md (+ .domain.md)
|
|
192
|
-
docs/architecture/persistence.md (+ .domain.md)
|
|
193
|
-
docs/architecture/testing.md (+ .domain.md)
|
|
194
|
-
docs/architecture/eventing.md (+ .domain.md)
|
|
195
|
-
docs/domainspecs/healthcare/domain-driven-design.domain.md
|
|
196
|
-
docs/domainspecs/healthcare/fhir.md
|
|
197
|
-
docs/domainspecs/healthcare/hl7.md (HL7 adapter tasks) <-- HL7
|
|
198
|
-
docs/security/authorization.md (+ .domain.md)
|
|
199
|
-
docs/security/auditing.md (+ .domain.md)
|
|
200
|
-
docs/governance/coding-standards.md (+ .domain.md)
|
|
201
|
-
docs/glossary/ai-rules.md (+ .domain.md)
|
|
202
|
-
|
|
203
|
-
COMMAND (copy-paste, single line)
|
|
204
|
-
/aw-spec-tasks Break the plan into ordered, testable tasks for the RegisterPatient slice: value objects + tests, Patient aggregate + invariant tests, EF config + migration, RegisterPatientCommand/Validator/Handler + handler tests (happy/validation/not-found/conflict), SecureFastEndpoint + integration test, FHIR Patient projector + round-trip test, HL7 v2 ADT^A04 inbound parser + outbound emitter with HL7 conformance tests against an internal corpus, PatientRegisteredEvent + publish, PHI-audit wiring. Tests precede implementation. @docs/architecture/folder-structure.md @docs/architecture/vertical-slices.md @docs/domainspecs/healthcare/vertical-slices.domain.md @docs/architecture/cqrs.md @docs/domainspecs/healthcare/cqrs.domain.md @docs/architecture/persistence.md @docs/domainspecs/healthcare/persistence.domain.md @docs/architecture/testing.md @docs/domainspecs/healthcare/testing.domain.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
|
|
205
|
-
|
|
206
|
-
MANUAL TEXT (the prompt portion, for reference)
|
|
207
|
-
Break the plan into ordered, testable tasks for the RegisterPatient slice: value objects
|
|
208
|
-
+ tests, Patient aggregate + invariant tests, EF config + migration,
|
|
209
|
-
RegisterPatientCommand/Validator/Handler + handler tests
|
|
210
|
-
(happy/validation/not-found/conflict), SecureFastEndpoint + integration test, FHIR
|
|
211
|
-
Patient projector + round-trip test, HL7 v2 ADT^A04 inbound parser + outbound emitter
|
|
212
|
-
with HL7 conformance tests against an internal corpus, PatientRegisteredEvent + publish,
|
|
213
|
-
PHI-audit wiring. Tests precede implementation.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
================================================================================
|
|
217
|
-
STEP 5 — /aw-spec-analyze (REQUIRED — cross-artifact correctness gate)
|
|
218
|
-
================================================================================
|
|
219
|
-
WHY THIS MATTERS (do not skip)
|
|
220
|
-
Analyze is a non-destructive consistency/quality check across spec.md, plan.md, and
|
|
221
|
-
tasks.md, run AFTER tasks and BEFORE implement. It is the last gate before code, and for
|
|
222
|
-
a regulated, interoperable feature it catches exactly the failures that are most costly
|
|
223
|
-
after implementation:
|
|
224
|
-
- Requirements in the spec with no covering task (e.g. ADT^A04 ingest, PIX/PDQ, Consent
|
|
225
|
-
capture, audit on every PHI write).
|
|
226
|
-
- Tasks with no basis in the spec (scope creep).
|
|
227
|
-
- Constitution NON-NEGOTIABLE gaps: missing ATNA audit task, hard-delete instead of
|
|
228
|
-
soft-delete, missing ETag/If-Match concurrency, PHI in logs, free-text where a coded
|
|
229
|
-
value object is required, a second FHIR write path, banned packages.
|
|
230
|
-
- Terminology / naming drift between artifacts.
|
|
231
|
-
Fix everything it flags by amending spec/plan/tasks, then re-run until clean.
|
|
232
|
-
|
|
233
|
-
CONTEXT FILES TO ADD
|
|
234
|
-
docs/domainspecs/healthcare/hl7.md (verify HL7 coverage) <-- HL7
|
|
235
|
-
docs/domainspecs/healthcare/hipaa.md
|
|
236
|
-
docs/domainspecs/healthcare/auditing.domain.md
|
|
237
|
-
docs/governance/coding-standards.md (+ .domain.md)
|
|
238
|
-
docs/domainspecs/healthcare/ai-rules.domain.md
|
|
239
|
-
|
|
240
|
-
COMMAND
|
|
241
|
-
/aw-spec-analyze @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/auditing.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/domainspecs/healthcare/ai-rules.domain.md
|
|
242
|
-
|
|
243
|
-
MANUAL TEXT
|
|
244
|
-
(none — review the report, then amend spec/plan/tasks for any finding and re-run)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
================================================================================
|
|
248
|
-
STEP 6 — /aw-spec-implement (execute the tasks / write the code)
|
|
249
|
-
================================================================================
|
|
250
|
-
PURPOSE
|
|
251
|
-
Execute tasks.md and produce the actual source under src/ following the standards.
|
|
252
|
-
Add the full implementation context: tasks-set + HL7 + dependency/versioning +
|
|
253
|
-
FHIR/terminology + data-classification/zero-trust.
|
|
254
|
-
|
|
255
|
-
CONTEXT FILES TO ADD
|
|
256
|
-
(everything from STEP 4) PLUS:
|
|
257
|
-
docs/domainspecs/healthcare/hl7.md (already in step 4 — keep) <-- HL7
|
|
258
|
-
docs/governance/dependency-policy.md (+ .domain.md)
|
|
259
|
-
docs/governance/api-versioning.md (+ .domain.md)
|
|
260
|
-
docs/domainspecs/healthcare/terminology.md
|
|
261
|
-
docs/security/data-classification.md (+ .domain.md)
|
|
262
|
-
docs/security/zero-trust.md (+ .domain.md)
|
|
263
|
-
|
|
264
|
-
COMMAND (copy-paste, single line)
|
|
265
|
-
/aw-spec-implement Implement the RegisterPatient tasks exactly per the loaded standards. Generate the complete vertical slice (Domain/Persistence/Features/Shared), the Interop/Hl7v2 ADT^A04 inbound adapter + outbound ADT emitter (MLLP + ACK, no direct aggregate writes), the FHIR R4 Patient projector, unit + integration + FHIR-validator + HL7-conformance tests, and the EF migration. Honor every NON-NEGOTIABLE: Result pattern, ETag/If-Match concurrency, soft-delete, ATNA audit, minimum-necessary, no PHI in logs, coded value objects, inbound feeds via adapters only, no banned packages. Do not run migrations against shared environments. @docs/architecture/folder-structure.md @docs/architecture/vertical-slices.md @docs/domainspecs/healthcare/vertical-slices.domain.md @docs/architecture/cqrs.md @docs/domainspecs/healthcare/cqrs.domain.md @docs/architecture/persistence.md @docs/domainspecs/healthcare/persistence.domain.md @docs/architecture/testing.md @docs/domainspecs/healthcare/testing.domain.md @docs/architecture/eventing.md @docs/domainspecs/healthcare/eventing.domain.md @docs/domain/domain-driven-design.md @docs/domainspecs/healthcare/domain-driven-design.domain.md @docs/domainspecs/healthcare/fhir.md @docs/domainspecs/healthcare/hl7.md @docs/domainspecs/healthcare/terminology.md @docs/domainspecs/healthcare/hipaa.md @docs/domainspecs/healthcare/consent.md @docs/security/authorization.md @docs/domainspecs/healthcare/authorization.domain.md @docs/security/auditing.md @docs/domainspecs/healthcare/auditing.domain.md @docs/security/data-classification.md @docs/domainspecs/healthcare/data-classification.domain.md @docs/security/zero-trust.md @docs/domainspecs/healthcare/zero-trust.domain.md @docs/governance/coding-standards.md @docs/domainspecs/healthcare/coding-standards.domain.md @docs/governance/dependency-policy.md @docs/domainspecs/healthcare/dependency-policy.domain.md @docs/governance/api-versioning.md @docs/domainspecs/healthcare/api-versioning.domain.md @docs/glossary/ai-rules.md @docs/domainspecs/healthcare/ai-rules.domain.md
|
|
266
|
-
|
|
267
|
-
MANUAL TEXT (the prompt portion, for reference)
|
|
268
|
-
Implement the RegisterPatient tasks exactly per the loaded standards. Generate the
|
|
269
|
-
complete vertical slice (Domain/Persistence/Features/Shared), the Interop/Hl7v2 ADT^A04
|
|
270
|
-
inbound adapter + outbound ADT emitter (MLLP + ACK, no direct aggregate writes), the
|
|
271
|
-
FHIR R4 Patient projector, unit + integration + FHIR-validator + HL7-conformance tests,
|
|
272
|
-
and the EF migration. Honor every NON-NEGOTIABLE: Result pattern, ETag/If-Match
|
|
273
|
-
concurrency, soft-delete, ATNA audit, minimum-necessary, no PHI in logs, coded value
|
|
274
|
-
objects, inbound feeds via adapters only, no banned packages. Do not run migrations
|
|
275
|
-
against shared environments.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
================================================================================
|
|
279
|
-
QUICK REFERENCE — order of operations (all required for this feature)
|
|
280
|
-
================================================================================
|
|
281
|
-
(0) /aw-spec-select-domain ... one-time: set active domain (healthcare) -> .aw-spec/domain.json
|
|
282
|
-
(0b) /aw-spec-constitution ... one-time, if not yet ratified
|
|
283
|
-
1. /aw-spec-specify ... Patient/RegisterPatient + domain/glossary + HL7 context
|
|
284
|
-
2. /aw-spec-clarify ... correctness gate: resolve HL7/PHI/identity ambiguities
|
|
285
|
-
3. /aw-spec-plan ... architecture + domain + HL7/eventing + security + governance
|
|
286
|
-
4. /aw-spec-tasks ... tasks-set + HL7 adapter/conformance tasks
|
|
287
|
-
5. /aw-spec-analyze ... correctness gate: spec<->plan<->tasks + NON-NEGOTIABLE coverage
|
|
288
|
-
6. /aw-spec-implement ... full build: slice + HL7 adapters + FHIR + tests + migration
|
|
289
|
-
|
|
290
|
-
All steps after /aw-spec-specify auto-resolve specs/Patient/RegisterPatient/ from
|
|
291
|
-
.aw-spec/feature.json — do not repeat the Patient/RegisterPatient token.
|
|
292
|
-
|
|
293
|
-
HL7 v2 is threaded through every step (docs/domainspecs/healthcare/hl7.md + docs/domainspecs/healthcare/eventing.domain.md) because inbound
|
|
294
|
-
ADT^A04 ingestion and outbound ADT emission are first-class surfaces of this feature, not an
|
|
295
|
-
afterthought — interoperability is a NON-NEGOTIABLE constitution principle (XIV).
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Email Component (`AppWeaver.Messaging.Email`)
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic). Reference sheet for the Email messaging component.
|
|
4
|
-
> To wire it into a project, follow the agent runbook in [integration.md](./integration.md).
|
|
5
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
6
|
-
|
|
7
|
-
## What it is
|
|
8
|
-
|
|
9
|
-
A provider-agnostic email-sending component. Application code depends on a single abstraction,
|
|
10
|
-
`IEmailService`; the transport (Microsoft Graph, SMTP, SendGrid, OAuth2-SMTP, or a local File
|
|
11
|
-
sink) is chosen once during DI registration via `AddEmailMessaging(...)`.
|
|
12
|
-
|
|
13
|
-
**Use when:** a feature must send transactional or notification email (user-created alerts,
|
|
14
|
-
confirmations, admin notices, password flows, attachments).
|
|
15
|
-
|
|
16
|
-
## Public contract (`AppWeaver.Messaging.Email`)
|
|
17
|
-
|
|
18
|
-
```csharp
|
|
19
|
-
namespace AppWeaver.Messaging.Email;
|
|
20
|
-
|
|
21
|
-
public interface IEmailService
|
|
22
|
-
{
|
|
23
|
-
// Convenience overload — single recipient.
|
|
24
|
-
Task SendAsync(string from, string to, string subject, string body,
|
|
25
|
-
bool isHtml = true, CancellationToken cancellationToken = default);
|
|
26
|
-
|
|
27
|
-
// Full message — multi-recipient, Cc/Bcc, attachments.
|
|
28
|
-
Task SendAsync(EmailMessage message, CancellationToken cancellationToken = default);
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```csharp
|
|
33
|
-
namespace AppWeaver.Messaging.Email.Entities;
|
|
34
|
-
|
|
35
|
-
public class EmailMessage
|
|
36
|
-
{
|
|
37
|
-
public string From { get; set; } // falls back to provider DefaultFrom if empty
|
|
38
|
-
public List<string> To { get; set; } = new();
|
|
39
|
-
public List<string> Cc { get; set; } = new();
|
|
40
|
-
public List<string> Bcc { get; set; } = new();
|
|
41
|
-
public string Subject { get; set; }
|
|
42
|
-
public string Body { get; set; }
|
|
43
|
-
public bool IsHtml { get; set; } = true;
|
|
44
|
-
public List<EmailAttachment> Attachments { get; set; } = new();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public class EmailAttachment
|
|
48
|
-
{
|
|
49
|
-
public string FileName { get; set; }
|
|
50
|
-
public byte[] Content { get; set; }
|
|
51
|
-
public string ContentType { get; set; } = "application/octet-stream";
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Packages
|
|
56
|
-
|
|
57
|
-
| Package | Version | Role | Builder method | Provider key |
|
|
58
|
-
|---|---|---|---|---|
|
|
59
|
-
| `AppWeaver.Messaging.Email` | `0.1.3` | **Required.** Abstraction + `AddEmailMessaging` + facade. | — | — |
|
|
60
|
-
| `AppWeaver.Messaging.Email.MsGraph` | `0.1.2` | Microsoft 365 / Graph API (recommended for prod). | `UseMsGraph` | `MsGraph` |
|
|
61
|
-
| `AppWeaver.Messaging.Email.Smtp` | `0.1.3` | Classic SMTP (host/port/user/password). | `UseSmtp` | `Smtp` |
|
|
62
|
-
| `AppWeaver.Messaging.Email.SendGrid` | `0.1.2` | SendGrid API key. | `UseSendGrid` | `SendGrid` |
|
|
63
|
-
| `AppWeaver.Messaging.Email.OAuth2` | `0.1.3` | OAuth2-authenticated SMTP (O365). | `UseOAuth2` | `OAuth2` |
|
|
64
|
-
| `AppWeaver.Messaging.Email.File` | `0.1.2` | Writes email to a local `.txt` file — local dev / tests. | `UseFile` | `File` |
|
|
65
|
-
|
|
66
|
-
Install the abstraction **plus exactly one provider** for the environment you are wiring.
|
|
67
|
-
|
|
68
|
-
## Provider option shapes
|
|
69
|
-
|
|
70
|
-
| Provider | Options type | Key fields | Bound config section |
|
|
71
|
-
|---|---|---|---|
|
|
72
|
-
| MsGraph | `MsGraphEmailOptions` | `TenantId`, `ClientId`, `ClientSecret`, `DefaultFrom`, `Scopes` | `Messaging.Email.MsGraph` |
|
|
73
|
-
| Smtp | `SmtpEmailOptions` | `Host`, `Port`, `Username`, `Password`, `EnableSsl`, `DefaultFrom` | `Messaging.Email.Smtp` |
|
|
74
|
-
| SendGrid | `SendGridEmailOptions` | `ApiKey` *(required)*, `DefaultFrom` | `Messaging.Email.SendGrid` |
|
|
75
|
-
| OAuth2 | `OAuth2EmailOptions` | `TenantId`, `ClientId`, `ClientSecret`, `Host`, `Port`, `Scopes`, `DefaultFrom` | `Messaging.Email.OAuth2` |
|
|
76
|
-
| File | `FileEmailOptions` | `DefaultFrom` | `Messaging.Email.Smtp` *(quirk — pass options inline)* |
|
|
77
|
-
|
|
78
|
-
## Registration entry point
|
|
79
|
-
|
|
80
|
-
```csharp
|
|
81
|
-
// In AppWeaver.Messaging.Email.Extensions
|
|
82
|
-
IComponentBuilder<IEmailService> AddEmailMessaging(
|
|
83
|
-
this IServiceCollection services,
|
|
84
|
-
Action<IComponentBuilder<IEmailService>> configureBuilder, // required
|
|
85
|
-
Action<MessagingEmailConfiguration>? configureOptions = null,// set Provider here
|
|
86
|
-
IConfiguration? configuration = null); // OR bind from config
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
`MessagingEmailConfiguration` exposes a single `[Required] string Provider`. The facade
|
|
90
|
-
(`DefaultImplementation`) resolves the keyed provider whose key equals `Provider`.
|
|
91
|
-
|
|
92
|
-
## Source map (framework)
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
framework/Messaging.Email/
|
|
96
|
-
Integration.md ← original MsGraph tutorial (reference)
|
|
97
|
-
src/
|
|
98
|
-
AppWeaver.Messaging.Email/ ← IEmailService, EmailMessage, AddEmailMessaging, facade
|
|
99
|
-
AppWeaver.Messaging.Email.MsGraph/ ← UseMsGraph + MsGraphEmailService
|
|
100
|
-
AppWeaver.Messaging.Email.Smtp/ ← UseSmtp + SmtpEmailService
|
|
101
|
-
AppWeaver.Messaging.Email.SendGrid/ ← UseSendGrid + SendGridEmailService
|
|
102
|
-
AppWeaver.Messaging.Email.OAuth2/ ← UseOAuth2 + OAuth2EmailService
|
|
103
|
-
AppWeaver.Messaging.Email.File/ ← UseFile + FileEmailService
|
|
104
|
-
test/
|
|
105
|
-
MsGraphTest/Program.cs ← MsGraph end-to-end sample
|
|
106
|
-
TestApp/Program.cs ← OAuth2 + File multi-provider sample
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Sample reference endpoint
|
|
110
|
-
|
|
111
|
-
A ready-to-run FastEndpoint that sends mail inline (no command/handler) is bundled at
|
|
112
|
-
[`ReferenceEndpoints/SendEmailEndpoint.cs`](./ReferenceEndpoints/SendEmailEndpoint.cs). It is offered
|
|
113
|
-
(opt-in) at the end of the [integration.md](./integration.md) runbook and, if accepted, copied into
|
|
114
|
-
the host project's `ReferenceEndpoints/` folder. Endpoint: `POST /reference/email/send`.
|
|
115
|
-
|
|
116
|
-
## Related
|
|
117
|
-
|
|
118
|
-
- [integration.md](./integration.md) · [[components-readme]] · [[cqrs]] ·
|
|
119
|
-
[[clean-architecture]] · [[dependency-policy]]
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
using FastEndpoints;
|
|
2
|
-
using Microsoft.Extensions.Configuration;
|
|
3
|
-
using AppWeaver.Messaging.Email;
|
|
4
|
-
|
|
5
|
-
// NOTE: This is a bundled SAMPLE endpoint for the AppWeaver Email component.
|
|
6
|
-
// It lives under docs/ and is NOT compiled here. /aw-spec-addcomponent copies it into the
|
|
7
|
-
// host project's ReferenceEndpoints/ folder and replaces the __HOSTPROJECT__ namespace token
|
|
8
|
-
// with the host project's root namespace (e.g. AppWeaver.Health.Service).
|
|
9
|
-
namespace __HOSTPROJECT__.ReferenceEndpoints;
|
|
10
|
-
|
|
11
|
-
/// <summary>
|
|
12
|
-
/// Sample reference endpoint for the AppWeaver Email component.
|
|
13
|
-
///
|
|
14
|
-
/// Demonstrates the full send sequence inline — it injects the <see cref="IEmailService"/>
|
|
15
|
-
/// abstraction directly and calls <c>SendAsync</c> with the provider wired during DI
|
|
16
|
-
/// registration (see the component's integration runbook). There is intentionally no
|
|
17
|
-
/// command / command-handler / mediator: this is a copy-paste sample only.
|
|
18
|
-
///
|
|
19
|
-
/// The active transport is whatever <c>options.Provider</c> was set to when
|
|
20
|
-
/// <c>AddEmailMessaging(...)</c> was registered. With the <c>File</c> provider the message is
|
|
21
|
-
/// written to <c>Emails_<yyyy-MM-dd>.txt</c> in the application base directory.
|
|
22
|
-
/// </summary>
|
|
23
|
-
public class SendEmailEndpoint(IEmailService _email, IConfiguration _config)
|
|
24
|
-
: Endpoint<SendEmailRequest>
|
|
25
|
-
{
|
|
26
|
-
public override void Configure()
|
|
27
|
-
{
|
|
28
|
-
Post("/reference/email/send");
|
|
29
|
-
AllowAnonymous();
|
|
30
|
-
Summary(s =>
|
|
31
|
-
{
|
|
32
|
-
s.Summary = "Send a sample email via the configured Email provider";
|
|
33
|
-
s.Description = "Reference endpoint for the AppWeaver Email component. Injects "
|
|
34
|
-
+ "IEmailService directly (no command/handler). 'from' falls back to "
|
|
35
|
-
+ "Messaging:Email:DefaultFrom when omitted.";
|
|
36
|
-
});
|
|
37
|
-
Options(o => o.WithTags("Reference - Email"));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public override async Task HandleAsync(SendEmailRequest req, CancellationToken ct)
|
|
41
|
-
{
|
|
42
|
-
if (string.IsNullOrWhiteSpace(req.To) || string.IsNullOrWhiteSpace(req.Subject))
|
|
43
|
-
{
|
|
44
|
-
HttpContext.Response.StatusCode = 400;
|
|
45
|
-
await HttpContext.Response.WriteAsJsonAsync(
|
|
46
|
-
new { error = "'to' and 'subject' are required." }, ct);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 'from' is optional in the request — fall back to the configured DefaultFrom.
|
|
51
|
-
var from = string.IsNullOrWhiteSpace(req.From)
|
|
52
|
-
? _config["Messaging:Email:DefaultFrom"] ?? "no-reply@your-domain.com"
|
|
53
|
-
: req.From;
|
|
54
|
-
|
|
55
|
-
await _email.SendAsync(from, req.To, req.Subject, req.Body ?? string.Empty, req.IsHtml, ct);
|
|
56
|
-
|
|
57
|
-
await HttpContext.Response.WriteAsJsonAsync(new
|
|
58
|
-
{
|
|
59
|
-
status = "sent",
|
|
60
|
-
from,
|
|
61
|
-
to = req.To,
|
|
62
|
-
note = "With the File provider, output is written to Emails_<yyyy-MM-dd>.txt "
|
|
63
|
-
+ "in the app base directory."
|
|
64
|
-
}, ct);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public class SendEmailRequest
|
|
69
|
-
{
|
|
70
|
-
/// <summary>Recipient address (required).</summary>
|
|
71
|
-
public string To { get; set; } = string.Empty;
|
|
72
|
-
|
|
73
|
-
/// <summary>Subject line (required).</summary>
|
|
74
|
-
public string Subject { get; set; } = string.Empty;
|
|
75
|
-
|
|
76
|
-
/// <summary>HTML or plain-text body.</summary>
|
|
77
|
-
public string Body { get; set; } = string.Empty;
|
|
78
|
-
|
|
79
|
-
/// <summary>Treat <see cref="Body"/> as HTML. Defaults to true.</summary>
|
|
80
|
-
public bool IsHtml { get; set; } = true;
|
|
81
|
-
|
|
82
|
-
/// <summary>Optional sender; falls back to Messaging:Email:DefaultFrom when omitted.</summary>
|
|
83
|
-
public string? From { get; set; }
|
|
84
|
-
}
|