/maigo:git-workflowfrom maigo
Assembles git commits with correct staging, scoping, and baseline selection. Prevents staging drift files, amending wrong commits, or running git commands in the wrong worktree.
Ships in maigo. 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.
Consumers: commit-assembly step of /maigo:go, /maigo:quick, /maigo:team, /maigo:address-comments; the orchestrator generally whenever it runs git commands or briefs an agent that will.
Committing a scoped change and running git commands correctly across
worktrees are mechanical steps that are easy to get subtly wrong: staging
too broadly, mutating shell state with cd, fixing a CI failure on the
wrong branch, or reasoning about diff size against the wrong baseline. None
of these mistakes fail loudly at the time — they surface later as unrelated
noise in a PR, a confusing force-push, or a wrong claim in a summary. This
skill collects the conventions that keep git operations scoped to exactly
what was intended.
Default to one commit per logical concern, and branch before the first
commit the user will actually test — don't land straight on main. See
references/commit-hygiene.md.
git add -AWhen committing a scoped change, stage the specific files by path. Do not
use git add -A / git add . — the working tree often carries regenerated
or drift files (lockfiles, generated dependency manifests, build caches)
that a blanket add will sweep into the commit as unrelated noise.
How to apply: run git status first and read it. Stage only the intended
paths: git add <file1> <file2>. Be especially careful after a rebase, a
package-manager sync/install step, or after a delegated subagent ran — those
can leave unexpected generated changes in the working tree.
Parallel sessions sharing one working tree: see references/commit-hygiene.md.
Treat drift as drift, not just "don't stage it" — revert it. A
package-manager install/codegen step (backend or frontend) can silently
rewrite a lockfile's security-relevant sections (e.g. deleting a version
overrides:/pin block) or scaffold a placeholder config file, in addition
to ordinary dependency-drift noise. After any such step, run
git diff HEAD --stat and scan for lockfiles, workspace-config files, and
other generated artifacts; git checkout HEAD -- <file> (or delete a
scaffold file) anything not intentional. Leaving it unstaged still risks a
later blanket add or a teammate sweeping it in — and a dropped security
pin is a real regression, not just noise.
cd; use absolute pathsNever cd into worktrees or other directories when running git/bash
commands or briefing another agent. Always:
git -C <worktree-path> for git commands targeting a different
worktree.pytest --rootdir, a package manager's --project/--cwd flag).cd <path> && <cmd> instruction — the agent should use absolute
paths or git -C directly.Why: cd mutates shell state, complicates tool composition, and most
harnesses already handle per-tool working directory cleanly via absolute
paths or -C-style flags.
Exception: if a human explicitly asks to cd somewhere, do it.
Otherwise default to no-cd.
This matters most in multi-worktree setups, where several worktrees off the
same repo exist at once and it's easy to accidentally run a command against
the wrong one after a cd.
--amend only ever operates on HEAD — briefing an amend target needs a HEAD
check baked in, not just a hash. See
references/commit-hygiene.md.
--amend 進該 commit,不另開 follow-up;只有真正獨立、或 commit 已在 PR 被 review 中才另開。references/commit-assembly-details.md(理由與 How to apply 全文,決定落點時讀)
Public-repo commit messages, PR bodies, and file contents may cite a
private-layer file by its path (e.g. ~/.claude/rules/model-dispatch.md)
but must not copy or excerpt its content — including quoting its
judgment/rule text verbatim. When the semantics need conveying, summarize in
one sentence instead of reproducing the source.
Editing a single JSON field (a version bump) should stay a 1-line diff — use
precise string replacement, not a full json.load/json.dump re-serialize.
See
references/commit-hygiene.md.
git diff upstream/main..HEAD、git show upstream/main:<file>,不要拿 branch tip 當基準。git merge-base <base> HEAD 或三點式 git diff <base>...HEAD,不用兩點式——本地 base 前進後兩點式會混進別人的 commit,產生看起來正常的假陽性。references/diff-baselines.md(理由、驗證步驟與案例,陳述 diff 規模或列舉新增行前讀)
A widget selection is not authorization to open a PR. Never run gh pr create
(including gh pr create --web, which only opens a pre-filled browser tab) unless
the user explicitly asks for it in the current turn. Picking a multi-choice option
like "Commit and open PR" from an AskUserQuestion-style widget is ambiguous for the
PR-creation half specifically — confirm once more (plain text is fine) immediately
before calling gh pr create. After committing and pushing a branch, default to
stopping there: report the branch/compare URL and ask if a PR should be opened.
Outward git/GitHub operations are the user's to run, not just PR creation.
git commit is authorized; pushing is not. Once verification is green, commit directly on the branch (never SKIP=, never git add -A) and report the hash and --stat — don't stop at "here's the command, paste it yourself".git push / --force-with-lease / gh pr create / gh issue create unless the user explicitly asks this turn.AskUserQuestion is not authorization to open an issue — show the draft, wait for "post this".--force-with-lease but neither run it nor frame it as the recommended next step. Case studies: references/outward-ops-authority.md.main; if they already landed there, rescue them as in references/outward-ops-authority.md "Commit on a feature branch".references/commit-hygiene.md "Rebase correctness".**硬規則:不要用 harness 內建的 EnterWorktree;一律用 git worktree add -b <topic> <root>/.worktrees/<topic> <remote>/main 建在 <root>/.worktrees/<topic>,branch 名不帶 worktree- 前綴。**內建工具預設建在 .claude/worktrees/ 並加前綴與鎖定,與本專案慣例不符。
worktree 慣例(layout 放 .worktrees/<topic>、不用 harness 內建 EnterWorktree、任務一開始就在自己的 worktree、ListAgents 先於動 git index、已完成的工作移進 worktree 的搬法、批次清理先列指令、squash-merge 的「已合併」檢查用 gh search prs、不要把意外 git 狀態先歸咎於 rogue agent、commit 後用 git log --oneline -1 驗 subject):
references/worktree-hygiene-index.md(慣例摘要)
;完整配方在 references/worktree-hygiene.md,開/清 worktree 或委派後 git 歷史看起來奇怪時讀。
--worktree flag)How /maigo:go / /maigo:take-issue's opt-in --worktree flag actually opens
a nested worktree, and where .maigo/ artifacts written during that task
belong (per-task artifacts vs. the Work Board, which only ever lives in the
main checkout). Details in
references/worktree-automation.md.
A shared worktree's branch, commits, or push/PR state can change from
something other than the current session — in both directions (external
revert/rebase/deletion and external forward progress) — so re-verify live
before restating a status claim, reusing a cached base ref, or running a
destructive reset. Recovery recipes, base-ref staleness, and CI/changelog
proxy traps in
references/shared-worktree-state.md.
The same file covers a mid-rebase Stop-hook red that is only an intermediate
commit, and where isolation: "worktree" places a worktree when the caller is
already in one.
When a pre-commit / prek run reports exit 0 but may have checked nothing —
unstaged changes stashed away, git add -N, git rebase --continue running no
hooks, a hook's files: regex that never matches, a corrupted prek toolchain
cache, reproducing from the wrong directory, or building a new hook — read
references/hook-runner-verification.md.
commit-message.github-title-description).
This skill only governs when it's okay to actually run gh pr create
(see "Pushing and opening a PR" above).references/commit-assembly-details.md (opens in a new tab)references/commit-hygiene.md (opens in a new tab)references/diff-baselines.md (opens in a new tab)references/hook-runner-verification.md (opens in a new tab)references/outward-ops-authority.md (opens in a new tab)references/shared-worktree-state.md (opens in a new tab)references/worktree-automation.md (opens in a new tab)references/worktree-hygiene-index.md (opens in a new tab)references/worktree-hygiene.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lee-w/maigo --plugin maigo26 skills in this plugin
/airflow-awareThis skill should be used when working in the apache/airflow repository as a contributor (not as a Dag author). It surfaces Airflow's own AGENTS.md conventions — naming, Breeze/uv, Ruff/Mypy, coding rules, pytest patterns, PR hygiene — for any review, quick-fix or refactor there./change-site-enumerationThis skill should be used when about to declare "N sites need changing", "the scope is closed", or "this is already fully shared" — before writing a plan that lists change sites, implementing one, reviewing a diff for lingering per-section branches, or reporting a scope/size number to the user./command-routerCodex pseudo-command router for Maigo. Use when the user sends or discusses any `/maigo:*` or `maigo:*` command (go, team, quick, review, board, remember, retro, doctor, etc.), or asks why Maigo commands do not behave like native Codex slash commands.Other plugins' skills for the same job