feat: give repositories made from the template a way to take template updates

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
git, shell
Domain
tooling

Research direction

Start with README.md, especially “Use the template,” and CONTRIBUTING.md; also review issue #3 because its setup changes need to work with updates. Compare the listed update options against all three install methods and the setup choices they must preserve. Done means choosing and documenting an update approach, recording the installed template commit, and listing non-file changes for a person to apply.

Written by the indexing model from the issue text.

Description

type/feature
Problem to solve

The template changes over time, but a repository made from it has no documented way to take the changes. README.md describes only the install, in "Use the template". No doc or skill describes an update.

Three properties of the template make an update hard:

  1. Different installs leave different Git states.

    Install method History shared with the template Effect on an update
    Use this template (the method in README.md) None. The new repository starts with one new commit git merge from the template finds no merge base
    Fork or clone, then push to a new repository Full git merge works, but it also brings commits that only apply to the template repository, for example to its own README.md
    Copy all or some of the files into an existing repository None No merge base, and the repository can hold only some of the files, for example only .agents/skills/
  2. Setup changes the files that updates change. Setup replaces the {{...}} placeholders, fills and then deletes the TEMPLATE: sections, replaces README.md and LICENSE, and keeps only one of .github/rulesets/main.json and .githooks/pre-push. A plain merge or a file copy then has conflicts in, or overwrites, exactly these files: AGENTS.md, CONTRIBUTING.md, docs/, .github/.

  3. No record of the installed version. A repository made from the template does not record the template commit that it came from. Without that commit, nobody can compute what changed in the template since the install.

Some updates also are not files. Examples are a new type/ label, a new required status check in the ruleset, or a new repository setting. Updated files cannot apply these changes.

Proposal

Requirements for any solution:

  • It works for every install method in the table, so it cannot depend on shared Git history.
  • It keeps the setup choices: placeholder values, filled sections, the branch protection method that the repository kept, and files that the repository removed or replaced.
  • It records the template commit that the repository is now based on, so that the next update has a base.
  • It lists the template changes that are not files (labels, settings, rulesets) for a person to apply.
  • The update commit follows CONTRIBUTING.md. For example, a rejected template change gets a Rejected: line.

Options that are not decided yet:

Option Can do Cannot do, or cost
An update-template skill in .agents/skills/ Reads git diff <base>..<latest> from the template repository and applies each change to the adapted files. Asks the person about conflicts and rejected changes. Works with no shared history Needs an AI assistant. Needs a recorded base. A repository without the record must first find the base by comparing its files with template commits
Document git remote add template and git merge --allow-unrelated-histories No new tool The first merge conflicts in every adapted file. Without a recorded base, every later merge does the same. Does not work for a partial copy
A scheduled workflow that opens a PR with the template changes, for example a third-party template-sync action Shows updates with no person Copies files, so it conflicts with or overwrites adapted files. Adds a third-party dependency and a token with write access
A script that copies the template files again Simple Overwrites the setup choices

All options need the installed template version to be recorded. Where to record it (a file at the repository root, or a line in AGENTS.md) and when (a setup step in README.md) is part of this issue.

More information
  • #3 makes the initial setup simpler or enforced. An update can add setup steps, so whatever #3 adds must also work for updates.
Dominant language
Shell
Stars
1
Forks
0
Avg merge
6h 59m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c-w-z/commit-decision-record

All issues in c-w-z/commit-decision-record

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.