aw-spec-cli 0.1.2 → 0.1.3

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 (26) hide show
  1. package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
  2. package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +5726 -0
  3. package/assets/docs/ModularMonolith/pack-foundation.ps1 +145 -0
  4. package/assets/docs/ModularMonolith/pack-foundation.sh +196 -0
  5. package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +157 -0
  6. package/assets/docs/ModularMonolith/pack-reference-foundation.sh +209 -0
  7. package/assets/docs/ModularMonolith/unpack-foundation.ps1 +126 -0
  8. package/assets/docs/ModularMonolith/unpack-foundation.sh +217 -0
  9. package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
  10. package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +218 -0
  11. package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
  12. package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +157 -0
  13. package/assets/docs/VerticalSlice/pack-reference-foundation.sh +209 -0
  14. package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
  15. package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +218 -0
  16. package/assets/docs/components/Email/README.md +7 -0
  17. package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
  18. package/assets/docs/components/Email/integration.md +57 -17
  19. package/assets/docs/components/Jobs/integration.md +29 -15
  20. package/assets/docs/components/QrGenerator/README.md +7 -0
  21. package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
  22. package/assets/docs/components/QrGenerator/integration.md +51 -6
  23. package/assets/docs/components/README.md +19 -2
  24. package/assets/docs/domainspecs/healthcare/comandrulemap.md +47 -0
  25. package/assets/docs/domainspecs/pharma/comandrulemap.md +50 -0
  26. package/package.json +5 -2
@@ -10,8 +10,12 @@
10
10
  ## Agent workflow — execute in order
11
11
 
12
12
  1. **Load context.** Read [README.md](./README.md) and this file.
13
- 2. **Locate target projects** (see [[folder-structure]]): `…Application` (injects `IQRGenerator`),
14
- `…Infrastructure` (does the registration), `…Service` (API endpoints).
13
+ 2. **Resolve the host project** `<HostProject>` (see [[folder-structure]], [[components-readme]] R0.2):
14
+ the single startup project that owns **`Program.cs`** + the ASP.NET Core web SDK —
15
+ `<SampleProjectName>.Service` (Vertical Slice foundation), `<SampleProjectName>.API` (Modular
16
+ Monolith foundation), or another name in a future template. **Find it by locating `Program.cs`, not
17
+ by assuming the name.** There is **no** separate `…Application` / `…Infrastructure` project in these
18
+ foundations; `<HostProject>` is the target for C1–C3 below and holds the API endpoints.
15
19
  3. **Present the implementation catalog (below) as a selection list and ASK the user which
16
20
  implementation(s) to integrate.** Use a multi-select prompt (`AskUserQuestion`,
17
21
  `multiSelect: true`) for consistency with the other components.
@@ -21,7 +25,10 @@
21
25
  5. **For each selected implementation, apply its block** (§Implementation blocks).
22
26
  6. **Set the provider:** `configureOptions: options => options.Provider = "<selected key>"`.
23
27
  7. **(Optional) Build the feature slice** (§Usage) — DTO + Command + Handler + Endpoint.
24
- 8. **Verify** (§Verification) and report what was added.
28
+ 8. **Offer the bundled sample endpoint (ASK).** After the wiring above, ask the user (single-select
29
+ yes/no via `AskUserQuestion`) whether to add the ready-made sample endpoint. If **yes**, copy it
30
+ into the host project — see §Sample reference endpoint. If **no**, skip silently.
31
+ 9. **Verify** (§Verification) and report what was added.
25
32
 
26
33
  > **Guardrail — namespace casing.** Package IDs use `QrGenerator` (lower `r`); **namespaces/types
27
34
  > use `QRGenerator` (upper `R`)**. `using AppWeaver.QRGenerator;` is correct — getting this wrong is
@@ -53,8 +60,8 @@
53
60
 
54
61
  ### C2 — Project references (no `Version=`)
55
62
 
56
- **File:** `src/<SampleProjectName>.Application/<SampleProjectName>.Application.csproj`
57
- **File:** `src/<SampleProjectName>.Infrastructure/<SampleProjectName>.Infrastructure.csproj`
63
+ **File:** `src/<HostProject>/<HostProject>.csproj` (the host project resolved in step 2 — single
64
+ project, no separate Application/Infrastructure).
58
65
 
59
66
  ```xml
60
67
  <ItemGroup>
@@ -65,7 +72,10 @@
65
72
 
66
73
  ### C3 — Registration scaffold
67
74
 
68
- **File:** `src/<SampleProjectName>.Infrastructure/Extensions/InfrastructureServiceRegistration.cs`
75
+ **File:** the host project `<HostProject>` (step 2) — register in its
76
+ `Extensions/InfrastructureServiceRegistration.cs` (`AddInfrastructure`) when that file exists (it does
77
+ in the Vertical Slice / Modular Monolith foundations), otherwise directly in `Program.cs` **before**
78
+ `builder.Build()`.
69
79
 
70
80
  ```csharp
71
81
  using AppWeaver.QRGenerator.Extensions; // AddQRGenerator (capital R)
@@ -78,6 +88,12 @@ services.AddQRGenerator(
78
88
  configureOptions: options => options.Provider = "<selected key>"); // step 6
79
89
  ```
80
90
 
91
+ > **Dual local/Aspire startup ([[components-readme]] R0.2a).** If the host project also has an
92
+ > `AddAspireInfrastructure` method (`Extensions/AspireInfrastructureExtensions.cs`) selected by
93
+ > `if (isAspire) … else …` in `Program.cs`, add this **same** `AddQRGenerator(...)` block to **both**
94
+ > `AddInfrastructure` and `AddAspireInfrastructure` (it is DB-agnostic — identical in both), or
95
+ > `IQRGenerator` is unresolvable when the app runs under Aspire.
96
+
81
97
  No `appsettings.json` entry is required — there is nothing to configure.
82
98
 
83
99
  ---
@@ -169,6 +185,32 @@ public class GenerateQrRequest { public string Content { get; set; } = string.Em
169
185
 
170
186
  ---
171
187
 
188
+ ## Sample reference endpoint
189
+
190
+ The §Usage slice above routes through a command + handler. For a quick, self-contained sample there
191
+ is also a ready-to-run FastEndpoint bundled in this component folder at
192
+ [`ReferenceEndpoints/GenerateQrEndpoint.cs`](./ReferenceEndpoints/GenerateQrEndpoint.cs). It injects
193
+ `IQRGenerator` directly and does the **full sequence inline** — no command/handler/mediator. It is
194
+ **not** wired automatically; it is offered in workflow step 8.
195
+
196
+ **When the user opts in (step 8) — copy procedure:**
197
+
198
+ 1. Confirm `docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs` exists. If it is
199
+ missing, tell the user and skip (do not hand-write a replacement).
200
+ 2. Create `src/<HostProject>/ReferenceEndpoints/` if it does not exist (`<HostProject>` = the project
201
+ resolved in step 2).
202
+ 3. Copy the file to `src/<HostProject>/ReferenceEndpoints/GenerateQrEndpoint.cs`, replacing the
203
+ namespace token `__HOSTPROJECT__` with `<HostProject>`'s root namespace (e.g.
204
+ `AppWeaver.Health.Service`). Keep the `using AppWeaver.QRGenerator;` (capital R) — do not "fix" it
205
+ to match the package id. Change nothing else.
206
+ 4. Do **not** touch the C1–C3 wiring. FastEndpoints auto-discovers the endpoint by assembly scan, so
207
+ no extra registration is required.
208
+
209
+ **Endpoint:** `POST /reference/qr-codes` — body `{ "content" }` — returns an `image/png` body.
210
+ An empty `content` string is valid (returns a small PNG); `null` is rejected with 400.
211
+
212
+ ---
213
+
172
214
  ## Verification
173
215
 
174
216
  1. **Builds** — `dotnet build` succeeds; `using` directives use `AppWeaver.QRGenerator…`; no
@@ -178,6 +220,9 @@ public class GenerateQrRequest { public string Content { get; set; } = string.Em
178
220
  4. **Generates** — `GenerateQR("test")` returns a non-empty `byte[]`; `POST /qr-codes` returns an
179
221
  `image/png` body that opens as a scannable QR image. (`null` content throws; empty string is
180
222
  valid and returns a PNG.)
223
+ 5. **Sample endpoint (only if copied in step 8)** — the build still succeeds with
224
+ `ReferenceEndpoints/GenerateQrEndpoint.cs` added, the `__HOSTPROJECT__` token was replaced, and
225
+ `POST /reference/qr-codes` returns an `image/png`.
181
226
 
182
227
  ## Related
183
228
 
@@ -42,8 +42,25 @@ Every folder contains two independent, agent-readable files:
42
42
 
43
43
  - **R0.1** — NuGet versions live in `Directory.Packages.props` only (`<PackageVersion>`); project
44
44
  files reference the package **without** a `Version=` attribute (see [[dependency-policy]]).
45
- - **R0.2** — Register the component in the **Infrastructure** registration extension, never in a
46
- feature slice or domain code (see [[clean-architecture]]).
45
+ - **R0.2** — Register the component in the **startup/host project** — the one project that owns
46
+ `Program.cs` + the ASP.NET Core web SDK. Its name is template-dependent: `<App>.Service` (Vertical
47
+ Slice foundation), `<App>.API` (Modular Monolith foundation), and possibly other names as templates
48
+ are added — so **resolve it by locating `Program.cs`, never by assuming a fixed project name**.
49
+ These foundations have **no** separate `…Application` / `…Infrastructure` project. Put the
50
+ `AddXxx(...)` registration in that project's `Extensions/InfrastructureServiceRegistration.cs`
51
+ (`AddInfrastructure`) when that extension exists, otherwise directly in `Program.cs` before
52
+ `builder.Build()`. Never register in a feature slice or domain code (see [[clean-architecture]]).
53
+ - **R0.2a** — *(dual local/Aspire startup)* Some foundations split infrastructure registration across
54
+ **two** methods that `Program.cs` selects at runtime — `if (isAspire) AddAspireInfrastructure(...)`
55
+ (the Aspire path: `Extensions/AspireInfrastructureExtensions.cs`, typically PostgreSQL + Redis)
56
+ `else AddInfrastructure(...)` (the local/dev path:
57
+ `Extensions/InfrastructureServiceRegistration.cs`, typically SQLite + in-memory cache). When
58
+ **both** methods exist, add the component registration to **both**, or the abstraction is
59
+ unresolvable in whichever run mode you skipped (e.g. `IEmailService` throws at runtime under
60
+ Aspire). The registration block is **identical** in both — copy it verbatim — *except*
61
+ provider-specific calls (connection strings, `UseSqlite(...)` vs `UseNpgsql(...)`, cache provider),
62
+ which must match each method's existing provider. If only `AddInfrastructure` (or only `Program.cs`)
63
+ exists, register once as in R0.2.
47
64
  - **R0.3** — Inject the **abstraction** (`IEmailService`, `IQRGenerator`, `IJobScheduler`) into
48
65
  handlers — never the concrete provider type (see [[cqrs]]).
49
66
  - **R0.4** — Always set `options.Provider = "<Key>"` explicitly. Do not rely on the implicit
@@ -104,6 +104,51 @@ domain-specific ones to load **in addition** for a healthcare project.
104
104
  - docs/domainspecs/healthcare/api-versioning.domain.md
105
105
  - docs/domainspecs/healthcare/ai-rules.domain.md
106
106
 
107
+ ## /aw-spec-fast-implement
108
+
109
+ > Fast path that collapses plan + tasks + analyze + implement into one pass. This list is the
110
+ > **deduplicated union** of those four commands' headings above (here, equal to `/aw-spec-plan`).
111
+ > Load it **once** for the whole pass — do not reload per phase.
112
+
113
+ - docs/domainspecs/healthcare/folder-structure.domain.md
114
+ - docs/domainspecs/healthcare/cqrs.domain.md
115
+ - docs/domainspecs/healthcare/vertical-slices.domain.md
116
+ - docs/domainspecs/healthcare/persistence.domain.md
117
+ - docs/domainspecs/healthcare/testing.domain.md
118
+ - docs/domainspecs/healthcare/eventing.domain.md
119
+ - docs/domainspecs/healthcare/domain-driven-design.domain.md
120
+ - docs/domainspecs/healthcare/fhir.md
121
+ - docs/domainspecs/healthcare/hl7.md
122
+ - docs/domainspecs/healthcare/dicom.md
123
+ - docs/domainspecs/healthcare/terminology.md
124
+ - docs/domainspecs/healthcare/hipaa.md
125
+ - docs/domainspecs/healthcare/consent.md
126
+ - docs/domainspecs/healthcare/zero-trust.domain.md
127
+ - docs/domainspecs/healthcare/authorization.domain.md
128
+ - docs/domainspecs/healthcare/auditing.domain.md
129
+ - docs/domainspecs/healthcare/data-classification.domain.md
130
+ - docs/domainspecs/healthcare/coding-standards.domain.md
131
+ - docs/domainspecs/healthcare/dependency-policy.domain.md
132
+ - docs/domainspecs/healthcare/api-versioning.domain.md
133
+ - docs/domainspecs/healthcare/ai-rules.domain.md
134
+
135
+ ## /aw-spec-minimal-implementation
136
+
137
+ > Single-step set for healthcare — the **per-domain knob** (edit freely). `/aw-spec-minimal-implementation`
138
+ > loads these to interpret and implement the requirement in one pass; genuinely-external runtime
139
+ > services (terminology server, FHIR endpoint) are stubbed behind ports. For an audited build use
140
+ > `## /aw-spec-fast-implement`.
141
+
142
+ - docs/domainspecs/healthcare/clinical-terms.md
143
+ - docs/domainspecs/healthcare/domain-driven-design.domain.md
144
+ - docs/domainspecs/healthcare/folder-structure.domain.md
145
+ - docs/domainspecs/healthcare/vertical-slices.domain.md
146
+ - docs/domainspecs/healthcare/fhir.md
147
+ - docs/domainspecs/healthcare/hl7.md
148
+ - docs/domainspecs/healthcare/terminology.md
149
+ - docs/domainspecs/healthcare/hipaa.md
150
+ - docs/domainspecs/healthcare/ai-rules.domain.md
151
+
107
152
  ---
108
153
 
109
154
  ## Quick reference (command → file count)
@@ -117,3 +162,5 @@ domain-specific ones to load **in addition** for a healthcare project.
117
162
  | /aw-spec-tasks | 13 |
118
163
  | /aw-spec-analyze | 5 |
119
164
  | /aw-spec-implement | 20 |
165
+ | /aw-spec-fast-implement | 21 |
166
+ | /aw-spec-minimal-implementation | 9 |
@@ -121,6 +121,54 @@ domain-specific ones to load **in addition** for a medicinal-product-registratio
121
121
  - docs/domainspecs/pharma/api-versioning.domain.md
122
122
  - docs/domainspecs/pharma/ai-rules.domain.md
123
123
 
124
+ ## /aw-spec-fast-implement
125
+
126
+ > Fast path that collapses plan + tasks + analyze + implement into one pass. This list is the
127
+ > **deduplicated union** of those four commands' headings above (here, equal to `/aw-spec-plan`).
128
+ > Load it **once** for the whole pass — do not reload per phase.
129
+
130
+ - docs/domainspecs/pharma/folder-structure.domain.md
131
+ - docs/domainspecs/pharma/cqrs.domain.md
132
+ - docs/domainspecs/pharma/vertical-slices.domain.md
133
+ - docs/domainspecs/pharma/persistence.domain.md
134
+ - docs/domainspecs/pharma/testing.domain.md
135
+ - docs/domainspecs/pharma/eventing.domain.md
136
+ - docs/domainspecs/pharma/domain-driven-design.domain.md
137
+ - docs/domainspecs/pharma/product-lifecycle.domain.md
138
+ - docs/domainspecs/pharma/ndc.md
139
+ - docs/domainspecs/pharma/idmp.md
140
+ - docs/domainspecs/pharma/fhir.md
141
+ - docs/domainspecs/pharma/hl7.md
142
+ - docs/domainspecs/pharma/terminology.md
143
+ - docs/domainspecs/pharma/atc.md
144
+ - docs/domainspecs/pharma/regulatory-compliance.md
145
+ - docs/domainspecs/pharma/data-provenance.md
146
+ - docs/domainspecs/pharma/zero-trust.domain.md
147
+ - docs/domainspecs/pharma/authorization.domain.md
148
+ - docs/domainspecs/pharma/auditing.domain.md
149
+ - docs/domainspecs/pharma/data-classification.domain.md
150
+ - docs/domainspecs/pharma/coding-standards.domain.md
151
+ - docs/domainspecs/pharma/dependency-policy.domain.md
152
+ - docs/domainspecs/pharma/api-versioning.domain.md
153
+ - docs/domainspecs/pharma/ai-rules.domain.md
154
+
155
+ ## /aw-spec-minimal-implementation
156
+
157
+ > Single-step set for pharma — the **per-domain knob** (edit freely). `/aw-spec-minimal-implementation`
158
+ > loads these to interpret and implement the requirement in one pass; genuinely-external runtime
159
+ > services (terminology server, FHIR endpoint) are stubbed behind ports. For an audited build use
160
+ > `## /aw-spec-fast-implement`.
161
+
162
+ - docs/domainspecs/pharma/pharma-terms.md
163
+ - docs/domainspecs/pharma/domain-driven-design.domain.md
164
+ - docs/domainspecs/pharma/folder-structure.domain.md
165
+ - docs/domainspecs/pharma/cqrs.domain.md
166
+ - docs/domainspecs/pharma/vertical-slices.domain.md
167
+ - docs/domainspecs/pharma/product-lifecycle.domain.md
168
+ - docs/domainspecs/pharma/ndc.md
169
+ - docs/domainspecs/pharma/idmp.md
170
+ - docs/domainspecs/pharma/atc.md
171
+
124
172
  ---
125
173
 
126
174
  ## Quick reference (command → file count)
@@ -134,3 +182,5 @@ domain-specific ones to load **in addition** for a medicinal-product-registratio
134
182
  | /aw-spec-tasks | 15 |
135
183
  | /aw-spec-analyze | 7 |
136
184
  | /aw-spec-implement | 24 |
185
+ | /aw-spec-fast-implement | 24 |
186
+ | /aw-spec-minimal-implementation | 9 |
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "aw-spec-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "AppWeaver Spec-Driven Development CLI - scaffolds projects with vertical slices, DDD, CQRS, and agent skills",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "exports": {
8
+ ".": "./dist/index.js"
9
+ },
7
10
  "bin": {
8
- "aw-spec": "dist/index.js"
11
+ "aw-spec": "./dist/index.js"
9
12
  },
10
13
  "files": [
11
14
  "dist",