本文へ移動
cccskills
無料GitHub で公開

plan-worktree

Update a WIP implementation plan by inserting a Phase 0 that creates a git branch and worktree, switches to it, and moves any WIP work from the current working copy into the new worktree. Use when asked to add worktree setup to a plan, when invoked as /plan:worktree, or when a plan should execute in an isolated checkout.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfilesスター 13(GitHub 13 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(2)

  • SKILL.md5.2 KB
  • agents/openai.yaml43 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Plan Worktree

Announce at start: "Using plan-worktree skill to add a Phase 0 worktree setup to <plan>."

Takes a WIP plan (default: PLAN.md at the repo root, or the path the user names) and prepends a Phase 0: Worktree Setup that isolates plan execution in a git worktree, carrying over any uncommitted work already in progress.

Arguments

  • Plan path (default PLAN.md at repo root).
  • Optional branch name. Default: derive from the plan title slug (e.g. ben/<slug> per repo convention); confirm with the user if ambiguous.
  • Optional base branch. Default: the repo's default branch, unless the WIP work clearly builds on the current branch — then use the current branch and say so.

Workflow

1. Read the plan

Read the plan file. Note:

  • Whether a Phase 0 / worktree-setup task already exists — if so, report and stop (idempotent).
  • The existing task/phase numbering so the inserted phase renumbers nothing: title the new section Phase 0 and leave all existing phases/tasks untouched.
  • The plan's task format (checkbox steps, **Files:** blocks) so Phase 0 matches it.

2. Assess WIP state

git status --porcelain=v1
git branch --show-current
  • Dirty tree: Phase 0 must move the changes. Use git stash push -u -m "wip: <plan-slug>" in the current checkout, create the worktree, then pop that entry, found by its message, inside the new worktree. (Stash-then-pop is the only safe cross-worktree move; never copy files by hand.)
  • Clean tree: Phase 0 skips the stash steps — note that in the step text so an executor on a dirty tree still knows what to do (keep the stash steps, marked "skip if tree is clean").
  • Untracked plan file: if PLAN.md itself is untracked, the -u flag covers it; call this out in the step.

3. Insert Phase 0

Insert immediately after the plan header block (after the --- following Goal/Architecture/Tech Stack), before the first existing phase/task. Match the plan's existing step style. Required content:

## Phase 0: Worktree Setup

**Files:**
- Modify: none (workspace setup only)

- [ ] **Step 1: Stash any WIP in the current checkout** (skip if `git status --porcelain` is empty)

Run: `git stash push -u -m "wip: <plan-slug>"`
Expected: `Saved working directory and index state …` (includes untracked files, e.g. PLAN.md if untracked)

- [ ] **Step 2: Create branch and worktree via the git-worktree skill**

REQUIRED SUB-SKILL: `git-worktree`

```bash
git branch <branch> <base-branch>   # skip if <branch> already exists
wt switch <branch>                  # add --allow-home for dotfiles
```

`wt switch` has no base option: it checks out an existing local branch, so the `git branch` line is what applies `<base-branch>`. If `<branch>` already existed, it is used as is and the report says so instead of naming a base. Creates the worktree and prints its path (`wt path <branch>`). From here, every command runs with the worktree as cwd; every file path is absolute under it; every subagent prompt states the worktree path (subagents inherit the parent cwd).

- [ ] **Step 3: Restore the WIP into the worktree** (skip if Step 1 was skipped)

Find the entry: `git stash list` and note the `stash@{n}` whose message ends in `wip: <plan-slug>`. The stash list is shared by every worktree of the repo, so it may not be `stash@{0}`.
Run: `git stash pop stash@{n}` (inside the worktree)
Expected: the stashed changes reappear in `git status`, and the successful pop drops the entry. Only if the pop stops on a conflict: resolve it, then run `git stash drop stash@{n}`.

- [ ] **Step 4: Rebase the session onto the worktree**

Follow the git-worktree skill's Session Rebase Protocol: bind all tool calls to the worktree path (part A), and print the one-line harness command for the user (omp: `/move <wt_path>`; claude: `/add-dir <wt_path>`). Do not block on the user running it.

- [ ] **Step 5: Verify baseline**

Run the repo's fast check (e.g. `just check` or `wt verify <branch>`) to confirm the worktree starts green before Phase 1 changes anything.

Substitute real values for <plan-slug>, <branch>, <base-branch>. If the repo is dotfiles, include --allow-home in the wt invocation.

4. Report

  • Plan file updated, branch name, base branch (or "existing branch, base unchanged").
  • Whether stash steps are live (dirty tree) or conditional (clean tree).
  • Reminder: Phase 0 delegates mechanics to the git-worktree skill; path derivation never goes in the plan prose.

Never

  • Never renumber or edit existing phases/tasks — Phase 0 is inserted, nothing else moves.
  • Never hardcode ~/.worktrees/... paths in the plan beyond referencing the wt CLI's printed path; wt path <branch> is the single source of truth.
  • Never use git worktree add directly in plan steps — the git-worktree skill owns creation and session rebasing.
  • Never add a second Phase 0 if one already exists.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

2ndbrain

無料

Quick-save the last assistant response as a verbatim note in the 2ndBrain Obsidian vault (~/2ndBrain/quick-notes/<year>/). Use when the user asks to quick-save/save the last response to 2ndBrain, or invokes $2ndbrain or /skill:2ndbrain.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

Write commit messages under the agent-commits convention - a Conventional Commits fork with no chore catch-all, intent-only type tokens, facts in trailers, and legally-grounded AI provenance (Assisted-by, never Co-authored-by). Use when composing a commit in a repo whose commitlint.config.js extends agent-commits, when deciding between feat/fix/refactor/perf, or when recording AI participation.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

Coordinate multi-agent work through durable artifacts in git instead of chat. Use this whenever a task involves sending a message to another agent, agent mailboxes or handoffs, claiming work from a shared queue, notifying another agent or crew (OpenClaw, Grok Bot, Claude Code, Codex, Gas Town/Gas City workers) that work is ready, or whenever the user mentions the artifact bus, message bus, agent mail, beads mail, doorbells, or pings between agents — even if they don't say "bus" explicitly.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

aven

無料

Use aven to find tasks, update status, and leave durable handoff context.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

Plan, order and deliver a batch of backlog items (e.g. every High item) in a Conventional Docs repo, one decision, branch, worktree, draft PR, review and merge per item. Use when asked to work through the backlog, implement all items of a priority, or sequence several backlog items end to end.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

boris

無料

Claude Code workflow tips from Boris Cherny (creator of Claude Code) and the Claude Code team. Use when: setting up Claude Code, optimizing workflows, running parallel sessions, configuring CLAUDE.md, using skills/commands, subagents, hooks, MCP integrations, or learning best practices. Covers: git worktrees, plan mode, verification, permissions, Slack MCP, BigQuery, prompting tips, plugins, custom agents, sandboxing, keybindings, status lines, output styles, customization, /simplify for code quality, /batch for parallel code migrations, /loop for scheduled tasks, code review agents, /btw for mid-task questions, /effort max reasoning, remote control sessions, voice mode, setup scripts, session naming, /color, PostCompact hook, auto mode, /schedule cloud jobs, iMessage plugin, auto-memory, and auto-dream, mobile app, session teleporting, Cowork Dispatch, Chrome extension, Desktop app, /branch forking, --bare SDK startup, --add-dir multi-repo, --agent custom agents, /voice input.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles132026年10月29日 更新

phatblat のスキルをすべて見る

このスキルの問題を報告する