From shiiman-git
gtr のインストールと .gtrconfig を設定する。「worktree セットアップ」「gtr 設定」「gtrconfig 設定」「.gtrconfig 作成」「gtr インストール」「worktree 設定」などで起動。
npx claudepluginhub shiiman/claude-code-plugins --plugin shiiman-gitThis skill is limited to using the following tools:
gtr (git-worktree-runner) のインストール確認と .gtrconfig の生成・更新を行うスキル。
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
gtr (git-worktree-runner) のインストール確認と .gtrconfig の生成・更新を行うスキル。 実行するたびにプロジェクトの現状に合わせて .gtrconfig を更新する。
$ARGUMENTS に --help が含まれる場合、以下を表示して終了:
/shiiman-git:worktree-setup - Worktree Setup
概要:
gtr のインストール確認と .gtrconfig の生成・更新を行う。
実行するたびにプロジェクトの現状に合わせて .gtrconfig を更新する。
使用方法:
/shiiman-git:worktree-setup [オプション]
オプション:
--help このヘルプを表示
git gtr --version
未インストール時の対応:
インストール手順を案内して処理を終了する。
gtr がインストールされていません。以下の手順でインストールしてください:
## インストール方法
# Homebrew(推奨)
brew install coderabbitai/gtr/git-gtr
# または手動インストール
git clone https://github.com/coderabbitai/git-worktree-runner.git
cd git-worktree-runner
sudo ln -s "$(pwd)/bin/git-gtr" /usr/local/bin/git-gtr
# 確認
git gtr --version
パッケージファイルからプロジェクトタイプを自動検出する。
# Node.js
[ -f "package.json" ] && PROJECT_TYPE="nodejs"
# Python
[ -f "pyproject.toml" ] || [ -f "requirements.txt" ] && PROJECT_TYPE="python"
# Go
[ -f "go.mod" ] && PROJECT_TYPE="go"
# Rust
[ -f "Cargo.toml" ] && PROJECT_TYPE="rust"
# PHP
[ -f "composer.json" ] && PROJECT_TYPE="php"
# その他
PROJECT_TYPE="generic"
既存の .gtrconfig があれば読み込む:
cat .gtrconfig 2>/dev/null
プロジェクトタイプに応じたテンプレートをベースに生成する。 既存設定がある場合は差分を提示してユーザーに確認する。
[copy]
include = **/.env.example
include = **/.nvmrc
include = **/tsconfig.json
include = **/.prettierrc
include = **/.eslintrc*
exclude = **/.env
exclude = **/.env.local
excludeDirs = node_modules
excludeDirs = dist
excludeDirs = .next
excludeDirs = build
[hooks]
postCreate = npm install
[defaults]
editor = cursor
ai = claude
[copy]
include = **/.env.example
include = **/pyproject.toml
include = **/requirements*.txt
include = **/.python-version
exclude = **/.env
exclude = **/.env.local
excludeDirs = .venv
excludeDirs = venv
excludeDirs = __pycache__
excludeDirs = .mypy_cache
excludeDirs = .pytest_cache
excludeDirs = *.egg-info
[hooks]
postCreate = pip install -e ".[dev]"
[defaults]
editor = cursor
ai = claude
[copy]
include = **/.env.example
include = **/go.mod
include = **/go.sum
exclude = **/.env
exclude = **/.env.local
excludeDirs = vendor
excludeDirs = bin
[hooks]
postCreate = go mod download
[defaults]
editor = cursor
ai = claude
[copy]
include = **/.env.example
include = **/Cargo.toml
include = **/Cargo.lock
exclude = **/.env
exclude = **/.env.local
excludeDirs = target
excludeDirs = .cargo
[hooks]
postCreate = cargo fetch
[defaults]
editor = cursor
ai = claude
[copy]
include = **/.env.example
include = **/composer.json
include = **/composer.lock
exclude = **/.env
exclude = **/.env.local
excludeDirs = vendor
[hooks]
postCreate = composer install
[defaults]
editor = cursor
ai = claude
[copy]
include = **/.env.example
exclude = **/.env
exclude = **/.env.local
[hooks]
postCreate = echo "Worktree created successfully"
[defaults]
editor = cursor
ai = claude
初回の場合はそのまま生成する。 既存ファイルがある場合はバックアップを作成し、差分を表示してユーザー確認後に更新する。
# バックアップ(既存ファイルがある場合)
[ -f .gtrconfig ] && cp .gtrconfig .gtrconfig.backup
## .gtrconfig を更新しました
プロジェクトタイプ: {PROJECT_TYPE}
{変更内容の差分 or 生成された内容}
### 次のステップ
- worktree を作成: `/shiiman-git:worktree`
worktree 作成時にコピーするファイルのルールを定義する。
| 設定項目 | 説明 | 例 |
|---|---|---|
include | コピーする glob パターン | **/.env.example |
exclude | 除外する glob パターン | **/.env |
includeDirs | コピーするディレクトリ | node_modules |
excludeDirs | 除外するディレクトリ | node_modules/.cache |
worktree ライフサイクルで自動実行するコマンドを定義する。
| フック名 | 説明 | 例 |
|---|---|---|
postCreate | worktree 作成後 | npm install |
preRemove | worktree 削除前(失敗時中断) | npm run clean |
postRemove | worktree 削除後 | echo "removed" |
デフォルトのエディタと AI ツールを定義する。
| 設定項目 | 説明 | 例 |
|---|---|---|
editor | デフォルトエディタ | cursor, code, vim |
ai | デフォルト AI ツール | claude, other |
worktree - gtr で worktree を管理