Get the FREE Ultimate OpenClaw Setup Guide →

git-integration

Scanned
npx machina-cli add skill a5c-ai/babysitter/git-integration --openclaw
Files (1)
SKILL.md
8.0 KB

git-integration

You are git-integration - the skill that manages all git operations within the GSD methodology. GSD enforces atomic commits per task, structured commit message formats, separation of planning file commits from code commits, and milestone tagging.

Overview

Git integration in GSD follows two key principles:

  1. Atomic commits: Each task produces exactly one commit containing all changes for that task.
  2. Separation of concerns: Planning file changes (.planning/) are committed separately from code changes.

This corresponds to the patterns in the original references/git-integration.md and references/git-planning-commit.md.

Capabilities

1. Atomic Commit Per Task

Each task in a plan produces one atomic commit:

# After completing task 1 of PLAN-1.md
git add src/auth/oauth.ts src/auth/types.ts
git commit -m "feat(auth): implement OAuth2 login endpoint

Phase 72, Plan 1, Task 1: Implement login endpoint
- Added POST /api/auth/login with email/password validation
- Returns JWT token on success, 401 on invalid credentials
- Rate limited to 5 attempts per minute

Refs: Phase-72/PLAN-1/Task-1"

Commit message format:

<type>(<scope>): <short description>

Phase <N>, Plan <M>, Task <K>: <task title>
- <change 1>
- <change 2>

Refs: Phase-<N>/PLAN-<M>/Task-<K>

Types: feat, fix, refactor, test, docs, chore, style, perf.

2. Planning File Commits

Planning files are committed separately from code:

# After generating plans
git add .planning/phase-72/PLAN-1.md .planning/phase-72/PLAN-2.md
git commit -m "plan(phase-72): create execution plans

Phase 72: Authentication
- PLAN-1.md: OAuth2 login and token management (4 tasks, wave 1)
- PLAN-2.md: Auth middleware and role guards (3 tasks, wave 1)

Refs: Phase-72/planning"

Planning commit types: plan, state, research, context, verify, audit.

3. Commit Message Generation

Generate commit messages from task context:

Input:
  phase: 72
  plan: 1
  task: 1
  title: "Implement login endpoint"
  type: "feat"
  scope: "auth"
  changes: ["POST /api/auth/login endpoint", "JWT token generation", "Rate limiting"]

Output:
  "feat(auth): implement OAuth2 login endpoint

  Phase 72, Plan 1, Task 1: Implement login endpoint
  - Added POST /api/auth/login endpoint
  - JWT token generation on success
  - Rate limiting (5 attempts/minute)

  Refs: Phase-72/PLAN-1/Task-1"

4. Git Tag Creation

Create annotated tags for milestone completions:

git tag -a v1.0 -m "Milestone v1.0: MVP Launch

Phases completed: 70, 71, 72, 73
Requirements covered: R1-R11
Audit result: PASSED

Key deliverables:
- Project scaffolding and CI pipeline
- Database layer with migrations
- OAuth2 authentication
- REST API endpoints"

5. Branch Status Detection

Detect current branch state:

{
  "branch": "main",
  "clean": false,
  "staged": ["src/auth/oauth.ts"],
  "unstaged": [".planning/STATE.md"],
  "untracked": ["src/auth/oauth.test.ts"],
  "ahead": 3,
  "behind": 0
}

6. Planning-Aware File Staging

Separate .planning/ files from source code files:

# Stage code changes only
git add src/auth/oauth.ts src/auth/types.ts

# Stage planning changes only (separate commit)
git add .planning/phase-72/SUMMARY.md .planning/STATE.md

Rules:

  • Code changes: committed with task-level commit messages
  • Planning changes: committed with phase-level commit messages
  • Mixed commits: never (always separate planning from code)

7. Commit History Analysis

Analyze commit history for progress tracking:

Phase 72 commits:
  abc1234 feat(auth): implement OAuth2 login endpoint (Task 1)
  def5678 feat(auth): add token refresh mechanism (Task 2)
  ghi9012 feat(auth): implement logout and revocation (Task 3)
  jkl3456 test(auth): add auth endpoint tests (Task 4)

Total: 4 commits, 12 files changed, +450 -30 lines

8. Diff Summary Generation

Generate diff summaries for SUMMARY.md:

Changes summary:
  Files created: 4
  Files modified: 2
  Files deleted: 0
  Lines added: 450
  Lines removed: 30

  New files:
    src/auth/oauth.ts (120 lines)
    src/auth/tokens.ts (85 lines)
    src/auth/types.ts (45 lines)
    src/middleware/auth.ts (90 lines)

  Modified files:
    src/routes/index.ts (+15 -2)
    package.json (+3 -0)

Tool Use Instructions

Creating an Atomic Commit

  1. Use Bash to run git status to see current changes
  2. Use Bash to stage only the files related to the current task: git add <files>
  3. Generate commit message from task context
  4. Use Bash to commit: git commit -m "<message>"
  5. Verify commit succeeded with git log -1

Creating a Planning Commit

  1. Use Bash to identify planning file changes: git status .planning/
  2. Stage only planning files: git add .planning/<files>
  3. Generate planning commit message
  4. Commit with planning-specific type prefix

Creating a Milestone Tag

  1. Use Read to load milestone audit data for tag annotation
  2. Use Bash to create annotated tag: git tag -a <version> -m "<annotation>"
  3. Verify tag with git tag -l <version>

Checking Branch Status

  1. Use Bash to run git status --porcelain
  2. Use Bash to run git rev-list --count HEAD..@{upstream} for behind count
  3. Use Bash to run git rev-list --count @{upstream}..HEAD for ahead count
  4. Return structured status

Process Integration

  • execute-phase.js - Atomic commit per task during execution
  • verify-work.js - Commit verification results and fixes
  • quick.js - Atomic commit for quick task execution
  • debug.js - Commit debug fixes
  • complete-milestone.js - Create milestone git tag
  • add-tests.js - Commit each test file atomically
  • research-phase.js - Commit research document
  • plan-phase.js - Commit generated plans (planning commit)

Output Format

{
  "operation": "commit|tag|status|history|diff",
  "status": "success|error",
  "commit": {
    "hash": "abc1234",
    "message": "feat(auth): implement OAuth2 login endpoint",
    "filesChanged": 3,
    "linesAdded": 120,
    "linesRemoved": 5
  },
  "tag": {
    "name": "v1.0",
    "annotation": "Milestone v1.0: MVP Launch"
  },
  "branchStatus": {
    "branch": "main",
    "clean": true,
    "ahead": 0,
    "behind": 0
  }
}

Configuration

SettingDefaultDescription
autoCommittrueAutomatically commit after each task
commitMessageFormatconventionalCommit message format (conventional/simple)
separatePlanningCommitstrueSeparate planning from code commits
signCommitsfalseGPG-sign commits
tagPrefixvPrefix for milestone tags

Error Handling

ErrorCauseResolution
Nothing to commitNo changes to stageVerify task made expected changes
Merge conflictConflicting changes in working treeResolve conflicts before committing
Dirty working treeUncommitted changes from previous taskCommit or stash before proceeding
Tag already existsMilestone tag already createdUse --force or choose different tag name
Detached HEADNot on a branchCheckout a branch before committing

Constraints

  • Never create commits with mixed planning and code changes
  • Each task gets exactly one code commit (atomic)
  • Commit messages must follow the structured format with phase/plan/task references
  • Planning commits use planning-specific type prefixes (plan, state, research, etc.)
  • Tags are annotated (not lightweight) with milestone summary
  • Never force-push or rewrite history on shared branches
  • Always check for clean working tree before starting a new task

Source

git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/gsd/skills/git-integration/SKILL.mdView on GitHub

Overview

git-integration enforces atomic commits per task and separates planning file changes from code changes. It also standardizes commit messages and supports milestone tagging to track progress across GSD phases and plans.

How This Skill Works

For every completed task, you create a single atomic commit containing all related changes. Planning files (.planning/) are committed separately using planning types, and commits follow a structured format with phase/plan/task references. Milestone tagging and branch awareness help manage progress and releases in the GSD workflow.

When to Use It

  • When implementing a single TASK under a specific PLAN (Phase-<N>/PLAN-<M>/Task-<K>) and needing an auditable, per-task history
  • When generating or updating planning files and wanting to commit them separately from code changes
  • When preparing to release or milestone-ship, requiring annotated tags (milestones) for Phase completions
  • When you must verify the current branch state (clean/unstaged/staged) before a release or planning review
  • When reviewing commit history to ensure changes are scoped to a single task and easily traceable to plan items

Quick Start

  1. Step 1: For each task, stage the code changes and commit with the atomic message: feat(scope): short description; then add Phase-<N>/PLAN-<M>/Task-<K> refs and bullet changes
  2. Step 2: After planning, stage and commit planning files only using plan-type commits like plan(phase-72): create execution plans with .planning/ paths and a Refs line
  3. Step 3: Create an annotated milestone tag when a phase completes and verify the branch state to ensure a clean history before release

Best Practices

  • Always create one atomic commit per task containing all changes for that task
  • Never mix planning file changes with code changes in the same commit; keep planning in .planning with plan-type commits
  • Use the recommended commit message format: <type>(<scope>): <short description> followed by Phase/PLAN/Task refs and bullet changes
  • When planning work, commit planning files separately using planning commit types (plan, state, research, context, verify, audit)
  • Create annotated tags for milestones when phases are completed and regularly review branch status before tagging

Example Use Cases

  • Atomic commit per task example: after completing Task 1 of PLAN-1, commit with feat(auth): implement OAuth2 login endpoint and a body listing changes; include Refs: Phase-72/PLAN-1/Task-1
  • Planning file commit example: after generating plans, commit planning files with plan(phase-72): create execution plans and list the involved plan files under .planning/phase-72
  • Commit message generation example: given phase=72, plan=1, task=1, type=feat, scope=auth, changes=[...], output a structured commit message with the Phase/PLAN/Task refs and bullet changes
  • Git tag creation example: git tag -a v1.0 -m "Milestone v1.0: MVP Launch" describing Phase completions and key deliverables
  • Branch status detection example: a JSON snippet showing current branch, clean/unstaged/staged statuses, ahead/behind counts, and untracked files

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers