Skip to content

Docs Index

Agent entry point — read only what the task needs.

  • architecture.md — the rings, the dependency flow, the key patterns, a request stage by stage, domain versus integration events and what each delivery step guarantees, shipping Api.Contracts as a package, scheduled use cases
  • development.md — prerequisites, commands, running the app, the testing map (what each project proves, the shared tests/TestSupport/ files, running part of the suite, which helper for which goal: InvoiceFactory, the drivers, ShouldBeSuccess()), when the build fails (RSLT001, CS9057), when a request fails, vulnerable packages, bumping the SDK, the agent hooks (what each decides, adding one, turning them off)
  • deployment.md — a one-host quick start (images, aspire publish, .env, docker compose up, the first probe), container images (tags, an SBOM), what aspire publish produces and what to add, edge TLS + forwarded headers, the migration job, required production config, probes, OTLP and trace sampling, the telemetry reference (every source, meter, instrument, attribute and log event id, test-checked), outbox and idempotency runbooks
  • upgrading.md — adopting a newer template version: regenerate, diff, merge
  • features/invoices.md — the canonical "copy me" vertical slice
  • features/auth.md — Identity + JWT, refresh rotation/revocation, permissions, lockout
  • features/exchange-rates.md — the reference outbound HTTP integration (typed client, per-client resilience, cached probe)
  • threat-model.md — assets, mitigations that exist today, known gaps to decide before production
  • api/openapi.v1.json — the committed OpenAPI contract, regenerated with UPDATE_OPENAPI_SNAPSHOT=1 and checked against the served document on every test run (ADR-0025)
  • releasing.md — releasing the template package: an agent dry run before a minor release, CHANGELOG section, dry run, tag, nuget.org trusted publishing, recovery

Layer rules (.claude/rules/, loaded when you touch a file their glob matches)

Section titled “Layer rules (.claude/rules/, loaded when you touch a file their glob matches)”
  • api.md — src/Presentation/Api/**/*.cs: one endpoint per use case, problem details, secure by default, rate limits, idempotency, caching, paging, OpenAPI
  • application.md — src/Core/Trellis.Application/**/*.cs: slices, handlers, validators, ports, event handlers, one aggregate per command, multi-aggregate commands, handler failures and idempotency keys, per-record authorization, telemetry names, the pipeline
  • dependencies.md — Directory.Packages.props, Directory.Build.props, global.json, .github/dependabot.yml, scripts/sdk-image/**, .config/dotnet-tools.json: asking before a package, the license ceilings and the two targets that enforce them, central versions and Dependabot groups, the order to answer a NuGetAudit advisory in, bumping the SDK, a .NET major as a migration
  • domain.md — src/Core/Trellis.Domain/**/*.cs: aggregates, lifecycle rules, value objects and what they guarantee, IDs, events, specifications, choosing an ErrorType
  • infrastructure.md — src/Infrastructure/Trellis.Infrastructure/**/*.cs: adapters, options, outbound HTTP, e-mail
  • persistence.md — src/Infrastructure/Trellis.Persistence/**/*.cs: EF configurations, interceptors, tenancy, outbox, retention, options, migrations, Identity
  • sharedkernel.md — src/Core/Trellis.SharedKernel/**/*.cs: Result and errors, CQRS contracts, the decorator pipeline, cancellation filters, the unit of work
  • tests.md — tests/**/*.cs: the stack, test names, the shared test support (tests/TestSupport/: ShouldBeSuccess(), InvoiceFactory) and RSLT001 over tests, arranging through the drivers (InvoiceDriver, InvoiceHttpDriver) and the switchable TestCurrentUser, each test project's conventions (one folder per use case, the validator boundary tests), the fitness suites and their positive controls, the fixture contract and helpers, the OpenAPI snapshot
  • tools.md — tools/**/*.{cs,csproj}, .github/**/*.{yml,yaml}, docker-compose.yml: AppHost, MigrationService, the RSLT001 analyzer, CI supply-chain gates
  • site.md — site/** (template repository only, ADR-0031): the Lattice visual language and its design system, the owner's rules for the two themes, how a site change is proven before it merges

Skills (.claude/skills/, step-by-step recipes; invoke one by name, e.g. /add-feature)

Section titled “Skills (.claude/skills/, step-by-step recipes; invoke one by name, e.g. /add-feature)”
  • add-feature — a new aggregate or use case, copied from the Invoices slice from the Domain outward; a checklist that starts from the feature doc, names the test behind each enforced box, and lists the shapes the slice does not show (ownership, several aggregates, unique keys, timers, keyset paging)
  • add-integration — a call to a third-party HTTP API, copied from ExchangeRates: port, validated options, typed client, per-client resilience, a cheap cached health probe, tests, docs; and receiving the provider's webhooks (signature, deduplication on its event id)
  • add-migration — an EF Core migration generated with the containerized dotnet-ef, never hand-edited
  • add-toggle — a new template toggle wired through template config, slnx/csproj conditionals, C# blocks, CI and docs (maintainers only)
  • finish-change — a change that is done, before it is committed, pushed or opened as a pull request: format, the Release build, the tests narrowed then whole, the OpenAPI snapshot, the drift and link checks, the CHANGELOG line and the reviewers it needs, each with the CI job that fails without it; /finish-change commit also commits, /finish-change pr opens the pull request from its template
  • new-adr — record an architecture decision: the next number in the right range (0100 and up for the project's own), the index line, an optional Alternatives / Revisit when section, dated amendments instead of edits
  • remove-feature — delete the Invoices reference slice from the Domain outward once your own first feature exists
  • run-app — run the full stack with aspire run (needs a local SDK) or as sibling containers without one, and verify it end to end
  • upgrade-template — adopt a later template version (/upgrade-template <version>; it runs only when you ask): the marker, the changelog between the versions, the target regenerated with the same name and options, take, merge or keep, the schema, the gates, the marker last

Reviewers (.claude/agents/, read-only; the AGENTS.md routing says which one a change needs)

Section titled “Reviewers (.claude/agents/, read-only; the AGENTS.md routing says which one a change needs)”
  • code-reviewer — any change under src/: correctness (a catch that swallows included), the conventions of the layers touched, whether the change is tested at all, the feature doc, the OpenAPI snapshot and the CHANGELOG line it owes
  • architecture-guard — a change that adds a project, a reference or a package, or crosses a layer: the dependency flow, the Infrastructure ∥ Persistence peer rule, each layer's purity, the licence ceilings, a new project anchored in ArchitectureRules.cs
  • test-reviewer — a change that adds or changes a test or fixes a bug: the tier, a bug fix's test failing without the fix for the expected reason, ShouldBeSuccess(), factories and drivers, time without sleeping, names, fixtures, positive controls, the narrowed run
  • security-reviewer — a change to authentication, identity, hardening or the Auth feature, or to who may call an endpoint: the allowlists and permissions, tokens, credential rate limits, what reaches a log or a problem, secrets, the hardening defaults, checked against docs/threat-model.md

Each opens with what it owns, what it leaves to another reviewer and how they overlap, so a change read by several gets each point once. Their findings are claims to check against the code before acting on them.

Hooks (.claude/hooks/, run by Claude Code from .claude/settings.json)

Section titled “Hooks (.claude/hooks/, run by Claude Code from .claude/settings.json)”
  • guard-edits.sh — PreToolUse on Edit|Write: asks the person before an edit under Migrations/ or of docs/api/openapi.v1.json (the reason names the regenerate command), a new .csproj, or an edit that adds a package (Directory.Packages.props, a .csproj) or a <Project> to the .slnx; silent otherwise
  • guard-commit.sh — PreToolUse on Bash, for a git commit: denies when gitleaks, if installed, finds a secret in the staged changes; asks when the subject is not type(scope): subject
  • stop-tests.sh — Stop: blocks the stop once when the session changed .cs or .razor code under src/ or tools/ and ran no dotnet test
  • docs-drift.sh — PostToolUse on Edit|Write: runs scripts/check-docs-drift.sh --working-tree and, when code changed without the doc that describes it (or a feature doc lacks a heading the add-feature skill names), adds a reminder to the agent's context, once per session for a given report; a non-blocking reminder (CI's docs-drift job is the guarantee)

They share the helpers in common.sh; scripts/check-hooks.sh is their self-test, run by CI, and docs/development.md (Agent hooks) says how to add one or turn them off.

.mcp.json declares four servers for the project; an interactive Claude Code session asks before it uses them (a headless claude -p run loads them without asking).

  • microsoft-learn — a .NET, ASP.NET Core, EF Core or Aspire API question: read the member's documentation before guessing its name, its overloads or its behaviour
  • context7 — the current documentation of a third-party package Microsoft Learn does not cover; works without a key, and a CONTEXT7_API_KEY in the environment raises its limits
  • playwright — look at the running app in a browser (navigate, resize, read the accessibility tree, take a screenshot) instead of guessing what a page shows
  • aspire — the running AppHost's resources and their state, console and structured logs, traces, and a resource's start, stop or restart, instead of scraping the terminal (the run-app skill); it runs as aspire agent mcp, so it needs the Aspire CLI 13.5 or later on PATH and an aspire run in progress under the working directory

Optional plugins: the dotnet/skills marketplace offers .NET plugins a collaborator may install for themselves (claude plugin marketplace add dotnet/skills, then choose from /plugin); this repository enables none. dotnet gives the agent a Roslyn language server with C#, refactoring and MSBuild skills, and needs a local .NET SDK. dotnet-test adds test-writing and test-quality agents with skills for running, filtering and measuring tests. dotnet-data adds EF Core query optimisation and data-driven ASP.NET Core scaffolding. Where a plugin's advice and a rule here disagree, the rule here wins.

Template decisions (docs/adr/, 0001–0099)

Section titled “Template decisions (docs/adr/, 0001–0099)”

Numbered by the template and updated by template upgrades; record your own from 0100 (the new-adr skill).

  • 0001 — record ADRs
  • 0002 — Infrastructure ∥ Persistence peer projects
  • 0003 — hand-rolled CQRS handlers + decorator pipeline (no mediator)
  • 0004 — Result pattern over exceptions; ProblemDetails mapping
  • 0005 — hand-rolled strongly-typed IDs (Vogen alternative)
  • 0006 — EF 10 complex types for value objects + SaveChanges interceptors (in-transaction event dispatch superseded by 0018)
  • 0007 — Identity in Persistence; custom JWT auth; permission-based authz
  • 0008 — containerized SDK for build/test; Aspire run + E2E need local SDK or CI
  • 0009 — test pyramid + architecture-fitness tests; free-for-commercial libraries
  • 0010 — conditional projects in the .slnx template (XML-comment conditionals work in .NET 10)
  • 0011 — license-ceiling policy for encumbered packages
  • 0012 — Presentation split into Api and UI, each with a Common library
  • 0013 — Api.Contracts as the API's public surface
  • 0014 — AI documentation architecture
  • 0015 — shared render-mode-agnostic Razor Class Library for the Blazor UI
  • 0016 — ring-grouped source folders (Core / Infrastructure / Presentation / Shared)
  • 0017 — hand-rolled Specification, Domain stays dependency-free
  • 0018 — transactional outbox for domain events (supersedes 0006's dispatch interceptor) + command idempotency (v2 amendment: reserve in the unit of work, replay the stored response)
  • 0019 — multi-tenancy as an opt-in template toggle
  • 0020 — outbound HTTP integrations: typed client, per-client resilience, validated options
  • 0021 — API hardening defaults: deny-by-default group + allowlist test, forwarded-header trust never widens, rate limits by credential type, headers, limits
  • 0022 — tenant on the principal: membership on the user, claim-only resolution (no header), fail-closed tokens, convention-based scoping of every aggregate root
  • 0023 — outbox processor semantics: lease-based claim with dispatch outside the transaction, per-handler checkpoints, token-keyed cancellation, validated Outbox options, backlog gauges, SQL re-drive runbook
  • 0024 — problem details v2: code/type/correlationId/instance on every problem, human titles, errors[] of {field, code, description}, one writer (CustomResults + ProblemCatalog/WriteProblemAsync), status-code pages, malformed requests as 400 problems
  • 0025 — OpenAPI truth: one generated document per API version (transformers, no versioning-OpenAPI package), operationId = endpoint class, problem responses by shape from the Contracts schema, conditional GET and paging declared as served, typed status/money/version, snapshot-gated committed document
  • 0026 — read caching: HybridCache cache-aside in the endpoint, keys only from the scoped CacheKeys service (tenant-scoped under multi-tenancy), L1 30 s / L2 5 min as the staleness bound, post-commit eviction, misses never pinned
  • 0027 — data retention for the bookkeeping tables: DataRetentionJanitor, validated Retention windows, set-based sweeps that never touch pending outbox rows; business data out of scope
  • 0028 — use-case telemetry: one outcome line per invocation with the level by outcome class, one span with outcome tags, Trellis.* subscription by prefix, enforced instrument and attribute names
  • 0029 — central package management with transitive pinning, NuGetAudit on the whole graph, Dependabot groups for the families that must move together
  • 0030 — a discarded Result fails the build: the in-repository RSLT001 analyzer (tools/Trellis.Analyzers), loaded into every project, what it reports and exempts, the Roslyn version ceiling
  • 0031 — the documentation website (template repository only): Astro + Starlight in site/ rendering docs/ in place, conditionals as labelled asides, every link validated, no third-party request, deployed from the release tag, a preview with a banner

Project decisions (docs/adr/, 0100 and up)

Section titled “Project decisions (docs/adr/, 0100 and up)”

None yet: the first decision this project records takes number 0100.

The documentation of Trellis.Templates 0.2.0 · release notes