Skip to content
Back to skills

Coreex Aspire

ASecurity

Wire a change into a CoreEx Aspire AppHost and its Test.Aspire end-to-end project. USE FOR: adding a host to the AppHost, adding a Service Bus queue/topic to the Test.Aspire topology, wiring an inter-domain HTTP dependency (service discovery), stubbing a third-party or out-of-AppHost HTTP dependency via the MockHost, and writing a cross-host E2E test (OnBeforeStartAsync / OnAfterStartAsync, polling async effects). DO NOT USE FOR: starting/stopping/debugging a running AppHost (use the aspire s...

  • 29 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 9, 2026
databasestestingdebugginggitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add Avanade/CoreEx --skill coreex-aspire --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coreex Aspire?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coreex Aspire
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/avanade-coreex-aspire/badge)](https://www.skillsdirectory.com/skills/avanade-coreex-aspire)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: coreex-aspire
description: "Wire a change into a CoreEx Aspire AppHost and its Test.Aspire end-to-end project. USE FOR: adding a host to the AppHost, adding a Service Bus queue/topic to the Test.Aspire topology, wiring an inter-domain HTTP dependency (service discovery), stubbing a third-party or out-of-AppHost HTTP dependency via the MockHost, and writing a cross-host E2E test (OnBeforeStartAsync / OnAfterStartAsync, polling async effects). DO NOT USE FOR: starting/stopping/debugging a running AppHost (use the aspire skill), intra-domain host tests (use coreex-test-api / coreex-test-subscribe / coreex-test-relay), the initial AppHost scaffold (use coreex-scaffold), or the typed HTTP client / adapter itself (use coreex-adapter)."
argument-hint: "Optional: what changed (new host / new queue / inter-domain HTTP call / third-party HTTP call / new E2E scenario) and the callee's location (same AppHost or external)"
tags: ["coreex", "aspire", "apphost", "mockhost", "e2e", "service-bus", "http", "testing"]
---

<!--
  AI workflow asset — dual-audience notice:
  - In the Avanade/CoreEx repository: this file is the authored source. Edit it here.
  - In a consumer repository: this file was generated by `dotnet new coreex-ai` (or refreshed via
    `dotnet new coreex-ai --force` / the `/coreex-docs-sync` skill). Do not hand-edit it directly —
    propose the change upstream in Avanade/CoreEx instead, then refresh once it is released.
-->

# CoreEx: Aspire Wiring & E2E

Makes a code change *visible and testable* in the Aspire environment: AppHost resources and references, MockHost stubs for anything outside the AppHost, the code-based Service Bus topology, and a cross-host E2E test. Aspire is where **inter-domain dependencies are real** — everything intra-domain tests deliberately mock is exercised here.

## When to Use

- A new Api / Relay / Subscribe host must join the AppHost
- A change introduces a **Service Bus queue** (e.g. a command queue) that the E2E topology must create
- A new queue/topic needs session requirements or a destination-specific producer session profile
- A host now calls **another domain's HTTP API** (needs service discovery) or a **third-party API** (needs a MockHost stub)
- A cross-host flow needs an automated E2E test (`*.Test.Aspire`)
- Invoked by [`coreex-command-publish-e2e`](../coreex-command-publish-e2e/SKILL.md) and [`coreex-command-subscribe-e2e`](../coreex-command-subscribe-e2e/SKILL.md) for their final step

## When Not to Use

- Running / stopping / inspecting a live AppHost (logs, traces, resource status) — use the `aspire` skill
- Intra-domain tests — `coreex-test-api`, `coreex-test-subscribe`, `coreex-test-relay`
- Generating the AppHost for the first time — `coreex-scaffold` (`dotnet new coreex-aspire`)
- Writing the typed HTTP client / adapter — `coreex-adapter` (this skill only wires it into Aspire)

> **Resolve project-wide choices from state before asking.** Read the solution-root `AGENTS.md` **Feature Configuration**
> (`data-provider`, `messaging-provider`, `outbox-enabled`) and inspect the existing `*.Aspire/AppHost.cs`, `*.Aspire.MockHost`
> and `*.Test.Aspire` before interviewing. Include resolved values in the implementation plan.

## The Deciding Question — where does the callee live?

| Callee | Mechanism | Stub in Test.Aspire? |
|---|---|---|
| Another domain **in the same AppHost** | `.WithReference(calleeApi)` on each caller + `BaseAddress = https+http://{resource-name}` | **No** — real call |
| A **third-party** API | MockHost + `.WithMockHostEnvironment("Section__BaseAddress", mockhost, "http")` | **Yes** — `app.HttpMock(...)` in `OnAfterStartAsync` |
| Another domain **outside** this AppHost | Same as third-party | **Yes** |

Get this wrong and the E2E either hides a real integration (stubbing an in-AppHost domain) or hits the internet (not stubbing a third party).

## Workflow Overview

1. **Inspect** — read AppHost, MockHost, Test.Aspire, Test.Common `ServiceBus`, the calling host's `Program.cs` + `appsettings.Development.json`.
2. **Interview** — what changed; where each callee lives; which async effect the E2E should prove.
3. **AppHost** — add/adjust visible external resources via `CoreEx.UnitTesting`'s `AddExternalConnectionString`, `AddProject` + `WithReference` (+ `ProjectReference`); service-discovery `BaseAddress`; MockHost wiring.
4. **Topology** — add queues/topics/subscriptions to the `ServiceBus` class used by Test.Aspire (union class if multi-domain); mark session-enabled entities with `RequiresSession = true` and check the producer's exact destination-specific session profile.
5. **Test.Aspire** — prepare state, wait for hosts, configure stubs, and test with bounded polling.
6. **Validate** — build the AppHost + Test.Aspire and execute the relevant Aspire tests when infrastructure is available; report infrastructure-blocked tests explicitly.

For step-by-step guidance see [`references/workflow.md`](references/workflow.md).

## Key References

- [`/.github/instructions/coreex-aspire.instructions.md`](/.github/instructions/coreex-aspire.instructions.md) — AppHost / MockHost / Test.Aspire invariants
- [`/.github/instructions/coreex-tests.instructions.md`](/.github/instructions/coreex-tests.instructions.md) — intra-domain test conventions (what Aspire deliberately does *not* re-cover)
- [`/.github/instructions/coreex-host-setup.instructions.md`](/.github/instructions/coreex-host-setup.instructions.md) — `AddTypedHttpClient`, receivers, `Program.cs`
- Related skills: [`coreex-adapter`](../coreex-adapter/SKILL.md) (typed HTTP client), [`coreex-scaffold`](../coreex-scaffold/SKILL.md) (AppHost scaffold)
- [Aspire & End-to-End](/.github/docs/coreex/aspire.md) — optional (after `/coreex-docs-sync`)
- Illustrative examples (CoreEx sample — not present in your project): [`AppHost.cs`](https://github.com/Avanade/CoreEx/blob/main/samples/aspire/Contoso.Aspire/AppHost.cs), [`E2ETest.cs`](https://github.com/Avanade/CoreEx/blob/main/samples/aspire/Contoso.Test.Aspire/E2ETest.cs), [`ServiceBus.cs`](https://github.com/Avanade/CoreEx/blob/main/samples/aspire/Contoso.Test.Aspire/ServiceBus.cs)

Files in this skill

  • SKILL.md6.1 KB
  • references/workflow.md14.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.