/productivity:git commit [context] | branch [name] [context] | pr [base] [--update|--new] [--ready] [context] | merge <local|host> [<branch>] --into <base> --squash|--merge-commitfrom productivity
Commits staged changes, creates branches, opens pull requests on GitHub or Bitbucket Cloud, and merges branches, with Conventional Commits text and Conventional Branch names. Use it for every commit, new branch, pull request, and merge. Do not run `git commit`, `git switch -c`, `gh pr create`, `gh pr merge`, or `twg` directly. Use it when the user asks ("commit this", "write a commit message", "put up a PR", "start a branch for this fix", "merge this into develop"). Use it when a task you are doing reaches one of these steps. The first argument is the mode: `commit`, `branch`, `pr`, or `merge`. It commits exactly what is staged. If nothing is staged, stage the changed files that the request means first. On `main`, `master`, or `develop`, commit mode and PR mode create a branch first. Merge mode prints a plan. It merges only when the user typed the full command. Not for other git work: staging on its own, switching or deleting branches, amending, rebasing, resolving conflicts, or reviewing a PR.
Ships in productivity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Commit the staged changes, create a branch, open a pull request (PR) for the current branch, or merge a branch. You write the text in this session, so use what the conversation says about why the work was done. For a large change, a read-only subagent reads the diff for you. These steps replace your built-in commit, branch, PR, and merge steps.
Paths are relative to this skill's directory. Load each file only when a step asks for it.
references/pr.md: the PR steps and the PR body rules. Read it at the start of PR mode.references/branch.md: the branch name rules and the branch steps. Read it at the start of
branch mode, and when a branch check prints trunk or a problem.references/merge.md: the merge steps. Read it at the start of merge mode.assets/explorer-brief.md: the prompt for the explorer. Read it when a step sends the explorer.scripts/check-message.sh: checks a draft message or title. The draft steps run it as
bash ${CLAUDE_SKILL_DIR}/scripts/check-message.sh [--title] <<'EOF', with the draft on stdin.scripts/check-branch.sh: checks a branch name. A branch check runs it as
bash ${CLAUDE_SKILL_DIR}/scripts/check-branch.sh <<'EOF', with the name on stdin. It prints
trunk, branch, or one line for each problem.scripts/resolve-base.sh: ranks the branches that the PR could merge into. PR step 3 runs it as
bash ${CLAUDE_SKILL_DIR}/scripts/resolve-base.sh <remote> [<default>].scripts/detect-host.sh: names the host of a remote, GitHub or Bitbucket Cloud. PR step 2 runs it
as bash ${CLAUDE_SKILL_DIR}/scripts/detect-host.sh <remote>.Run each script with this exact path and no quotes around it.
Each term has one meaning in this skill.
| Term | Meaning |
|---|---|
| context | The user's text after the mode word and the flags. It can be empty. |
| header line | The first line of a commit message, and the PR title: <type>(<scope>)!: <description>. |
| title | The header line of a PR. |
| type | The label that classes the change, in a header line or in a branch name. |
| description | The text after : in a header line. |
| branch description | The text after / in a branch name. |
| PR body | The text under the title. |
| footer | A last line of the form Token: value or Token #value. |
| trunk branch | main, master, or develop. |
| valid branch name | A name for which check-branch.sh prints branch. |
| base | The branch that a PR or a merge goes into. |
| range | The commits on this branch that the base does not have. |
| hash | A commit identifier. |
| identity | The repository of this run: the output of git rev-parse --absolute-git-dir at the start. |
| the write | The command that changes the repository or the host. |
| place | Where a merge runs. local: in this repository. host: through the PR on the host. |
| method | How a merge runs: squash or merge commit. |
| host | Where the remote lives: github or bitbucket. PR step 2 finds it. |
| explorer | The read-only subagent that reads a large change. |
| findings | What the explorer sends back. |
| check | A command whose failure its step handles. A failed check is not an error. |
| stop | Show the reason, end the run, and try no workaround. |
The user's text, which can be empty:
$ARGUMENTS
The first word selects the mode: commit, branch, pr, or merge. With no mode word, use
the mode that the request asks for. If that is not clear, use commit mode.
In commit mode, the rest of the text is the context, or all of it when there is no mode word. In the other modes, step 1 of the mode reads the rest.
A flag is one of --base, --into, --update, --new, --ready, --squash, --merge-commit.
If the mode is not pr or merge and a flag comes before any context, print this usage and
stop:
/productivity:git commit [context]
/productivity:git branch [name] [context]
/productivity:git pr [base] [--update|--new] [--ready] [context]
/productivity:git merge <local|host> [<branch>] --into <base> --squash|--merge-commit
When you start this skill yourself:
Obey these rules from the start of the run to the final report. They do not bind a new instruction that the user gives after the run. The merge rule is the exception. It also binds after the run.
All modes
commit, rebase, reset, merge,
cherry-pick, revert, stash, tag, branch -d, checkout -B. Use no --force.commit runs in commit step 4 and in merge step 5.
git switch -c <name> runs in branch mode, commit step 4, and PR step 2. git switch <base> and
git merge run in merge step 5.git switch takes only -c <name> or one branch name. Never use -C, --discard-changes,
--force, --detach, or --orphan./productivity:git merge with the place, --into, and the method flag. If
you called the Skill tool to start this run, the user did not type it. A "yes" in plain words is
not the command: print the command again.git, gh, or twg command fails, show its output exactly and stop. Do not repair it or try again.
A check is the exception: its step says what to do.cd and
no git -C. Check the identity where a step says so (see Repository identity).Commit mode
git add, git rm, git mv, git stash, or git commit -a. The
user decides what the commit holds.--amend, no git push, and no --no-verify.PR mode
--update.Merge mode
--admin, --auto, --delete-branch, --close-source-branch, or --force.When the user types the command, the frontmatter pre-approves the commands in these steps for that turn. It does not block other commands. Only these rules limit the run. Run each command as its own call, exactly as written. A combined or reworded command loses its pre-approval.
In a commit message, a title, and a PR body, start no word with =. The shell check reads a word
such as =x as a command and denies the write. Keep text in front of the sign with no space
between, as in key=x. Or write the sign as a word: "an equals sign, then x".
Every mode starts with this command:
git rev-parse --absolute-git-dir
If it fails, the working directory is not inside a git repository. Say so and stop. Otherwise, the output is the identity. It names the repository that this directory belongs to. In a repository inside another repository, that is the inner one. Where this skill's files are installed plays no part.
A step that says check the identity runs the same command again, immediately before a write. If the output is not the identity, the working directory has moved to another repository. Report both paths and stop. Do not move back and continue.
Start with the identity (see Repository identity).
git diff --cached --shortstat
The index is empty only when the output is empty. A mode-only change prints 1 file changed.
If the output is empty, run the check git rev-parse -q --verify MERGE_HEAD.
If it succeeds, a merge is waiting. A plain git commit records it with git's prepared message.
Report that and stop.
Otherwise, print this line word for word, and stop. Do not stage files to unblock the commit.
Nothing is staged. Stage what you want committed (`git add`, `git rm`, `git mv`) and re-run.
Add the insertions and the deletions from step 1.
1. git log --oneline -15
This is a check, because a new repository has no log. If it fails,
continue without it.
2. git diff --cached --no-color --no-ext-diff --find-renames
At about 500 changed lines or more, skip this command. Run
git diff --cached --stat, then git diff --cached -- <path> only on
the files with behavior changes.
For a binary file, the "Binary files ... differ" marker is enough.
3. git show :<path>, to see a whole staged file. The working tree can
differ from the index.
Use the log only for the scopes this repository uses and for the uniqueness test. Do not copy its wording. The writing rules outrank it.
Draft in this order: type, scope, description, body (only if the rules call for one), footers. Follow the writing rules and the commit message rules below. Describe the staged changes as they are. Do not propose a split into several commits. Do not show the draft or a rules review.
Check the draft with check-message.sh (see Files), with the whole message on stdin. If it prints a
problem, fix the draft and check again. To shorten a header line, name the change, not every
identifier.
First, do the branch check. Run the check git symbolic-ref --quiet --short HEAD. No output means
a detached checkout: go on to the commit. Otherwise, check the name with check-branch.sh (see
Files).
branch, go on to the commit.trunk or a problem, read references/branch.md. Follow "Commit mode on a trunk
branch" or "A name that is not valid". Then go on to the commit.Check the identity. Then run exactly this form, with the message between the markers:
git commit --cleanup=whitespace -F - <<'EOF'
<header line>
<body, if any>
<footers, if any>
EOF
-m. Do not escape characters in the message.[<branch> <short-hash>] <header line>. Take the hash and the header line
from that line, never from memory.--no-verify. Do not change the message to get past a hook. If this
run created a branch, add its branch: line.<short-hash> <header line>
Add a second line only when git's output shows something the user must act on. A hook that rewrote
files is one example. Then add the branch: lines that step 4 gave, if any.
Read references/branch.md, and follow it.
Read references/pr.md, and follow it.
Read references/merge.md, and follow it.
The explorer reads a large change, so the diff stays out of this session. It only reads. You draft
and write. To send it, read assets/explorer-brief.md and follow it. Wait for the findings before you
draft. If the findings show that a diff command failed or was denied, stop. If they show that the
explorer was not in this repository, run its commands yourself.
These rules cover the header line, the commit body, and the PR body. Rules apply unless a user instruction plainly overrides them. Defaults apply unless this change gives a reason to differ. Never break a Rule to keep a Default.
git log,
git blame, or a bisect.Rules:
Default (PR): if one main change has a long tail of mechanical follow-up, say what to review first.
These rules apply to the commit body and the PR body. They are based on the principles of ASD-STE100 (Simplified Technical English). Identifiers, quoted errors, and code keep their exact form.
Rules:
<type>(<optional scope>)<optional !>: <description>, with one space after the
colon.(misc) or (stuff).Defaults:
foo to bar across 14
call sites".| Instead of | Write |
|---|---|
update, change, improve, handle | the operation: batch, cache, escape, retry, extract |
fix bug, fix issue, fix build | the symptom that is fixed: fix crash on empty payload |
refactor <thing> as the whole line | the structural move: extract, inline, split, rename |
misc, cleanup, various changes | the one change that matters most |
proper, better, weird, convenience | the concrete property: idempotent, UTC, paginated |
This commit…, This PR…, Update some files | the change itself, with no preamble |
| a bare filename, or the title of a ticket | what changed in that file, or what this work did specifically |
address review comments, as discussed, rebased | what the code does now, never how the change came about |
Type. Use one type from this table, in lowercase. Use the most specific type. If two apply, use
the one with more impact: a change that improves performance and refactors is perf. For a PR,
choose the type for the branch as a whole.
| Type | Use it when the change… |
|---|---|
feat | adds a capability that users can see. SemVer MINOR. |
fix | corrects wrong behavior. SemVer PATCH. |
perf | improves speed, memory, or throughput, with no change in behavior. |
refactor | changes the structure, with no change in behavior and no fix. |
docs | changes only docs, comments, READMEs, or examples. |
test | adds or fixes tests, with no change to production code. |
build | changes build scripts, packaging, or dependency manifests (npm, pip, cargo). |
ci | changes CI pipelines, workflows, runners, or deploy automation. |
chore | is routine upkeep with no effect on source, tests, or build, for example .gitignore. |
style | changes only formatting or whitespace. Not for UI or visual changes: use feat or fix. |
revert | reverts earlier work. Give the reason in the body. Name the reverted commit in a Refs: footer. |
Rules:
4f2c1ab ("use libvirt reset for hard reboot"). This applies in a body, a PR body, and a
footer. In a footer, write Refs: 4f2c1ab ("use libvirt reset for hard reboot"). A line such
as Reverts 4f2c1ab has no : and is not a footer.! just before the colon (feat(api)!: drop v1 endpoints). Add a
BREAKING CHANGE: <description> footer that gives the break and the migration path.! in the title. Add the same BREAKING CHANGE: <description> footer to the PR body.Defaults:
WEAK fix(compute): fix missing import
Which import, and why? The line fits hundreds of commits.
STRONG fix(compute): import `exception` in compute utils
WEAK perf(api): improve query performance
"improve" is a judgment, not a change. No reader can check it.
STRONG perf(api): fetch accounts in one query instead of per row
Defaults:
Rules:
feat, fix, perf) before cosmetic content (style, docs, comments, renames,
formatting).Defaults:
Rules:
Token: value or Token #value. A token of several words uses - for each
space (Co-authored-by, Signed-off-by). BREAKING CHANGE is the one exception.Co-Authored-By. Append it last, exactly as given.Default: use footers for issue references (Closes #123, Refs #456, Fixes #789), co-authors
(Co-authored-by: Name <email>), and breaking-change notes.
A header line that needs no body: fix(reports): use UTC timestamps in generated reports
A full body: the problem first, the earlier commit as hash and header line, the exact error text, then the change in the imperative. It does not explain what libvirt is.
fix(compute): require libvirt 0.9.7 or newer
The `reset` API adopted in 4f2c1ab ("use libvirt reset for hard
reboot") does not exist before libvirt 0.9.7. A hard reboot on an
older host fails with `libvirtError: unsupported flags`.
Check the libvirt version when the compute service starts. Refuse to
start on an older libvirt, so the failure does not wait for the first
reboot.
Closes #1012689
A breaking change, with the before and the after marked:
feat(api)!: paginate the list endpoints
Unbounded list calls time out for large accounts.
Previously, the list endpoints returned a bare array. Now they return
`{items, nextCursor}`, and `items` holds the previous payload.
BREAKING CHANGE: list endpoints return `{items, nextCursor}` instead
of a bare array. Read `items` for the previous payload.
assets/explorer-brief.md (opens in a new tab)references/branch.md (opens in a new tab)references/merge.md (opens in a new tab)references/pr.md (opens in a new tab)scripts/check-branch.sh (opens in a new tab)scripts/check-message.sh (opens in a new tab)scripts/detect-host.sh (opens in a new tab)scripts/resolve-base.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub arveekay-co/agentry --plugin productivity2 skills in this plugin
Other plugins' skills for the same job