本文へ移動
cccskills
無料GitHub で公開日本語紹介

gh-stack

依存関係のある複数のブランチとPRを、GitHubの拡張機能で管理します。変更の積み重ねを計画し、下位ブランチの修正反映や同期、競合からの復旧を支援します。

原文原文の説明を見る

Manage Cherry Studio stacked branches and pull requests with the GitHub gh-stack extension. Use for planning, creating, inspecting, rebasing, syncing, linking, or recovering a stack of dependent PRs.

インストール方法を見る

こんなときに便利

  • 依存する変更を複数PRに分けたいとき
  • 下位の修正を上位へ反映したいとき
  • 既存PRの構成確認と関連付け
  • リベース競合からの復旧

日本語での紹介

できること

依存関係のある変更を複数のブランチとPRに分け、順序を保って管理します。gh stackで構成を確認し、下位ブランチの修正を上位へ反映するリベースや同期を進めます。既存PRの関連付けや、競合発生時の復旧手順も扱います。

こんなときに便利

仕様、基本実装、UIのように、前の変更に依存する作業を段階的にレビューしたいときに向いています。ローカル情報だけでは分からない既存PRの依存関係を調べたい場合や、同期後の各PRの対象範囲を確認したい場合にも役立ちます。

使い方の例

  • 「仕様、基本実装、UIの順で、依存関係を持つブランチ構成を計画して」
  • 「下位ブランチの修正を上位へ反映し、競合があれば復旧して」
  • 「既存PRを依存順に関連付けて、構成を確認して」

注意点

GitHub CLIの認証とgithub/gh-stack拡張機能が必要です。Cherry StudioのPR本文作成や承認は別のgh-create-prに従います。複数のリモートがある場合は対象を明示し、GitHub側でstacked PRsが使えない場合は処理を停止します。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

GitHub Stack

Use gh stack for branch topology and synchronization. Use the repository's gh-create-pr skill for Cherry-specific PR bodies, Spec approval, AC coverage, verification, and Agent Note lifecycle.

Availability and prerequisites

This public skill is tracked in .agents/skills/ and discovered from the repository. Developers do not install a separate agent skill. pnpm skills:sync maintains the .claude/skills/ compatibility symlink.

Run this preflight before the first gh stack command in a task:

command -v gh >/dev/null 2>&1 || {
  echo "GitHub CLI is required: https://cli.github.com/" >&2
  exit 1
}
gh auth status
if ! gh stack --help >/dev/null 2>&1; then
  gh extension install github/gh-stack
fi
gh stack --help >/dev/null

If GitHub CLI authentication, extension installation, or the final verification fails, stop and report the failing command. Do not guess stack topology with ad hoc branch comparisons.

Before initializing a stack, avoid extension prompts:

git config rerere.enabled true

When multiple remotes exist, resolve the intended remote and pass --remote <name> to commands that accept it. Do not silently change remote.pushDefault for the developer.

Stack model

A stack is a linear dependency chain. The bottom branch is closest to the trunk; each higher branch contains only work that depends on the layer below it.

main
  -> spec
    -> implementation-core
      -> implementation-ui

Plan the complete dependency order before creating branches. Put a newly discovered lower-layer change on its owning branch, then rebase the upstack branches; do not hide it in the current layer.

Agent-safe commands

All commands must be non-interactive:

  • Always run gh stack view --json; plain view opens a TUI.
  • Always supply branch names to init, add, and checkout.
  • Always use --auto with submit if that command is explicitly allowed.
  • Pass --remote <name> to push, submit, sync, or link when more than one remote exists.
  • Use ordinary git add and git commit -S --signoff so each layer is staged deliberately.

Common operations:

gh stack init --base main <bottom-branch> [<higher-branch>...]
gh stack add <new-top-branch>
gh stack view --json
gh stack push --remote <remote>
gh stack rebase --upstack --remote <remote>
gh stack sync --remote <remote>
gh stack checkout <branch-or-pr>
gh stack link --remote <remote> <bottom-pr> <higher-pr> [...]

Exit code 2 from gh stack view --json means only that the current checkout has no matching local stack metadata. It does not prove that an existing PR is standalone on GitHub. In a clean disposable worktree, run gh stack checkout <pr-number-or-url> to discover and hydrate remote topology, then rerun gh stack view --json. Classify an existing PR as standalone only after remote discovery confirms that it is not attached to a GitHub stack.

Exit code 3 means a conflict, but recovery depends on the command. gh stack rebase leaves active recovery state, so resolve the conflict and run gh stack rebase --continue, or gh stack rebase --abort. gh stack sync rolls the attempted rebase back before returning; start a new gh stack rebase to resolve that conflict, and do not use --continue or --abort unless a rebase is active. Exit code 9 means GitHub stacked PRs are unavailable for the repository; stop instead of silently publishing a different PR shape.

Cherry PR creation

Do not use gh stack submit --auto to create human-authored Cherry PRs. It creates PRs before the required body preview and auto-generates bodies that do not satisfy the repository template.

Create a compliant stack bottom-up:

  1. Push the branches with gh stack push --remote <remote>.
  2. Invoke gh-create-pr for each layer, using the parent branch as that layer's base.
  3. After every PR has its approved title and body, link the existing PRs with gh stack link --remote <remote> <bottom-pr> <higher-pr> [...].
  4. Verify the resulting topology with gh stack view --json.

gh stack submit --auto is allowed only for an explicitly authorized automation workflow that is exempt from the human PR template. It is not a shortcut around Cherry's preview requirement.

Changes to an existing stack

When changing a lower layer:

  1. Check out that branch explicitly.
  2. Make and verify the focused change there.
  3. Run gh stack rebase --upstack --remote <remote>.
  4. Push or sync the stack.
  5. For every rewritten live PR, rerun pnpm change:scope --base <verified-parent-ref> and only the checks invalidated by that rewritten scope.

After gh stack sync, inspect its output and run gh stack view --json; a successful command alone is not proof that each PR still has the intended base, scope, or verification.

Lifecycle boundary

Follow .agents/skills/agent-notes/SKILL.md for Spec approval and lifecycle transitions. Intermediate implementation layers keep the note proposed. Only the final layer whose cumulative, actually-run evidence covers every approved AC may move the bilingual note triplet to implemented/.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

agent-notes

無料日本語概要

Cherry Studioの設計や修正で残すべき判断を見極め、理由や代替案、受け入れ条件をAgent Notesに記録し、承認から実装済みへの移行まで管理するスキル。

  • 変更の判断記録が必要か見極めたいとき
  • 重要な不具合修正の理由を残したいとき
  • 実装前の仕様承認を準備したいとき
CherryHQ/cherry-studio5.3万2026年10月18日 更新

cherry-assistant-guide

無料日本語概要

Cherry Studioのインストール済みバージョンを調べ、機能や設定場所、ショートカットを案内します。接続失敗や設定異常などの診断にも対応します。

  • 機能や設定画面を探したいとき
  • 対応Providerや標準キー操作の確認
  • 接続失敗や実行エラーを調べたいとき
CherryHQ/cherry-studio5.3万2026年10月18日 更新

cherry-browser

無料日本語概要

Cherry Studioの会話内に表示されたブラウザーで、ページ移動やクリック、フォーム入力、画面撮影を行います。ログイン済みサイトの操作や不具合調査にも使えます。

  • ログイン済みサイトの移動と操作
  • フォーム入力と結果の確認
  • ページや特定箇所の画面撮影
CherryHQ/cherry-studio5.3万2026年10月18日 更新

cherry-computer

無料日本語概要

Cherry Studioからデスクトップアプリを開き、画面の状態を確認しながら入力やクリックを進めます。操作後は画面情報や画像で結果を確かめるスキルです。

  • アプリを開いて画面を確認したいとき
  • アプリで文字入力やクリックを頼みたいとき
  • ウィンドウの画像を取得したいとき
CherryHQ/cherry-studio5.3万2026年10月18日 更新

cherry-electron-dev

無料日本語概要

Cherry Studioの実際の画面を使い、機能実装や不具合修正、性能調査、PRの動作確認を進めるスキル。変更前後の証拠を集めて検証結果を報告します。

  • 画面の変更を実アプリで確認したいとき
  • 不具合を再現してログを調べたいとき
  • 修正前後の性能を比較したいとき
CherryHQ/cherry-studio5.3万2026年10月18日 更新

cherry-regression-test

無料日本語概要

Cherry Studioの主要機能をPlaywrightで回帰テストし、macOSとWindowsの結果を英語レポートにまとめ、リリース前の動作確認を支えるスキル。

  • リリース前に主要機能を確認したいとき
  • 開発ブランチの動作検証
  • 特定タスクの回帰テスト
CherryHQ/cherry-studio5.3万2026年10月18日 更新

CherryHQ のスキルをすべて見る

このスキルの問題を報告する