원클릭으로
worktree-status
// Audit all git worktrees in the current project. Use when the user asks about worktree status, which branches are merged, which have uncommitted changes, or which worktrees can be safely cleaned up.
// Audit all git worktrees in the current project. Use when the user asks about worktree status, which branches are merged, which have uncommitted changes, or which worktrees can be safely cleaned up.
Execute the release workflow for Kimi Code CLI packages.
Generate changelog entries for code changes.
Sample plugin demonstrating the Skills + Tools model. Includes a Python tool (greeting) and a TypeScript tool (calculator).
针对 Kimi Code CLI 的新增或变更功能,规划并执行可重复的端到端冒烟测试。从 git diff 推断功能边界,读取相关文档和代码,设计测试 prompt,以 --print 非交互模式运行本地 CLI,检查进程退出码和 session 产物,总结预期与实际行为之间的差异。发现问题时自动启动多路并行探查以定位根因。
Spawn and manage multiple Codex CLI agents via tmux to work on tasks in parallel. Use whenever a task can be decomposed into independent subtasks (e.g. batch triage, parallel fixes, multi-file refactors). When codex and tmux are available, prefer this over the built-in Task tool for parallelism.
Sync Rust implementation with Python changes (exclude UI/login) by reviewing recent changes, mapping modules, porting logic, and updating tests.
| name | worktree-status |
| description | Audit all git worktrees in the current project. Use when the user asks about worktree status, which branches are merged, which have uncommitted changes, or which worktrees can be safely cleaned up. |
Report the status of every git worktree for the current project, covering dirty state and merge status.
You MUST pull latest main before any status checks. Without this, merge detection (both ancestry and content diff) will produce stale results and you may mistakenly conclude a branch is not merged.
cd "$(git rev-parse --show-toplevel)" && git pull origin main
PROJECT_DIR="$(git rev-parse --show-toplevel)"
for wt in $(git worktree list --porcelain | grep "^worktree " | sed 's/^worktree //' | grep -v "$PROJECT_DIR$"); do
branch=$(git -C "$wt" branch --show-current 2>/dev/null)
[ -z "$branch" ] && branch="(detached)"
name=$(basename "$wt")
# dirty?
if [ -z "$(git -C "$wt" status --short 2>/dev/null)" ]; then
dirty="clean"
else
dirty="DIRTY"
fi
# merged into origin/main?
# NOTE: This project uses squash merges exclusively. `git merge-base
# --is-ancestor` does NOT detect squash-merged branches. Always follow
# up with a content diff (step 3) for branches that appear "not merged".
if [ "$branch" != "(detached)" ]; then
if git merge-base --is-ancestor "$branch" origin/main 2>/dev/null; then
merged="merged"
else
merged="not merged (verify with content diff)"
fi
else
merged="n/a"
fi
echo ""
echo "[$name] branch=$branch $dirty $merged"
if [ "$dirty" = "DIRTY" ]; then
git -C "$wt" status --short 2>/dev/null | sed 's/^/ /'
fi
done
For any branch that shows "not merged", check whether the branch's changes are already in main. The correct method is:
⚠️ Do NOT use git diff origin/main <branch> — that compares the
two tips directly, so commits added to main after the branch diverged
will show up as false differences.
BRANCH="<branch>"
BASE=$(git merge-base origin/main "$BRANCH")
# List files the branch touched
FILES=$(git diff --name-only "$BASE" "$BRANCH")
# Compare each file between branch and current main
for f in $FILES; do
d=$(git diff "$BRANCH" origin/main -- "$f" | wc -l)
if [ "$d" != "0" ]; then
echo "❌ $f — differs"
else
echo "✅ $f — identical in main"
fi
done
# All ✅ = squash-merged
Only run this if tmux is available and relevant (e.g. worktrees were
created by codex-worker or similar tooling). Skip if not applicable.
tmux ls 2>/dev/null | grep -E 'codex-worker|<other-pattern>' || true
Always present results as a Markdown table. Every worktree must appear as a row. Never use abbreviated or prose-only summaries.
| Worktree | Branch | Dirty | Merged | Can clean? |
|---|---|---|---|---|
example-wt | feat-foo | ✅ clean | ✅ squash-merged | ✅ |
another-wt | fix-bar | ⚠️ 3 files | ❌ not merged | ❌ dirty + not merged |
detached-wt | (detached) | ⚠️ 14 files | n/a | ❌ has uncommitted changes |
Column definitions:
✅ clean or ⚠️ N files✅ merged / ✅ squash-merged (confirmed via content diff) / ❌ not merged / n/a✅ only when merged (or squash-merged) AND cleanAdd extra columns (e.g. tmux session, notes) only when relevant.
Only clean worktrees the user explicitly approves. For each:
NAME="<worktree-name>"
git worktree remove "/path/to/$NAME"
git branch -D "<branch>" # only if the branch is no longer needed