aw-spec-cli 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.appweaver/DESIGN-FORMAT.md +200 -0
- package/assets/.appweaver/ORCH-DIALECT.md +156 -0
- package/assets/.appweaver/RULE-PARTITION.md +175 -0
- package/assets/.appweaver/STACK-PROFILES.md +461 -0
- package/assets/.appweaver/ai-rules.md +180 -0
- package/assets/.appweaver/domain.json +1 -0
- package/assets/.appweaver/extensions/.registry +19 -0
- package/assets/.appweaver/extensions/agent-context/README.md +57 -0
- package/assets/.appweaver/extensions/agent-context/agent-context-config.yml +4 -0
- package/assets/.appweaver/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
- package/assets/.appweaver/extensions/agent-context/extension.yml +37 -0
- package/assets/.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
- package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
- package/assets/.appweaver/extensions.yml +16 -0
- package/assets/.appweaver/feature.json +3 -0
- package/assets/.appweaver/init-options.json +9 -0
- package/assets/.appweaver/integration.json +15 -0
- package/assets/.appweaver/integrations/aw-spec.manifest.json +9 -0
- package/assets/.appweaver/interpreter/run-skill.py +1176 -0
- package/assets/.appweaver/memory/constitution.md +50 -0
- package/assets/.appweaver/orchestrator/.smoke-out/smoke.md +6 -0
- package/assets/.appweaver/orchestrator/AGENT-PROFILE.md +94 -0
- package/assets/.appweaver/orchestrator/README.md +300 -0
- package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +74 -0
- package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +74 -0
- package/assets/.appweaver/orchestrator/modules/delta-design.orch.yaml +105 -0
- package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +101 -0
- package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +90 -0
- package/assets/.appweaver/orchestrator/modules/lane-gate.orch.yaml +126 -0
- package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +123 -0
- package/assets/.appweaver/orchestrator/orchestrator.py +1721 -0
- package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +40 -0
- package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +101 -0
- package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +245 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-constitution.skeleton.md +63 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +59 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
- package/assets/.appweaver/orchestrator/rev-templates/frontend-rule-file.skeleton.md +63 -0
- package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +116 -0
- package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
- package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-constitution.skeleton.md +125 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +123 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +294 -0
- package/assets/.appweaver/orchestrator/workflows/_smoke.orch.yaml +160 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-add-component.orch.yaml +270 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +934 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +251 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +265 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +437 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +197 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +475 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-constitution.orch.yaml +727 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml +100 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-design-ui.orch.yaml +386 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +462 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-foundation.orch.yaml +265 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +253 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-ui.orch.yaml +267 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +287 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +238 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1822 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-run.orch.yaml +194 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-domain.orch.yaml +83 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +296 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +439 -0
- package/assets/.appweaver/scripts/bash/aw-inventory.sh +17 -0
- package/assets/.appweaver/scripts/bash/aw-parity.sh +13 -0
- package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +13 -0
- package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +2626 -0
- package/assets/.appweaver/scripts/bash/aw-xref.sh +15 -0
- package/assets/.appweaver/scripts/bash/common.sh +533 -0
- package/assets/.appweaver/scripts/powershell/aw-inventory.ps1 +17 -0
- package/assets/.appweaver/scripts/powershell/aw-parity.ps1 +13 -0
- package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +13 -0
- package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +2232 -0
- package/assets/.appweaver/scripts/powershell/aw-xref.ps1 +15 -0
- package/assets/.appweaver/scripts/python/aw-component-catalog.py +121 -0
- package/assets/.appweaver/scripts/python/aw-inventory.py +1180 -0
- package/assets/.appweaver/scripts/python/aw-parity.py +380 -0
- package/assets/.appweaver/scripts/python/aw-rev-constitution.py +329 -0
- package/assets/.appweaver/scripts/python/aw-stack.py +1251 -0
- package/assets/.appweaver/scripts/python/aw-xref.py +1330 -0
- package/assets/.appweaver/scripts/python/validate_okf.py +352 -0
- package/assets/.appweaver/stack-profiles/angular.json +16 -0
- package/assets/.appweaver/stack-profiles/blazor-wasm.json +17 -0
- package/assets/.appweaver/stack-profiles/dotnet-webapi.json +15 -0
- package/assets/.appweaver/stack-profiles/go-chi.json +14 -0
- package/assets/.appweaver/stack-profiles/java-spring.json +16 -0
- package/assets/.appweaver/stack-profiles/nextjs.json +16 -0
- package/assets/.appweaver/stack-profiles/node-express.json +15 -0
- package/assets/.appweaver/stack-profiles/python-fastapi.json +16 -0
- package/assets/.appweaver/stack-profiles/react-vite.json +17 -0
- package/assets/.appweaver/stack-profiles/sveltekit.json +16 -0
- package/assets/.appweaver/stack-profiles/vue-vite.json +17 -0
- package/assets/.appweaver/stacks.json +3 -0
- package/assets/.appweaver/templates/constitution-domain-template.md +116 -0
- package/assets/.appweaver/templates/constitution-technical-template.md +108 -0
- package/assets/.appweaver/templates/constitution-ui-template.md +116 -0
- package/assets/.appweaver/templates/delta-design-template.md +69 -0
- package/assets/.appweaver/templates/delta-spec-template.md +63 -0
- package/assets/.appweaver/templates/design-template.md +383 -0
- package/assets/.appweaver/templates/okf-concept-template.md +114 -0
- package/assets/.appweaver/templates/parity-manifest-template.json +49 -0
- package/assets/.appweaver/templates/source-map-template.md +85 -0
- package/assets/.appweaver/templates/spec-template.md +309 -0
- package/assets/.appweaver/templates/ui-design-template.md +273 -0
- package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
- package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.pack.txt +5726 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-foundation.ps1 +145 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-foundation.sh +196 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.ps1 +157 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.sh +209 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.ps1 +126 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.sh +217 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.sh +218 -0
- package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
- package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.pack.txt +2833 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-foundation.ps1 +145 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-foundation.sh +196 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.ps1 +157 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.sh +209 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.ps1 +126 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.sh +217 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.sh +218 -0
- package/assets/foundations/dotnet/components/Email/README.md +119 -0
- package/assets/foundations/dotnet/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
- package/assets/foundations/dotnet/components/Email/integration.md +300 -0
- package/assets/foundations/dotnet/components/Jobs/README.md +113 -0
- package/assets/foundations/dotnet/components/Jobs/integration.md +259 -0
- package/assets/foundations/dotnet/components/QrGenerator/README.md +85 -0
- package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
- package/assets/foundations/dotnet/components/QrGenerator/integration.md +230 -0
- package/assets/foundations/dotnet/components/README.md +74 -0
- package/assets/guardrails/README.md +222 -0
- package/assets/guardrails/domain/healthcare/ai-rules.domain.md +34 -0
- package/assets/guardrails/domain/healthcare/api-versioning.domain.md +17 -0
- package/assets/guardrails/domain/healthcare/auditing.domain.md +97 -0
- package/assets/guardrails/domain/healthcare/authorization.domain.md +26 -0
- package/assets/guardrails/domain/healthcare/clinical-terms.md +20 -0
- package/assets/guardrails/domain/healthcare/coding-standards.domain.md +26 -0
- package/assets/guardrails/domain/healthcare/consent.md +19 -0
- package/assets/guardrails/domain/healthcare/cqrs.domain.md +12 -0
- package/assets/guardrails/domain/healthcare/data-classification.domain.md +28 -0
- package/assets/guardrails/domain/healthcare/dependency-policy.domain.md +11 -0
- package/assets/guardrails/domain/healthcare/dicom.md +15 -0
- package/assets/guardrails/domain/healthcare/domain-constitution.md +119 -0
- package/assets/guardrails/domain/healthcare/domain-driven-design.domain.md +28 -0
- package/assets/guardrails/domain/healthcare/eventing.domain.md +18 -0
- package/assets/guardrails/domain/healthcare/fhir.md +36 -0
- package/assets/guardrails/domain/healthcare/folder-structure.domain.md +25 -0
- package/assets/guardrails/domain/healthcare/hipaa.md +34 -0
- package/assets/guardrails/domain/healthcare/hl7.md +15 -0
- package/assets/guardrails/domain/healthcare/ihe-conformance.md +31 -0
- package/assets/guardrails/domain/healthcare/integration-terms.md +21 -0
- package/assets/guardrails/domain/healthcare/persistence.domain.md +20 -0
- package/assets/guardrails/domain/healthcare/terminology.md +30 -0
- package/assets/guardrails/domain/healthcare/testing.domain.md +15 -0
- package/assets/guardrails/domain/healthcare/ux/accessibility-standards.md +36 -0
- package/assets/guardrails/domain/healthcare/ux/content-design.md +32 -0
- package/assets/guardrails/domain/healthcare/ux/interaction-states.md +44 -0
- package/assets/guardrails/domain/healthcare/ux/journey-mapping.md +40 -0
- package/assets/guardrails/domain/healthcare/vertical-slices.domain.md +18 -0
- package/assets/guardrails/domain/healthcare/zero-trust.domain.md +12 -0
- package/assets/guardrails/domain/pharma/ai-rules.domain.md +32 -0
- package/assets/guardrails/domain/pharma/api-versioning.domain.md +20 -0
- package/assets/guardrails/domain/pharma/atc.md +22 -0
- package/assets/guardrails/domain/pharma/auditing.domain.md +90 -0
- package/assets/guardrails/domain/pharma/authorization.domain.md +25 -0
- package/assets/guardrails/domain/pharma/coding-standards.domain.md +28 -0
- package/assets/guardrails/domain/pharma/cqrs.domain.md +16 -0
- package/assets/guardrails/domain/pharma/data-classification.domain.md +24 -0
- package/assets/guardrails/domain/pharma/data-provenance.md +21 -0
- package/assets/guardrails/domain/pharma/dependency-policy.domain.md +11 -0
- package/assets/guardrails/domain/pharma/domain-constitution.md +113 -0
- package/assets/guardrails/domain/pharma/domain-driven-design.domain.md +36 -0
- package/assets/guardrails/domain/pharma/domain-requirements.sample.md +103 -0
- package/assets/guardrails/domain/pharma/eventing.domain.md +18 -0
- package/assets/guardrails/domain/pharma/fhir.md +31 -0
- package/assets/guardrails/domain/pharma/folder-structure.domain.md +26 -0
- package/assets/guardrails/domain/pharma/hl7.md +17 -0
- package/assets/guardrails/domain/pharma/idmp.md +26 -0
- package/assets/guardrails/domain/pharma/integration-terms.md +21 -0
- package/assets/guardrails/domain/pharma/ndc.md +28 -0
- package/assets/guardrails/domain/pharma/persistence.domain.md +23 -0
- package/assets/guardrails/domain/pharma/pharma-terms.md +27 -0
- package/assets/guardrails/domain/pharma/product-lifecycle.domain.md +30 -0
- package/assets/guardrails/domain/pharma/regulatory-compliance.md +19 -0
- package/assets/guardrails/domain/pharma/terminology.md +32 -0
- package/assets/guardrails/domain/pharma/testing.domain.md +19 -0
- package/assets/guardrails/domain/pharma/vertical-slices.domain.md +17 -0
- package/assets/guardrails/domain/pharma/zero-trust.domain.md +12 -0
- package/assets/guardrails/projects/dotnet-default-project/domain/domain-requirements.md +58 -0
- package/assets/guardrails/projects/dotnet-default-project/domain-rule-bindings.md +113 -0
- package/assets/guardrails/projects/dotnet-default-project/frontend/ui-requirements.md +43 -0
- package/assets/guardrails/projects/dotnet-default-project/service/technical-requirements.md +40 -0
- package/assets/guardrails/projects/dotnet-default-project/tech-rule-bindings.md +263 -0
- package/assets/guardrails/requirement-spec.txt +27 -0
- package/assets/guardrails/technology/dotnet-webapi/PACKAGING.md +184 -0
- package/assets/guardrails/technology/dotnet-webapi/api-versioning.md +44 -0
- package/assets/guardrails/technology/dotnet-webapi/auditing.md +96 -0
- package/assets/guardrails/technology/dotnet-webapi/authorization-matrix.md +14 -0
- package/assets/guardrails/technology/dotnet-webapi/authorization.md +39 -0
- package/assets/guardrails/technology/dotnet-webapi/clean-architecture.md +54 -0
- package/assets/guardrails/technology/dotnet-webapi/coding-standards.md +87 -0
- package/assets/guardrails/technology/dotnet-webapi/cqrs.md +63 -0
- package/assets/guardrails/technology/dotnet-webapi/data-classification.md +38 -0
- package/assets/guardrails/technology/dotnet-webapi/dependency-policy.md +40 -0
- package/assets/guardrails/technology/dotnet-webapi/domain-driven-design.md +91 -0
- package/assets/guardrails/technology/dotnet-webapi/eventing.md +57 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/api-versioning.md +75 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/auditing.md +84 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/authorization.md +68 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/clean-architecture.md +37 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/cqrs.md +97 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/domain-driven-design.md +141 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/eventing.md +46 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/persistence.md +207 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/vertical-slices.md +151 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/zero-trust.md +48 -0
- package/assets/guardrails/technology/dotnet-webapi/folder-structure.md +61 -0
- package/assets/guardrails/technology/dotnet-webapi/modular-monolith.md +47 -0
- package/assets/guardrails/technology/dotnet-webapi/persistence.md +82 -0
- package/assets/guardrails/technology/dotnet-webapi/technology-constitution.md +162 -0
- package/assets/guardrails/technology/dotnet-webapi/testing.md +55 -0
- package/assets/guardrails/technology/dotnet-webapi/vertical-slices.md +70 -0
- package/assets/guardrails/technology/dotnet-webapi/zero-trust.md +48 -0
- package/assets/guardrails/technology/java-spring/README.md +62 -0
- package/assets/guardrails/technology/nextjs/accessibility-implementation.md +56 -0
- package/assets/guardrails/technology/nextjs/api-client.md +56 -0
- package/assets/guardrails/technology/nextjs/api-integration.dotnet-webapi.md +174 -0
- package/assets/guardrails/technology/nextjs/api-integration.java-spring.md +203 -0
- package/assets/guardrails/technology/nextjs/auth-session.md +68 -0
- package/assets/guardrails/technology/nextjs/client-security.md +69 -0
- package/assets/guardrails/technology/nextjs/component-architecture.md +60 -0
- package/assets/guardrails/technology/nextjs/component-conventions.md +58 -0
- package/assets/guardrails/technology/nextjs/design-system.md +60 -0
- package/assets/guardrails/technology/nextjs/error-handling.md +72 -0
- package/assets/guardrails/technology/nextjs/forms-and-validation.md +75 -0
- package/assets/guardrails/technology/nextjs/frontend-testing.md +94 -0
- package/assets/guardrails/technology/nextjs/i18n.md +57 -0
- package/assets/guardrails/technology/nextjs/observability.md +67 -0
- package/assets/guardrails/technology/nextjs/performance-budgets.md +66 -0
- package/assets/guardrails/technology/nextjs/routing-navigation.md +52 -0
- package/assets/guardrails/technology/nextjs/state-management.md +70 -0
- package/assets/guardrails/technology/nextjs/ui-constitution.md +166 -0
- package/package.json +1 -1
- package/assets/docs/pharma-constitution.my-ref.md +0 -86
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# QrGenerator Component (`AppWeaver.QrGenerator`)
|
|
2
|
+
|
|
3
|
+
> Pure technology (domain-agnostic). Reference sheet for the QR-code generation component.
|
|
4
|
+
> To wire it into a project, follow the agent runbook in [integration.md](./integration.md).
|
|
5
|
+
> Commands: `/appweaver add-component`.
|
|
6
|
+
|
|
7
|
+
## What it is
|
|
8
|
+
|
|
9
|
+
A small provider-agnostic component that turns a string into a QR-code **PNG byte array**.
|
|
10
|
+
Application code depends on the `IQRGenerator` abstraction; the implementation
|
|
11
|
+
(`QRCoder` library) is selected once during DI registration.
|
|
12
|
+
|
|
13
|
+
**Use when:** a feature must produce a scannable QR code — patient/asset cards, share links,
|
|
14
|
+
check-in tokens, downloadable QR images.
|
|
15
|
+
|
|
16
|
+
## Public contract (`AppWeaver.QrGenerator`)
|
|
17
|
+
|
|
18
|
+
```csharp
|
|
19
|
+
namespace AppWeaver.QRGenerator; // note: namespace is "QRGenerator" (capital R)
|
|
20
|
+
|
|
21
|
+
public interface IQRGenerator
|
|
22
|
+
{
|
|
23
|
+
/// <summary>Encodes the content and returns a PNG image as a byte[].</summary>
|
|
24
|
+
byte[] GenerateQR(string QRContent);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Implementation detail (`QRCoderService`): ECC level **Q**, **20px** per module, output **PNG**.
|
|
29
|
+
`null` content throws `ArgumentNullException`; an **empty string is allowed** (returns a valid
|
|
30
|
+
PNG).
|
|
31
|
+
|
|
32
|
+
## Packages
|
|
33
|
+
|
|
34
|
+
| Package | Version | Role | Builder method | Provider key |
|
|
35
|
+
|---|---|---|---|---|
|
|
36
|
+
| `AppWeaver.QrGenerator` | `0.1.2` | **Required.** Abstraction + `AddQRGenerator` + facade. | — | — |
|
|
37
|
+
| `AppWeaver.QrGenerator.QRCoder` | `0.1.2` | QRCoder-backed implementation. | `UseQRCoder` | `QRCoder` |
|
|
38
|
+
|
|
39
|
+
> **Casing trap:** the **package IDs** use `QrGenerator` (lower `r`) but the **namespaces/types**
|
|
40
|
+
> use `QRGenerator` (upper `R`). `using AppWeaver.QRGenerator;` is correct.
|
|
41
|
+
|
|
42
|
+
## Registration entry point
|
|
43
|
+
|
|
44
|
+
```csharp
|
|
45
|
+
// In AppWeaver.QRGenerator.Extensions
|
|
46
|
+
IComponentBuilder<IQRGenerator> AddQRGenerator(
|
|
47
|
+
this IServiceCollection services,
|
|
48
|
+
Action<IComponentBuilder<IQRGenerator>> configureBuilder, // required
|
|
49
|
+
Action<QRConfiguration>? configureOptions = null, // set Provider here
|
|
50
|
+
IConfiguration? configuration = null); // OR bind from config
|
|
51
|
+
|
|
52
|
+
// In AppWeaver.QRGenerator.QRCoder.Extensions
|
|
53
|
+
IComponentBuilder<IQRGenerator> UseQRCoder(
|
|
54
|
+
this IComponentBuilder<IQRGenerator> builder,
|
|
55
|
+
Action<QRGeneratorOptions>? options = null, // QRGeneratorOptions is currently empty
|
|
56
|
+
IConfiguration? configuration = null); // binds section "QRGenerator.QRCoder"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`QRConfiguration` exposes a single `[Required] string Provider`. The facade resolves the keyed
|
|
60
|
+
provider whose key equals `Provider`.
|
|
61
|
+
|
|
62
|
+
## Source map (framework)
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
framework/QrGenerator/
|
|
66
|
+
Integration.md ← original endpoint tutorial (reference)
|
|
67
|
+
README.md ← component overview
|
|
68
|
+
src/
|
|
69
|
+
AppWeaver.QrGenerator/ ← IQRGenerator, AddQRGenerator, DefaultImplementation
|
|
70
|
+
AppWeaver.QrGenerator.QRCoder/ ← UseQRCoder + QRCoderService
|
|
71
|
+
test/
|
|
72
|
+
QrGenerator.QrCoder.Tests/ ← QRCoderServiceTests (xUnit)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Sample reference endpoint
|
|
76
|
+
|
|
77
|
+
A ready-to-run FastEndpoint that generates a QR PNG inline (no command/handler) is bundled at
|
|
78
|
+
[`ReferenceEndpoints/GenerateQrEndpoint.cs`](./ReferenceEndpoints/GenerateQrEndpoint.cs). It is
|
|
79
|
+
offered (opt-in) at the end of the [integration.md](./integration.md) runbook and, if accepted,
|
|
80
|
+
copied into the host project's `ReferenceEndpoints/` folder. Endpoint: `POST /reference/qr-codes`.
|
|
81
|
+
|
|
82
|
+
## Related
|
|
83
|
+
|
|
84
|
+
- [integration.md](./integration.md) · [[components-readme]] · [[cqrs]] ·
|
|
85
|
+
[[vertical-slices]] · [[dependency-policy]]
|
package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
using FastEndpoints;
|
|
2
|
+
using AppWeaver.QRGenerator; // namespace uses QRGenerator (capital R); package id is QrGenerator
|
|
3
|
+
|
|
4
|
+
// NOTE: This is a bundled SAMPLE endpoint for the AppWeaver QrGenerator component.
|
|
5
|
+
// It lives under foundations/dotnet/components/ and is NOT compiled here. `/appweaver add-component`
|
|
6
|
+
// copies it into the host project's ReferenceEndpoints/ folder and replaces the __HOSTPROJECT__ token
|
|
7
|
+
// with the host project's root namespace (e.g. AppWeaver.Health.Service).
|
|
8
|
+
namespace __HOSTPROJECT__.ReferenceEndpoints;
|
|
9
|
+
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Sample reference endpoint for the AppWeaver QrGenerator component.
|
|
12
|
+
///
|
|
13
|
+
/// Demonstrates the full sequence inline — it injects the <see cref="IQRGenerator"/> abstraction
|
|
14
|
+
/// directly, calls <c>GenerateQR</c>, and streams the PNG back as <c>image/png</c>. There is
|
|
15
|
+
/// intentionally no command / command-handler / mediator: this is a copy-paste sample only.
|
|
16
|
+
///
|
|
17
|
+
/// Behaviour note: <c>GenerateQR(null)</c> throws <see cref="System.ArgumentNullException"/>, but an
|
|
18
|
+
/// empty string is valid and returns a (small) PNG, so only <c>null</c> content is rejected here.
|
|
19
|
+
/// </summary>
|
|
20
|
+
public class GenerateQrEndpoint(IQRGenerator _qr) : Endpoint<GenerateQrRequest>
|
|
21
|
+
{
|
|
22
|
+
public override void Configure()
|
|
23
|
+
{
|
|
24
|
+
Post("/reference/qr-codes");
|
|
25
|
+
AllowAnonymous();
|
|
26
|
+
Summary(s =>
|
|
27
|
+
{
|
|
28
|
+
s.Summary = "Generate a QR-code PNG from text content";
|
|
29
|
+
s.Description = "Reference endpoint for the AppWeaver QrGenerator component. Injects "
|
|
30
|
+
+ "IQRGenerator directly (no command/handler) and returns an image/png body.";
|
|
31
|
+
});
|
|
32
|
+
Options(o => o.WithTags("Reference - QrGenerator"));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public override async Task HandleAsync(GenerateQrRequest req, CancellationToken ct)
|
|
36
|
+
{
|
|
37
|
+
if (req.Content is null) // null throws inside the provider; empty string is allowed
|
|
38
|
+
{
|
|
39
|
+
HttpContext.Response.StatusCode = 400;
|
|
40
|
+
await HttpContext.Response.WriteAsJsonAsync(
|
|
41
|
+
new { error = "'content' is required (an empty string is allowed)." }, ct);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
byte[] png = _qr.GenerateQR(req.Content);
|
|
46
|
+
|
|
47
|
+
HttpContext.Response.ContentType = "image/png";
|
|
48
|
+
HttpContext.Response.Headers["Content-Disposition"] = "inline; filename=qr-code.png";
|
|
49
|
+
await HttpContext.Response.Body.WriteAsync(png, ct);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public class GenerateQrRequest
|
|
54
|
+
{
|
|
55
|
+
/// <summary>Text to encode into the QR code. Empty string is valid; null is rejected.</summary>
|
|
56
|
+
public string? Content { get; set; }
|
|
57
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# QrGenerator Component — Integration Workflow (agent playbook)
|
|
2
|
+
|
|
3
|
+
> Pure technology (domain-agnostic). This file is an **agent runbook**: read it top-to-bottom and
|
|
4
|
+
> execute the workflow in order. It drives an interactive integration of `IQRGenerator` into a
|
|
5
|
+
> project. Read [README.md](./README.md) first for the contract. Replace `<SampleProjectName>`
|
|
6
|
+
> with the project name. Commands: `/appweaver add-component`.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Agent workflow — execute in order
|
|
11
|
+
|
|
12
|
+
1. **Load context.** Read [README.md](./README.md) and this file.
|
|
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.
|
|
19
|
+
3. **Present the implementation catalog (below) as a selection list and ASK the user which
|
|
20
|
+
implementation(s) to integrate.** Use a multi-select prompt (`AskUserQuestion`,
|
|
21
|
+
`multiSelect: true`) for consistency with the other components.
|
|
22
|
+
- This component currently ships **one** implementation (`QRCoder`). If the catalog has a single
|
|
23
|
+
row, tell the user it is the only option and proceed once they confirm (do not invent others).
|
|
24
|
+
4. **Apply “Common steps”** (§Common steps).
|
|
25
|
+
5. **For each selected implementation, apply its block** (§Implementation blocks).
|
|
26
|
+
6. **Set the provider:** `configureOptions: options => options.Provider = "<selected key>"`.
|
|
27
|
+
7. **(Optional) Build the feature slice** (§Usage) — DTO + Command + Handler + Endpoint.
|
|
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.
|
|
32
|
+
|
|
33
|
+
> **Guardrail — namespace casing.** Package IDs use `QrGenerator` (lower `r`); **namespaces/types
|
|
34
|
+
> use `QRGenerator` (upper `R`)**. `using AppWeaver.QRGenerator;` is correct — getting this wrong is
|
|
35
|
+
> the most common build break.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Implementation catalog (selection list)
|
|
40
|
+
|
|
41
|
+
| Key | Implementation | Best for | Package (v) | Settings |
|
|
42
|
+
|---|---|---|---|---|
|
|
43
|
+
| `QRCoder` | QRCoder library (PNG, ECC level Q, 20px/module) | All QR-code generation | `AppWeaver.QrGenerator.QRCoder` (0.1.2) | none (`QRGeneratorOptions` is empty) |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Common steps (apply once)
|
|
48
|
+
|
|
49
|
+
### C1 — Abstraction package version
|
|
50
|
+
|
|
51
|
+
**File:** `Directory.Packages.props`
|
|
52
|
+
|
|
53
|
+
```xml
|
|
54
|
+
<ItemGroup>
|
|
55
|
+
<!-- AppWeaver — QrGenerator (abstraction) -->
|
|
56
|
+
<PackageVersion Include="AppWeaver.QrGenerator" Version="0.1.2" />
|
|
57
|
+
<!-- + one <PackageVersion> per selected implementation — see block below -->
|
|
58
|
+
</ItemGroup>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### C2 — Project references (no `Version=`)
|
|
62
|
+
|
|
63
|
+
**File:** `src/<HostProject>/<HostProject>.csproj` (the host project resolved in step 2 — single
|
|
64
|
+
project, no separate Application/Infrastructure).
|
|
65
|
+
|
|
66
|
+
```xml
|
|
67
|
+
<ItemGroup>
|
|
68
|
+
<PackageReference Include="AppWeaver.QrGenerator" />
|
|
69
|
+
<!-- + each selected implementation’s package — see block below -->
|
|
70
|
+
</ItemGroup>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### C3 — Registration scaffold
|
|
74
|
+
|
|
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()`.
|
|
79
|
+
|
|
80
|
+
```csharp
|
|
81
|
+
using AppWeaver.QRGenerator.Extensions; // AddQRGenerator (capital R)
|
|
82
|
+
|
|
83
|
+
services.AddQRGenerator(
|
|
84
|
+
configureBuilder: builder =>
|
|
85
|
+
{
|
|
86
|
+
// ⬇ one Use…() call per selected implementation
|
|
87
|
+
},
|
|
88
|
+
configureOptions: options => options.Provider = "<selected key>"); // step 6
|
|
89
|
+
```
|
|
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
|
+
|
|
97
|
+
No `appsettings.json` entry is required — there is nothing to configure.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Implementation blocks
|
|
102
|
+
|
|
103
|
+
### QRCoder
|
|
104
|
+
```xml
|
|
105
|
+
<!-- Directory.Packages.props --> <PackageVersion Include="AppWeaver.QrGenerator.QRCoder" Version="0.1.2" />
|
|
106
|
+
<!-- *.csproj --> <PackageReference Include="AppWeaver.QrGenerator.QRCoder" />
|
|
107
|
+
```
|
|
108
|
+
```csharp
|
|
109
|
+
using AppWeaver.QRGenerator.QRCoder.Extensions; // UseQRCoder
|
|
110
|
+
// inside AddQRGenerator builder:
|
|
111
|
+
builder.UseQRCoder();
|
|
112
|
+
// → set options.Provider = "QRCoder" in step 6
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Usage (feature slice — DTO + Command + Handler + Endpoint)
|
|
118
|
+
|
|
119
|
+
Generate inside an Application command handler; inject **`IQRGenerator`**. Return the image as
|
|
120
|
+
base64 in a DTO so the API layer owns the response shape (see [[cqrs]], [[vertical-slices]]).
|
|
121
|
+
|
|
122
|
+
**DTO** — `src/<SampleProjectName>.Application/Features/Qr/Dtos/QrCodeDto.cs`
|
|
123
|
+
```csharp
|
|
124
|
+
public record QrCodeDto
|
|
125
|
+
{
|
|
126
|
+
public string Base64Image { get; init; } = string.Empty;
|
|
127
|
+
public string ContentType { get; init; } = "image/png";
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Command + Handler** — `…/Features/Qr/Commands/GenerateQrCommand.cs`
|
|
132
|
+
```csharp
|
|
133
|
+
public record GenerateQrCommand(string Content) : ICommand<Result<QrCodeDto>>;
|
|
134
|
+
|
|
135
|
+
public class GenerateQrCommandHandler(IQRGenerator _qr) // using AppWeaver.QRGenerator;
|
|
136
|
+
: ICommandHandler<GenerateQrCommand, Result<QrCodeDto>>
|
|
137
|
+
{
|
|
138
|
+
public ValueTask<Result<QrCodeDto>> Handle(GenerateQrCommand req, CancellationToken ct)
|
|
139
|
+
{
|
|
140
|
+
if (string.IsNullOrWhiteSpace(req.Content)) // GenerateQR(null) throws; guard first
|
|
141
|
+
return ValueTask.FromResult(
|
|
142
|
+
Result<QrCodeDto>.Failure(new Error("qr.empty_content", "QR content is required.", 400)));
|
|
143
|
+
|
|
144
|
+
byte[] png = _qr.GenerateQR(req.Content);
|
|
145
|
+
return ValueTask.FromResult(Result<QrCodeDto>.Ok(new QrCodeDto
|
|
146
|
+
{
|
|
147
|
+
Base64Image = Convert.ToBase64String(png),
|
|
148
|
+
ContentType = "image/png"
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Endpoint** — `src/<SampleProjectName>.Service/Qr/Features/GenerateQr/GenerateQrEndpoint.cs`
|
|
155
|
+
```csharp
|
|
156
|
+
public class GenerateQrEndpoint(IMediator _mediator) : Endpoint<GenerateQrRequest>
|
|
157
|
+
{
|
|
158
|
+
public override void Configure()
|
|
159
|
+
{
|
|
160
|
+
Post("/qr-codes");
|
|
161
|
+
Summary(s => s.Summary = "Generate a QR-code PNG from text content");
|
|
162
|
+
Options(o => o.WithTags("04 - QR - (FastEndpoints)"));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public override async Task HandleAsync(GenerateQrRequest req, CancellationToken ct)
|
|
166
|
+
{
|
|
167
|
+
var result = await _mediator.Send(new GenerateQrCommand(req.Content), ct);
|
|
168
|
+
if (result.IsSuccess && result.Value is not null)
|
|
169
|
+
{
|
|
170
|
+
var bytes = Convert.FromBase64String(result.Value.Base64Image);
|
|
171
|
+
HttpContext.Response.ContentType = result.Value.ContentType; // image/png
|
|
172
|
+
HttpContext.Response.Headers["Content-Disposition"] = "attachment; filename=qr-code.png";
|
|
173
|
+
await HttpContext.Response.Body.WriteAsync(bytes, ct);
|
|
174
|
+
}
|
|
175
|
+
else
|
|
176
|
+
{
|
|
177
|
+
HttpContext.Response.StatusCode = 400;
|
|
178
|
+
await HttpContext.Response.WriteAsJsonAsync(new { error = "Failed to generate QR code" }, ct);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public class GenerateQrRequest { public string Content { get; set; } = string.Empty; }
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
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 `foundations/dotnet/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
|
+
|
|
214
|
+
## Verification
|
|
215
|
+
|
|
216
|
+
1. **Builds** — `dotnet build` succeeds; `using` directives use `AppWeaver.QRGenerator…`; no
|
|
217
|
+
`Version=` on package references.
|
|
218
|
+
2. **Startup validates** — app boots; `options.Provider` is `"QRCoder"`.
|
|
219
|
+
3. **Resolves** — `IQRGenerator` resolves from DI.
|
|
220
|
+
4. **Generates** — `GenerateQR("test")` returns a non-empty `byte[]`; `POST /qr-codes` returns an
|
|
221
|
+
`image/png` body that opens as a scannable QR image. (`null` content throws; empty string is
|
|
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`.
|
|
226
|
+
|
|
227
|
+
## Related
|
|
228
|
+
|
|
229
|
+
- [README.md](./README.md) · [[components-readme]] · [[cqrs]] · [[vertical-slices]] ·
|
|
230
|
+
[[clean-architecture]] · [[dependency-policy]]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Framework Components — Integration Catalog
|
|
2
|
+
|
|
3
|
+
> Pure technology (domain-agnostic). These docs are the authoritative integration contracts for
|
|
4
|
+
> opt-in AppWeaver framework components. An AI coding agent (or a human) MUST read the relevant
|
|
5
|
+
> component folder **before** wiring the component into a project.
|
|
6
|
+
> Commands: `/appweaver add-component`.
|
|
7
|
+
|
|
8
|
+
Each component is an optional NuGet-distributed building block that plugs into the standard
|
|
9
|
+
AppWeaver layout (see [[folder-structure]]) via the same **provider/registry** registration
|
|
10
|
+
pattern: `AddXxx(builder => builder.UseProvider(...), options => options.Provider = "Key")`.
|
|
11
|
+
Your application code depends only on the component's **abstraction interface** — the concrete
|
|
12
|
+
provider is a single registration decision and is swappable with zero changes to feature code.
|
|
13
|
+
|
|
14
|
+
## Available components
|
|
15
|
+
|
|
16
|
+
| Component | Abstraction | Folder | Use when… |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| **Email** | `IEmailService` | [Email](./Email/README.md) | Sending transactional/notification email (MsGraph, SMTP, SendGrid, OAuth2, File). |
|
|
19
|
+
| **QrGenerator** | `IQRGenerator` | [QrGenerator](./QrGenerator/README.md) | Generating QR-code PNG images from text. |
|
|
20
|
+
| **Jobs** | `IJobScheduler` | [Jobs](./Jobs/README.md) | Background jobs — fire-and-forget, delayed, recurring, with progress + status polling. |
|
|
21
|
+
|
|
22
|
+
## How each component folder is organized
|
|
23
|
+
|
|
24
|
+
Every folder contains two independent, agent-readable files:
|
|
25
|
+
|
|
26
|
+
| File | Purpose | Read it to… |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `README.md` | Reference — what the component is, its contract, packages, implementations, file map. | Understand the API surface and the available implementations. |
|
|
29
|
+
| `integration.md` | **Agent runbook** — an ordered workflow that asks the user which implementation(s) to use, then adds the matching code. | Drive the integration interactively, end to end. |
|
|
30
|
+
|
|
31
|
+
## Integration workflow (every component's `integration.md` follows this shape)
|
|
32
|
+
|
|
33
|
+
1. The agent reads `README.md` + `integration.md` and locates the target projects.
|
|
34
|
+
2. The agent presents the component's **implementation catalog** as a selection list and **asks the
|
|
35
|
+
user** which implementation(s) to wire — via a multi-select prompt (`AskUserQuestion`,
|
|
36
|
+
`multiSelect: true`). The user may pick more than one (e.g. a production transport + a local-dev one).
|
|
37
|
+
3. The agent applies the **common steps** once, then the **per-implementation block** for each
|
|
38
|
+
selected implementation, and sets the default provider.
|
|
39
|
+
4. The agent runs the **verification** checklist and reports what was added.
|
|
40
|
+
|
|
41
|
+
## Cross-cutting rules (apply to every component)
|
|
42
|
+
|
|
43
|
+
- **R0.1** — NuGet versions live in `Directory.Packages.props` only (`<PackageVersion>`); project
|
|
44
|
+
files reference the package **without** a `Version=` attribute (see [[dependency-policy]]).
|
|
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.
|
|
64
|
+
- **R0.3** — Inject the **abstraction** (`IEmailService`, `IQRGenerator`, `IJobScheduler`) into
|
|
65
|
+
handlers — never the concrete provider type (see [[cqrs]]).
|
|
66
|
+
- **R0.4** — Always set `options.Provider = "<Key>"` explicitly. Do not rely on the implicit
|
|
67
|
+
"first registered" fallback — it is order-dependent and, for Email, hardcoded.
|
|
68
|
+
- **R0.5** — Secrets (client secrets, API keys, SMTP passwords, connection strings) MUST NOT be
|
|
69
|
+
committed. Use user-secrets / environment variables / key vault (see [[ai-rules]]).
|
|
70
|
+
|
|
71
|
+
## Related
|
|
72
|
+
|
|
73
|
+
- [[folder-structure]] · [[clean-architecture]] · [[cqrs]] · [[vertical-slices]] ·
|
|
74
|
+
[[dependency-policy]] · [[persistence]]
|