diff --git a/.claude/commands/best-practices.md b/.claude/commands/best-practices.md index dd0ca4a..167391f 100644 --- a/.claude/commands/best-practices.md +++ b/.claude/commands/best-practices.md @@ -27,7 +27,7 @@ Give every `Invoke-RestMethod` call `-TimeoutSec 30`, bound every download the s 5. Resolve every link you write: the path exists on the default branch (`git cat-file -e origin/:`) and has that line (`git show origin/:` has at least that many lines). Fix or drop a link that doesn't resolve. 6. Compare the answers with the evidence: every `static_analysis_fixed` justification must name each alert dismissed as won't fix with its rationale (never 'none dismissed' while one exists), `regression_tests_added50` must name each fix with its test and not be N/A while a fix exists, and every release criterion agrees with the releases (`gh api repos///releases?per_page=5`); fix each answer that disagrees and say so. 7. When `best_practices_project` is unset, read `https://www.bestpractices.dev/projects.json?url=` with `Invoke-RestMethod`, never the `/en/` form (it redirects to HTML) and never `?q=` (it matches names only). A result with an entry whose `repo_url` equals the web address means registered: use its `id` as the number, use the update prompt, and end the reply with the `.\.template\Update-Project.ps1 -Data @{ best_practices_project = '' }` line. No match means not registered. Say which source the number came from. When `best_practices_project` is set, read `https://www.bestpractices.dev/projects/.json` with `Invoke-RestMethod`: each `_status` and `_justification`, `badge_level`, and `badge_percentage_0`, `_1` and `_2`. List each saved answer that no longer matches: an Unmet or `?` whose evidence now exists, a Met whose evidence is gone, and a justification with a link that step 5 can't resolve. -8. Report the OpenSSF Scorecard gaps. Read `https://api.scorecard.dev/projects//` with `Invoke-RestMethod`. On a 404 say Scorecard has published no result (a private repository, or before `scorecard.yml` first ran) and go on. Report `score`, `date`, the run's commit (`repo.commit`) and whether `origin/` has moved since. Count the people with write access: the entries whose `type` is `User` in `gh api "repos///collaborators?affiliation=all&permission=push&per_page=100"`; when the read fails, say why and recommend nothing below that depends on the count. Read the Scorecard alerts with `gh api "repos///code-scanning/alerts?tool_name=Scorecard&per_page=100"`, where an alert's `rule.name` is its check's name. A check under 10 with a dismissed alert and no open one is accepted: give its `dismissed_reason` and `dismissed_comment` as its action and `accepted` as who, instead of its row's action below. With one writer, Branch-Protection, CII-Best-Practices and Contributors can't reach 10 (decision record 0035 in `docs/decisions/project-template/`): for each of them with an open alert, the action is `.\tools\Dismiss-ScorecardAlerts.ps1 -Repo / -WhatIf`, run from a project-template clone, which lists the alerts it dismisses as won't fix and their reason, then the same without `-WhatIf`. For each check whose `score` is under 10 (a score of -1 is skipped, never reported), give its `details` lines and the action, in this order of rows: +8. Report the OpenSSF Scorecard gaps. Read `https://api.scorecard.dev/projects//` with `Invoke-RestMethod`. On a 404 say Scorecard has published no result (a private repository, or before `scorecard.yml` first ran) and go on. Report `score`, `date`, the run's commit (`repo.commit`) and whether `origin/` has moved since. Count the people with write access: the entries whose `type` is `User` in `gh api "repos///collaborators?affiliation=all&permission=push&per_page=100"`; when the read fails, say why and recommend nothing below that depends on the count. Read the Scorecard alerts with `gh api "repos///code-scanning/alerts?tool_name=Scorecard&per_page=100"`, where an alert's `rule.name` is its check's name. A check under 10 with a dismissed alert and no open one is accepted: give its `dismissed_reason` and `dismissed_comment` as its action and `accepted` as who, instead of its row's action below. With one writer, Branch-Protection, CII-Best-Practices and Contributors can't reach 10 (decision record 0035 in `docs/decisions/project-template/`): for each of them with an open alert, the action is `.\tools\Dismiss-ScorecardAlerts.ps1 -Repo / -WhatIf`, run from a project-template clone, which lists the alerts it dismisses as won't fix and their reason, then the same without `-WhatIf`. Whatever the number of writers, the same commands are the action for each open Token-Permissions alert whose workflow, its `most_recent_instance.location.path`, and permission, the `jobLevel ''` of its `most_recent_instance.message.text`, the Token-Permissions row of the Scorecard decision record's table (`docs/decisions/project-template/0020-*.md`) lists (decision record 0086 in `docs/decisions/project-template/`); any other Token-Permissions alert, such as a top-level write or one in a workflow of the project's own, is the project's to narrow. For each check whose `score` is under 10 (a score of -1 is skipped, never reported), give its `details` lines and the action, in this order of rows: - Fuzzing: write property tests with the stack's property-test library, for .NET `FsCheck.Xunit` with `[Property(Replay = )]` and a `using FsCheck` Scorecard detects; suggest `/plan-tests`. Who: a person writes them, the template adds nothing. - Signed-Releases: Scorecard counts only the releases with assets among the five newest (`gh api repos///releases?per_page=5`, each release's `immutable` and `assets`) and averages them. From Scorecard v5.7.0 (the result's `scorecard.version`) an immutable release scores 10 and needs no signature or provenance asset; otherwise a release with a `*.intoto.jsonl` provenance file scores 10, one with only a signature (`.asc`, `.minisig`, `.sig`, `.sign`, `.sigstore` or `.sigstore.json`) 8, and any other 0. When the result's Scorecard is older than v5.7.0, say that a `scorecard.yml` pinning `ossf/scorecard-action` v2.6.0 or later, which a template update brings, counts immutable releases. When the releases are mutable and no workflow attaches files to a published release, name `.\tools\Set-RepositoryBaseline.ps1 -Repo -WhatIf`, run from a project-template clone, which shows it turning immutable releases on. For mutable releases that get their files after publishing, such as a .NET library's, list which have no `*.intoto.jsonl` or signature. Two options: wait for newer releases to push the old ones out of the five, or a person deletes the old unsigned assets (packages stay on the registry). `release-provenance.yml`'s `workflow_dispatch` can backfill only while the Publish run's `packages` artifact is kept (14 days). Never attest packages downloaded from a registry: that claims a build the workflow never ran. - Branch-Protection: compare the `Warn:` lines with `gh api repos///rulesets` and `.../rulesets/` (`required_approving_review_count`, `require_last_push_approval`), with whether `.github/workflows/code-review.yml` passes `approve: true`, and with the count of people with write access. NCode Review's approver is set up when `.github/workflows/code-review.yml` passes `approve: true` and a non-empty `approver-private-key:`, and `gh secret list --env code-review --repo /` lists `NCODE_REVIEW_APPROVER_PRIVATE_KEY` (decision record 0036 in `docs/decisions/project-template/`). With one writer and no approver set up, never recommend a required approval or approval of the last push: GitHub counts no approval from the author or from NCode Review's own app, so either blocks every merge, and decision record 0034 expects neither; when the ruleset has either, name `.\tools\Set-RepositoryBaseline.ps1 -Repo -WhatIf`, run from a project-template clone, which shows it turning them off. Where the approver is set up, whatever the number of writers, the NCode Review Approver's approval meets a required approval, and decision record 0036 expects one approval and last-push approval; with two writers or more, ADR-0022 expects them where `code-review.yml` passes `approve: true`. When the ruleset lacks what decision record 0036 or ADR-0022 expects, name the same command, which shows what it would set. When the ruleset has what ADR-0022 and decision records 0034 and 0036 expect, Branch-Protection scores 8 where it requires one approval and 4 where it requires none, as the Branch-Protection row of the Scorecard decision record's table (`docs/decisions/project-template/0020-*.md`) says: at 8 the `Warn:` lines `required approving review count is 1` and `codeowners review is not required` are expected, since only tier 4's two approvals and code owners' review clear them, so give that row's Needs-a-person text for them, and with one writer never recommend requiring two approvals, which blocks every merge, since only the approver's approval counts. When it has what they expect and scores lower, say the run may predate the change and to compare the next run. diff --git a/.claude/commands/handoff-plan.md b/.claude/commands/handoff-plan.md index 3e8ef75..956b016 100644 --- a/.claude/commands/handoff-plan.md +++ b/.claude/commands/handoff-plan.md @@ -50,7 +50,7 @@ A smaller, cheaper model — a local model or a lower-cost Copilot model — wil - A step or Done-when command that reaches a sibling repository, a clone next to this one, such as a documentation toolchain's, finds it from the folder that holds the main checkout, never through `..`: a plan's worktree is `.claude/worktrees//`, so `..` from it is `.claude/worktrees/`, and `../` works only in the main checkout. Write `Join-Path (Split-Path -Parent (Split-Path -Parent (git rev-parse --path-format=absolute --git-common-dir))) `, which names the same folder from the main checkout and from every worktree. - Keep each step under about 25 lines. Split anything bigger. - Expect escalations: when a step needs a decision the plan didn't make, the executor stops, marks it `[?]` with an `- Escalation:` note, and the step comes back to you for re-planning. Every escalation costs a round trip, so settle decisions now. -- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, where the next release's section takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. +- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, or, where the state script prints `changelog-entries: files`, in the plan's entry file, and the next release takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, or where the plan's entries are in an entry file, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. - Make the last step write the plan's changelog entries as The Changelog below says, for every plan, with or without a `Release:` line. - Under `## Follow-ups`, list only work someone would plan as its own task: a real defect, gap or cleanup you found that this plan doesn't do. Write each as one line, `: `, that a reader who never saw this plan understands; `/ship-plan` files each one as an issue once the plan has landed, where and with the label `AGENTS.md`'s Landing section says (`follow-ups`, `follow-up-label`). Leave out nits, style preferences, ideas for someday, and anything this plan should do itself (add a step for that): mention them in your reply instead. @@ -107,6 +107,7 @@ A project is pre-release while the `pre-release` key of `AGENTS.md`'s `## Landin The plan's last step writes the plan's entries, for every plan: +- When the state script prints `changelog-entries: files`, the project keeps each plan's entries in a file of its own, as `changelog.d/README.md` says (ADR-0081 in `docs/decisions/project-template/`): the last step creates `changelog.d/-.md`, where `` is the day the step runs, in UTC, written `yyyyMMdd` (`Get-Date -AsUTC -Format yyyyMMdd`), and `` is the plan's branch name without a leading `worktree-`, with each `/` written as `-`, such as `changelog.d/20261202-issue-42.md`, adding `-2`, `-3` and so on before `.md` when that file exists, keeps the name of the entry file the plan already has, and lists it on its Files line. The date sorts the folder by when each plan wrote its file; a release lists the entries in the order their files reached the default branch, whatever their names. The file holds the plan's entries, written as this section says for the changelog, each under its group's `### ` heading, the groups in the order above, each heading once, and nothing else: no `## ` heading, no version, no date and no link reference definitions. Outside a pre-release project, the step changes neither `` nor another entry file, with or without a `Release:` line: the release the merge makes publishes the entries under the `Release:` version, or the next free one. In a pre-release project, the file holds the capabilities and protections the plan adds, and the step rewrites or deletes an entry the plan reshapes or removes where it is, in `## [Unreleased]` or in another entry file. The plan whose `Release:` line names the first stable version also moves every entry of every entry file into its section and deletes those files, except `changelog.d/README.md`. `version.json` is still set as below. The bullets below apply when it prints `changelog-entries: changelog`. - In a pre-release project, whatever its `changelog-format` and with or without a `Release:` line: create the file when it is missing, as `missing` below says, with the preamble's pre-release line last before `## [Unreleased]`. Then edit `## [Unreleased]` in place, so it describes the product once the plan has landed: add an entry for each capability or protection the plan adds, rewrite the entry of each one the plan reshapes, keeping its links and adding the plan's issue, and delete the entry of each one it removes. A fix to behavior no stable release shipped adds nothing, unless an entry no longer matches the code. Put each entry under `### Added` or `### Security`, and write no other heading, release section or link. A changelog that isn't a catalog yet, because it has another heading under `## [Unreleased]`, a release section or another format, is left as it is, and the plan lists this follow-up under `## Follow-ups`, filling in ``: `Describe the product as it is in the changelog: rewrite as the pre-release catalog ADR-0015 describes, so each plan edits it in place.` - The plan whose `Release:` line names the first stable version, such as `v1.0.0`, in a project whose Landing section says `pre-release: untracked`, ends the pre-release: its last step inserts `## [] - ` right below `## [Unreleased]`, moves every catalog entry into it, edited for the plan's own work as the bullet above says, so that version's notes describe everything it ships, leaves `## [Unreleased]` empty, deletes the preamble's pre-release line, and adds `[unreleased]: /compare/...HEAD` and `[]: /releases/tag/`. With `release: none`, the first plan whose state script prints `pre-release: no` while the Landing section says `untracked` and the changelog has no release section does this, with the first stable tag's number and date (`git log -1 --format=%as `), before it writes its own entries as `keep-a-changelog` says. From then on, the bullets below apply. - `missing`: create the file, then write to it as for `keep-a-changelog`. It starts with these lines, each followed by a blank line except the last: `# Changelog`, then `All notable changes to this project will be documented in this file.`, then `The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).`, then `## [Unreleased]`. diff --git a/.claude/commands/plan-bugfix.md b/.claude/commands/plan-bugfix.md index 3a0f1bc..df8f23a 100644 --- a/.claude/commands/plan-bugfix.md +++ b/.claude/commands/plan-bugfix.md @@ -52,7 +52,7 @@ A smaller, cheaper model — a local model or a lower-cost Copilot model — wil - A step or Done-when command that reaches a sibling repository, a clone next to this one, such as a documentation toolchain's, finds it from the folder that holds the main checkout, never through `..`: a plan's worktree is `.claude/worktrees//`, so `..` from it is `.claude/worktrees/`, and `../` works only in the main checkout. Write `Join-Path (Split-Path -Parent (Split-Path -Parent (git rev-parse --path-format=absolute --git-common-dir))) `, which names the same folder from the main checkout and from every worktree. - Keep each step under about 25 lines. Split anything bigger. - Expect escalations: when a step needs a decision the plan didn't make, the executor stops, marks it `[?]` with an `- Escalation:` note, and the step comes back to you for re-planning. Every escalation costs a round trip, so settle decisions now. -- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, where the next release's section takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. +- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, or, where the state script prints `changelog-entries: files`, in the plan's entry file, and the next release takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, or where the plan's entries are in an entry file, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. - Make the last step write the plan's changelog entries as The Changelog below says, for every plan, with or without a `Release:` line. - Under `## Follow-ups`, list only work someone would plan as its own task: a real defect, gap or cleanup you found that this plan doesn't do. Write each as one line, `: `, that a reader who never saw this plan understands; `/ship-plan` files each one as an issue once the plan has landed, where and with the label `AGENTS.md`'s Landing section says (`follow-ups`, `follow-up-label`). Leave out nits, style preferences, ideas for someday, and anything this plan should do itself (add a step for that): mention them in your reply instead. @@ -109,6 +109,7 @@ A project is pre-release while the `pre-release` key of `AGENTS.md`'s `## Landin The plan's last step writes the plan's entries, for every plan: +- When the state script prints `changelog-entries: files`, the project keeps each plan's entries in a file of its own, as `changelog.d/README.md` says (ADR-0081 in `docs/decisions/project-template/`): the last step creates `changelog.d/-.md`, where `` is the day the step runs, in UTC, written `yyyyMMdd` (`Get-Date -AsUTC -Format yyyyMMdd`), and `` is the plan's branch name without a leading `worktree-`, with each `/` written as `-`, such as `changelog.d/20261202-issue-42.md`, adding `-2`, `-3` and so on before `.md` when that file exists, keeps the name of the entry file the plan already has, and lists it on its Files line. The date sorts the folder by when each plan wrote its file; a release lists the entries in the order their files reached the default branch, whatever their names. The file holds the plan's entries, written as this section says for the changelog, each under its group's `### ` heading, the groups in the order above, each heading once, and nothing else: no `## ` heading, no version, no date and no link reference definitions. Outside a pre-release project, the step changes neither `` nor another entry file, with or without a `Release:` line: the release the merge makes publishes the entries under the `Release:` version, or the next free one. In a pre-release project, the file holds the capabilities and protections the plan adds, and the step rewrites or deletes an entry the plan reshapes or removes where it is, in `## [Unreleased]` or in another entry file. The plan whose `Release:` line names the first stable version also moves every entry of every entry file into its section and deletes those files, except `changelog.d/README.md`. `version.json` is still set as below. The bullets below apply when it prints `changelog-entries: changelog`. - In a pre-release project, whatever its `changelog-format` and with or without a `Release:` line: create the file when it is missing, as `missing` below says, with the preamble's pre-release line last before `## [Unreleased]`. Then edit `## [Unreleased]` in place, so it describes the product once the plan has landed: add an entry for each capability or protection the plan adds, rewrite the entry of each one the plan reshapes, keeping its links and adding the plan's issue, and delete the entry of each one it removes. A fix to behavior no stable release shipped adds nothing, unless an entry no longer matches the code. Put each entry under `### Added` or `### Security`, and write no other heading, release section or link. A changelog that isn't a catalog yet, because it has another heading under `## [Unreleased]`, a release section or another format, is left as it is, and the plan lists this follow-up under `## Follow-ups`, filling in ``: `Describe the product as it is in the changelog: rewrite as the pre-release catalog ADR-0015 describes, so each plan edits it in place.` - The plan whose `Release:` line names the first stable version, such as `v1.0.0`, in a project whose Landing section says `pre-release: untracked`, ends the pre-release: its last step inserts `## [] - ` right below `## [Unreleased]`, moves every catalog entry into it, edited for the plan's own work as the bullet above says, so that version's notes describe everything it ships, leaves `## [Unreleased]` empty, deletes the preamble's pre-release line, and adds `[unreleased]: /compare/...HEAD` and `[]: /releases/tag/`. With `release: none`, the first plan whose state script prints `pre-release: no` while the Landing section says `untracked` and the changelog has no release section does this, with the first stable tag's number and date (`git log -1 --format=%as `), before it writes its own entries as `keep-a-changelog` says. From then on, the bullets below apply. - `missing`: create the file, then write to it as for `keep-a-changelog`. It starts with these lines, each followed by a blank line except the last: `# Changelog`, then `All notable changes to this project will be documented in this file.`, then `The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).`, then `## [Unreleased]`. diff --git a/.claude/commands/plan-docs.md b/.claude/commands/plan-docs.md index 2dadb2c..08ef909 100644 --- a/.claude/commands/plan-docs.md +++ b/.claude/commands/plan-docs.md @@ -50,7 +50,7 @@ A smaller, cheaper model — a local model or a lower-cost Copilot model — wil - A step or Done-when command that reaches a sibling repository, a clone next to this one, such as a documentation toolchain's, finds it from the folder that holds the main checkout, never through `..`: a plan's worktree is `.claude/worktrees//`, so `..` from it is `.claude/worktrees/`, and `../` works only in the main checkout. Write `Join-Path (Split-Path -Parent (Split-Path -Parent (git rev-parse --path-format=absolute --git-common-dir))) `, which names the same folder from the main checkout and from every worktree. - Keep each step under about 25 lines. Split anything bigger. - Expect escalations: when a step needs a decision the plan didn't make, the executor stops, marks it `[?]` with an `- Escalation:` note, and the step comes back to you for re-planning. Every escalation costs a round trip, so settle decisions now. -- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, where the next release's section takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. +- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, or, where the state script prints `changelog-entries: files`, in the plan's entry file, and the next release takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, or where the plan's entries are in an entry file, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. - Make the last step write the plan's changelog entries as The Changelog below says, for every plan, with or without a `Release:` line. - Under `## Follow-ups`, list only work someone would plan as its own task: a real defect, gap or cleanup you found that this plan doesn't do. Write each as one line, `: `, that a reader who never saw this plan understands; `/ship-plan` files each one as an issue once the plan has landed, where and with the label `AGENTS.md`'s Landing section says (`follow-ups`, `follow-up-label`). Leave out nits, style preferences, ideas for someday, and anything this plan should do itself (add a step for that): mention them in your reply instead. @@ -107,6 +107,7 @@ A project is pre-release while the `pre-release` key of `AGENTS.md`'s `## Landin The plan's last step writes the plan's entries, for every plan: +- When the state script prints `changelog-entries: files`, the project keeps each plan's entries in a file of its own, as `changelog.d/README.md` says (ADR-0081 in `docs/decisions/project-template/`): the last step creates `changelog.d/-.md`, where `` is the day the step runs, in UTC, written `yyyyMMdd` (`Get-Date -AsUTC -Format yyyyMMdd`), and `` is the plan's branch name without a leading `worktree-`, with each `/` written as `-`, such as `changelog.d/20261202-issue-42.md`, adding `-2`, `-3` and so on before `.md` when that file exists, keeps the name of the entry file the plan already has, and lists it on its Files line. The date sorts the folder by when each plan wrote its file; a release lists the entries in the order their files reached the default branch, whatever their names. The file holds the plan's entries, written as this section says for the changelog, each under its group's `### ` heading, the groups in the order above, each heading once, and nothing else: no `## ` heading, no version, no date and no link reference definitions. Outside a pre-release project, the step changes neither `` nor another entry file, with or without a `Release:` line: the release the merge makes publishes the entries under the `Release:` version, or the next free one. In a pre-release project, the file holds the capabilities and protections the plan adds, and the step rewrites or deletes an entry the plan reshapes or removes where it is, in `## [Unreleased]` or in another entry file. The plan whose `Release:` line names the first stable version also moves every entry of every entry file into its section and deletes those files, except `changelog.d/README.md`. `version.json` is still set as below. The bullets below apply when it prints `changelog-entries: changelog`. - In a pre-release project, whatever its `changelog-format` and with or without a `Release:` line: create the file when it is missing, as `missing` below says, with the preamble's pre-release line last before `## [Unreleased]`. Then edit `## [Unreleased]` in place, so it describes the product once the plan has landed: add an entry for each capability or protection the plan adds, rewrite the entry of each one the plan reshapes, keeping its links and adding the plan's issue, and delete the entry of each one it removes. A fix to behavior no stable release shipped adds nothing, unless an entry no longer matches the code. Put each entry under `### Added` or `### Security`, and write no other heading, release section or link. A changelog that isn't a catalog yet, because it has another heading under `## [Unreleased]`, a release section or another format, is left as it is, and the plan lists this follow-up under `## Follow-ups`, filling in ``: `Describe the product as it is in the changelog: rewrite as the pre-release catalog ADR-0015 describes, so each plan edits it in place.` - The plan whose `Release:` line names the first stable version, such as `v1.0.0`, in a project whose Landing section says `pre-release: untracked`, ends the pre-release: its last step inserts `## [] - ` right below `## [Unreleased]`, moves every catalog entry into it, edited for the plan's own work as the bullet above says, so that version's notes describe everything it ships, leaves `## [Unreleased]` empty, deletes the preamble's pre-release line, and adds `[unreleased]: /compare/...HEAD` and `[]: /releases/tag/`. With `release: none`, the first plan whose state script prints `pre-release: no` while the Landing section says `untracked` and the changelog has no release section does this, with the first stable tag's number and date (`git log -1 --format=%as `), before it writes its own entries as `keep-a-changelog` says. From then on, the bullets below apply. - `missing`: create the file, then write to it as for `keep-a-changelog`. It starts with these lines, each followed by a blank line except the last: `# Changelog`, then `All notable changes to this project will be documented in this file.`, then `The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).`, then `## [Unreleased]`. diff --git a/.claude/commands/plan-feature.md b/.claude/commands/plan-feature.md index bec426f..e8a2098 100644 --- a/.claude/commands/plan-feature.md +++ b/.claude/commands/plan-feature.md @@ -52,7 +52,7 @@ A smaller, cheaper model — a local model or a lower-cost Copilot model — wil - A step or Done-when command that reaches a sibling repository, a clone next to this one, such as a documentation toolchain's, finds it from the folder that holds the main checkout, never through `..`: a plan's worktree is `.claude/worktrees//`, so `..` from it is `.claude/worktrees/`, and `../` works only in the main checkout. Write `Join-Path (Split-Path -Parent (Split-Path -Parent (git rev-parse --path-format=absolute --git-common-dir))) `, which names the same folder from the main checkout and from every worktree. - Keep each step under about 25 lines. Split anything bigger. - Expect escalations: when a step needs a decision the plan didn't make, the executor stops, marks it `[?]` with an `- Escalation:` note, and the step comes back to you for re-planning. Every escalation costs a round trip, so settle decisions now. -- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, where the next release's section takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. +- When `AGENTS.md`'s `## Landing` section sets `release` to `tag` or `tag+release`, add the `Release:` line when the plan changes something a release ships: the product's code, a file its package or download carries, such as the `README.md` a package takes as its readme, which nuget.org shows, or what its build puts out, such as a build setting, a dependency or the SDK version. A plan that changes only what reaches its readers without a release, such as documentation-site pages, which deploy from every push to the default branch, CI workflows, decision records, tests or repository docs, such as `CONTRIBUTING.md`, `AGENTS.md`, instruction files or a `README.md` no package carries, gets no `Release:` line: its changelog entries go under `## [Unreleased]`, or, where the state script prints `changelog-entries: files`, in the plan's entry file, and the next release takes them in, and it lands with no tag and no release, as ADR-0032 in `docs/decisions/project-template/` says. When `AGENTS.md` says what this project's releases ship, follow it. A plan for several issues gets the line when any of them changes something a release ships. Use the newest version tag on `origin`, not one only this clone has (the first `git ls-remote --tags --refs --sort=-version:refname origin` entry whose name after `refs/tags/` is shaped like `v1.2.3` or `1.2.3`, or the first such `git tag --list --sort=-version:refname` entry when the repository has no `origin`; `v0.1.0` when there is none), raised by one patch version for a bugfix, docs, tests or refactor plan, or by one minor version, with the patch set to 0, for any other plan. A `Release:` version is `major.minor.patch`, such as `v1.4.0`, with no prerelease label such as `-alpha` or `-rc.1`, also in a pre-release project, whose versions are `0.y.z` (ADR-0075 in `docs/decisions/project-template/`). In a pre-release project, as The Changelog below defines it, a raise keeps the major version at 0: name the first stable version, such as `v1.0.0`, only when the request asks for the first stable release. For a plan that covers several issues, use the largest raise any one of them would get on its own: one issue that needs a minor raise makes the plan's raise minor. When the change breaks how existing users work, ask me which version to use, except in a pre-release project, which has none. The version holds unless another plan lands it, or a later one, first: `/ship-plan` then moves this plan to the next free version, raised the same way, which the state script prints as `renumber`, and adds a step that merges in the default branch and retitles the changelog section, or, in a pre-release project, whose changelog has no release section, or where the plan's entries are in an entry file, only changes the `Release:` line, so a plan can run ahead of one still waiting for review. - Make the last step write the plan's changelog entries as The Changelog below says, for every plan, with or without a `Release:` line. - Under `## Follow-ups`, list only work someone would plan as its own task: a real defect, gap or cleanup you found that this plan doesn't do. Write each as one line, `: `, that a reader who never saw this plan understands; `/ship-plan` files each one as an issue once the plan has landed, where and with the label `AGENTS.md`'s Landing section says (`follow-ups`, `follow-up-label`). Leave out nits, style preferences, ideas for someday, and anything this plan should do itself (add a step for that): mention them in your reply instead. @@ -109,6 +109,7 @@ A project is pre-release while the `pre-release` key of `AGENTS.md`'s `## Landin The plan's last step writes the plan's entries, for every plan: +- When the state script prints `changelog-entries: files`, the project keeps each plan's entries in a file of its own, as `changelog.d/README.md` says (ADR-0081 in `docs/decisions/project-template/`): the last step creates `changelog.d/-.md`, where `` is the day the step runs, in UTC, written `yyyyMMdd` (`Get-Date -AsUTC -Format yyyyMMdd`), and `` is the plan's branch name without a leading `worktree-`, with each `/` written as `-`, such as `changelog.d/20261202-issue-42.md`, adding `-2`, `-3` and so on before `.md` when that file exists, keeps the name of the entry file the plan already has, and lists it on its Files line. The date sorts the folder by when each plan wrote its file; a release lists the entries in the order their files reached the default branch, whatever their names. The file holds the plan's entries, written as this section says for the changelog, each under its group's `### ` heading, the groups in the order above, each heading once, and nothing else: no `## ` heading, no version, no date and no link reference definitions. Outside a pre-release project, the step changes neither `` nor another entry file, with or without a `Release:` line: the release the merge makes publishes the entries under the `Release:` version, or the next free one. In a pre-release project, the file holds the capabilities and protections the plan adds, and the step rewrites or deletes an entry the plan reshapes or removes where it is, in `## [Unreleased]` or in another entry file. The plan whose `Release:` line names the first stable version also moves every entry of every entry file into its section and deletes those files, except `changelog.d/README.md`. `version.json` is still set as below. The bullets below apply when it prints `changelog-entries: changelog`. - In a pre-release project, whatever its `changelog-format` and with or without a `Release:` line: create the file when it is missing, as `missing` below says, with the preamble's pre-release line last before `## [Unreleased]`. Then edit `## [Unreleased]` in place, so it describes the product once the plan has landed: add an entry for each capability or protection the plan adds, rewrite the entry of each one the plan reshapes, keeping its links and adding the plan's issue, and delete the entry of each one it removes. A fix to behavior no stable release shipped adds nothing, unless an entry no longer matches the code. Put each entry under `### Added` or `### Security`, and write no other heading, release section or link. A changelog that isn't a catalog yet, because it has another heading under `## [Unreleased]`, a release section or another format, is left as it is, and the plan lists this follow-up under `## Follow-ups`, filling in ``: `Describe the product as it is in the changelog: rewrite as the pre-release catalog ADR-0015 describes, so each plan edits it in place.` - The plan whose `Release:` line names the first stable version, such as `v1.0.0`, in a project whose Landing section says `pre-release: untracked`, ends the pre-release: its last step inserts `## [] - ` right below `## [Unreleased]`, moves every catalog entry into it, edited for the plan's own work as the bullet above says, so that version's notes describe everything it ships, leaves `## [Unreleased]` empty, deletes the preamble's pre-release line, and adds `[unreleased]: /compare/...HEAD` and `[]: /releases/tag/`. With `release: none`, the first plan whose state script prints `pre-release: no` while the Landing section says `untracked` and the changelog has no release section does this, with the first stable tag's number and date (`git log -1 --format=%as `), before it writes its own entries as `keep-a-changelog` says. From then on, the bullets below apply. - `missing`: create the file, then write to it as for `keep-a-changelog`. It starts with these lines, each followed by a blank line except the last: `# Changelog`, then `All notable changes to this project will be documented in this file.`, then `The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).`, then `## [Unreleased]`. diff --git a/.claude/commands/plan-issue.md b/.claude/commands/plan-issue.md index 90ce60e..acb2f08 100644 --- a/.claude/commands/plan-issue.md +++ b/.claude/commands/plan-issue.md @@ -197,7 +197,7 @@ Read these two files first, before any other file. Where these instructions star Clone into a scratch folder outside the repository, `$scratch = Join-Path ([IO.Path]::GetTempPath()) "template-update-$([guid]::NewGuid().ToString('N').Substring(0, 8))"`, and delete it before you reply. -1. **Research.** Clone the template from its address, `_src_path` read as `.template/Get-TemplateUpdate.ps1` reads it: `gh:` is `https://github.com/`, the old `https://github.com/polewskm/project-template`, with or without `.git`, is `https://github.com/NCodeGroup/project-template.git`, and a local path that isn't a folder on this PC, such as the clone of the template the project was created from on another PC, is `https://github.com/NCodeGroup/project-template.git`: `git clone --quiet --no-checkout -- $scratch\template`. The target is the version the request names, or else the newest tag, as `Update-Project.ps1` picks it: `git -C $scratch\template tag --list --sort=-version:refname | Where-Object { $_ -match '^v?\d+(\.\d+){0,3}$' } | Select-Object -First 1`. When the target is the project's version and the request changes no answer, the project is up to date: stop and say so. Read `git -C $scratch\template show :CHANGELOG.md`, every section after the project's version up to and including the target, and list each change that reaches a project: commands added, renamed or removed, changed rules and conventions, files added, moved or removed, new answers, and anything the notes say a project must do. +1. **Research.** Clone the template from its address, `_src_path` read as `.template/Get-TemplateUpdate.ps1` reads it: `gh:` is `https://github.com/`, the old `https://github.com/polewskm/project-template`, with or without `.git`, is `https://github.com/NCodeGroup/project-template.git`, and a local path that isn't a folder on this PC, such as the clone of the template the project was created from on another PC, is `https://github.com/NCodeGroup/project-template.git`: `git clone --quiet --no-checkout -- $scratch\template`. The target is the version the request names, or else the newest tag, as `Update-Project.ps1` picks it: `git -C $scratch\template tag --list --sort=-version:refname | Where-Object { $_ -match '^v?\d+(\.\d+){0,3}$' } | Select-Object -First 1`. When the target is the project's version and the request changes no answer, the project is up to date: stop and say so. Read `git -C $scratch\template show :CHANGELOG.md`, every section after the project's version up to and including the target, and, where the target has `changelog.d/README.md`, each entry file the target has in `changelog.d/` that the project's version lacks, listed with `git -C $scratch\template diff --name-only --diff-filter=A -- changelog.d/` and read with `git -C $scratch\template show :`, which hold the changes of the versions the changelog has no section for yet (ADR-0081 in `docs/decisions/project-template/`), and list each change that reaches a project: commands added, renamed or removed, changed rules and conventions, files added, moved or removed, new answers, and anything the notes say a project must do. 2. **Trial run.** Clone the project and branch from the commit the plan starts from: `git clone --quiet -- (git rev-parse --show-toplevel) $scratch\project`, then `git -C $scratch\project switch --quiet -c template-trial (git rev-parse HEAD)`. The clone's `origin/HEAD` names the branch checked out where it was cloned from, such as a plan worktree's `worktree-`, and `Update-Project.ps1` records the branch `origin/HEAD` names as the `default_branch` answer when the answers have none (the template's ADR-0060). So point it where the project's own `origin/HEAD` points, which the update step reads: `$default = "$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>$null)".Trim() -replace '^origin/', ''`, then `if ($default) { git -C $scratch\project symbolic-ref refs/remotes/origin/HEAD "refs/remotes/origin/$default" } else { git -C $scratch\project remote set-head origin --delete }`. Its `origin` is the project's folder too, where the update finds no GitHub repository. The update step reads the project's own `origin`, and in a GitHub project prints notes written for that repository, such as the last one, which names `tools/Set-RepositoryBaseline.ps1 -Repo /`, and reads its visibility from GitHub. So point the clone's `origin` at the project's own as well: `$origin = "$(git remote get-url origin 2>$null)".Trim()`, then `if ($origin) { git -C $scratch\project remote set-url origin $origin }`. Run the clone's update script with the target, adding `-Data @{ = }` for the answers the request changes: `& $scratch\project\.template\Update-Project.ps1 -Ref -NoCommit -TemplateClone $scratch\template *>&1 | Tee-Object $scratch\trial.txt`. Run it with `&`, not `pwsh -File`, which can't pass `-Data`. `-TemplateClone` has it read the clone from step 1 instead of cloning `_src_path` itself, which an older update script can't do when `_src_path` names a folder that isn't on this PC; the target's script, which the update hands over to, then moves `_src_path` to the clone's address, and the trial's output says so. From its output, record each file under `Template -> :` with its kind, each conflict, the files under `Local edits discarded` and `Restored`, and each project-owned file the template changed, with its diff. Then, in the clone, run the project's `build_command` and each check its `AGENTS.md` names, such as a lint or customization check, and record each failure. 3. **Project files that describe the old template.** The template owns each file it renders, except those its `copier.yml` lists under `_skip_if_exists`, which are the project's, and `_merged_files`, which updates merge. A merged or template-owned file that the project's `project_owned_files` answer in `.copier-answers.yml` names is the project's too: updates leave it alone, and the trial shows the template's change to it with the project-owned files. List the files it renders with `git -C $scratch\template ls-tree -r --name-only -- template/`, named as `Update-Project.ps1` names them: without `template/`, without each Jinja tag and without a `.jinja` suffix. Every other tracked file is the project's own, and so is each `_skip_if_exists` file. For each change from step 1, search the project's own files, such as `AGENTS.md`, `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, ADRs, `.claude/rules/`, project instruction files and the project's own scripts, such as a `build/*.ps1` wrapper that runs a check a template script now runs (a command in it that runs the check, such as `dotnet csharpier check .`, not a comment, comment-based help or a string that only names the check), for text or code that still describes or repeats the old behavior, and plan its exact replacement. Leave text that records history, such as a past changelog entry, as it is. For each project-owned file the trial showed a template change for, decide which of its hunks the project takes, and plan them the same way. Then, unless the `follow-ups` that the `landing` line of `pwsh -NoProfile -File .template/Get-PlanState.ps1` prints is `none`, find the open follow-up issues the update completes: an update takes in the template's work since the project's last update, which can complete a follow-up an earlier plan filed, such as one waiting for a pinned version's cooldown to pass before it drops an exception that the template's change to a project-owned workflow also drops. List the open issues labelled with the `landing` line's `follow-up-label`, without the quotes, adding `--repo ` when `follow-ups` names a repository: `gh issue list --state open --label "