Add git-init reminder; remove AGENTS.md
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
|
||||
This repo **is** a `dotnet new` project template (identity `SCPSL.LabApi.PluginTemplate`,
|
||||
shortName `labapi-plugin`), not a runnable plugin. It scaffolds SCP: Secret Laboratory
|
||||
LabAPI plugins. `AGENTS.md` carries a shorter, tool-agnostic version of the essentials
|
||||
for non-Claude agents; this file is the authoritative one — keep both in sync when a
|
||||
rule below changes.
|
||||
LabAPI plugins.
|
||||
|
||||
The next section only applies while you're editing **this template repository**
|
||||
(i.e. a `.template.config/` folder is present next to this file). It does not apply
|
||||
@@ -15,8 +13,8 @@ are ordinary project files at that point, not template scaffolding.
|
||||
## Repo is template *source* — read before touching any file
|
||||
|
||||
`.template.config/template.json` sets this folder's name as the template's
|
||||
`sourceName` and defines two text-replacement `symbols` (plus a third, `skipRestore`,
|
||||
that only toggles the post-generation `dotnet restore` and replaces no text). The
|
||||
`sourceName` and defines two text-replacement `symbols` (plus `skipRestore` and
|
||||
`skipGit`, which only toggle post-generation actions and replace no text). The
|
||||
dotnet templating engine does a literal, repo-wide **string replacement** at
|
||||
generation time — not semantic renaming — driven by that config:
|
||||
|
||||
@@ -46,19 +44,44 @@ Consequences:
|
||||
|
||||
## Repo layout (only what affects decisions)
|
||||
|
||||
- `.template.config/template.json` — template identity, the 3 symbols above,
|
||||
`primaryOutputs` (points at the project file using its pre-substitution literal
|
||||
name — that's correct and expected, not a bug), and a `postActions` restore step
|
||||
(the standard dotnet-templating "restore NuGet packages" action, id
|
||||
`210D431B-...`; skipped in Visual Studio, which restores on its own).
|
||||
- `.template.config/template.json` — template identity, the symbols above plus
|
||||
`skipGit` (a display-only toggle, see below), `primaryOutputs` (points at the
|
||||
project file using its pre-substitution literal name — that's correct and expected,
|
||||
not a bug), and two `postActions`: the standard dotnet-templating "restore NuGet
|
||||
packages" action (id `210D431B-...`; skipped in Visual Studio, which restores on
|
||||
its own) and a "display manual instructions" action (id `AC1156F7-...`) that prints
|
||||
a reminder to run `git init` — see "Git on generation" below for why it's just a
|
||||
printed reminder and not an executed command.
|
||||
- The `.csproj` at the repo root — the project file every generated plugin ships with.
|
||||
- `EntryPoint.cs` / `Config.cs` — the scaffolded plugin (`Plugin<Config>`) and its
|
||||
YAML-backed settings class.
|
||||
- `.editorconfig` — formatting/naming only (indentation, brace style). It does **not**
|
||||
enforce the comment/language rules below — those aren't analyzer-checkable.
|
||||
- No `.sln`, no test project, no CI, no packaging (`.nupkg`) project, no git repo, and
|
||||
no GitHub Copilot instructions file currently exist in this folder. Don't assume
|
||||
any of them.
|
||||
- No `.sln`, no test project, no CI, no packaging (`.nupkg`) project, no GitHub
|
||||
Copilot instructions file currently exist in this folder. Don't assume any of them.
|
||||
This repo itself does have its own git history (see `git log`) — that's unrelated
|
||||
to whether a *generated* project gets one, which is what "Git on generation" below
|
||||
covers.
|
||||
|
||||
## Git on generation — why there's no automated `git init`
|
||||
|
||||
A generated project is **not** a git repository by default; a `postAction` only
|
||||
prints a reminder to run `git init && git add -A && git commit -m "Initial commit"`.
|
||||
This was a deliberate choice after testing the alternative:
|
||||
|
||||
- `dotnet new`'s only postAction capable of running an arbitrary process is the
|
||||
"Run script" action (id `3A7C4B45-...`). Actually wiring it to run `git init`/
|
||||
`git add`/`git commit` was tested and it **hangs forever** in any non-interactive
|
||||
shell: the CLI's script-execution security gate demands an explicit `Y` typed at a
|
||||
`Do you want to run this action [Y(yes)|N(no)]?` prompt, once per script action,
|
||||
with no flag on this SDK to pre-approve it — unlike the NuGet-restore postAction,
|
||||
which the CLI treats as trusted and never gates. Do not reintroduce "Run script"
|
||||
postActions for this without re-verifying that gate no longer applies.
|
||||
- Visual Studio's own "New Project" dialog already has a built-in "Create new Git
|
||||
repository" checkbox that works for any template, including this one, with zero
|
||||
template-side configuration — so VS users get this for free regardless.
|
||||
- CLI users see the printed reminder above (governed by the `skipGit` symbol) and run
|
||||
the one-liner themselves.
|
||||
|
||||
## LabAPI contract (verified against northwood-studios/LabAPI source, not guessed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user