Skip to main content

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
But: One commit per task, right away.
Each commit is:
  • 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:
With bulk commits, you’d have to manually search through 20 file changes.

2. Surgical Rollback

Revert exactly what broke:
With bulk commits, reverting means losing all work.

3. AI Observability

Claude can understand history:
With vague commits (“Update auth”), Claude has no context.

4. Review Granularity

Each commit is reviewable:
With bulk commits, PRs become 1000+ line monsters.

Commit Format

GSD uses conventional commits with phase/plan prefix:

Type

Phase-Plan Prefix

Benefits:
  • git log filtered by phase: git log --grep="08-"
  • git log filtered by plan: git log --grep="08-02"
  • Clear traceability from commit to PLAN.md

Description

Good Examples

Bad Examples

Rule: Commit message should tell you WHAT changed without reading the diff.

Body (Optional)

For complex tasks, add bullet points:
But most tasks are concise enough for one-line commits.

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:
Git History:
SUMMARY.md:
Final Commit (metadata only):

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:
Tracked in SUMMARY.md:

Checkpoint Commits

When executor pauses at checkpoint:
No “checkpoint reached” commits. Checkpoints are execution pauses, not code changes.

File Ownership

Each task’s commit includes only files from <files> element:
Executors NEVER use:
  • git add .
  • git add -A
  • git add -u
Always stage files individually to maintain atomicity.

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:
Why separate?
  • 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

DON’T:
  • Squash GSD commits during PR (loses traceability)
  • Manually commit during execute-phase (breaks atomicity)
  • Use vague commit messages (“update code”, “fix stuff”)
  • Bulk stage files (git add .)
  • Skip commit messages (executor never does this, but humans might)
DO:
  • Trust the executor’s commit strategy
  • Keep atomic commits in git history
  • Use conventional commit format
  • Stage files individually per task
  • Document deviations in SUMMARY.md

Next Steps

Workflow Stages

See how commits fit into the 5-stage workflow

Quickstart

Try the full workflow with atomic commits