/moai-ref-git-workflow
Git workflow patterns, branch strategies, conventional commits, and PR templates reference for git operations. Agent-extending skill that amplifies manager-git expertise with production-grade git workflow patterns. NOT for: code implementation, testing, architecture design,
Claude Code
$ npx -y skills add modu-ai/moai-adk --skill moai-ref-git-workflow --agent claude-code
Codex
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a codex -y
Cursor
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a cursor -y
Gemini CLI
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a gemini-cli -y
GitHub Copilot
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a github-copilot -y
OpenCode
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a opencode -y
Windsurf
$ npx skills add modu-ai/moai-adk --skill moai-ref-git-workflow -a windsurf -y
SKILL.md
moai-ref-git-workflow.SKILL.mdname: moai-ref-git-workflow
description: >
Git workflow patterns, branch strategies, conventional commits, and PR templates
reference for git operations. Agent-extending skill that amplifies manager-git
expertise with production-grade git workflow patterns.
NOT for: code implementation, testing, architecture design, documentation content.
when_to_use: >
Use for git workflow reference: branch strategies, conventional commits,
PR templates, merge and rebase flows, and commit/branch/release
conventions. Amplifies manager-git expertise with production-grade git
workflow patterns.
user-invocable: false
metadata:
version: "1.0.0"
category: "workflow"
status: "active"
updated: "2026-03-30"
tags: "git, branch, commit, pr, workflow, reference"
# MoAI Extension: Progressive Disclosure
progressive_disclosure:
enabled: true
level1_tokens: 100
level2_tokens: 3000
Git Workflow Reference
Target Agent
`manager-git` - Applies these patterns directly to git operations, branch management, and PR creation.
Branch Strategy Patterns
GitHub Flow (Default for Most Projects)
main ─────────────────────────────────────────
└── feat/SPEC-XXX-description ──── PR ──→ merge
Rules:
- `main` is always deployable
- Feature branches from `main`
- PR required for all merges
- Delete branch after merge
GitFlow (Complex Release Cycles)
main ──────────────────────────────────────────
└── develop ─────────────────────────────────
├── feature/SPEC-XXX ──── PR ──→ develop
└── release/v1.2.0 ────── PR ──→ main + developAgentic-Trunk (Local Batch Landing)
`git_strategy.manual.workflow: af-flow` names the model MoAI-ADK's own factory runs on:
main ──────────────────────────────────────────
└── WT-card-slug ── integration-worktree merge ──→ batch PR (release/main-batch-YYYYMMDD) ──→ tagged release
Rules:
- One standing trunk `main`; card worktrees branch from it
- Two delivery routes, decided by which tree holds `main`: when a dedicated
integration worktree holds it, cards land serially there (`--no-ff`, no per-card pull request); when only the primary checkout holds it, `moai factory complete` opens the card's pull request and the leader merges it
- With the dedicated integration worktree, the leader opens one batch pull
request per `lead_push_threshold` landings
- Lanes take no per-version release branch and run no lane push
Trunk-Based (CI/CD Heavy)
main ──────────────────────────────────────────
└── short-lived branch (< 1 day) ──→ merge
Branch Naming Convention
| Pattern | Example | Use Case | |---------|---------|----------| | `feat/SPEC-{ID}-{slug}` | `feat/SPEC-AUTH-001-jwt-auth` | New feature | | `fix/SPEC-{ID}-{slug}` | `fix/SPEC-BUG-042-null-check` | Bug fix | | `refactor/{slug}` | `refactor/extract-auth-middleware` | Refactoring | | `docs/{slug}` | `docs/api-reference-update` | Documentation | | `chore/{slug}` | `chore/upgrade-dependencies` | Maintenance |
Conventional Commits Reference
| Type | When | Example | |------|------|---------| | `feat` | New feature | `feat(auth): add JWT refresh token flow` | | `fix` | Bug fix | `fix(api): handle null user in profile endpoint` | | `refactor` | Code restructure | `refactor(db): extract query builder` | | `test` | Test changes | `test(auth): add login edge case tests` | | `docs` | Documentation | `docs(api): update endpoint descriptions` | | `chore` | Maintenance | `chore(deps): upgrade Go to 1.23` | | `perf` | Performance | `perf(query): add index for user lookup` | | `style` | Formatting | `style: apply gofmt formatting` | | `ci` | CI/CD changes | `ci: add GitHub Actions workflow` | | `revert` | Revert commit | `revert: undo feat(auth) commit abc123` |
Commit Message Structure
<type>(<scope>): <description> # max 72 chars
[optional body] # what and why, not how
[optional footer] # Breaking changes, issue refs
BREAKING CHANGE: <description>
Refs: #123, SPEC-AUTH-001
Pull Request Template
## Summary
- [1-3 bullet points describing what this PR does]
## Changes
- [ ] File 1: description of change
- [ ] File 2: description of change
## Test Plan
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing completed
## SPEC Reference
- SPEC-{ID}: {title}
## Checklist
- [ ] Tests pass (project test command)
- [ ] Lint and format pass (project toolchain)
- [ ] No secrets committed
- [ ] Documentation updated if neededMerge Strategy Selection
| Strategy | When | Command | |----------|------|---------| | Squash merge | Feature branches (clean history) | `gh pr merge --squash` | | Merge commit | Release branches (preserve history) | `gh pr merge --merge` | | Rebase | Small, clean commits | `gh pr merge --rebase` |
The active method for sync-phase PR auto-merge is governed by the `git_strategy.<mode>.merge_method` config value (`squash` | `merge` | `rebase`; default `squash`), not hardcoded. The sync agent resolves it from the active mode profile and renders the matching `gh pr merge --<merge_method>` command.
Git Safety Rules
| Action | Risk | Rule | |--------|------|------| | `git push --force` | Overwrites remote | NEVER on main/master, ask user first | | `git reset --hard` | Loses local changes | Confirm with user first | | `git checkout .` | Discards changes | Confirm with user first | | `git branch -D` | Deletes branch | Only after merge confirmed | | `--no-verify` | Skips hooks | NEVER unless user explicitly requests | | `git rebase -i` | Interactive (not supported) | NEVER use (requires interactive input) |
Context Memory in Commits
Embed decision context in commit messages for future session continuity:
feat(auth): implement JWT refresh token rotation
Decision: Chose rotation over sliding window for security
Pattern: Middleware chain: RateLimit -> Auth -> Authz -> Handler
Gotcha: Token blacklist require
Read more
name: moai-ref-git-workflow description: > Git workflow patterns, branch strategies, conventional commits, and PR templates reference for git operations. Agent-extending skill that amplifies manager-git expertise with production-grade git workflow patterns. NOT for: code implementation, testing, architecture design, documentation content. when_to_use: > Use for git workflow reference: branch strategies, conventional commits, PR templates, merge and rebase flows, and commit/branch/release conventions. Amplifies manager-git expertise with production-grade git workflow patterns. user-invocable: false metadata: version: "1.0.0" category: "workflow" status: "active" updated: "2026-03-30" tags: "git, branch, commit, pr, workflow, reference" # MoAI Extension: Progressive Disclosure progressive_disclosure: enabled: true level1_tokens: 100 level2_tokens: 3000
Git Workflow Reference
Target Agent
`manager-git` - Applies these patterns directly to git operations, branch management, and PR creation.
Branch Strategy Patterns
GitHub Flow (Default for Most Projects)
main ───────────────────────────────────────── └── feat/SPEC-XXX-description ──── PR ──→ merge
Rules:
- `main` is always deployable
- Feature branches from `main`
- PR required for all merges
- Delete branch after merge
GitFlow (Complex Release Cycles)
main ──────────────────────────────────────────
└── develop ─────────────────────────────────
├── feature/SPEC-XXX ──── PR ──→ develop
└── release/v1.2.0 ────── PR ──→ main + developAgentic-Trunk (Local Batch Landing)
`git_strategy.manual.workflow: af-flow` names the model MoAI-ADK's own factory runs on:
main ────────────────────────────────────────── └── WT-card-slug ── integration-worktree merge ──→ batch PR (release/main-batch-YYYYMMDD) ──→ tagged release
Rules:
- One standing trunk `main`; card worktrees branch from it
- Two delivery routes, decided by which tree holds `main`: when a dedicated
integration worktree holds it, cards land serially there (`--no-ff`, no per-card pull request); when only the primary checkout holds it, `moai factory complete` opens the card's pull request and the leader merges it
- With the dedicated integration worktree, the leader opens one batch pull
request per `lead_push_threshold` landings
- Lanes take no per-version release branch and run no lane push
Trunk-Based (CI/CD Heavy)
main ────────────────────────────────────────── └── short-lived branch (< 1 day) ──→ merge
Branch Naming Convention
| Pattern | Example | Use Case | |---------|---------|----------| | `feat/SPEC-{ID}-{slug}` | `feat/SPEC-AUTH-001-jwt-auth` | New feature | | `fix/SPEC-{ID}-{slug}` | `fix/SPEC-BUG-042-null-check` | Bug fix | | `refactor/{slug}` | `refactor/extract-auth-middleware` | Refactoring | | `docs/{slug}` | `docs/api-reference-update` | Documentation | | `chore/{slug}` | `chore/upgrade-dependencies` | Maintenance |
Conventional Commits Reference
| Type | When | Example | |------|------|---------| | `feat` | New feature | `feat(auth): add JWT refresh token flow` | | `fix` | Bug fix | `fix(api): handle null user in profile endpoint` | | `refactor` | Code restructure | `refactor(db): extract query builder` | | `test` | Test changes | `test(auth): add login edge case tests` | | `docs` | Documentation | `docs(api): update endpoint descriptions` | | `chore` | Maintenance | `chore(deps): upgrade Go to 1.23` | | `perf` | Performance | `perf(query): add index for user lookup` | | `style` | Formatting | `style: apply gofmt formatting` | | `ci` | CI/CD changes | `ci: add GitHub Actions workflow` | | `revert` | Revert commit | `revert: undo feat(auth) commit abc123` |
Commit Message Structure
<type>(<scope>): <description> # max 72 chars [optional body] # what and why, not how [optional footer] # Breaking changes, issue refs BREAKING CHANGE: <description> Refs: #123, SPEC-AUTH-001
Pull Request Template
## Summary
- [1-3 bullet points describing what this PR does]
## Changes
- [ ] File 1: description of change
- [ ] File 2: description of change
## Test Plan
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing completed
## SPEC Reference
- SPEC-{ID}: {title}
## Checklist
- [ ] Tests pass (project test command)
- [ ] Lint and format pass (project toolchain)
- [ ] No secrets committed
- [ ] Documentation updated if neededMerge Strategy Selection
| Strategy | When | Command | |----------|------|---------| | Squash merge | Feature branches (clean history) | `gh pr merge --squash` | | Merge commit | Release branches (preserve history) | `gh pr merge --merge` | | Rebase | Small, clean commits | `gh pr merge --rebase` |
The active method for sync-phase PR auto-merge is governed by the `git_strategy.<mode>.merge_method` config value (`squash` | `merge` | `rebase`; default `squash`), not hardcoded. The sync agent resolves it from the active mode profile and renders the matching `gh pr merge --<merge_method>` command.
Git Safety Rules
| Action | Risk | Rule | |--------|------|------| | `git push --force` | Overwrites remote | NEVER on main/master, ask user first | | `git reset --hard` | Loses local changes | Confirm with user first | | `git checkout .` | Discards changes | Confirm with user first | | `git branch -D` | Deletes branch | Only after merge confirmed | | `--no-verify` | Skips hooks | NEVER unless user explicitly requests | | `git rebase -i` | Interactive (not supported) | NEVER use (requires interactive input) |
Context Memory in Commits
Embed decision context in commit messages for future session continuity:
feat(auth): implement JWT refresh token rotation Decision: Chose rotation over sliding window for security Pattern: Middleware chain: RateLimit -> Auth -> Authz -> Handler Gotcha: Token blacklist require
Agentic development harness for Claude Code — SPEC-driven plan/run/sync, TRUST 5 quality gates, model+effort routing, and Claude×GLM multi-LLM cost control. Single Go binary, 16 languages, zero deps.
Other skills on moai-adk.
More skills from other plugins.
agentmail
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
adr-create
Create a new Architecture Decision Record with sequential numbering and AgentDB registration
Questions about moai-ref-git-workflow.
- Which coding agents can use moai-ref-git-workflow?
- moai-ref-git-workflow installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

