|
| 1 | +--- |
| 2 | +name: hosting-integration-authoring |
| 3 | +description: Guides authoring and reviewing CommunityToolkit Aspire.Hosting integration APIs. Classifies integration archetypes, then applies self-contained best practices for naming, resource shape, run/publish/deploy behavior, eventing, connection properties, security, endpoint semantics, polyglot exports, READMEs, and tests. |
| 4 | +--- |
| 5 | + |
| 6 | +# Aspire hosting integration authoring |
| 7 | + |
| 8 | +Use this skill when creating, modifying, or reviewing `CommunityToolkit.Aspire.Hosting.*` hosting integration packages and related `Aspire.Hosting.*` APIs. |
| 9 | + |
| 10 | +This skill is self-contained. The resource files in this skill are the authoritative guidance, and repository paths are examples of existing patterns only. |
| 11 | + |
| 12 | +## First step: classify the integration |
| 13 | + |
| 14 | +Read `resources/selector-matrix.md` first. Then read `resources/app-model-fundamentals.md` for the app model rules that apply to every hosting integration. Classify the work across all four axes: |
| 15 | + |
| 16 | +1. Resource shape. |
| 17 | +2. Lifecycle mode. |
| 18 | +3. Integration role. |
| 19 | +4. Structure. |
| 20 | + |
| 21 | +Do not force the integration into a single bucket. Most integrations compose several patterns. For example, PostgreSQL is a container-backed service, has parent-child database resources, exposes connection properties, creates databases during resource readiness, and has admin UI companion helpers. |
| 22 | + |
| 23 | +## Then read the matching resources |
| 24 | + |
| 25 | +Always read the relevant archetype resource and the cross-cutting resources that apply to the change. |
| 26 | + |
| 27 | +| If the integration involves | Read | |
| 28 | +| --- | --- | |
| 29 | +| Any resource, annotation, lifecycle event, structured value, endpoint, manifest, or app-model behavior | `resources/app-model-fundamentals.md` | |
| 30 | +| Local container service, database, broker, cache, vector DB | `resources/archetype-container-backed-service.md` | |
| 31 | +| Admin UI, inspector, dashboard, load/test tool, or standalone utility container | `resources/archetype-admin-and-tool-container.md` | |
| 32 | +| Migration, package/tool install, model pull, schema deployment, DACPAC, or one-shot setup helper | `resources/archetype-setup-and-migration-helper.md` | |
| 33 | +| Serialized controller, reconciler, command-driven resource operations, drift detection, or state-machine orchestration | `resources/archetype-controller-reconciler.md` | |
| 34 | +| Sidecar, component registry, telemetry collector, service mesh, middleware, or app-wide annotation-driven infrastructure | `resources/archetype-sidecar-and-middleware.md` | |
| 35 | +| Local tunnel, webhook forwarder, callback bridge, or CLI that exposes/forwards local endpoints | `resources/archetype-tunnel-and-webhook-bridge.md` | |
| 36 | +| Secret manager, credential broker, external secret provider, or provider-backed managed secret child resources | `resources/archetype-secret-provider.md` | |
| 37 | +| External/SaaS service reference with API key/endpoint, no local container/provisioning | `resources/archetype-external-cloud-reference.md` | |
| 38 | +| Azure resource provisioning, Bicep, role assignments, existing Azure resources, emulators, local containers for Azure resources | `resources/archetype-azure-provisioning.md` | |
| 39 | +| Docker Compose, Kubernetes, Azure Container Apps, or another deployment target/publisher | `resources/archetype-deployment-target-publisher.md` and `resources/deployment-production-readiness.md` | |
| 40 | +| Python, Go, JavaScript, Node, Vite, Next.js, or another language runtime/workload | `resources/archetype-language-executable-app.md` | |
| 41 | +| Non-resource model/configuration overlay, e.g. Orleans-style APIs | `resources/archetype-overlay-configuration.md` | |
| 42 | +| Public API names, overloads, return types, polyglot AppHost compatibility, annotations, experimental state | `resources/api-naming-and-shape.md` | |
| 43 | +| Any run/publish/deploy branching | `resources/run-publish-deploy-modes.md` | |
| 44 | +| Event subscriptions, initialization, generated files, health checks, pipeline steps | `resources/eventing-and-initialization.md` | |
| 45 | +| Custom resource lifetime, synthetic/facade resources, manually allocated endpoints, or resource notification state machines | `resources/custom-lifecycle-and-facade-resources.md` | |
| 46 | +| `IResourceWithConnectionString`, `WithReference`, environment variables, URI/JDBC properties | `resources/connection-properties.md` | |
| 47 | +| Parent-child resources, companions, setup siblings, `WithReference`, waits, relationships | `resources/relationships-and-companions.md` | |
| 48 | +| `[AspireExport]`, TypeScript/polyglot AppHosts, ATS metadata, analyzer diagnostics, DTOs, union parameters, value catalogs, callback contexts | `resources/polyglot-exports.md` | |
| 49 | +| Endpoint names, service discovery, external URLs, reference endpoints, endpoint environment variables | `resources/endpoints-and-service-discovery.md` | |
| 50 | +| Secrets, parameters, credentials, managed identity, RBAC, private networking, generated artifacts containing sensitive data | `resources/security-secrets-and-identity.md` | |
| 51 | +| Resource names, physical names, annotations, constructors, mutability, model invariants | `resources/resource-model-invariants.md` | |
| 52 | +| Package metadata, preview/stable posture, `aspire add` discovery, icons, gallery/README visibility | `resources/package-and-discoverability.md` | |
| 53 | +| Dashboard icons, URLs, commands, notifications, resource logs, admin companion UX | `resources/dashboard-ux.md` | |
| 54 | +| Generated config files, `WithContainerFiles`, file permissions, temp/store usage, build dependencies | `resources/generated-files-and-container-files.md` | |
| 55 | +| Toolchain detection, path handling, Windows/macOS/Linux behavior, shell quoting, executable permissions | `resources/cross-platform-tooling.md` | |
| 56 | +| Experimental/obsolete/deprecation lifecycle, compatibility shims, migration guidance | `resources/compatibility-and-deprecation.md` | |
| 57 | +| README or tests | `resources/testing-and-readmes.md` | |
| 58 | + |
| 59 | +## Authoring workflow |
| 60 | + |
| 61 | +1. State the classification briefly before changing or reviewing code. |
| 62 | +2. Apply the archetype-specific DO/DON'T list. |
| 63 | +3. Apply every relevant cross-cutting checklist. |
| 64 | +4. Validate both run-mode and publish/deploy behavior when the integration changes those surfaces. |
| 65 | +5. Keep generated API baseline files under `*/api/*.cs` untouched unless the task explicitly asks for API baseline regeneration. |
| 66 | + |
| 67 | +## Review workflow |
| 68 | + |
| 69 | +When reviewing an integration PR, look for concrete violations that can cause wrong runtime behavior, wrong generated manifests, broken deployment output, bad public API, missing connection properties, or bad polyglot projection. Do not spend review budget on style-only comments. |
0 commit comments