一键导入
cross-review
実装・commit 後、`acceptance-check` 通過後・PR 作成前に、実装セッションから独立した reviewer session を実行中 agent runtime に対応する CLI で起動し、diff への second opinion を得る。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
実装・commit 後、`acceptance-check` 通過後・PR 作成前に、実装セッションから独立した reviewer session を実行中 agent runtime に対応する CLI で起動し、diff への second opinion を得る。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
特定の GitHub issue への実装着手と PR 作成を依頼されたときに使う。issue 番号・URL・会話内で選んだ issue のいずれかを起点に、実装・commit・lint・受け入れ条件チェック・cross-review・PR 作成・CI 確認まで一気通貫で自動進行する。コードを書いてプルリクを出す作業全般が対象で、issue 選定相談・タイトル編集・クローズ操作・PR レビュー単体には使わない。
既存の GitHub issue を `issue-create` skill のフォーマットに沿って整理する。タイトルのみで起票された issue や、フォーマット不完全な issue を後から rich plan に仕上げ直したい場合に使用する。
Invoke for any request to create, file, open, or record a new GitHub issue. Trigger on: - Direct creation: 「issue 作って」「起票して」「issue 立て(といて)」「issue 化して」「issue 作れる?」 - Record intent: 「issue に残したい/残しておいてほしい」「issue として残しておきたい」 - Issue types: bug reports (with repro steps), feature requests, refactoring tasks, doc fixes, code-review findings to track later Do NOT trigger for viewing, listing, searching, or implementing existing issues.
Claude Code 専用。素の `claude` で起動した直後に、タスク説明または issue URL / 番号から命名した git worktree へ `EnterWorktree` で切り替えて作業を開始する。issue 起点・タスク起点どちらでも並列セッション立ち上げに使う。issue URL / 番号入力で Status: Ready かつコメント上の未解決事項がない場合は worktree 切り替え後に `issue-implement` へ自動連鎖する。
Use when the user has NOT yet decided which issue to work on and needs help choosing. This is the pre-decision advisory phase: the user is weighing multiple open issues and wants structured guidance — not implementation. Key triggers: asking which issue to prioritize or tackle next, identifying which issues are blocked vs. ready to start independently, selecting issues that fit limited capacity (small/high-impact), or finding independent issues for parallel worktree sessions. The user's state is "I have several candidates and don't know where to start." Provides ranked recommendation (1 pick + 1-2 alternates) across impact/dependencies/size/urgency — read-only, no state changes.
GitHub issue 本文の `## 受け入れ条件` セクションを抽出し、各項目を自動検査して結果を ✓ / ✗ / ? で報告する read-only skill。`issue-implement` cycle 内で実装・commit 後・cross-review 前に呼び出して受け入れ条件確認を標準化する。
| name | cross-review |
| description | 実装・commit 後、`acceptance-check` 通過後・PR 作成前に、実装セッションから独立した reviewer session を実行中 agent runtime に対応する CLI で起動し、diff への second opinion を得る。 |
| version | 1.0.6 |
実装済みの変更を、実装セッションから独立した reviewer session に渡して second opinion を得る。目的は「別 backend / 別モデルであること」の機械的保証ではなく、実装時の会話文脈・自己正当化・途中判断から切り離したレビュー専用セッションを作ること。
Agent Skills は agent-portable な open standard であり、本 skill は特定の Claude Code 固有 primitive (Sub-Agent / Task tool) には依存しない。実行中 agent runtime に対応する外部 CLI を使い、Codex 利用時は Codex CLI、Claude Code 利用時は Claude CLI だけで完結させる。
acceptance-check を通過した時点で PR 作成前に呼び出す(cycle 内では実装/commit → acceptance-check → cross-review → PR の順)。レビュー指摘の修正は 追加 commit として残し、git commit --amend / rebase 等で履歴整形しない。brew install --cask codex)。codex exec + stdin diff pipe 方式で独立 reviewer session を起動する。codex exec review --base ... [PROMPT] は少なくとも codex-cli 0.142.5 時点で parser が拒否するため(openai/codex#22145)、本 skill は codex exec review のサブコマンド固有の挙動には依存しない。npm install -g @anthropic-ai/claude-code)。claude -p で独立 reviewer session を起動する。stdin の 10MB 上限に当たる場合は 4. 分割レビューに切り替える。gh CLI: default branch 解決に必要。未認証 / repo 外実行では本 skill が明示的に停止する(失敗時の対応参照)。実行中の agent runtime に対応する CLI で reviewer session を起動する。backend の自動検出や環境変数 override による切り替えは扱わない。runtime は実行中 agent が自分の環境情報として明示的に把握している値だけで判定し、command -v codex / command -v claude の存在順から推測しない。
| 実装中の runtime | 使用 CLI | 起動方法 |
|---|---|---|
| Codex CLI | Codex CLI | codex exec --sandbox read-only |
| Claude Code | Claude CLI | claude -p --allowedTools "Read" |
この対応は「同じ製品ファミリーの CLI で別セッションを起動する」ためのものであり、別モデルレビューを保証するものではない。別 backend / 別モデルレビューが必要な場合は、本 skill の責務として残さず別 issue で設計する。
実行中 agent runtime を明示的に判定する。Codex CLI で実装している場合は Codex CLI、Claude Code で実装している場合は Claude CLI を使う。判定できない場合、または Cursor / Gemini など本 skill に手順が定義されていない runtime の場合は、別 CLI へ自動的に切り替えず停止する。
runtime 判定後、対応 CLI の存在だけを確認する。以下はいずれか一方だけを実行し、両方を連続実行しない。
# Codex CLI で実装している場合
command -v codex >/dev/null 2>&1 || { printf '%s\n' 'Codex CLI runtime ですが `codex` コマンドが見つかりません。`brew install --cask codex` で導入してください。' >&2; exit 1; }
# Claude Code で実装している場合
command -v claude >/dev/null 2>&1 || { printf '%s\n' 'Claude Code runtime ですが `claude` コマンドが見つかりません。`npm install -g @anthropic-ai/claude-code` で導入してください。' >&2; exit 1; }
リポジトリの default branch 名を動的に取得し、ローカルで実際に解決可能な ref を BASE_REF に確定する。BASE_REF は git diff "$BASE_REF"...HEAD の base として使う。
BASE_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
[ -n "$BASE_BRANCH" ] || { echo "default branch を取得できませんでした。gh の認証状態 / repo 内での実行か確認してください。" >&2; exit 1; }
if git rev-parse --verify --quiet "$BASE_BRANCH" >/dev/null; then
BASE_REF="$BASE_BRANCH"
elif git rev-parse --verify --quiet "origin/$BASE_BRANCH" >/dev/null; then
BASE_REF="origin/$BASE_BRANCH"
else
echo "'$BASE_BRANCH' も 'origin/$BASE_BRANCH' も resolve できません。git fetch origin を実行してから再試行してください。" >&2
exit 1
fi
master / develop / trunk を default branch とするリポジトリでも、この BASE_REF 経由で同じ手順がそのまま動く。main への暗黙フォールバックは行わない(後述「失敗時の対応」参照)。
# コミット済みの変更(ブランチの差分)
git diff "$BASE_REF"...HEAD --stat
git diff "$BASE_REF"...HEAD
# 未コミットの変更がある場合(unstaged + staged)
git diff --stat
git diff
git diff --cached --stat
git diff --cached
差分のファイル数と行数を確認し、レビュー方法を決定する。
codex exec に diff を stdin から流し込み、レビュー指示を [PROMPT] 引数として渡す。stdin が piped されかつ [PROMPT] も指定された場合、codex は stdin を <stdin> ブロックとして prompt に append する仕様 (codex exec --help 参照)。codex exec review のサブコマンド固有の挙動には依存しない。
--sandbox read-only を明示することで、汎用 codex exec を使いながらも cross-review の「報告のみ・自動修正しない」原則を CLI レイヤーで担保する(--full-auto は workspace-write が付くため使わない)。
{
echo "=== Committed diff ($BASE_REF...HEAD) ==="
git diff "$BASE_REF"...HEAD
echo
echo "=== Unstaged diff ==="
git diff
echo
echo "=== Staged diff ==="
git diff --cached
} | codex exec --sandbox read-only "You are a senior code reviewer providing a second opinion. Do not modify any files; output the review only. The diff is supplied via stdin (codex wraps it as a <stdin> block). First, read the repository's AGENTS.md (if it exists) to understand project conventions and coding standards.
Then evaluate the diff from these perspectives:
1. **Correctness**: Are there logic errors, edge cases, or incorrect assumptions?
2. **Readability**: Are names clear and intent obvious? Is the code self-documenting?
3. **Consistency**: Do the changes follow existing patterns, naming conventions, and style in the codebase?
4. **Security**: Is there proper input validation? Are secrets or credentials exposed?
5. **Performance**: Are there unnecessary computations or inefficient patterns?
6. **Tests**: If the project has tests, is coverage adequate for the changes?
7. **Documentation**: Are related docs (README, CLAUDE.md, AGENTS.md, inline comments, etc.) updated to reflect the changes? Flag missing or outdated documentation.
8. **Related-file consistency**: When a file changes, are sibling/peer files that must stay in sync also updated? Examples: cross-references between skills, generated files, lock files, schema and its migration, config and its documentation. Flag any consistency gap where one side of a known pair was changed but the other was not.
Output format (respond in Japanese):
- List each finding with severity: critical / warning / info
- For each finding, include: file path, line number or range, description, and a concrete fix suggestion
- If no issues found, state that the code looks good
- End with a summary table: total findings by severity"
claude -p で Claude CLI に diff を stdin 経由で渡す。--bare は OAuth / keychain のログイン状態を読まず ANTHROPIC_API_KEY または --settings の apiKeyHelper 前提になるため、ローカルの Claude.ai ログイン運用でも動くように使わない。AGENTS.md を読ませるために --allowedTools "Read" を付与する。
{
echo "=== Committed diff ($BASE_REF...HEAD) ==="
git diff "$BASE_REF"...HEAD
echo
echo "=== Unstaged diff ==="
git diff
echo
echo "=== Staged diff ==="
git diff --cached
} | claude -p \
--allowedTools "Read" \
--append-system-prompt "You are a senior code reviewer providing a second opinion. The diff is supplied via stdin. First, read the repository's AGENTS.md (if it exists) to understand project conventions and coding standards." \
"Evaluate the diff from these perspectives:
1. **Correctness**: Are there logic errors, edge cases, or incorrect assumptions?
2. **Readability**: Are names clear and intent obvious? Is the code self-documenting?
3. **Consistency**: Do the changes follow existing patterns, naming conventions, and style in the codebase?
4. **Security**: Is there proper input validation? Are secrets or credentials exposed?
5. **Performance**: Are there unnecessary computations or inefficient patterns?
6. **Tests**: If the project has tests, is coverage adequate for the changes?
7. **Documentation**: Are related docs (README, CLAUDE.md, AGENTS.md, inline comments, etc.) updated to reflect the changes? Flag missing or outdated documentation.
8. **Related-file consistency**: When a file changes, are sibling/peer files that must stay in sync also updated? Examples: cross-references between skills, generated files, lock files, schema and its migration, config and its documentation. Flag any consistency gap where one side of a known pair was changed but the other was not.
Output format (respond in Japanese):
- List each finding with severity: critical / warning / info
- For each finding, include: file path, line number or range, description, and a concrete fix suggestion
- If no issues found, state that the code looks good
- End with a summary table: total findings by severity"
差分をファイル単位に分割し、ファイルごとに reviewer session を呼ぶ。最後に全ファイルのレビュー結果を集約してサマリーを作成する。
# 変更ファイル一覧を取得(コミット済み + unstaged + staged の和集合)
git diff "$BASE_REF"...HEAD --name-only
git diff --name-only
git diff --cached --name-only
FILE_PATH でファイルパスを変数化し、空白や shell メタ文字を含むファイル名でも壊れないようにする(3-a と同じく --sandbox read-only で書き込みを禁止)。<file-path> は placeholder で、実利用時は単一引用符付きで実パスに置き換える(例: FILE_PATH='skills/cross-review/SKILL.md')。
FILE_PATH='<file-path>'
{
echo "=== Diff for $FILE_PATH ==="
git diff "$BASE_REF"...HEAD -- "$FILE_PATH"
git diff -- "$FILE_PATH"
git diff --cached -- "$FILE_PATH"
} | codex exec --sandbox read-only "You are a senior code reviewer providing a second opinion. Do not modify any files; output the review only. The diff for a single file is supplied via stdin (codex wraps it as a <stdin> block). Review the changes to $FILE_PATH.
Evaluate from: Correctness, Readability, Consistency, Security, Performance, Tests, Documentation, Related-file consistency.
Output (respond in Japanese):
- Each finding with severity (critical / warning / info), file path, line number, description, fix suggestion
- If no issues, state the file looks good"
FILE_PATH='<file-path>'
{
echo "=== Diff for $FILE_PATH ==="
git diff "$BASE_REF"...HEAD -- "$FILE_PATH"
git diff -- "$FILE_PATH"
git diff --cached -- "$FILE_PATH"
} | claude -p \
--allowedTools "Read" \
--append-system-prompt "You are a senior code reviewer providing a second opinion. The diff for a single file is supplied via stdin." \
"Review the changes to $FILE_PATH.
Evaluate from: Correctness, Readability, Consistency, Security, Performance, Tests, Documentation, Related-file consistency.
Output (respond in Japanese):
- Each finding with severity (critical / warning / info), file path, line number, description, fix suggestion
- If no issues, state the file looks good"
reviewer session の結果を確認し、ユーザーへ報告する。
codex、Claude Code で実装しているなら claude が必要。該当 CLI が無ければ明示的に停止し、Codex CLI は brew install --cask codex、Claude CLI は npm install -g @anthropic-ai/claude-code を案内する。Codex CLI 初回利用時は codex login で OpenAI アカウント認証が必要。Claude CLI 初回利用時は claude を一度起動して認証する。gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' が空文字を返す、もしくは gh がエラーを返した場合は、その時点で停止しエラーメッセージを出す。main への暗黙フォールバックは行わない(誤った base に対する diff でレビュー結果が破綻するため)。よくある原因は、gh 未認証 (gh auth status で確認) / git repo 外での実行 / リモートが GitHub 以外。原因を解消してから再実行する。BASE_BRANCH 名は取れたが、ローカルに該当 ref も origin/$BASE_BRANCH も存在しない場合(例: 浅い clone / default branch を local 側で削除した worktree 等)も停止する。git fetch origin で remote-tracking ref を取得すれば多くの場合解消する。codex exec review --base ... [PROMPT] 系のエラーに遭遇した場合: Codex CLI 側の既知制約として、native review target (--base / --commit / --uncommitted) と custom prompt は同時に受け付けられない。本 skill の実行例は git diff "$BASE_REF"...HEAD を stdin で codex exec --sandbox read-only に渡す方式なので、codex exec review へ置き換えない。古いメモや shell history に残った codex exec review --base ... [PROMPT] の呼び出しは破棄する。codex exec + stdin diff pipe で正面突破する)。