Contributing
Contributing
Section titled “Contributing”This page covers the repository layout and the day-to-day commands for working on
Purview.Aspire.ResourceKit. It is aimed at contributors, not consumers.
Repository layout
Section titled “Repository layout”src/src/ResourceKit— runtime APIs consumed by AppHost projects (the packable project).src/src/SourceGeneration— the Roslyn incremental generator, analyzers, suppressor, and attributes.src/src/SourceGeneration.CodeFixes— the SG0020 IDE code fix provider.src/src/Example.*— sample Aspire applications (Example.AppHostgenerated pattern,Example.ManualAppHostmanual pattern,Example.Service,Example.ServiceDefaults).src/tests/*— unit and integration tests for the runtime and the generator.docs/wiki— this documentation suite.
The NuGet package is produced from src/src/ResourceKit/ResourceKit.csproj and includes the runtime
APIs plus the analyzer/code-fix assemblies.
Building and testing
Section titled “Building and testing”The repository uses Just recipes (see Justfile). All recipes run from the
repository root.
just build # build the solution (Debug)just test # run all testsjust test-unit # run unit tests only (TUnit [Category=Unit] filter)just restore # restore dependenciesjust pack # produce NuGet packages into ./artifactsjust lint-check # CSharpier formatting checkjust lint-fix # CSharpier formatjust scrub # remove bin/obj, clean, restore, stop build serverjust version # show the current version from package.jsonTesting conventions
Section titled “Testing conventions”- Tests use TUnit (and TUnit.Mocks); do not introduce NUnit, xUnit, or MSTest patterns.
- All tests follow AAA with explicit
// Arrange,// Act,// Assertcomments. - Test names mirror production structure:
{ClassUnderTest}Testsand{SubjectOrMethodUnderTest}_{Scenario}_{Expectation}. - When a method under test accepts a
CancellationToken, pass one and make it the final argument. - Unit tests are tagged
[Category=Unit]and are the only tests CI runs.
Test projects:
src/tests/ResourceKit.UnitTests— runtime behavior (host app resources,OptionsHelper).src/tests/ResourceKit.IntegrationTests— starts the example AppHosts via TUnit.Aspire.src/tests/SourceGeneration.UnitTests— generator diagnostics/severity and attributes.src/tests/SourceGeneration.IntegrationTests— generated source content, caching, diagnostics, suppression, and the SG0020 code fix.
Reports are written to TestResults/.
Agent skills and workflows
Section titled “Agent skills and workflows”The repository carries agent skills and prompt workflows under .agents/. Consult them when working
on source generators, tests, the project SDK, or conventional commits. AGENTS.md is the canonical
agent guidance and references .agents/ for reusable workflows.
Pull requests
Section titled “Pull requests”Pull requests target main and are validated by .github/workflows/pr.yml, which delegates to the
shared Purview.Build pipeline (restore, build, CSharpier lint,
unit tests, pack, package-content validation). See Release Flow.
Commits follow Conventional Commits, enforced by commitlint and Lefthook hooks.