Skip to content

git_workflow

Run named multi-step workflows with resumable lifecycle controls. This tool is designed for common orchestration patterns so agents can avoid long chains of ad-hoc Git commands.

Lifecycle actions

  • start — start a new workflow execution
  • status — read the current active workflow state
  • continue — continue a paused workflow (for example after resolving conflicts)
  • abort — abort the active workflow and run best-effort abort commands
  • list — list supported workflow families

Supported workflow families

  • snapshot — combined inspection snapshot (remotes, branches, merge-base, graph log, status)
  • replay — replay changes through cherry-pick series or git am patch series
  • branch_surgery — backup branch + checkout/reset + replay + optional publish
  • publish — fetch, optional rebase, and push with guarded options

Parameters

ParameterTypeRequiredDefaultDescription
repo_pathstring*Absolute path to Git repo unless server default is configured
action"start" | "status" | "continue" | "abort" | "list"no"start"Lifecycle action
workflow"snapshot" | "replay" | "branch_surgery" | "publish"for startWorkflow family
base_branchstringnomainSnapshot merge-base branch
log_countnumberno12Snapshot graph log size
mode"cherry-pick" | "am"no"cherry-pick"Replay mode
target_branchstringdependsTarget branch for replay/branch_surgery/publish
source_commitsstring[]dependsCommit list for replay/branch_surgery
patch_filesstring[]dependsPatch files for replay mode am
three_waybooleannotrueUse --3way for git am
backup_branchstringnoderivedBackup branch in branch_surgery
reset_tostringnoHard-reset target for replay/branch_surgery
confirm_hard_resetbooleannofalseMust be true when reset_to is provided
publishbooleannofalsePublish at end of replay/branch_surgery
remotestringnooriginRemote for publish/fetch/push
force_with_leasebooleannofalsePush with --force-with-lease
set_upstreambooleannofalsePush with --set-upstream
fetch_firstbooleannotrueFetch before publish workflow
rebase_ontostringnoRebase target before push in publish workflow
response_format"markdown" | "json"no"markdown"Output format

Example: combined snapshot

json
{
  "tool": "git_workflow",
  "params": {
    "repo_path": "/Users/me/project",
    "action": "start",
    "workflow": "snapshot",
    "base_branch": "origin/main",
    "log_count": 15
  }
}

Example: replay commits onto target branch

json
{
  "tool": "git_workflow",
  "params": {
    "repo_path": "/Users/me/project",
    "action": "start",
    "workflow": "replay",
    "mode": "cherry-pick",
    "target_branch": "feature/cascade-status-and-skills-npm",
    "source_commits": ["064b5bd"],
    "publish": true,
    "remote": "origin",
    "force_with_lease": true
  }
}

Example: patch series apply

json
{
  "tool": "git_workflow",
  "params": {
    "repo_path": "/Users/me/project",
    "action": "start",
    "workflow": "replay",
    "mode": "am",
    "target_branch": "feature/cascade-status-and-skills-npm",
    "patch_files": [
      "patches/0001-feature.patch",
      "patches/0002-config.patch"
    ],
    "three_way": true
  }
}

Notes

  • Workflows are intentionally bounded and typed; this tool does not accept arbitrary shell command queues.
  • Only one active workflow state is supported at a time per repository in this version.
  • Use action=status to inspect paused state and action=continue or action=abort to recover.

Released under the MIT License.