Skip to main content

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?​

SituationWhat you doThe bat file?
New projectCreate 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 rulescopia-regole.bat option 1 from the template copy, then "Applica le regole di questo progetto" in ClaudeYes, option 1 (or the sentence with the template path, without the bat file)
Existing project with rules already in placegit pull in the template, copia-regole.bat option 2, then "Riallinea le regole" in ClaudeYes, 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​

  1. Create the repository from the template (on GitHub: Use this template) or copy the files into a new folder, without the .git folder of the template.

  2. Open Claude Code in that folder and write: "Avvia un nuovo progetto".

  3. Answer the startup questions (project type, security, Docker, frontend, ORM, etc.).

  4. At the end, Claude has: moved the modules you did not choose from .claude/rules/ to rules-optional/, moved the optional ones you confirmed from rules-optional/ to rules/, filled in CLAUDE.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's README.md and CHANGELOG.md are replaced by the project's own). Check with /context that 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​

TypeModules 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 onlycore, git, the three backend.editorconfig, NuGet.config
Frontend onlycore, git, frontendneither of the two .NET files: delete them
Git onlycore, gitneither 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):

  1. Update the copy of the template (git pull).
  2. Start copia-regole.bat from 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.md in the project.
  3. Open Claude Code in the project folder and write: "Applica le regole di questo progetto" (without a path). The CLAUDE.md and 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:

  1. Look, without changing anything: it reads git and the code and shows you where the project differs from the rules.

  2. 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 in PIANO.md. It does not rewrite the git history or restructure the code on its own.

  3. Then it copies into the project's .claude/rules/ only the modules you chose (if the bat file has not already done it), creates the CLAUDE.md with what it found, and proposes a local chore(rules) commit, which it creates only after your OK. The push and the PR are yours.

  4. Check with /context that 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:

  1. Update the copy of the template (git pull).
  2. Start copia-regole.bat from 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 has backend.md, it also adds the missing backend modules (backend-architecture.md, backend-app.md), next to backend.md.
  3. 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 the push.
  • 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):

OptionProject typeWhat the script does
1Existing project without rulesCopies 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)
2Project with rules already in placeUpdates 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.md or other project files, and it does not commit anything (the chore(rules) commit is proposed by Claude, after your OK).
  • CLAUDE.md is 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.md in 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.config and .editorconfig are only needed for projects with a .NET backend.