pr-and-cleanup

worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pr-and-cleanup" with this command: npx skills add shikajiro/claude-code-skill-example/shikajiro-claude-code-skill-example-pr-and-cleanup

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ディレクトリ内で実行すること

  • すべての変更がコミット済みであること

  • gh CLI がインストール・認証済みであること

  • リモートブランチに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 を参照してください。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated