Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .agents/skills/releases/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ Versions are the build date and run number, `YYYY.MM.DD.<run>`, like `2026.12.01

1. **Release Check** runs after Summary passes. It compares `HEAD` with the latest GitHub release tag, ignoring `.github/`. No changes means no release, unless `force` is set.
2. **Publish** downloads the packed template and logs in to NuGet with trusted publishing (`NuGet/login`, no stored API key). It publishes the Presentation project to build an SPDX bill of materials, attests the package, pushes it to nuget.org and creates the GitHub release with the package, the SBOM and notes generated from the pull request labels (`branches-and-pull-requests`).
3. A scheduled release opens its notes with "Monthly release for <month>". A manual one says "Out-of-cycle release".
3. A scheduled release opens its notes with "Monthly release for <month>". A manual one says "Out-of-cycle release". Both end with a link to the upgrade guide on the docs site.

### Before the 1st

1. Make sure everything meant for the month is merged and `main` is green.
2. Rehearse: run **Build Pipeline** from the Actions page with `run: release` and `dry-run: true`. It runs Release Check and Publish, logs in to NuGet and builds the SBOM, but pushes, attests and releases nothing. Dry runs work from any branch.
3. Read the run summary: Release Check says what it compared and whether it would publish.
4. Write the month's upgrade notes. Every release's notes link to the upgrade guide on the docs site (`guides/upgrade/`), and that page has a section per release under **What changed in each release**: a few handwritten lines on what someone with an older solution should bring in and anything that needs care, such as a setting that changed name. Add the section for the coming release in a docs site pull request, merged before the 1st. A release with nothing worth porting still gets a line saying so.

### After the 1st

Expand Down
4 changes: 3 additions & 1 deletion .agents/skills/template-authoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ The repository itself stays all on. The Presentation project and the presentatio

A toggle's inputs, such as `authority` and `audience`, are separate symbols, enabled with `isEnabled` and made required with `isRequired` only when the toggle is on. Only `dotnet new` honours those two. Visual Studio and Rider show every input whatever the toggle says ([dotnet/templating#7860](https://github.com/dotnet/templating/issues/7860)), and Rider lists checkboxes first, then text fields in alphabetical order by label. So an input's label starts with its feature, such as "Authentication authority", to sit right under its checkbox, and its IDE description says it's only used when that box is ticked. A toggle that needs another one says so in its conditions, such as `(includeTests && includeArchitectureTests)`. Verify Template checks the defaults, everything on, everything off, and each toggle flipped on its own.

Every generated solution gets `.lmca.json`, which records the template release and the options it was made with, so the docs site's upgrade guide can generate the same solution from the old and new releases and diff them. The repository's copy says `0.0.0-local`; `template/template.csproj` swaps in the package version when it packs. Its options come through the usual replacements: the `sourceName` becomes the name, `Stephen Walsh` the author name and, where the template has `--include-auth`, the `"Authority": ""` and `"Audience": ""` lines the authentication values, inside `//#if (includeAuth)`. A new option gets a line there too. Name the template by its `lmca-<key>` short name, never by anything containing the `sourceName`, which `dotnet new` would replace.

The package includes `src/`, `tests/`, `docs/RUN.md`, the root build files, `AGENTS.md`, `CLAUDE.md` and the engineering skills. It also packs `template/README.md` as the generated solution's `README.md` and `template/ci.yml` as `.github/workflows/ci.yml`, while leaving the template repository's own `README.md`, the rest of `.github/`, the community files and the repository and maintainer skills out. Those skills are listed in `RepositorySkills` in `template/template.csproj`; a new one is added there. The pipeline fails a package over 1 MB.

## Getting found
Expand Down Expand Up @@ -95,4 +97,4 @@ The README and `NUGET.md` name the aliases under the install commands, and the d

## Check

The Test job's Verify Template step installs the packed template, generates a solution and checks that nothing of the template leaked into it (no `includeAuth` markers, no trace of the template's own name, no `icon.png`) and that it has `README.md` and `.github/workflows/ci.yml`, then checks its format and runs its tests. Where the template has `--include-auth` it does it again with the toggle on, and checks that `--include-auth` without `--authority` is refused with exit code 102.
The Test job's Verify Template step installs the packed template, generates a solution and checks that nothing of the template leaked into it (no `includeAuth` markers, no trace of the template's own name, no `icon.png`) that it has `README.md` and `.github/workflows/ci.yml`, and that `.lmca.json` names the version and the options it was made with, then checks its format and runs its tests. Where the template has `--include-auth` it does it again with the toggle on, and checks that `--include-auth` without `--authority` is refused with exit code 102.
7 changes: 6 additions & 1 deletion .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,19 @@ jobs:
test ! -e "$1/icon.png"
test -f "$1/README.md"
test -f "$1/.github/workflows/ci.yml"
jq -e --arg version "$VERSION" --arg name "$1" '.version == $version and .options.name == $name' "$1/.lmca.json"
dotnet format "$1" --verify-no-changes
dotnet test "$1" --configuration Release
}

verify Template.Verification
VARIANTS="the generated solution carries nothing of the template, passes its format check, builds and passes its tests"
VARIANTS="the generated solution carries nothing of the template, records the release and options that made it, passes its format check, builds and passes its tests"

# Templates with an auth option are verified a second time with it on, and --include-auth without
# --authority has to stop before anything is written (exit code 102, a missing mandatory option).
if jq -e '.symbols.includeAuth' .template.config/template.json > /dev/null; then
verify Template.Authentication --include-auth --authority https://login.example.com --audience https://api.example.com
jq -e '.options.authentication.Authority == "https://login.example.com"' Template.Authentication/.lmca.json
set +e
dotnet new "$SHORT_NAME" --name Template.NoAuthority --output Template.NoAuthority --include-auth
NO_AUTHORITY=$?
Expand All @@ -260,6 +262,8 @@ jobs:

echo "### Template" >> "$GITHUB_STEP_SUMMARY"
echo "The packed template installs, and $VARIANTS." >> "$GITHUB_STEP_SUMMARY"
env:
VERSION: ${{ needs.build.outputs.version }}
shell: bash

analysis:
Expand Down Expand Up @@ -597,6 +601,7 @@ jobs:
else
NOTES="Out-of-cycle release. The template is normally released on the 1st of each month with every change merged since the previous release."
fi
NOTES="$NOTES Made a solution with an earlier release? The upgrade guide shows how to bring the changes in: https://leanmeanclean.dev/mcp/guides/upgrade/"
echo "notes=$NOTES" >> "$GITHUB_OUTPUT"
{
echo "### Publish${DRY_RUN:+ (dry run)}"
Expand Down
17 changes: 17 additions & 0 deletions .lmca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$comment": "The template release and options this solution was made with. The upgrade guide uses them to show what changed in the template since: https://leanmeanclean.dev/mcp/guides/upgrade/",
"template": "lmca-mcp",
"version": "0.0.0-local",
"options": {
"name": "CleanModelContextProtocol",
"authorName": "Stephen Walsh",
//#if (includeAuth)
"authentication": {
"Authority": "",
"Audience": ""
}
//#else
"authentication": null
//#endif
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ A new version lands on the 1st of each month, as long as something changed, with
dotnet new update
```

That updates the template, not the solution you already made with it. `dotnet new` hands over a solution and never looks back. The [upgrade guide](https://leanmeanclean.dev/mcp/guides/upgrade/) shows exactly what changed between your release and the latest, and lets git merge it in around your own changes.

## The family

| Template | Presentation |
Expand Down
4 changes: 4 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ docker compose up -d --build

See [docs/RUN.md](docs/RUN.md) for the ports, the database and its migrations, the Aspire dashboard and the tests.

## Template updates

`.lmca.json` records the template release and options this solution was made with. When a new release comes out, the [upgrade guide](https://leanmeanclean.dev/mcp/guides/upgrade/) uses it to show you exactly what changed, so you can bring in the parts you want. Leave it be; the upgrade updates it for you.

## Docs and coding agents

- [AGENTS.md](AGENTS.md): architecture rules, project map and the skills in `.agents/skills/` for coding agents.
Expand Down
11 changes: 11 additions & 0 deletions template/template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@
<None Include="../NUGET.md" Pack="true" PackagePath="docs/" />
</ItemGroup>

<!-- Every generated solution records the template version that made it, for the upgrade guide. -->
<Target Name="StampTemplateVersion" BeforeTargets="_GetPackageFiles">
<PropertyGroup>
<TemplateStamp>$(IntermediateOutputPath).lmca.json</TemplateStamp>
</PropertyGroup>
<WriteLinesToFile File="$(TemplateStamp)" Lines="$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)../.lmca.json').Replace('0.0.0-local', '$(PackageVersion)'))" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<None Include="$(TemplateStamp)" Pack="true" PackagePath="content/" />
</ItemGroup>
</Target>

</Project>
Loading