Skip to content

Commit 79ebb4d

Browse files
authored
Keep maintainer rules out of generated solutions (#82)
## Summary A generated solution was getting rules that only make sense in the template repository: the line about the five templates sharing Application and Infrastructure, the table of repository-only skills, and Jacques stopping to ask before any Application or Infrastructure change. They now sit inside `#if (false)`, so they stay here and never ship. `template-authoring` says so. ## Related issues Part of LeanMeanCleanApps/.github#126 ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Breaking change (the generated solution or template parameters change in a way existing users will notice) - [x] Refactoring or clean-up - [x] Documentation - [ ] Build, pipeline or dependency update ## Shared layers - [ ] This only touches the Presentation layer of this template. - [x] This touches the Application or Infrastructure layers, tests, pipeline or repository setup, so it needs to be carried across all five templates. ## Checklist - [x] `dotnet build` and `dotnet test` pass locally with no warnings. - [ ] I added or updated tests, and line coverage stays at or above 95%. - [ ] I updated the README or docs where behaviour changed. - [x] If this changes how we do something, I updated the matching skill in `.agents/skills`. - [x] I checked the template still installs and creates a working solution (see CONTRIBUTING.md).
1 parent 229a0e4 commit 79ebb4d

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎.agents/agents/jacques.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ Write the handoff as you stop, not from memory later, and never tick an item you
6262

6363
## When you stop and ask
6464

65-
- A change to `src/Application` or `src/Infrastructure`, or their tests. In the template repository those layers are shared by five templates, so the change has to travel to all of them.
6665
- A new package, or a major version upgrade.
6766
- A change to a public route, response shape, schema or anything else a client depends on.
6867
- Anything touching packaging, the pipeline or releases.
6968
- Anything no skill covers. Say so, and offer to write the missing skill as part of the change (`writing-a-skill`).
69+
<!--#if (false) -->
70+
- A change to `src/Application` or `src/Infrastructure`, or their tests. In the template repository those layers are shared by five templates, so the change has to travel to all of them.
71+
<!--#endif -->
7072

7173
## How you disagree
7274

‎.agents/skills/template-authoring/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Every optional feature is a toggle, and every toggle has the same shape, so peop
4040

4141
Off means absent, not switched off. Files that only exist for a toggle go in a `(!include<Feature>)` exclude list under `sources` in `template.json`, and code inside shared files is wrapped so `dotnet new` can leave it out. In C#, `#if includeAuth` and `#endif` start at the beginning of the line, with no brackets (the build fails IDE0047 and IDE0055 otherwise). In project files it's `<!--#if (includeAuth) -->` and `<!--#endif -->`, and in `appsettings.json` it's `//#if (includeAuth)` and `//#endif`. A file type the template engine doesn't know, such as the GraphQL schema snapshot, gets `#if (includeAuth)` and `#endif` lines through `SpecialCustomOperations` in `template.json`.
4242

43-
The repository itself stays all on. The Presentation project and the presentation integration tests define each toggle's constant, such as `includeAuth`, inside `<!--#if (false) -->`, which `dotnet new` always removes. The template's skills and `AGENTS.md` ship either way.
43+
The repository itself stays all on. The Presentation project and the presentation integration tests define each toggle's constant, such as `includeAuth`, inside `<!--#if (false) -->`, which `dotnet new` always removes. The template's skills and `AGENTS.md` ship either way. Lines in `AGENTS.md` and the persona that only make sense in the template repository, such as the table of repository skills, sit inside `<!--#if (false) -->` as well, so a generated solution never gets them.
4444

4545
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.
4646

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ Start with [Jacques](.agents/agents/jacques.md), our sous-chef and the persona e
1616
| `tests/Presentation.Tests.Unit` | Tool, result mapper and error filter tests. |
1717
| `tests/Presentation.Tests.Integration` | A real MCP client talking to the server through `WebApplicationFactory`. |
1818
| `.agents/skills` | How we do each kind of change, one skill per folder. |
19+
<!--#if (false) -->
1920

2021
Application and Infrastructure, and their tests, are identical in the five Lean Mean Clean Apps templates. Only Presentation differs.
22+
<!--#endif -->
2123

2224
## Commands
2325

@@ -98,6 +100,7 @@ These are for this MCP server's presentation layer. The other templates have the
98100
| `json-serialization` | Add a result model or change how JSON looks |
99101
| `presentation-integration-tests` | Write a test that talks to the server through an MCP client |
100102
| `mcp-inspector` | Try the server by hand as a client sees it |
103+
<!--#if (false) -->
101104

102105
These are for working on the template repository itself, and they aren't included in solutions created with `dotnet new`:
103106

@@ -110,6 +113,7 @@ These are for working on the template repository itself, and they aren't include
110113
| `template-authoring` | Change `.template.config/` or the package |
111114
| `family-sync` | Carry a shared change to all five templates |
112115
| `releases` | Work with the monthly release |
116+
<!--#endif -->
113117

114118
## Done means
115119

0 commit comments

Comments
 (0)