pr-and-cleanup
- Repo stars 64
- Author updated Live
- Author repo claude-code-skill-example
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @shikajiro · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: pr-and-cleanup
description: Create a PR and automatically cleanup the worktree. Keeps local and remote branches intact. work…
category: engineering
runtime: no special runtime
---
# pr-and-cleanup output preview
## PART A: Task fit
- Use case: Create a PR and automatically cleanup the worktree. Keeps local and remote branches intact. worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。 このスキルは以下を自動で実行します: cd .worktrees/<feature-name> runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “概要 / 使用方法 / 基本的な使い方” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Create a PR and automatically cleanup the worktree. Keeps local and remote branches intact. worktreeでの開発完了後、PR作成と同時にworktreeを自動的にクリーンアップします。 このスキルは以下を自動で実行します: cd .worktrees/<feature-name> runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “概要 / 使用方法 / 基本的な使い方” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source mentions slash commands such as `/path`; use them first when your agent supports command triggers.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “概要 / 使用方法 / 基本的な使い方”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: pr-and-cleanup
description: Create a PR and automatically cleanup the worktree. Keeps local and remote branches intact. work…
category: engineering
source: shikajiro/claude-code-skill-example
---
# pr-and-cleanup
## When to use
- Create a PR and automatically cleanup the worktree. Keeps local and remote branches intact. worktreeでの開発完了後、PR作成と同時にwo…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “概要 / 使用方法 / 基本的な使い方” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "pr-and-cleanup" {
input -> user goal + target files + boundaries + acceptance criteria
context -> 概要 / 使用方法 / 基本的な使い方
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} 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 を参照してください。
Decide Fit First
Design Intent
How To Use It
Boundaries And Review