From f53c5e6951263a25437df0aa3d078687156acdbb Mon Sep 17 00:00:00 2001 From: Marcin Polewski Date: Mon, 30 Nov 2026 22:52:00 -0700 Subject: [PATCH 1/2] Plan step 1: Update from project-template v0.156.0 --- .claude/commands/plan-issue.md | 2 +- .claude/commands/plan-template-update.md | 2 +- .claude/commands/run-epic.md | 120 ++++++++++++++++++ .claude/commands/run-feedback.md | 4 +- .claude/commands/run-issues.md | 2 +- .claude/commands/ship-plan.md | 2 +- .copier-answers.yml | 2 +- .../project-template.instructions.md | 8 +- .github/prompts/plan-issue.prompt.md | 2 +- .../prompts/plan-template-update.prompt.md | 2 +- .github/prompts/run-epic.prompt.md | 119 +++++++++++++++++ .github/prompts/run-feedback.prompt.md | 4 +- .github/prompts/run-issues.prompt.md | 2 +- .github/prompts/ship-plan.prompt.md | 2 +- .github/skills/plan-issue/SKILL.md | 2 +- .github/skills/plan-template-update/SKILL.md | 2 +- .github/skills/run-epic/SKILL.md | 117 +++++++++++++++++ .github/skills/run-feedback/SKILL.md | 4 +- .github/skills/run-issues/SKILL.md | 2 +- .github/skills/ship-plan/SKILL.md | 2 +- .template-version | 2 +- CLAUDE.md | 1 + 22 files changed, 381 insertions(+), 24 deletions(-) create mode 100644 .claude/commands/run-epic.md create mode 100644 .github/prompts/run-epic.prompt.md create mode 100644 .github/skills/run-epic/SKILL.md diff --git a/.claude/commands/plan-issue.md b/.claude/commands/plan-issue.md index b1c0315..19e918f 100644 --- a/.claude/commands/plan-issue.md +++ b/.claude/commands/plan-issue.md @@ -199,7 +199,7 @@ Clone into a scratch folder outside the repository, `$scratch = Join-Path ([IO.P 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. 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. Also search the project's own tooling, meaning its scripts, generators, checks and CI, hook and release helpers but not the product's code or its stack's toolchain, for a language that ADR-0021 in the target's `docs/decisions/project-template/` doesn't list, such as a `*.py` script, a `requirements.txt` or `pyproject.toml` that serves only tooling, or a CI step that runs `pip`, `uv` or `python` for it. Leave a Python program the project runs as it is, such as Copier or pre-commit, and add no step that ports a tool: list each one under `## Follow-ups` as a port to the first language ADR-0021 lists that fits, naming its files. +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 "