本文へ移動
cccskills
無料GitHub で公開日本語紹介

setup-worktree

タスクごとにGitの作業ディレクトリとブランチを用意します。共有設定とローカル設定に従い、必要なファイルのコピーや初期設定、複数リポジトリの準備を進めます。

原文原文の説明を見る

Only use when the user explicitly invokes this skill by name.

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • タスク専用の作業場所を準備したいとき
  • 環境ファイルやローカル設定を引き継ぐ
  • 複数リポジトリのworktreeをまとめて準備
  • 既存の準備スクリプトの慣習を設定に移す

日本語での紹介

できること

タスクごとにGit worktree(同じリポジトリの別の作業ディレクトリ)とブランチを用意します。.humanlayer/workspace.jsonと.humanlayer/workspace.local.jsonに従い、作成先や元の参照を決め、指定ファイルのコピーと初期設定コマンドの実行まで進めます。複数リポジトリをまとめて準備する構成にも対応します。

こんなときに便利

タスク専用の作業場所を用意し、環境ファイルやローカル設定を引き継いで実装を始めたいときに向いています。設定がなければ、既存のscripts/create_worktree.shの慣習を引き継ぐか、既定の設定ファイルを作成します。

使い方の例

  • 「setup-worktreeを使って、このタスクの作業場所を準備してください」
  • 「setup-worktreeを使い、設定済みの複数リポジトリを準備してください」

注意点

利用者が名前を明示して呼び出すスキルです。Gitとタスク情報を前提とし、ローカル設定が共有設定に優先します。設定で無効化されている場合はブランチ作成にとどまり、すでにworktree内にいる場合も新規作成を止めます。どちらも続行には明示的な確認が必要です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md6.2 KB

SKILL.md(原文)

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

steps to follow

<step index=0>

Step 0: Check if worktree setup should be skipped

First, check if workspace setup is disabled via config files:

Read(.humanlayer/workspace.json)
Read(.humanlayer/workspace.local.json)
<condition if="disabled is true (workspace.local.json takes precedence over workspace.json)"> Worktree setup is disabled for this project.

Output this final answer instead of proceeding:

First, check out the task branch for the user:

Bash(git checkout -b [BRANCHNAME])

Then output this final answer:

<output_example> Workspace setup is disabled for this project (via .humanlayer/workspace.json or .humanlayer/workspace.local.json).

I've checked out branch [BRANCHNAME] for you. To start implementation, use the button below or create a new session with the following command:

/rpi:implement-outline

If you really do want to create a worktree anyway, let me know and I can still help with that.

To re-enable workspace setup, edit the file that sets disabled: true and change it to false, or add "disabled": false to .humanlayer/workspace.local.json to override the shared config. </output_example>

Do NOT proceed to Step 1 unless the user explicitly confirms they want to create a worktree anyway. </condition>

Next, check if you're already in a git worktree:

Bash(git rev-parse --git-dir)
<condition if="output contains '.git/worktrees/'"> You are already inside a worktree. Creating another worktree from here is probably not what the user wants.

Output this final answer instead of proceeding:

<output_example> You're already in a worktree at [current directory].

To start implementation, use the button below or create a new session with the following command:

/rpi:implement-outline

If you really do want to create a new worktree from here, let me know and I can still help with that. </output_example>

Do NOT proceed to Step 1 unless the user explicitly confirms they want to create a worktree anyway. </condition>

</step> <step index=1>

Step 1 Get required information

  1. Figure out what task you're working on - you should have the slug to .humanlayer/tasks/TASKSLUG already

1a. once you have a task dir, read ticket.md (or task.md) and outline.md if present:

Read(.humanlayer/tasks/TASKSLUG/ticket.md)   # or task.md
Read(.humanlayer/tasks/TASKSLUG/...outline...md)
</step> <step index=2 only_if="no .humanlayer/workspace.json or .humanlayer/workspace.local.json was found">

First, check for the legacy create_worktree.sh script to see if the user has existing preferences

Read(scripts/create_worktree.sh)
<subcondition if="script not exists"> If no script is found, create a new `.humanlayer/workspace.json` with the following default content:
{
  "disabled": false,
  "pathTemplate": "~/.humanlayer/workspaces/{{ TASKSLUG }}/{{ REPOBASENAME }}",
  "branchTemplate": "{{ TASKSLUG }}",
  "repos": [
    {
      "localPath": ".",
      "description": "Selected repository",
      "sourceRef": "HEAD",
      "setupCommand": "",
      "copyGlobs": [
          ".env*",
          ".claude/settings.local.json",
          "CLAUDE.local.md",
          ".humanlayer/workspace.local.json"
      ]
    }
  ]
}
</subcondition> <subcondition if="script exists"> If the create_worktree.sh script exists, create a new `.humanlayer/workspace.json` matching the conventions in the script, including copyGlobs, setupCommand, etc. </subcondition>

Note: For multi-repo setups, add additional entries to repos[] with relative paths like "localPath": "../other-repo". The localPath: "." entry is required and becomes the primary working directory.

If the user wants more control over the workspace configuration (custom paths, setup commands, multi-repo coordination), they can use the rpi:configure-workspaces skill to interactively set it up.

</step> <step index=3>

Create the worktree according to .humanlayer/workspace.json and .humanlayer/workspace.local.json, taking the workspace.local.json as overrides for the workspace.json config.

REPOBASENAME is the basename of the repository, e.g. ~/repos/humanlayer -> humanlayer

<loop for="each repo in repos"> <step index=3.1> Create the worktree for the repository
```
Bash(git worktree add -b {{ branchTemplate(TASKSLUG) }} {{ pathTemplate(TASKSLUG, REPOBASENAME) }} {{ sourceRef }})
```
</step> <step index=3.2> Copy the files matching the patterns specified in the `copyGlobs` key of `.humanlayer/workspace.json` (and overridden by `.humanlayer/workspace.local.json`, if present) from the repository root into the new worktree directory (computed by pathTemplate)
```bash
ls -la [REPO_ROOT]/[glob-pattern]
```

For each matched file, preserve directory structure when copying:

```bash
mkdir -p [WORKTREE_FULL_PATH]/[parent-dir]
cp [matched-file] [WORKTREE_FULL_PATH]/[same-relative-path]
```

For example, `.claude/settings.local.json` → `[WORKTREE_FULL_PATH]/.claude/settings.local.json`
</step> <step index=3.3> Then run the setup command specified in the `setupCommand` key of `.humanlayer/workspace.json` (and overridden by `.humanlayer/workspace.local.json`, if present) in the new worktree directory.
```
cd [WORKTREE_FULL_PATH] && [setup-command]
```
</step> </loop>

If there are any error messages or failures, report the error to the user and work with the user to complete the setup

don't proceed to step 4 until the worktrees are created and setup is complete

</step> <step index=4>

Only output this if the worktree(s) were successfully created.

If you encountered an error in Step 3, do NOT output this section.

<output_example> Worktree for {{ TASKSLUG }} has been configured. You can start implementation by running

use the rpi:implement-outline skill for task .humanlayer/tasks/{{ TASKSLUG }}

in the [WORKTREE_FULL_PATH] directory

You can modify worktree behavior by editing the .humanlayer/workspace.json (committed, shared config) and .humanlayer/workspace.local.json (local overrides, gitignored) files.

</output_example>

</step>

レビュー

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

コメント

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

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

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

0 / 1000 文字

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

同じリポジトリのスキル

agent-browser

無料概要あり

Webページの移動やフォーム入力、クリックをエージェントに任せ、情報抽出や画面保存、操作前後の比較まで行います。ブラウザ作業の自動化やWebアプリの確認に使えるスキル。

  • フォーム入力やクリックを自動化したいとき
  • Webページのテキスト抽出
  • ページのスクリーンショット・PDF保存
humanlayer/humanlayer1.2万2026年10月23日 更新

asd-ste100

無料概要あり

曖昧で読みにくい英文を、語の意味をそろえた短い能動態の文へ書き直すスキル。指示文やツール説明を見直し、修正理由と変更前後を表で確認できます。

  • 別のエージェントへの英文指示の明確化
  • 英語のツール説明やエラー文の簡素化
  • 英語を母語としない読者向けの文章整理
humanlayer/humanlayer1.2万2026年10月23日 更新

better-github-skill

無料概要あり

GitHubのPRの状態、レビューの会話、CI失敗のログを専用スクリプトで収集し、変更の確認状況や未解決の指摘、失敗したジョブとステップを調べるスキル。

  • PRの状態をまとめて確認したいとき
  • 未解決のレビューの会話の確認
  • CIの失敗ジョブとステップの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

bump-version

無料概要あり

リリース時に対象パッケージの基準バージョンを更新し、関連ファイルの同期と生成結果を検証して、コミットからPRブランチへのプッシュまで進めるスキル。

  • リリース用のバージョンを更新したいとき
  • 関連ファイルのバージョン表記の同期
  • プッシュ前の生成バージョン検証
humanlayer/humanlayer1.2万2026年10月23日 更新

calldiff

無料概要あり

Git のコミット間や作業中のコードで、関数の呼び出し構造の違いを確認します。呼び出しツリーの表示や、指定した関数へ至る経路の調査にも使えます。

  • 変更前後の関数呼び出しを比較したいとき
  • ブランチ間の呼び出し構造レビュー
  • 起点から目的の関数への経路調査
humanlayer/humanlayer1.2万2026年10月23日 更新

chrome-devtools-cli

無料概要あり

ターミナルからブラウザのクリックや入力、ページ移動を自動化し、通信やエラー、表示速度も調べられる、Chrome DevToolsのCLI操作を支援するスキル。

  • フォーム入力やページ移動の自動化
  • ページや要素の画面撮影
  • 通信内容やコンソールエラーの調査
humanlayer/humanlayer1.2万2026年10月23日 更新

humanlayer のスキルをすべて見る

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