github
Skill1 starsChanged 5 days agoMITView on GitHub
Single source of truth for git + GitHub work - the conventions AND mechanics the other bundled skills (commit, review-code, fix-pr-comments) follow when they touch git or the GitHub CLI/API. Covers the git -C / workspace rule, branch naming, commit-message format, token-frugal gh usage (--jq/--json, never diff_hunk), PR create + body template, squash-merge + delete-branch, reading CI checks, reading review comments/threads, review-as-PENDING, multi-repo PR discovery, and the safety rules (never --force/--admin/--no-verify). Read this before any git/gh action, when another skill defers GitHub specifics here, or when the user asks how git/GitHub should be handled / types /kaizen:github (or /github on a clone install).
- Commits and pushes
166 other projects use a version of this.
Adopted by
Most recently taken up by
- GradScalerTeam/claude_clitheir own version, first seen Nov 8, 2026
- artivilla/agent-skillstheir own version, first seen Nov 8, 2026
- DmacMcgreg/psibottheir own version, first seen Nov 8, 2026
- ashleysbrain/skillstheir own version, first seen Nov 8, 2026
- sidmanale643/pekka-bottheir own version, first seen Nov 8, 2026
- wubinKKK/private-ai-workbenchtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use taskflow-inbox-triage, BlueBubbles and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AtomicBot-aiSkilltaskflow-inbox-triage
Also in 6 projects that use this
jiulingyunSkillBlueBubbles
为Clawdbot构建或更新BlueBubbles外部通道插件(扩展包,REST发送/探测,webhook入站)。
Also in 20 projects that use this
hkyutongSkillnode-connect
Diagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps. Use when QR/setup code/manual connect fails, local Wi-Fi works but VPS/tailnet does not, or errors mention pairing required, unauthorized, bootstrap token invalid or expired, gateway.bind, gateway.remote.url, Tailscale, or plugins.entries.device-pair.config.publicUrl.
Also in 18 projects that use this
molt-botSkilldiscord-e2e
Test Discord with Convex-leased QA bots: check credentials without a Gateway, exercise owned messages, or prove OpenClaw replies, files, threads, reactions, streaming, and typing. Distinguish API and Gateway evidence from manual user interactions.
Also in 10 projects that use this
molt-botSkillopenclaw-repair-sweep
Run scoped OpenClaw issue/PR repair campaigns: coordinate workers, prove root causes, and land or close verified work under the requested authority.
Also in 10 projects that use this
clawdbotSkillopenclaw-performance
Performance work in OpenClaw: a slow or heavy flow (latency, CPU, memory, SQL, RPC, renders), writing or reviewing a perf PR, or adding a cache. Count the work, delete waste first, cache last.
Also in 7 projects that use this
- +2 more from molt-bot
Other versions166 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 166
- moltbot/clawdbot★ 394ksame name
- steipete/warelay★ 394ksame name
- steipete/clawdis★ 394ksame name
- moltbot/moltbot★ 394ksame name
- clawdbot/clawdbot★ 394ksame name
- openclaw/openclaw★ 394ksame name
- molt-bot/clawdbot★ 391ksame name
- NousResearch/hermes-agent★ 262ksame name
- spinabot/brigade★ 11ksame name
- the-open-agent/openagent★ 5.7ksame name
156 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- commitSkill
- fix-pr-commentsSkill
- hoply-daySkill
- loop-auditSkill
- model-balanceSkill
- review-codeSkill
- self-learnSkill
- setupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 3 are distinctive, and 13 are very specific to this project.
0
Common
Most of the 151 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 29
Default baseBranch when unset: git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@', fallback main.
- Very specific: line 45
Never commit on a skipBranches branch (develop/main/master/release/*/hotfix/*) - branch first.
- Very specific: line 46
Cut from the branch the PR will target: Default is baseBranch (git -C {workspaceRoot}/{repo} fetch origin && git -C {workspaceRoot}/{repo} …
- Very specific: line 48
If the user says this change lands somewhere else - straight to main/prod, a release branch, or "where prod was last released from" - cut …
- Very specific: line 60
Never --no-verify. Never amend an already-pushed commit.
- Very specific: line 92
No ticket (or no browseBaseUrl): omit the link line and use a plain title/heading.
- Very specific: line 95
Never --force-push a PR branch.
- Very specific: line 96
--basemust equal the branch you cut from: When the user names a landing branch other than baseBranch for *this* PR, the PR's --base and … - Very specific: line 98
If the branch was already cut from baseBranch, do not fix it with gh pr edit --base {target} alone - retargeting moves only the comparison …
- Very specific: line 142
Always select fields (§4) - review payloads are diff_hunk-heavy.
- Very specific: line 161
Never --force, --force-push, --admin, --no-verify, or bypass branch protection.
- Distinctive: line 162
Never merge a PR that is not approved + green (an unrelated flaky check may be re-run once.
- Distinctive: line 165
Never auto-resolve merge conflicts: stop and surface them.
- Distinctive: line 166
Never amend or rewrite pushed history.
- Very specific: line 175
Commit? -> {ticket}: {message} <=72, lint first, explicit staging, no --no-verify.
- Very specific: line 179
Never --force/--admin/bypass.
“Common” is measured: kept by at least 6 in 10 of the 151 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub + git (single source of truth)
Shipped with JB Kaizen. Every skill that runs git or gh does it the same way, and the conventions live here: other skills link to this file instead of restating them. When a skill says "follow github", this is what it means.
Project-specific values come from .claude/dev.config.json, searched from the current directory upward to $HOME (first match wins). This skill states the conventions + mechanics; the config holds the values.
0. Config values (from dev.config.json)
| Value | Key | Example |
| Workspace root | workspaceRoot | ~/work/my-product |
| GitHub org | githubOrg | my-org |
| Repos | repos[] | api, web, infra |
| Base branch | baseBranch | develop |
| Branch prefix | branchPrefix | feature/ (bug fixes use bugfix/) |
| Ticket regex | ticketPattern | [A-Z]+-\d+ |
| Skip branches | commit.skipBranches | develop, master, main, release/, hotfix/ |
| Issue link base | browseBaseUrl | https://tracker.example.com/browse/ (omit when there is no tracker) |
Default baseBranch when unset: git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@', fallback main.
1. git -C / workspace rule (hard rule)
A workspace root can itself be a git repo - a superproject whose subdirs are submodules, each a full repo - and then a bare git at the root acts on the superproject, never on the repo you mean. Every git command uses git -C {workspaceRoot}/{repo}; never cd into a repo. Multi-repo commands and any command from the workspace root MUST pass -C/absolute paths.
Reading a file at a ref: always brace the variable - git show "${REF}:{path}", never git show "$REF:{path}". In zsh, after a colon an unbraced expansion gets history-style modifiers even inside double quotes, so "$B:libs/..." silently lowercases the ref and eats the l (:l), and "$B:terraform/..." truncates it to its last path segment (:t). Biting letters: a A c e h l P q Q r t u (silent) and s (hard bad substitution). The failure is usually invisible - with 2>/dev/null or a pipe the exit code is 0 and the empty output reads as "that file is not on this branch". Brace it up front.
2. Branch naming
{branchPrefix}{ticketId}when the work has a ticket;{branchPrefix}{slug}otherwise (slug = lowercase, hyphens, max 50 chars).- Bug fixes conventionally use
bugfix/{ticketId}even thoughbranchPrefixdefaults tofeature/. - Never commit on a
skipBranchesbranch (develop/main/master/release//hotfix/) - branch first. - Cut from the branch the PR will target. Default is
baseBranch(git -C {workspaceRoot}/{repo} fetch origin && git -C {workspaceRoot}/{repo} checkout -b {branch} origin/{baseBranch}). If the user says this change lands somewhere else - straight tomain/prod, a release branch, or "where prod was last released from" - cut from that branch and pass the same branch to--base(§5). A stated target overrides any projectCLAUDE.mddefault that pinsorigin/{baseBranch}.
3. Commit messages
- Format:
{ticket}: {message}- present tense, one sentence, max 72 chars on the subject. Ticket id parsed from the branch name; no ticket, no prefix. - Lint before committing. Never blind
git add -A- stage explicit paths after a sensitive-file check. - Trailers: append the Claude co-author + session trailers (
Co-Authored-By: Claude ...andClaude-Session: ...) exactly as the session harness specifies; no other trailers. - Never
--no-verify. Never amend an already-pushed commit. Never auto-push from a commit step (push is a separate, explicit step).
4. Token-frugal gh (hard rule)
Always pass --jq or --json field1,field2 to gh api / gh pr view / gh pr diff / gh pr list / gh run. Never take the default/raw response - it carries diff_hunk blobs and other bulk that explodes context. Select only the fields you act on. Save large diffs/logs to /tmp/*.txt and grep them rather than piping into context.
5. PR create + body template
gh pr create --repo {org}/{repo} --base {baseBranch} --head {branch} \
--title "{ticket}: {summary}" \
--body "$(cat <<'EOF'
## [{ticket}]({browseBaseUrl}{ticket}): {summary}
### Changes
{bullet list}
### Quality Gates
- Lint: PASS | Build: PASS | Tests: PASS
### Related PRs
{cross-references - MANDATORY for multi-repo changes}
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"- No ticket (or no
browseBaseUrl): omit the link line and use a plain title/heading. - "PR already exists" -> inform, skip creation for that repo.
- Re-derive the facts before rewriting an open PR's Changes section. A body written at design time describes the design that was then abandoned - counts, symbol names and schema constraints drift with the work, so do not keep the old wording and patch around it. Falsify the specifics first:
git -C {workspaceRoot}/{repo} grep -c '<symbol>'for anything it counts,Readthe migration for a constraint it asserts,git -C {workspaceRoot}/{repo} diff --stat origin/{baseBranch}...HEADfor paths it calls untouched; correct or drop whatever does not survive, and say what you checked. A body just written from the diff in hand, and mechanical section edits that add no claims (cross-links to related PRs), need no such pass. - Never
--force-push a PR branch. Push feature branches with-u origin {branch}. --basemust equal the branch you cut from. When the user names a landing branch other thanbaseBranchfor this PR, the PR's--baseand the branch's fork point must be the same commit. If the branch was already cut frombaseBranch, do not fix it withgh pr edit --base {target}alone - retargeting moves only the comparison base, so the diff drags in every commitbaseBranchis ahead of the target (one real case: 65 commits / 462 files). Rebuild instead:git -C {workspaceRoot}/{repo} fetch origin,checkout -b {branch}-{target} origin/{target}, cherry-pick your own commits, push, open a new PR with--base {target}, and close the mis-based PR with a one-line pointer to the new one (same shape as §11's fresh-branch rebuild - never--force-push or rewrite the pushed branch). Verify before asking for review:gh pr view <PR> --json baseRefName,commits --jq '"\(.baseRefName) \(.commits|length)"'should show the target and only your own commits.
6. Squash-merge + delete branch (mechanics)
First branch on mergeStateStatus - you already have it from the approved + green check (§11), so this costs nothing. CLEAN/UNSTABLE -> merge as below. BEHIND (the repo requires the head branch be up to date with the base) -> a plain gh pr merge is rejected with not mergeable: the head branch is not up to date with the base branch, and waiting never clears it. Run gh pr update-branch <PR> --repo {org}/{repo} first (dependabot PR: comment @dependabot rebase instead), then re-check approved + green - the update re-triggers CI - and merge. If update-branch reports a conflict, stop and surface it (§11). BLOCKED -> the refusal reads not mergeable: the base branch policy prohibits the merge: some branch-protection requirement is unmet. Never re-fire the merge, and never reach for a different endpoint to land it - a second door is still a bypass (§11). Name the cause before acting: reviewDecision not APPROVED, or any required check not yet SUCCESS -> wait. Already approved and green -> the usual remainder is an unresolved review thread under require conversation resolution, which gh pr view --json does not expose - read them with §8's reviewThreads query and resolve them. Still unexplained -> stop and hand it to the user: it is a protection the PR JSON cannot see (merge queue, required deployment, signed commits, linear history). --auto is available to land it when CI goes green, but do not use it when a post-merge step (a deploy watch, a ticket hand-off) must run right after the merge.
gh pr merge <PR> --repo {org}/{repo} --squash --delete-branch closes the PR and removes the remote branch. Run it unpiped - | tail/| head returns the filter's exit status, so a refused merge is recorded as a successful call (§4's pipe-to-/tmp rule is for reads, not for mutating commands). Unless you passed --auto, confirm it landed before any post-merge step: gh pr view <PR> --repo {org}/{repo} --json state --jq .state must read MERGED; anything else means GitHub refused it - read the refusal message and branch above, do not retry. Then sync the local base branch:
git -C {workspaceRoot}/{repo} fetch origin --prune
git -C {workspaceRoot}/{repo} checkout {baseBranch}
git -C {workspaceRoot}/{repo} pull --ff-only origin {baseBranch}
git -C {workspaceRoot}/{repo} branch -D {headRefName} 2>/dev/null || trueMerge only an approved + green PR (§11).
7. Reading CI checks
- Snapshot:
gh pr view <PR> --json statusCheckRolluporgh pr checks <PR> --json name,bucket,state- key offbucket(pass/fail/pending/skipping), not per-step state; use--required(fall back to all if none required). - Green describes the base the checks last ran against, not today's base. A
pull_requestrun tests head merged with the base as of that run; GitHub never re-runs it when the base later moves, andmergeStateStatussaysBEHINDonly where the repo requires up-to-date branches - so a long-open PR readsCLEAN+ all-green against a base that no longer exists. Whenever you hand a green verdict to a human (asking for review, "ready to merge", §6's merge gate), read the gap once and state the number with the verdict:gh api repos/{org}/{repo}/compare/{baseRefName}...{headRefName} --jq .behind_by- use the PR's ownbaseRefName(§5: it is not always{baseBranch}). Double-digit, or the base has since landed something this PR touches ->gh pr update-branch(§6), then re-read the checks that update re-triggers. Never fireupdate-branchfrom a watch loop - it pushes a commit and restarts CI; there, just report the count and leave the refresh to the merge step. (Real case: a green PR 180 commits behind base was rejected on review - its checks described a merge that no longer existed.) - Watch transitions by emitting only on a bucket change, so a
pass -> failflip is caught. - Locate a deploy/workflow run by merge SHA:
gh run list --repo {org}/{repo} --branch {baseBranch} --event push --json databaseId,workflowName,headSha,status,conclusion --jq '[.[]|select(.headSha=="'$SHA'")]'.
8. Reading review comments / threads
- Unresolved threads:
gh api graphqlonpullRequest.reviewThreads { isResolved, comments { ... } }. - Per-PR comment sweep:
gh api --paginate ".../{issues,pulls}/{pr}/comments?since=<ISO>"gated on each comment'screated_at- never track progress bymax(.id)of a single page (misses paginated/older comments). - Reply to a review comment:
gh api .../pulls/{pr}/comments/{id}/replies -f body=.... - Resolve a thread: the
resolveReviewThreadGraphQL mutation. - Always select fields (§4) - review payloads are
diff_hunk-heavy.
9. Review-as-PENDING (hard rule)
When posting a code review on someone else's PR, create it as PENDING via gh api .../pulls/{pr}/reviews - never auto-submit. Inline comments anchor to RIGHT-side line numbers (walk the diff to compute positions). The human submits: right after posting, ask for the verdict (approve / request changes / leave pending) and submit only the chosen one.
10. Multi-repo PR discovery
- Open PRs across repos: loop
gh pr list --repo {org}/$repo --state open --json number,title,headRefNameoverrepos[]. - Changed repos this session:
git -C {workspaceRoot}/$repo status --porcelain+ current branch vsbaseBranch.
11. Safety rules (hard)
- Never
--force,--force-push,--admin,--no-verify, or bypass branch protection. - Never merge a PR that is not approved + green (an unrelated flaky check may be re-run once; a real failure stops the flow).
- A user override of these rules is scoped to what was named when it was granted, and expires with it. "Merge them all with admin bypass" covers the PRs on the table at that moment - not a PR opened afterwards, not a different ticket, not the next day. When the user grants one, state back which PRs it covers; when you later reach for it, re-check that the PR was in that set. If it was not, ask again. A PR created after the override has by definition never been seen by the person who waived the review, which is the whole thing the review requirement protects.
- Lint before commit; never blind
git add -A; sensitive-file check before staging. - Never auto-resolve merge conflicts: stop and surface them.
- Never amend or rewrite pushed history.
- Someone else's commit is already pushed on your branch and you cannot reach its author (typically a parallel session on a shared checkout): do not
revertit either - their work may still be in flight. Cherry-pick your commits onto a fresh branch, open a new PR, close the old one with a one-line explanation. (A teammate's review-suggestion or co-author commit on your PR is normal - leave it alone; this is only for a commit that does not belong on the branch at all.)
Quick checklist for any git/gh action
- Git command? ->
git -C {workspaceRoot}/{repo}, nevercd. Reading a ref? ->"${REF}:{path}", braced. ghread? ->--jq/--json, never raw (diff_hunk).- Commit? ->
{ticket}: {message}<=72, lint first, explicit staging, no--no-verify. - PR? -> body template + Related PRs + Claude footer; no ticket -> no tracker link.
- Merge? -> squash + delete-branch, only approved + green;
BEHIND->update-branchfirst. - Review? -> PENDING, never auto-submit.
- Never
--force/--admin/bypass.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

