pr-and-cleanup
- Repo stars 64
- Author repo claude-code-skill-example
PR And Cleanup
worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。
概要
このスキルは以下を自動で実行します:
- 現在のworktreeディレクトリとブランチを検出
- 未コミットの変更がないか確認
- PRを作成(タイトル・本文はインタラクティブ入力可能)
- PR作成成功後、worktreeを削除
- mainブランチ(リポジトリルート)にチェックアウト
重要: ローカルブランチとリモートブランチは残ります(削除されません)
使用方法
基本的な使い方
# worktreeディレクトリ内で実行
cd .worktrees/<feature-name>
bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh
オプション
# PR作成のみ(worktreeを削除しない)
bash pr_and_cleanup.sh --pr-only
# worktreeクリーンアップのみ(PR作成済みの場合)
bash pr_and_cleanup.sh --cleanup-only
# タイトルと本文を事前指定
bash pr_and_cleanup.sh --title "feat: Add new feature" --body "詳細な説明..."
# ドラフトPRとして作成
bash pr_and_cleanup.sh --draft
# 未コミット変更を無視(非推奨)
bash pr_and_cleanup.sh --force
前提条件
- worktreeディレクトリ内で実行すること
- すべての変更がコミット済みであること
ghCLI がインストール・認証済みであること- リモートブランチにpush済みであること(またはgh pr createが自動push)
実行例
$ cd .worktrees/user-auth
$ bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh
[INFO] Current branch: feature/user-auth
[INFO] Worktree path: /path/to/.worktrees/user-auth
[STEP] Checking for uncommitted changes...
[INFO] No uncommitted changes detected
[STEP] Creating pull request...
[INFO] PR created: https://github.com/user/repo/pull/123
[STEP] Removing worktree...
[INFO] Worktree removed successfully
[STEP] Returning to main branch...
[INFO] Now on branch: main
エラーハンドリング
未コミットの変更がある場合
スクリプトは停止し、コミットを促します。
PR作成失敗時
worktreeは削除されず、現在のディレクトリに留まります。
worktree外で実行した場合
警告を表示し、処理を中止します。
関連スキル
create-worktree: worktree作成commit-commands:commit-push-pr: 従来のPR作成(worktree削除なし)commit-commands:clean_gone: マージ済みブランチの一括削除
詳細
詳細については REFERENCE.md を参照してください。
- Fluxly category
- Engineering
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Author / version / license
- @shikajiro · no license declared
- Fluxly token estimate
- Lean
- Fluxly setup estimate
- Plug-and-play
- External API key
- No requirement detected
- Detected OS requirements
- Unspecified
- Runtime requirements
- Unspecified
- Detected file/system behavior
-
- Read-only
- Write / modify
- Detected network behavior
- Local-only
- Install commands
- None (reference only)
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
The current SKILL.md does not define a fixed output example. 概要
このスキルは以下を自動で実行します: 現在のworktreeディレクトリとブランチを検出 未コミットの変更がないか確認
使用方法
使用方法
基本的な使い方
基本的な使い方
オプション
オプション
前提条件
worktreeディレクトリ内で実行すること すべての変更がコミット済みであること gh CLI がインストール・認証済みであること
実行例
実行例
# PR And Cleanup
worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。
## 概要
このスキルは以下を自動で実行します:
1. 現在のworktreeディレクトリとブランチを検出
2. 未コミットの変更がないか確認
3. PRを作成(タイトル・本文はインタラクティブ入力可能)
4. PR作成成功後、worktreeを削除
5. mainブランチ(リポジトリルート)にチェックアウト
**重要**: ローカルブランチとリモートブランチは残ります(削除されません)
## 使用方法
### 基本的な使い方
```bash
# worktreeディレクトリ内で実行
cd .worktrees/<feature-name>
bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh
```
### オプション
```bash
# PR作成のみ(worktreeを削除しない)
bash pr_and_cleanup.sh --pr-only
# worktreeクリーンアップのみ(PR作成済みの場合)
bash pr_and_cleanup.sh --cleanup-only
# タイトルと本文を事前指定
bash pr_and_cleanup.sh --title "feat: Add new feature" --body "詳細な説明..."
# ドラフトPRとして作成
bash pr_and_cleanup.sh --draft
# 未コミット変更を無視(非推奨)
bash pr_and_cleanup.sh --force
```
## 前提条件
- worktreeディレクトリ内で実行すること
- すべての変更がコミット済みであること
- `gh` CLI がインストール・認証済みであること
- リモートブランチにpush済みであること(またはgh pr createが自動push)
## 実行例
```bash
$ cd .worktrees/user-auth
$ bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh
[INFO] Current branch: feature/user-auth
[INFO] Worktree path: /path/to/.worktrees/user-auth
[STEP] Checking for uncommitted changes...
[INFO] No uncommitted changes detected
[STEP] Creating pull request...
[INFO] PR created: https://github.com/user/repo/pull/123
[STEP] Removing worktree...
[INFO] Worktree removed successfully
[STEP] Returning to main branch...
[INFO] Now on branch: main
```
## エラーハンドリング
### 未コミットの変更がある場合
スクリプトは停止し、コミットを促します。
### PR作成失敗時
worktreeは削除されず、現在のディレクトリに留まります。
### worktree外で実行した場合
警告を表示し、処理を中止します。
## 関連スキル
- `create-worktree`: worktree作成
- `commit-commands:commit-push-pr`: 従来のPR作成(worktree削除なし)
- `commit-commands:clean_gone`: マージ済みブランチの一括削除
## 詳細
詳細については [REFERENCE.md](REFERENCE.md) を参照してください。 Evidence boundary and execution chain
Author text anchors workflow facts; Fluxly only indexes current sections, terms, files, and commands.
sections -> 概要 → 使用方法 → 基本的な使い方 → オプション → 前提条件 → 実行例
terms -> 重要 · worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。 · 1. 現在のworktreeディレクトリとブランチを検出 2. · [INFO] Current branch: feature/user-auth [INFO] Worktree path: /path/to/.worktrees/user-auth [STEP] Checking for uncommitted changes... · 詳細については [REFERENCE.md](REFERENCE.md) を参照してください。
files/cmd -> create-worktree · commit-commands:commit-push-pr · commit-commands:cleangone · ../../.claude/skills/pr-and-cleanup/scripts/prandcleanup.sh · .worktrees/user-auth · feature/user-auth · path/to/.worktrees/user-auth · github.com/user/repo/pull/123
body sha256 -> 2227a9b39cb5
Decide Fit First
Design Intent
How To Use It
Boundaries And Review