How to use, in detail
The premise and the table of sentences to write to Claude are on the home page. Here are the steps for each situation.
Which case is yours?
| Situation | What you do | The bat file? |
|---|---|---|
| New project | Create the repository from the template, open Claude Code in the folder and write "Avvia un nuovo progetto" | No: Claude deletes it at the end of the procedure |
| Existing project without rules | copia-regole.bat option 1 from the template copy, then "Applica le regole di questo progetto" in Claude | Yes, option 1 (or the sentence with the template path, without the bat file) |
| Existing project with rules already in place | git pull in the template, copia-regole.bat option 2, then "Riallinea le regole" in Claude | Yes, option 2 |
The bat file only does the mechanical part (copying files); the questions, the checks and the CLAUDE.md are handled by Claude. Where to run it and what exactly it does: The template as a separate folder and Details of copia-regole.bat.
New project
-
Create the repository from the template (on GitHub: Use this template) or copy the files into a new folder, without the
.gitfolder of the template. -
Open Claude Code in that folder and write: "Avvia un nuovo progetto".
-
Answer the startup questions (project type, security, Docker, frontend, ORM, etc.).
-
At the end, Claude has: moved the modules you did not choose from
.claude/rules/torules-optional/, moved the optional ones you confirmed fromrules-optional/torules/, filled inCLAUDE.md, and deleted the template material that the project does not need (_template/,.claude-plugin/,plugins/,copia-regole.bat;.claude/rules/and.claude/rules-optional/stay, for later changes to the rules; the template'sREADME.mdandCHANGELOG.mdare replaced by the project's own). Check with/contextthat the modules are loaded at startup.
The three backend modules (backend.md, backend-architecture.md, backend-app.md) are always moved together.
What stays, depending on the project type
| Type | Modules in .claude/rules/ | Root files to keep |
|---|---|---|
| Fullstack (API + Angular) | core, git, the three backend, frontend (+ feature-workflow if you confirm it) | .editorconfig, NuGet.config |
| API only | core, git, the three backend | .editorconfig, NuGet.config |
| Frontend only | core, git, frontend | neither of the two .NET files: delete them |
| Git only | core, git | neither of the two .NET files: delete them |
In all cases security and docker are kept only if you choose them, and backend-email / backend-infra are activated later, when needed. .gitattributes and .gitignore always stay. In projects without a .NET backend there is no frontend configuration file in the template: linting and formatting are decided in the Angular project.
Existing project without rules
The project repository does not change and does not receive the template: the rules are copied from a copy of the template kept separately (see The template as a separate folder). This also applies if the repository is already on GitHub: "Use this template" only works for new repositories.
Route A, with the bat file (Windows):
- Update the copy of the template (
git pull). - Start
copia-regole.batfrom the template folder, choose option 1 and paste the path of the project root. The bat file asks which optional modules to include and, on request, the root files (CLAUDE.md,NuGet.config,.editorconfig,.gitignore,.gitattributes); it also copies the startup procedure to_template/avvio-progetto.mdin the project. - Open Claude Code in the project folder and write: "Applica le regole di questo progetto" (without a path). The
CLAUDE.mdand the exceptions still require Claude (steps 4-7 below).
Route B, without the bat file: open Claude Code in the project folder and write, with the template path:
- all rules: "Applica le regole in
<percorso del template>a questo progetto esistente"; - only Git (branches and commits): "Integra solo le regole Git in questo progetto, con le regole in
<percorso del template>".
From here on the work is Claude's, with both route A and route B:
-
Look, without changing anything: it reads git and the code and shows you where the project differs from the rules.
-
For each difference it asks you for a choice, one at a time: record it as an exception in the project's
CLAUDE.md(the project stays as it is), or bring the project into line with a refactoring planned inPIANO.md. It does not rewrite the git history or restructure the code on its own. -
Then it copies into the project's
.claude/rules/only the modules you chose (if the bat file has not already done it), creates theCLAUDE.mdwith what it found, and proposes a localchore(rules)commit, which it creates only after your OK. Thepushand the PR are yours. -
Check with
/contextthat the rules are loaded.
If the project already has a CLAUDE.md or a .claude/ folder, remember to say so: when in doubt Claude stops and asks you how to proceed (merge or keep the existing one), without overwriting anything without your OK.
If the project has a Blazor frontend to replace with Angular, there is a dedicated procedure (_template/avvio-progetto.md §3d).
Existing project with rules already in place
The project already contains .claude/rules/ and a CLAUDE.md: they are copies of the template's rules, and there is no need to repeat the startup. To update them:
- Update the copy of the template (
git pull). - Start
copia-regole.batfrom the template folder, choose option 2 and paste the path of the project root. The bat file compares the modules already present in the project (in.claude/rules/and.claude/rules-optional/) with those of the template, shows you the ones that differ and asks for confirmation for each, saving the old file as.md.bak. If the project hasbackend.md, it also adds the missing backend modules (backend-architecture.md,backend-app.md), next tobackend.md. - Open Claude Code in the project and write: "Riallinea le regole". The bat file does not touch the project's
CLAUDE.md: Claude aligns its references and the list of modules.
As an alternative to the bat file, write "Riallinea le regole" directly to Claude, indicating the path of the template.
To add a module that the project does not have: option 1 of the bat file, or "Aggiungi il modulo <nome>". Option 2 only updates what is already there and, for modules that are missing, prints "[nuovo]".
The template as a separate folder
For existing projects the template lives outside any project, for example in C:\Template\ClaudeCode: clone it once (without linking it to the project repositories) and update it with git pull before each use.
- The bat file is started from the template folder, not from the project: it uses as its source the folder where it is located (
.claude\rules\,.claude\rules-optional\,_template\), so it must not be copied into the project. Start it with a double click or from a terminal, from any folder. - The project path (its root) is pasted when the bat file asks for it. The bat file refuses a project that is the same as the template folder.
- Repository already on GitHub: there is no need to change or recreate it. Clone the project repository locally, apply the rules as above, make the
chore(rules)commit and thepush. - Template path for Claude: it is needed in the route B sentences and to add a module or realign the rules; the folder must be complete,
_template/included.
Where Claude finds the procedure
When you write one of these sentences, Claude reads _template/avvio-progetto.md and follows it (questions, checks, choice of modules, CLAUDE.md, plan). You do not need to open or quote it. In a new project it is in the copy of the template; in an existing project it is in the project itself if you used option 1 of the bat file, otherwise Claude reads it from the template folder you indicate. The bat file does not replace the procedure: it only copies the files, without questions or checks.
Details of copia-regole.bat
It shows a menu (Windows only):
| Option | Project type | What the script does |
|---|---|---|
| 1 | Existing project without rules | Copies the rules into the project (asks for the path and, for each optional module, whether to include it; core.md and git.md are always copied; the three backend modules are a single question) and, on request, the root files CLAUDE.md, NuGet.config, .editorconfig, .gitignore and .gitattributes (if a file already exists and is different, it asks for confirmation and saves the old one as .bak) |
| 2 | Project with rules already in place | Updates the rules already present in the project, both in .claude/rules/ and in .claude/rules-optional/ (shows the files that differ from the template, asks for confirmation for each and saves the old file as .md.bak). If the project has backend.md, it adds the two missing backend modules. Modules absent from the project are not added (option 1); root files, CLAUDE.md included, are not touched |
- It never touches
PIANO.mdor other project files, and it does not commit anything (thechore(rules)commit is proposed by Claude, after your OK). CLAUDE.mdis copied only if it is missing (without asking): it is the template with the[..]fields, which Claude then fills in with the startup questions. If the project already has one, the script does not touch it and Claude aligns it with the rules without replacing it.- If option 1 finds
.claude/rules/already in the project, it warns you to use option 2 and asks whether to continue; if you continue, the startup procedure is not copied. - Otherwise option 1 also copies the startup procedure to
_template/avvio-progetto.mdin the project: so you only need to open Claude Code in the project and write "Applica le regole di questo progetto", without giving the template path. Claude deletes the project's_template/at the end of the procedure. NuGet.configand.editorconfigare only needed for projects with a .NET backend.