Skip to content

About

Copier template for projects worked through a plan-then-execute workflow in Claude Code, GitHub Copilot Chat and Copilot CLI

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3,606 Commits

Folders and files

Repository files navigation

Project Template

Private Copier template for new repositories set up for plan-then-execute AI coding:

  • Claude Opus plans each change into PLAN.md, a cheaper model executes it one verified step at a time, and any step that needs a decision goes back to Opus.
  • Every project works with Claude Code and with GitHub Copilot, and you can switch between them at any time (Claude Code or GitHub Copilot).
  • The base works for any language, with the decisions behind its rules recorded as ADRs.
  • A .NET layer adds shared build settings, analyzers, banned APIs, C# and test conventions, and for libraries the license files, icon and a NuGet publish workflow.
  • It serves NCodeGroup's repositories, which are on GitHub, and supports no other host: GitLab isn't supported, and a GitLab template, if one is ever needed, is a separate template there (ADR-0040).
  • Every project made from it can pull later template improvements with Update-Project.ps1.

Related:

  • Configuration G — the accounts, the shack PC, the VS Code tunnel and the daily loop this template is built for.
  • Plan-and-execute — how the workflow works and how to choose between its variants.
  • This repository is the single source of truth for the workflow's templates and scripts (workflow/); personal-notes and every project consume them.
  • USAGE.md — setting up a PC for Claude Code and GitHub Copilot, and using and switching between them.

Quick Start

  • .\New-Project.ps1 -Path C:\src\<name> -CreateRemote creates a project with AGENTS.md, CLAUDE.md, Claude Code permissions, the plan-then-execute commands and agents for Claude Code, Copilot Chat and Copilot CLI — switch between your Claude and Copilot plans at any time — CI, Dependabot, and optional .NET settings, then creates its repository on GitHub, public, and pushes.
  • Add -Visibility private for a private repository.
  • Every file has one of three owners:
    • Template-owned files are replaced on every update and never edited.
    • Merged files — settings whose tools can't include a second file — take the template's changes merged with the project's edits.
    • Project-owned files, including the AGENTS.md index, are never touched.
  • .\.template\Update-Project.ps1, run in a project, updates itself to the newest version first, then does all three and commits, or stops on a same-line conflict in a merged file.
  • Dependabot keeps each GitHub project's actions, packages and SDK current through weekly pull requests.
  • Change the workflow in workflow/templates, run tools/Update-Template.ps1 and tests/Test-Template.ps1, then tag and push; this repository is its single source of truth.
  • .\Adopt-Project.ps1 -Path <repository> brings an existing repository under the template.

Table of Contents

What a Project Gets

Every file has one of three owners, listed in copier.yml:

Owner Files On update
Template The workflow machinery Replaced; an edit in the project is discarded
Template and project, merged Settings files whose tools can't include a second file The template's changes merge with the project's edits, like a Git merge
Project AGENTS.md, README.md, .node-version (with uses_node) and, for .NET, Directory.Build.props and, for a library, version.json Never touched

Where a tool can include a second file, the template's part and the project's part are separate files, so the project changes the template's behavior without editing it (Extend or Override the Template).

Template-Owned Files

The template-owned files, and what each one does, are listed in The Files a Project Gets.

Merged Files

The merged files, and how an update merges each one, are listed in The Files a Project Gets.

Project-Owned Files

The project-owned files, and how a project takes a file over, are listed in The Files a Project Gets.

Claude Code or GitHub Copilot

Every project carries the same workflow for both:

  • You can work on it with your Claude plan or your Copilot plan, and switch whenever you like: open the other panel in VS Code, or run claude or copilot in a terminal.
  • Nothing in the project needs to change.
  • PLAN.md is the only state the tools share, so one can plan and another execute, re-plan or review.
  • Each plan lives in its own git worktree, .claude/worktrees/<name>/, in every tool, so several sessions can work on different plans at once.
  • A Copilot session starts each command in the plan's folder; open that folder to continue the plan in the other tool.
  • A Claude Code cloud session, which may push only to the branch made for it, still makes each plan on its own branch and lands it through that branch, one pull request at a time (USAGE.md).
  • Each request bills the plan of the tool that makes it.

USAGE.md is the guide: the tools to install, signing in to each, the commands per tool, switching mid-plan, and troubleshooting.

Extend or Override the Template

A project never edits a template-owned file. It adds to the template and overrides it with files of its own, which win where they differ.

AGENTS.md is the project's index. Its first entry imports the template's rules; every entry after it is the project's:

## Instructions

- @.github/instructions/project-template.instructions.md — the plan-then-execute workflow and base conventions, from the project template. …
- @.github/instructions/api.instructions.md — how this project designs its HTTP API
- @docs/agents/releases.md — how to cut a release
  • Add an instruction, or override one of the template's, for every agent
    • Add: A line under Conventions in AGENTS.md, or a file listed in its index as @<path> — what it covers. A .github/instructions/<name>.instructions.md file with an applyTo glob also reaches Copilot automatically
    • Picked up by: Claude Code imports each @ entry; Copilot reads AGENTS.md and loads every .github/instructions/ file; other agents follow the index
  • Add a command, skill or agent
    • Add: A file with a new name in .claude/commands/, .github/prompts/, .github/skills/<name>/ or .github/agents/
    • Picked up by: The tool; updates leave it alone
  • Add an instruction for Claude Code only
    • Add: .claude/rules/<name>.md
    • Picked up by: Claude Code loads every file there
  • Override a .NET build setting
    • Add: A property in Directory.Build.props, after its import of build/ProjectTemplate.props
    • Picked up by: MSBuild: the later value wins
  • Change a merged file — .gitignore, CI, editor settings, permissions
    • Add: Edit the file; later template changes merge into it
    • Picked up by: —

An instruction override is the project's word against the template's, so say it plainly — "Ignore the template's rule on X; here, do Y" — and the agents follow the project.

Questions

The questions Copier asks, each one's default and what it affects are in Questions.

Create a Project

New-Project.ps1 makes a new repository from the template: it asks the questions, writes the files, runs git init and makes the first commit. With -CreateRemote it also creates the repository on GitHub and protects its default branch.

.\New-Project.ps1 -Path C:\src\qso-viewer -CreateRemote

Reference: New-Project.ps1: its parameters, what it runs, and notes for public and .NET projects. docs/adopt.md is the step-by-step runbook.

Adopt an Existing Repository

Adopt-Project.ps1 brings an existing repository under the template with no questions asked: it works out the answers, applies the template, runs the build and tests, and commits.

.\Adopt-Project.ps1 -Path C:\src\Buffers

Reference: Adopt-Project.ps1: its parameters, what it refuses, how it works out each answer and treats each file, and what it leaves to you.

How it works

How the script works out each answer and treats each file the repository already has is in How it works.

Legacy Adapters

The adapters that remove an old setup the template replaces, and how to add one, are in Legacy Adapters.

Protect the Default Branch

tools/Set-RepositoryBaseline.ps1 makes a GitHub repository take changes only through pull requests. It sets up:

  • A "Protect main" ruleset on the default branch.
  • A "Protect release tags" ruleset.
  • The security settings a public project should have.
  • Auto-merge.
  • The contribution policy.
  • The pull_request_target event policy the code-review workflows need.

New-Project.ps1 -CreateRemote runs it, and running it again brings a repository up to date.

.\tools\Set-RepositoryBaseline.ps1 -Repo Buffers -WhatIf

Reference: Set-RepositoryBaseline.ps1: each ruleset and setting, when the script changes or leaves it, and its organization mode. docs/adopt.md says when to run it.

Plan on a Kanban Board

tools/kanban-board.mjs sets up a GitHub Project whose Status field has the Kanban columns Backlog, Ready, In progress, In review and Done, and prints the board line for a project's AGENTS.md Landing section.

Reference: kanban-board.mjs: how to run it, what it sets, and the steps GitHub's API leaves to you. For the organization's private Project, see Set Up Private Planning.

Report Outside Contributions

tools/outside-contributions.mjs reports, for each repository whose contributions answer is open, how outside contributors' pull requests fared over the last 90 days, so a maintainer can tell whether the policy is working.

Reference: outside-contributions.mjs: how to run it and what each line reports.

Update a Project

Every project carries .template\Update-Project.ps1, which moves it to the newest template version in one commit: template-owned files are replaced, merged files take the template's changes, and project-owned files are never touched.

.\.template\Update-Project.ps1                # newest template tag; commits the update

Reference: Update-Project.ps1: its parameters, what happens to each file, the warnings it prints, and how to plan an update with /plan-template-update.

The Update Notice

The weekly workflow that opens an issue when a newer template version exists is in The Update Notice.

The Template's Address

How a project records where its template came from, and how the update moves an old address, is in The Template's Address.

Resolve a Conflict

What to do when the template and the project changed the same lines is in Resolve a Conflict.

Commit Attribution

A commit records the people who wrote it. AI tools add their own attribution by default, and GitHub then lists the agent as a contributor, which only rewriting published history undoes:

  • Claude Code adds a Co-Authored-By: Claude <[email protected]> trailer and a Claude-Session: trailer.
  • Copilot adds a Co-authored-by: Copilot trailer.
  • Codex, Cursor, Devin, Jules, Gemini, Grok, GitLab Duo, aider and other agents add their own trailers, footers, session links or bot accounts.

Every project, and this repository, prevents it at the source, in settings and rules that travel with the repository, and enforces nothing (ADR-0018):

Layer Stops
attribution in .claude/settings.json: commit and pr empty, sessionUrl off Claude Code's trailers and pull request text
git.addAICoAuthor off in .vscode/settings.json VS Code's own Copilot trailer when you commit from Source Control
The rule in .github/instructions/project-template.instructions.md (here, AGENTS.md) Agents that write the commit message themselves, such as Copilot's
/ship-plan and /run-issues delete agent attribution lines from the pull request title and description they write (workflow/templates/_pr-attribution.md) Attribution in the text the workflow writes

Nothing checks for attribution or fails over it:

  • No hook rewrites or refuses a commit.
  • No CI job or required check fails a pull request, push or pipeline.
  • No workflow command reads a post back to remove a footer, such as the _Generated by [Claude Code](…)_ line a Claude Code cloud session appends, or reports one.
  • What gets through stays.
  • A repository whose ruleset still requires a Commit attribution check, from a template version before v0.83.0, drops it from the required checks, or every pull request waits for a check no workflow reports.
    • .template/Update-Project.ps1 says so when its update removes the check.

Stay Current

A project pins exact versions, and something has to move each pin: Dependabot for a GitHub project's actions, packages and .NET SDK, and .template\Update-Project.ps1 for the template's files, with a weekly issue when a new template version exists.

Reference: Keep a Project Current: what keeps each kind of pin current, the pins inside the template, and the NCode Review bump that merges itself.

Change the Template

Edit template/ and workflow/templates, regenerate with .\tools\Update-Template.ps1, run .\tests\Invoke-AllTests.ps1, add the version's section to CHANGELOG.md, and land it through a pull request; the Release workflow tags and publishes it.

Reference: How to Change the Template: the rules each step follows.

What each test suite checks, and how the end-to-end tests run, are in The Template's Tests.

Publish the Template

Once, from this folder:

git add -A
git commit -m "Create the project template"
git tag v0.1.0
gh repo create NCodeGroup/project-template --public --source . --remote origin --push
git push origin v0.1.0

Copier picks the newest tag, so a change reaches projects only once it is tagged and pushed.

Repository Layout

Every file and folder in this repository, and what it is for, is listed in Repository Layout.

About

Copier template for projects worked through a plan-then-execute workflow in Claude Code, GitHub Copilot Chat and Copilot CLI

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages