Skip to content
cccskills
FreePublished on GitHub

shiiman-workflow:issue-branch-pr-create

既存変更から Issue → ブランチ → コミット・プッシュ(コマンド提示)→ PR を作成する Backward フロー。「変更から Issue と PR」「既存変更を PR に」「diff から Issue」「変更を Issue 化」「Backward フロー」などで起動。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md6.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Issue Branch PR Create(Backward フロー)

既存の変更内容から Issue → ブランチ → コミット → プッシュ提示 → PR を作成する Backward フロー。

Help

$ARGUMENTS に --help が含まれる場合、以下を表示して終了:

/shiiman-workflow:issue-branch-pr-create - 既存変更から Issue・PR を作成する Backward フロー

概要:
  ワーキングツリーの変更やコミット済み未プッシュの変更から
  Issue → ブランチ/worktree → コミット → プッシュ提示 → PR を自動作成する。

使用方法:
  /shiiman-workflow:issue-branch-pr-create
  /shiiman-workflow:issue-branch-pr-create --help

オプション:
  --help  このヘルプを表示

例:
  /shiiman-workflow:issue-branch-pr-create         # 既存変更から Issue・PR を作成(既定はブランチ)
  /shiiman-workflow:issue-branch-pr-create --help  # ヘルプを表示

指定の伝え方(フラグの代わり):
  - 「worktree で」  → ブランチではなく worktree を作成(既存変更は stash 経由で移動)

フロー概要

既存変更 → 確認 → Issue 作成 → ブランチ/worktree 作成 → コミット → プッシュ提示 → PR 作成

状態分岐テーブル

ブランチ変更状態IssueBranchCommitPushPR
default未コミットあり実行実行実行提示実行
defaultコミット済み未push実行実行スキップ提示実行
feature未コミットあり実行スキップ実行提示実行
featureコミット済み未push実行スキップスキップ提示実行
any変更なしエラー終了----

実行フロー

ステップ 1: 変更確認

Bash で現在の変更状態を確認する。

git status
git diff
git diff --cached

未プッシュコミットの確認:

git log @{u}..HEAD --oneline 2>/dev/null || git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline 2>/dev/null

判定ロジック:

  1. ステージング済み変更・未ステージング変更・未プッシュコミットのいずれもない場合 → エラー終了:
## エラー: 変更がありません

コミット対象の変更が見つかりませんでした。
変更を加えてから再度実行してください。
  1. デフォルトブランチ(main/master)か feature ブランチかを判定:
DEFAULT_BRANCH="$(gh repo view --json defaultBranchRef -q '.defaultBranchRef.name')"
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
  • CURRENT_BRANCH が DEFAULT_BRANCH と一致 → デフォルトブランチ上
  • それ以外 → feature ブランチ上
  1. 未コミット変更があるか、コミット済み未プッシュのみかを判定

ステップ 2: Issue 作成

Skill ツールで Issue を作成する。変更内容のサマリーを引数に渡す。

Skill: shiiman-github:issue-create
Args: --no-confirm {変更内容のサマリー}

作成された Issue 番号を記録する。

ステップ 3: ブランチ / worktree 作成

デフォルトブランチ上の場合のみ実行。feature ブランチ上ならスキップ。

既定はブランチ。発話に「worktree で」等があれば worktree を作成する。

ブランチ(既定):

Skill: shiiman-github:branch-create
Args: {issue番号}

worktree(「worktree で」と指示された場合):

⚠️ worktree は別ディレクトリに作成されるため、既存の未コミット変更の移動が必要です。 以下の手順で変更を移動する:

  1. 元ディレクトリで変更を stash する
git stash push -m "worktree migration: {issue番号}"
  1. worktree を作成する
Skill: shiiman-github:worktree-create
Args: {issue番号}
  1. worktree ディレクトリで stash を適用する
git stash pop

stash pop が失敗した場合(コンフリクト等):

  • git stash pop がコンフリクトした場合、手動でコンフリクトを解消する
  • 元の変更は git stash list で確認可能(git stash pop 失敗時は stash は残る)
  • 復旧が困難な場合は git stash pop --abort 後、元ディレクトリに戻り git stash pop で変更を復元し、--worktree なしでやり直す

ステップ 4: コミット

未コミット変更がある場合のみ実行。コミット済みならスキップ。

Skill ツールでコミットを実行する。

Skill: shiiman-git:add-commit
Args: --no-confirm

ステップ 5: プッシュコマンド提示

重要: プッシュは自動実行しない。コマンドを表示するのみ。

## プッシュコマンド

以下のコマンドでリモートにプッシュしてください:

\`\`\`bash
git push -u origin {branch}
\`\`\`

ステップ 6: PR 作成

Skill ツールで PR を作成する。

Skill: shiiman-github:pr-create
Args: --no-confirm

ステップ 7: 完了報告

## Backward フロー完了

### 作成された Issue
- #{issue番号}: {タイトル}

### ブランチ
- {ブランチ名}

### 作成された PR
- PR #{pr番号}: {タイトル}
- URL: {pr_url}

PR がマージされると Issue #{issue番号} は自動的にクローズされます。

### worktree クリーンアップ(worktree 作成時のみ)

PR マージ後、不要になった worktree を削除してください:
`/shiiman-git:worktree` で gtr rm または gtr clean を実行

重要な注意事項

  • ✅ プッシュは自動実行せず、コマンドを提示するのみ
  • ✅ 変更がない場合はエラー終了する
  • ✅ デフォルトブランチ上の場合のみブランチを作成する
  • ✅ 未コミット変更がある場合のみコミットを実行する
  • ✅ Issue 作成・コミット・PR 作成は Skill ツール経由で実行する
  • ❌ 変更がないまま Issue や PR を作成しない
  • ❌ プッシュを自動実行しない

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

プラグインに新しいフックを作成する。「フック作成」「新しいフック」「フックを作って」「フック追加」「hook 作成」「フックを追加したい」「新規フック」などで起動。ツール実行前後やセッションイベントで実行されるフックを生成。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

マーケットプレイスのソースを dev(directory)/ prd(git)に切り替える。「マーケットプレイス切替」「marketplace toggle」「dev モード」「prd モード」「ローカル開発モード」「開発モード切替」「マーケットプレイス dev」などで起動。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

新しい Claude Code プラグインを作成する。「プラグイン作成」「新しいプラグイン」「プラグインを作って」「プラグイン追加」「plugin 作成」「プラグイン一括作成」「フル作成」などで起動。プラグインのみ作成と、スキル/サブエージェント/フックを含む一括作成の両方に対応。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

MCP サーバーの一覧表示・追加・削除を一つのスキルで管理する。「MCP 管理」「MCP 一覧」「MCP を追加」「MCP を削除」「MCP サーバー管理」「MCP 設定」「MCP 操作」などで起動。引数があれば優先し、なければ発話内容から list/install/remove を判定。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

プロジェクトの Claude Code リソース一覧を表示する。「Claude リソース一覧」「スキル一覧」「エージェント一覧」「フック一覧」「プロジェクトリソース確認」「何があるか確認」「リソースを見せて」などで起動。表示対象(スキル/エージェント/フック)は発話から判断する。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

Claude Code 設定の表示・更新・ローカル更新を統合管理する。「Claude 設定管理」「設定を表示」「settings を更新」「local settings を更新」「権限設定を変更」「設定ファイル管理」「claude settings」などで起動。引数があれば優先し、なければ発話内容から view/update/local-update を判定。

The English summary is being prepared. Showing the original description.

shiiman/claude-code-plugins6Updated Jun 17, 2026

See all skills by shiiman

Report a problem with this skill