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
13 changes: 12 additions & 1 deletion .agents/skills/template-authoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ A toggle's inputs, such as `authority` and `audience`, are separate symbols, ena

The package includes `src/`, `tests/`, `docs/RUN.md`, the root build files, `AGENTS.md`, `CLAUDE.md`, the persona and the engineering skills. It also packs `template/ci.yml` as the generated solution's `.github/workflows/ci.yml`, a small pipeline with no template name in it. It leaves out the rest of `.github/`, the community files and the repository and maintainer skills, which only make sense in the template repository. 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

`dotnet new search` and `dotnet new list` match any part of the template `name` or of any short name, and nothing else. `--tag` matches a whole classification, and nuget.org and `dotnet package search` read the package's `PackageTags`. So every template puts its search words in all three:

- `shortName` is a list. The first entry is the template's own name in lower case, such as `cleanminimalapi`, and never changes. After it come one or two shorter aliases, such as `cleanminimal` or `cleanmcp`, then `lmca-<key>` and `leanmeancleanapps-<key>`, where the key is the docs site's (`minimalapi`, `mcp`, `graphql`, `webapi`, `lambda`). Those two make searches for clean, lmc, lmca, lean, mean and leanmeanclean find every template. Never a bare short name such as `mcp`, which clashes with other people's templates.
- The `name` and the package `Title` match, and carry the words people search for that the name lacks, such as "(MCP)", "(Hot Chocolate)", "(Controllers)" or "AWS".
- Every template has the `Lean Mean Clean Apps` classification, so `dotnet new list --tag "Lean Mean Clean Apps"` shows the family.
- `PackageTags` carry the tags all five share, brand words included (`clean`, `cleanarchitecture`, `lmc`, `lmca`, `leanmeanclean`, `leanmeancleanapps`), then the template's own.

The README and `NUGET.md` name the aliases under the install commands, and the docs site's template options page lists them. The pipeline's Verify Template step uses the first short name.

## Steps

1. Change `template.json` or `template.csproj`. `template.csproj` references `Microsoft.TemplateEngine.Authoring.Tasks`, Microsoft's template validator, which checks `.template.config` on every build and pack; keep its output free of messages, not just errors. A new option also goes in `dotnetcli.host.json` with a short flag that doesn't clash with `dotnet new`'s own (`-n`, `-o`, `-lang`, `-h`), and in `ide.host.json` with `isVisible` set, or Visual Studio hides it.
Expand Down Expand Up @@ -74,7 +85,7 @@ The package includes `src/`, `tests/`, `docs/RUN.md`, the root build files, `AGE

## Don't

- Change `identity` or the first `shortName`; existing installs and docs depend on them. Adding a shorter alias after it is fine.
- Change `identity` or the first `shortName`; existing installs and docs depend on them. Adding aliases after it is fine (see Getting found).
- Make a primary output that isn't a project visible to the CLI. The restore post action restores every primary output it can see, so `docs/RUN.md` carries the same `HostIdentifier` condition as the action that opens it.
- Add a `.sln`. The solution is `.slnx` only, and `primaryOutputs`, the Dockerfile and the package all point at it.
- Reuse a short flag across options, or give one to `--no-restore`; the `dotnet new` templates from Microsoft leave it long, and so do we.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
# would fail the generated solution's format check.
run: |
dotnet new install packages/*.nupkg
SHORT_NAME=$(jq -r .shortName .template.config/template.json)
SHORT_NAME=$(jq -r '[.shortName] | flatten | first' .template.config/template.json)
SOURCE_NAME=$(jq -r .sourceName .template.config/template.json)

# Nothing of the template itself leaks into a generated solution: no toggle markers, and no trace of the
Expand Down
10 changes: 8 additions & 2 deletions .template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
"Lambda",
"Serverless",
"Cloud",
"Lean Mean Clean Apps",
"Clean Architecture"
],
"identity": "CleanLambdaFunction.Template",
"groupIdentity": "CleanLambdaFunction",
"generatorVersions": "[1.0.0.0-*)",
"precedence": "100",
"name": "Clean Lambda Function Template",
"name": "Clean AWS Lambda Function Template",
"description": "An AWS Lambda function on .NET 10, built with Clean Architecture minus the ceremony.",
"shortName": "cleanlambdafunction",
"shortName": [
"cleanlambdafunction",
"cleanlambda",
"lmca-lambda",
"leanmeancleanapps-lambda"
],
"tags": {
"language": "C#",
"type": "solution"
Expand Down
2 changes: 2 additions & 0 deletions NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ dotnet new cleanlambdafunction --name WorksOnMyMachine.Reviews --authorName "You
cd WorksOnMyMachine.Reviews
```

`cleanlambda` works too, for anyone who'd rather not type `cleanlambdafunction` every time, and so do `lmca-lambda` and `leanmeancleanapps-lambda`. `dotnet new search leanmeanclean` lists the whole family.

| Option | Default | What it does |
| --- | --- | --- |
| `--name`, `-n` | The folder's name | Names the solution and its root namespace |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ dotnet new cleanlambdafunction --name WorksOnMyMachine.Reviews --authorName "You
cd WorksOnMyMachine.Reviews
```

`cleanlambda` works too, for anyone who'd rather not type `cleanlambdafunction` every time, and so do `lmca-lambda` and `leanmeancleanapps-lambda`. `dotnet new search leanmeanclean` lists the whole family.

| Option | Default | What it does |
| --- | --- | --- |
| `--name`, `-n` | The folder's name | Names the solution and its root namespace |
Expand Down
4 changes: 2 additions & 2 deletions template/template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<TargetFramework>net10.0</TargetFramework>
<PackageType>Template</PackageType>
<PackageId>CleanLambdaFunction.Template</PackageId>
<Title>Clean Lambda Function Template</Title>
<Title>Clean AWS Lambda Function Template</Title>
<Authors>Stephen Walsh</Authors>
<Description>A dotnet new template for an AWS Lambda function packaged as a container image, built with a streamlined Clean Architecture on .NET 10.</Description>
<PackageTags>dotnet;csharp;dotnet-template;template;clean-architecture;cqrs;mediator;fluentvalidation;mapperly;entity-framework-core;docker;aws;aws-lambda;serverless</PackageTags>
<PackageTags>dotnet;csharp;dotnet-template;template;clean-architecture;cqrs;mediator;fluentvalidation;mapperly;entity-framework-core;docker;aws;aws-lambda;serverless;clean;cleanarchitecture;lmc;lmca;leanmeanclean;leanmeancleanapps;project-template;solution-template;net10;dotnet10;sqlite;efcore;serilog;opentelemetry;lambda;amazon;lambda-annotations;cloudformation;container-image</PackageTags>
<PackageProjectUrl>https://leanmeancleanapps.github.io/lambda/</PackageProjectUrl>
<RepositoryUrl>https://github.com/LeanMeanCleanApps/CleanLambdaFunction</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
Loading