The Strategy
Every task in a GSD plan produces one commit immediately after completion. Not:- One commit per plan
- One commit per phase
- Bulk commit at the end
- Atomic — One logical unit of work
- Traceable — Links to phase, plan, task
- Revertable — Can undo without affecting others
- Meaningful — Describes what changed and why
Why It Matters
1. Git Bisect Works
Find the exact failing task:2. Surgical Rollback
Revert exactly what broke:3. AI Observability
Claude can understand history:4. Review Granularity
Each commit is reviewable:Commit Format
GSD uses conventional commits with phase/plan prefix:Type
Phase-Plan Prefix
git logfiltered by phase:git log --grep="08-"git logfiltered by plan:git log --grep="08-02"- Clear traceability from commit to PLAN.md
Description
Good Examples
Bad Examples
Body (Optional)
For complex tasks, add bullet points:Commit Timing
Executors commit immediately after each task:1
Execute Task
2
Stage Files
3
Commit
4
Record Hash
5
Continue to Next Task
Executor moves to Task 2, repeats process.No waiting. No batching. Commit immediately.
Real Example
Phase 08, Plan 02: User Registration PLAN.md:TDD Commits
Test-driven tasks produce 2-3 commits:RED Commit
GREEN Commit
REFACTOR Commit (if needed)
TDD cycle produces granular history: exactly when tests were added, when implementation shipped, when refactoring happened.
Deviation Commits
When executor applies Rules 1-3 (auto-fixes), separate commit:Checkpoint Commits
When executor pauses at checkpoint:File Ownership
Each task’s commit includes only files from<files> element:
Benefits Summary
Debugging
Git bisect finds exact failing task in O(log n) time. Manual search through bulk commits takes O(n).
Rollback
Revert surgical changes without affecting unrelated work. Bulk commits force all-or-nothing.
Review
Each commit is reviewable unit. Reviewers understand WHAT changed and WHY.
History
Future Claude agents read commit history to understand how features were built, in what order, with what decisions.
Traceability
Direct link from commit → task → plan → phase → requirement. Full visibility.
CI/CD
Each commit triggers build. Know immediately which task broke the build.
Planning File Commits
GSD commits planning files separately from code:- Code commits are feature work (feat, fix, test)
- Planning commits are documentation (docs)
- Different revert semantics (rarely need to revert docs)
- Clean
git log --grep="feat"shows only code changes
Best Practices
Let executors commit
Don’t manually commit during execute-phase. Executors handle atomicity automatically.
Use git log filters
Review commit messages
After execute-phase, run:Check commit messages are meaningful.
Use git bisect
When debugging:Find exact breaking commit.
Anti-Patterns
Next Steps
Workflow Stages
See how commits fit into the 5-stage workflow
Quickstart
Try the full workflow with atomic commits