/git:setupfrom git
Configure how changes move in this project — write its `git-workflow` skill and `.claude/git.json`, or check them.
Ships in git. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Arguments passed: $ARGUMENTS
Two files, both committed, both following from one decision — does main take direct pushes, or
only pull requests?
.claude/skills/git-workflow/SKILL.md — the project's own skill with every git and PR command an
agent needs. The dev pipeline (/dev:fix … /dev:deliver, /dev:review,
/dev:fix-pr-comments) takes all of them from here and stops when it is missing..claude/git.json — read by this plugin's hooks. protectedBranches lists the branches an agent
may not push to: { "protectedBranches": ["main"] }; without the file every branch takes pushes.
The sync key configures the background sync hook (refresh from the PR base, optional push and
autosave); keys, defaults and examples:
${CLAUDE_PLUGIN_ROOT}/skills/setup/references/sync-config.md.The two must agree: a git-workflow that lands changes through PRs lists the main line in
protectedBranches; one that pushes to main directly has no entry for it (and no file, unless
another branch is protected).
Read both files if they exist (including the sync key), the project's CLAUDE.md and its other skills. The knowledge often
already exists under another name — a commit-and-push skill, a PR checklist. One owner per fact:
point at it rather than copy it.
git-workflow needs one section per operation, in this order:
k, what must stay in the bottom
node, how the chain lands.A section that misses one of the bold items has a gap of exactly that item. A section that says the project does not do something counts as covered — that is an answer, not a gap.
Everything covered and the two files agree → report it, one line per operation plus one for
.claude/git.json, and stop without writing anything. Re-running on a configured project ends here.
Evidence before questions: the remote and its host (git remote -v; gh or glab available?),
branch names and commit style from git log, PR templates, .gitmodules, how branches and commits
name tracker issues, which tracker tools this session has, any CLI the project wraps git with. Branch
protection on the host is the strongest evidence for the main-line decision
(gh api repos/{owner}/{repo}/branches/main/protection, read-only), and git log --first-parent main
shows whether main grows by merged PRs or by direct commits.
Run a command before you write it down, where it is safe to (read-only). A recorded command nobody has run is a guess, and a wrong guess fails silently.
One round, genuine gaps only, each with the answer you would recommend: direct pushes to main or
PRs only; which tracker, and how an issue is tied to a branch; whether PRs open as drafts; whether
changes ever land as stacks; who lands a change and how.
The main-line answer also decides the sync config:
main — base fixed to the main line, strategy: "rebase"; offer push: "base",
commitReminder and autosave.sync key needed (the base is the PR's base). Ask only whether to add
afterUpdate commands, proposing ones the repository evidences (a lockfile → its install command).git-workflow as the project's own skill: its facts and commands, in its conventions, sections in
the order above. One line says it fulfils the dev pipeline's git-workflow contract; the
description says the pipeline relies on it and when else to reach for it (any commit, push or PR)..claude/git.json to match: the main line in protectedBranches when it takes only PRs. Keep any
other key already in the file. Then the sync key to match step 3, if any; keep an existing one.push or autosave on, the git-workflow says in one line that hooks push, so the agent
does not push itself.What already existed, what you wrote, which commands you confirmed by running them, and what is unsupported. Leave the files uncommitted for the user to read — unless they asked you to land them.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kedrzu/skills --plugin git2 skills in this plugin