Git Flow — Skill
Purpose
Enforce consistent git practices across all phases — planning, implementation, and validation.
When to Use
- •Creating or naming a branch
- •Writing a commit message
- •Merging work back to a base branch
- •Planning implementation steps that involve git operations
Branching Conventions
- •Avoid direct commits to
mainwhen possible. Prefer feature/fix branches for isolated work. - •Branch naming:
feature/<short-kebab-description>for features,fix/<short-kebab-description>for fixes. - •Branch from
main. - •One logical task per branch. Do not mix unrelated changes.
Commit Conventions
- •Format:
type(scope): subject- •
type: feat, fix, refactor, test, docs, chore - •
scope: module or component name (e.g.,router,handler,timeout) - •
subject: imperative mood, lowercase, no period, under 72 characters
- •
- •One logical change per commit. Every commit must leave the codebase runnable.
- •Include traceability: Add
Fulfills: REQ-XX-NNNin the commit body when the commit completes a requirement. - •Push after every commit. The remote is backup and audit trail.
Merge Conventions
- •Merge with
--no-ffto preserve feature branch history. - •Delete the feature branch after a successful merge.
- •Verify tests pass before merging.
Pre-Commit Self-Check
- •Run
git diff --stagedand review every changed line. - •Confirm no debug prints, commented-out code, or TODOs remain.
- •Confirm the commit message accurately describes the change.
- •Confirm the code runs without errors.
Quality Checklist
- • Branch name follows
feature/<name>orfix/<name>convention - • Each commit has one logical change
- • Commit messages follow
type(scope): subjectformat - • Commit body includes
Fulfills: REQ-XX-NNNwhere applicable - • All commits pushed to remote
- • Feature branch merged with
--no-ff - • Feature branch deleted after merge