en un clic
git-worktree
git worktree 생성과 제거 라이프사이클을 하나의 절차로 통합해 실행하는 스킬입니다.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
git worktree 생성과 제거 라이프사이클을 하나의 절차로 통합해 실행하는 스킬입니다.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
Diagnose over-abstraction in a package, then consolidate files by domain and deduplicate functional logic.
Per-carrier request-block contracts and dispatch composition rules for carrier_dispatch requests. Load before the first dispatch of the session; skip reloading if already in context.
Host-owned Fleet Plan authoring and mutation workflow. Load before the first host plan_write call in a session and skip reloading when already in context. Use it for the required Plan template, optional Nimitz Plan assurance, Genesis Plan-driven handoff, host completion marking after artifact inspection, and Plan-state verification boundaries.
Drive a headless real-browser end-to-end test or diagnosis of the Fleet Console web UI with agent-browser. Use for Console SPA behavior such as blank screens, terminal rendering, Theater or Operation interactions, modal and keyboard boundaries, responsive layout, browser errors, HTTP requests, WebSockets, or final browser verification after a Console change. Do not use for Electron lifecycle, native menus or dialogs, Desktop security policy, packaging, or installed-app behavior; use desktop-e2e instead.
Use the coordinated Fleet protocol mode for multi-carrier or parallel ownership work.
Use the normal Fleet protocol mode for bounded operational work without downward-guard triggers.
| name | git-worktree |
| description | git worktree 생성과 제거 라이프사이클을 하나의 절차로 통합해 실행하는 스킬입니다. |
Use this skill to route a user request into exactly one git worktree lifecycle mode: create a new .fleet/worktrees/<worktree-name> checkout from origin/canary, or remove the currently active non-main worktree after safety checks. The user's free-form request may refine arguments, but it must stay inside one of these two workflows.
Replace each <placeholder> before running. The LLM must infer whether the request is create-mode or remove-mode from the user's extra text, then apply only that mode's inputs.
<mode> — create | remove. Required by interpretation. Route phrases like "make/create/new worktree" to create; route phrases like "remove/delete/cleanup current worktree" to remove.<worktree-name> — Required for create. Use as the directory name under .fleet/worktrees/ and as the default branch name. Sanitize by trimming whitespace, lowercasing only when the user did not provide a deliberate case-sensitive token, replacing spaces with -, and rejecting values containing /, .., leading ., shell metacharacters, or path separators. Allowed safe shape: [A-Za-z0-9._-]+.<new-branch> — Optional for create. Default <worktree-name>. Apply the same safety rejection as <worktree-name>; branch names must not be main or master.<base-branch> — Optional for create. Default canary. Reject main and master. Non-standard bases require Nimitz judgment before proceeding.<force> — Optional for remove. Default yes (autonomous cleanup). The remove flow self-applies git worktree remove --force and git branch -D as needed — including a squash-merged branch that -d rejects as unmerged — after reporting any dirty/unpushed/unmerged state. It never pauses for confirmation; the only hard stops are the main checkout and protected branches.<delete-remote> — Optional for remove. Default no. Delete the remote tracking branch (git push origin --delete <branch>) only when the user's request explicitly asks for remote cleanup.Create or remove a Fleet git worktree safely, without mutating unrelated files, without deleting the main checkout, and with the agent's subsequent command context fixed to the active worktree path when a new worktree is created. On removal, autonomously clean up the associated local branch — force-deleting it when needed (e.g. a squash-merged branch) — without pausing for confirmation, while never touching the main checkout or a protected branch (main/master/canary).
create or remove.Environment check — Run via the Bash tool:
pwduname -aecho "SHELL=$SHELL"git --versionAGENTS.md check — Read the repository root AGENTS.md before planning or work. If the workflow later references a subdirectory with its own AGENTS.md, read that file too and let child rules override parent rules within that scope.
Repository root resolution:
repo_root="$(git rev-parse --show-toplevel)"cd "$repo_root".fleet/worktrees/ is inside the repository root.Input validation:
<worktree-name> and <new-branch> using the sanitization rules from Inputs.<base-branch> when it is main or master.canary.Fetch the base:
git fetch origin canary<base-branch>, use git fetch origin <base-branch> instead.Create the worktree:
abs_worktree_path="$repo_root/.fleet/worktrees/<worktree-name>"git worktree add -b <new-branch> .fleet/worktrees/<worktree-name> origin/canary<base-branch>, replace origin/canary with origin/<base-branch>.Fix the active command context:
cd <abs-worktree-path>.<abs-worktree-path> as the required cwd for all subsequent commands in the task.Complete mandatory project setup inside the worktree:
<abs-worktree-path>, always run pnpm install --frozen-lockfile before reporting create-mode completion.Report in Korean:
pnpm install --frozen-lockfile completed successfully inside the worktree.Environment check — Run via the Bash tool:
pwduname -aecho "SHELL=$SHELL"git --versionAGENTS.md check — Read the repository root AGENTS.md before planning or work. If the active worktree contains additional applicable AGENTS.md files for referenced paths, read them too.
Determine the currently active worktree:
current_top="$(git rev-parse --show-toplevel)"git worktree list --porcelaincurrent_top is the main checkout repository root, immediately refuse. Never remove the main checkout.<path> as current_top, <worktree-name> as basename "$current_top", and <branch> as the output of git -C <path> branch --show-current.Inspect local risk before removal:
git -C <path> status --short --branchgit -C <path> branch --show-currentgit -C <path> rev-list --left-right --count @{upstream}...HEAD when an upstream exists.Proceed autonomously:
Leave the worktree directory:
cd <parent-repo-root>.<parent-repo-root> is the main checkout path from git worktree list --porcelain.Remove and prune:
--force as needed: git worktree remove --force <path> (untracked build artifacts such as node_modules otherwise block a plain removal).git worktree pruneDelete the branch:
<branch> is main, master, or canary, skip deletion and report the protection. This is a hard safety stop, not an escalation.<branch> is empty or HEAD (detached).git branch -d <branch> first, and when git reports it is not fully merged (the normal case after a squash merge), run git branch -D <branch>. Report that the branch was force-deleted, but do not pause for authorization.<delete-remote> is set, run git push origin --delete <branch>. Otherwise leave the remote branch in place (GitHub usually auto-deletes a merged PR head).Report in Korean:
--force was used for the worktree removal.git worktree prune result.main or master; reject those bases by default.node_modules; pnpm-managed links that remain inside the new worktree or target a package store outside the main checkout are allowed. Install dependencies inside the active worktree with pnpm install --frozen-lockfile.Bash tool.create or remove, then allow changes only within that mode's workflow.main, master, canary) under any circumstance.git push origin --delete) unless the user explicitly requests remote cleanup.git reset --hard or git checkout -- to clean a worktree.<base-branch> request. This is especially important when the requested base changes branch policy or release flow.origin/canary path and have no conflict or policy issue.create, when you delegate file edits to a carrier (carrier_dispatch), pass the absolute worktree path as the dispatch cwd argument so the carrier's CLI spawns inside this worktree and its repo-relative paths resolve here. If you omit cwd, the carrier's cwd defaults to the main checkout (not this worktree), so omitting it for worktree work risks editing the main checkout — always set cwd for worktree delegation. Before dispatch, confirm pnpm install --frozen-lockfile succeeded in this worktree, identify every target package, and run each package's declared typecheck and build scripts from this worktree. If either preflight script is absent or fails, stop and report instead of dispatching. After each return run git -C <main-checkout> status --short to confirm the main checkout stayed clean, and treat the carrier's reported workspaceChanges (window-approx) as unreliable — trust the real git status.