settings/gitflow.md
Read-only
Extra Markdown files installed with the setup, such as references your agents and skills read.
gitflow.md
Gitflow settings
Parameters
- branch_strategy: per_apply
- base_branch: main
- commit_strategy: per_leaf
- tag_strategy: none
- tag_prefix: v
- after_apply: leave
- branch_name_template: feature/<slug>
- commit_message_template: <type>(<scope>): <summary> [spec <spec_id>]
Rules
Apply start
- Record
git -C <repo> status --porcelainin every repository as its pre-run dirty paths. - Create one run branch per apply run in every repository, named
feature/<slug>with<slug>taken from the root specification's title, starting frommain, following the branch creation steps below. - Branch creation steps:
- Slug: lowercase the title, replace every run of characters outside
[a-z0-9]with-, trim-at both ends, truncate to 50 characters and trim trailing-again. - Clean tree: if
git -C <repo> status --porcelainreports paths other than those the user already chose to carry over in this repository, ask the user, listing them: Commit them first (stage exactly those paths and commit them on the current branch with the messagechore: wip before <slug>), Stash them (git -C <repo> stash push --include-untracked -- <paths>), Carry them over onto the new branch (leave them and don't ask about them again in this repository) or Abort git operations for this repository. Without a user, abort git operations for this repository. - Existing name: if
git -C <repo> rev-parse --verify --quiet refs/heads/<name>succeeds, ask the user whether to Reuse it (git -C <repo> switch <name>) or Create<name>-2(the first free suffix:-2,-3, …). Without a user, create the suffixed branch. - Switch: record the current branch (
git -C <repo> branch --show-current, or the commit fromgit -C <repo> rev-parse HEADwhen detached) as the new branch's original branch, and the commit it starts from as its start point. For a branch frommain, rungit -C <repo> switch -c <name> main; ifmaindoesn't exist locally, rungit -C <repo> fetch origin mainand useorigin/main. For a stacked branch, rungit -C <repo> switch -c <name>. If the base still doesn't exist, or git refuses to switch, abort git operations for this repository and report why. - Record the branch for the report.
- Slug: lowercase the title, replace every run of characters outside
Leaf done
- Commit the leaf in every repository it touched, following the commit steps below.
- Commit steps, used by every commit this file asks for:
- The staged set is the leaf's files in this repository that
git -C <repo> status --porcelain -- <paths>reports as changed. If it is empty, make no commit in this repository. - Stage exactly the staged set with
git -C <repo> add -- <path>...(a deleted path stages its deletion). Nevergit add -Aorgit add .. - If nothing is staged (
git -C <repo> diff --cached --quietsucceeds), skip the commit. Otherwise rungit -C <repo> commit -m "<subject>"(add-m "<body>"for a body). - Build the subject from the template
<type>(<scope>): <summary> [spec <spec_id>]:<type>isfeatby default,fixfor a fix, anddocs,test,refactororchorewhen clearly applicable, with!after the type and aBREAKING CHANGE:footer in the body only when the specification describes a breaking change;<scope>is the sub-project's settings folder name or the repository's directory name, and may be empty (then drop the parentheses);<summary>is the leaf title, starting lowercase, without a trailing period;<spec_id>is the leaf id. - List a staged path that is among the pre-run dirty paths in the report as "may include pre-run changes". Record the commit's sha and subject for the report.
- The staged set is the leaf's files in this repository that
Review approved
- If any of the leaf's files are still changed in a repository (review fixes), commit them there as a follow-up commit, following the commit steps in
### Leaf done, with typefixand summaryaddress review findings for <leaf title>.
Apply end
- Remove every branch this run created that holds no changes, following these branch cleanup steps:
- Keep the branch unless
git -C <repo> rev-list --count <start point>..<name>is0and no leaf it was created for (every leaf of the run for a run branch, the leaf itself for a leaf branch) has changed files in this repository. - Switch back to its original branch (
git -C <repo> switch <original branch>, orgit -C <repo> switch --detach <commit>when it was detached); carried-over changes move along. - Delete it with
git -C <repo> branch -D <name>. Never delete a reused existing branch. - If the switch fails, keep the branch and report it. Record every removed branch for the report.
- Keep the branch unless
- Create no tags.
- Do not push and do not open a pull request.
Implementation
- Never run a git command that changes state — no
git add,commit,branch,checkout,switch,stash,reset,restore,rebase,merge,tagorpush. Read-only commands such asgit statusandgit diffare fine. Git operations belong toatn-applyand the user.
Custom
Project-specific additions. Agents follow this section; the init skill never overwrites it.