본문으로 건너뛰기
cccskills
무료GitHub에 공개

mk:worktree

Manages git worktrees for parallel agent isolation. Creates isolated worktrees for parallel agents on parallel/{name}-{timestamp} branches, merges results with conflict detection, prunes stale metadata, and reports health status. NOT for user-initiated feature branches — use git worktree directly for that.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(6)

  • SKILL.md7.1 KB
  • references/commands.md8.5 KB
  • scripts/lib/worktree-git-helpers.cjs15.1 KB
  • scripts/lib/worktree-review-pr.cjs18.2 KB
  • scripts/worktree.cjs29.3 KB
  • scripts/worktree.test.cjs22.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Git Worktree Manager

Manages git worktrees for parallel agent isolation. Each parallel agent works in its own worktree to prevent file conflicts. Backed by scripts/worktree.cjs.

See references/commands.md for full option reference and JSON field docs.

Actions

create

Pre-flight: get repo info, then create a parallel worktree.

# Step 1: verify repo state
node .claude/skills/worktree/scripts/worktree.cjs info --json

# Step 2: create parallel agent worktree
node .claude/skills/worktree/scripts/worktree.cjs create "{agent-name}" --orchestrated --json

Before creating the first parallel worktree in a repo, verify .worktrees/ is in .gitignore. If not, append it:

echo '.worktrees/' >> .gitignore

The script places the worktree at .worktrees/{agent-name} on branch parallel/{agent-name}-{timestamp} per parallel-execution-rules.md Rule 3.

merge

Merge a completed parallel branch back to the feature branch using no-fast-forward:

git merge --no-ff {branch} -m "merge: parallel/{agent-name} into {feature-branch}"

On conflict: list conflicting files, STOP, report to orchestrator. Do NOT auto-resolve — human or lead agent decides.

On success: run the full test suite (parallel-execution-rules.md Rule 5). After integration test passes, delegate to project-manager (background):

"Generate delivery status for plan at {plan-dir}. Write report to
{plan-dir}/status-reports/{YYMMDD}-status.md (create subdir if absent).
Load template from tasks/templates/pm-status-template.md.
Run in the background — do not block the caller."

Skip PM delegation if MEOWKIT_PM_AUTO=off is set in environment.

cleanup

Before removing a worktree, ensure the parallel agent has released its task ownership in mk:task-queue. Then:

node .claude/skills/worktree/scripts/worktree.cjs remove "{agent-name}" --json

Never cleanup a worktree with uncommitted changes — commit or stash first.

list

node .claude/skills/worktree/scripts/worktree.cjs list --json

status

Health audit of all active worktrees (ahead/behind divergence, dirty state):

node .claude/skills/worktree/scripts/worktree.cjs status --json

prune

Clean stale worktree metadata. Always dry-run first:

# Safe first-pass
node .claude/skills/worktree/scripts/worktree.cjs prune --dry-run --json
# Execute if no surprises
node .claude/skills/worktree/scripts/worktree.cjs prune --json

review-pr

Create an isolated, detached, SHA-bound worktree from a PR head for a high-assurance review (never mutates the user's checkout). The base remote is a required argument — pull/N/head exists only on the PR's base repo, so a fork PR is fetched from the base remote, never a fork remote. Writes a manifest to the persistent session dir tasks/reviews/<session>/manifest.json (survives worktree removal) and a .mewkit-review.json back-reference (ownership nonce) inside the worktree.

# Preview only (no fetch, no worktree) — validates inputs, prints the manifest
node .claude/skills/worktree/scripts/worktree.cjs review-pr --pr 123 --remote origin --session <id> --dry-run --json
# Create for real
node .claude/skills/worktree/scripts/worktree.cjs review-pr --pr 123 --remote origin --session <id> --json

review-pr-cleanup

Remove a review worktree. Accepts only a manifest path — nothing else. Removal proceeds only when the manifest's nonce matches the in-worktree back-reference AND the target is a detached .worktrees/review-pr-* worktree (never the main checkout, never a feature worktree). Force is allowed (review worktrees are legitimately dirty after build/test); ownership, not cleanliness, is the guard.

node .claude/skills/worktree/scripts/worktree.cjs review-pr-cleanup --manifest tasks/reviews/<id>/manifest.json --json
# Stale-session sweep — dry-run by default; --apply to execute
node .claude/skills/worktree/scripts/worktree.cjs review-pr-cleanup --sweep --dry-run --json

Gotchas

  • review-pr worktrees are DETACHED (no branch) and owned by their manifest nonce; review-pr-cleanup refuses any worktree whose in-worktree back-reference nonce does not match the manifest — this is what makes cross-session deletion impossible
  • Worktree creation fails if the branch name already exists — script handles this with BRANCH_CHECKED_OUT error; timestamps in orchestrated branches prevent collisions
  • git worktree remove fails silently if the directory was already deleted manually — script checks existence first via getWorktreeRecords()
  • Worktrees share the same .git — force-pushing from a worktree affects the main checkout (Safety Rule: NEVER force-push)
  • .worktrees/ directory must be gitignored — add to .gitignore before first parallel run
  • Merge conflicts on SKILL.md/CLAUDE.md are common in parallel runs — always stop and report to orchestrator, never auto-resolve
  • mk:task-queue ownership must be released before worktree cleanup, or the next agent cannot claim that task
  • Max 3 active worktrees at any time (parallel-execution-rules.md Rule 2) — status command shows current count
  • On macOS, paths with : in skill names need quoting in shell commands

Safety Rules

  • NEVER create worktrees on main or master — only on feature branches
  • ALWAYS cleanup worktrees after merge (don't leave stale worktrees)
  • NEVER force-delete a worktree with uncommitted changes — commit or stash first
  • NEVER force-push from a worktree — it affects the shared .git
  • ALWAYS check .worktrees/ is in .gitignore before creating the first worktree
  • ALWAYS release mk:task-queue task ownership before calling cleanup

Integration

  • Called by orchestrator (mk:cook, mk:workflow-orchestrator) when decomposing COMPLEX tasks
  • Coordinates with mk:task-queue for task claiming and ownership enforcement during parallel runs
  • Delegates to project-manager after merge integration test passes (post-phase-delegation Rule 1, background mode)
  • Respects MEOWKIT_PM_AUTO=off — skip PM delegation when set
  • Not invoked directly by users

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use this skill to generate well-branded interfaces and assets for MeowKit (AI Agent Toolkit for Claude Code), either for production or throwaway prototypes/mocks/etc. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

mk-advise

무료

Turn a raw idea into ONE honest recommendation: interview one question at a time until confirmed, then give a verdict with trade-offs and a checklist. Not for options or debate.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Browser automation CLI for agents: navigate, click/fill, screenshot, extract data, test apps, Electron/Slack, cloud browsers. NOT for the user's real Chrome profile/cookies (mk:chrome-profile).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Detects the right agent and complexity tier at Phase 0 orient; runs first in every workflow. NOT for runtime agent routing inside a single skill.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Design and review durable REST, GraphQL, RPC, or event API contracts: shape, compatibility, pagination, error semantics. Discovers existing consumers first. Not implementation, schema, or release.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

ngocsangyem의 스킬 모두 보기

이 스킬의 문제 신고