Git Workflow
Purpose
Manage version control safely and consistently. Implements ../../system/GIT_WORKFLOW_RULES.md. Covers branching, commits, and PRs; remote/publish actions require approval.
When to Use
- When a change is ready to branch/commit/PR (on request).
- When defining the git strategy for a work item/phase.
- Not to commit/push proactively without being asked.
Inputs
- The change to be versioned and its work item.
- Repo conventions (commit style, branch naming).
- The user's authorship/co-author preference.
Discovery Questions
- Has the user asked to commit/push, or only to implement?
- What is the branch naming and commit convention here?
- Does the repo have hooks/gates to run first?
- Any authorship/co-author trailer preference?
Responsibilities
- Branch off the default branch with a descriptive name.
- Make small, coherent commits with why-focused messages.
- Keep secrets out of commits; respect
.gitignore.
- Run
before-commit / before-pr hook checks (tests, security).
- Open PRs only when asked, with a clear description.
- Follow the user's authorship preference (no unrequested trailers).
Required Workflow
- Confirm the user wants git actions (not just implementation).
- Branch from the up-to-date default branch.
- Stage a coherent change; run before-commit checks.
- Commit with a clear message.
- For a PR: run before-pr checks; open with a summary of what/why/testing/risks.
Decision Rules
- Never commit directly to
main/master — branch first.
- Never commit/push unless asked.
- No remote repo creation here (that's
github-repository, and requires approval).
- Destructive/history-rewriting ops require explicit confirmation and a reason.
Rules
- No secrets in commits; flag any previously committed secret for rotation.
- Match repo commit/branch conventions.
- Gate git actions behind hooks/gates (
../../system/QUALITY_GATES.md).
Anti-Patterns
- Auto-committing/pushing without request.
- Committing to the default branch.
- Force-push/history rewrite without explicit approval.
- Adding co-author trailers the user didn't ask for.
Validation Checklist
Definition of Done
Changes are on a descriptive branch with clean, coherent commits (no secrets, correct authorship), pre-commit/pre-PR checks run, and a PR opened only if requested — all consistent with the repo's conventions.
Related Skills
github-repository, release-planning, code-review, security-review, project-orchestrator.
Related Knowledge
../../memory/ (user git preferences), ../../knowledge/.
Related References
None typically.
Context Loading Guidance
- Requires: the change, repo conventions, the user's git preference.
- Does not require: unrelated source, references, planning skills' bodies.
- May load:
github-repository (remote), release-planning (release).
- Stop when: the branch/commit/PR action is complete or a gate blocks it.
Token Efficiency Guidance
Operate on the diff and conventions only. Keep commit/PR text tight and informative.
1---2name: git-workflow3description: Use to plan and perform branching, commits, and PRs safely. Branches off the default branch, never commits/pushes without being asked, keeps secrets out of history, and gates git actions behind the relevant hooks and quality gates.4---56# Git Workflow78## Purpose910Manage version control safely and consistently. Implements `../../system/GIT_WORKFLOW_RULES.md`. Covers branching, commits, and PRs; remote/publish actions require approval.1112## When to Use1314- When a change is ready to branch/commit/PR (on request).15- When defining the git strategy for a work item/phase.16- **Not** to commit/push proactively without being asked.1718## Inputs1920- The change to be versioned and its work item.21- Repo conventions (commit style, branch naming).22- The user's authorship/co-author preference.2324## Discovery Questions2526- Has the user asked to commit/push, or only to implement?27- What is the branch naming and commit convention here?28- Does the repo have hooks/gates to run first?29- Any authorship/co-author trailer preference?3031## Responsibilities3233- **Branch off the default branch** with a descriptive name.34- Make **small, coherent commits** with why-focused messages.35- Keep **secrets out of commits**; respect `.gitignore`.36- Run **`before-commit` / `before-pr`** hook checks (tests, security).37- Open PRs **only when asked**, with a clear description.38- Follow the user's **authorship preference** (no unrequested trailers).3940## Required Workflow41421. Confirm the user wants git actions (not just implementation).432. Branch from the up-to-date default branch.443. Stage a coherent change; run before-commit checks.454. Commit with a clear message.465. For a PR: run before-pr checks; open with a summary of what/why/testing/risks.4748## Decision Rules4950- Never commit directly to `main`/`master` — branch first.51- Never commit/push unless asked.52- No remote repo creation here (that's `github-repository`, and requires approval).53- Destructive/history-rewriting ops require explicit confirmation and a reason.5455## Rules5657- No secrets in commits; flag any previously committed secret for rotation.58- Match repo commit/branch conventions.59- Gate git actions behind hooks/gates (`../../system/QUALITY_GATES.md`).6061## Anti-Patterns6263- Auto-committing/pushing without request.64- Committing to the default branch.65- Force-push/history rewrite without explicit approval.66- Adding co-author trailers the user didn't ask for.6768## Validation Checklist6970- [ ] User requested the git action.71- [ ] Branched off the default branch.72- [ ] Commit small/coherent; message explains why.73- [ ] No secrets committed.74- [ ] before-commit/before-pr checks run.75- [ ] Authorship preference respected.7677## Definition of Done7879Changes are on a descriptive branch with clean, coherent commits (no secrets, correct authorship), pre-commit/pre-PR checks run, and a PR opened only if requested — all consistent with the repo's conventions.8081## Related Skills8283`github-repository`, `release-planning`, `code-review`, `security-review`, `project-orchestrator`.8485## Related Knowledge8687`../../memory/` (user git preferences), `../../knowledge/`.8889## Related References9091None typically.9293## Context Loading Guidance9495- **Requires:** the change, repo conventions, the user's git preference.96- **Does not require:** unrelated source, references, planning skills' bodies.97- **May load:** `github-repository` (remote), `release-planning` (release).98- **Stop when:** the branch/commit/PR action is complete or a gate blocks it.99100## Token Efficiency Guidance101102Operate on the diff and conventions only. Keep commit/PR text tight and informative.