feat(skill): prepare-pr スキル新設 (PR-D、試験運用) - #59
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 46 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Skill as prepare-pr skill
participant JJ as jj (VCS)
participant PNPM as pnpm helpers
participant Harness as permissions/harness
participant Remote as Remote (PR host)
User->>Skill: 起動 (pnpm push 後)
Skill->>JJ: `jj status` / `jj log` で状態検証
JJ-->>Skill: ブックマーク/diff 情報
Skill->>Skill: PR タイトル草案を作成(最新コミットの1行目)
Skill->>Skill: `master..@` から PR 本文草案を作成
Skill->>User: AskUserQuestion(承認/編集/キャンセル、必須)
alt User approves
Skill->>PNPM: `pnpm prepare-pr-body` ← 本文を stdin で書込、一時ファイル生成
PNPM-->>Skill: 一時ファイルパス
Skill->>Harness: permissions.ask(ハーネスの確認を要請)
Harness-->>Skill: 承認
Skill->>PNPM: `pnpm create-pr --body-file=<path>`(フォアグラウンド実行)
PNPM->>Remote: PR 作成リクエスト
Remote-->>PNPM: PR 作成成功/失敗
alt 成功
Skill->>PNPM: 一時ファイルを削除
else 失敗
Skill-->>User: 失敗報告(ファイルは残す)
end
else User edits or cancels
Skill-->>User: 編集再提出またはキャンセル処理
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/prepare-pr/SKILL.md:
- Line 35: The markdown link target `scripts/prepare-pr-body.ps1` in SKILL.md is
using the wrong relative path and breaks the internal link; update that link
target to the repository-root relative path (e.g. /scripts/prepare-pr-body.ps1)
so the markdown link correctly points to the scripts/prepare-pr-body.ps1 file
from the document location.
- Around line 113-117: Replace the Bash heredoc examples with PowerShell
here-strings: change the block that starts with "cat <<'EOF' | pnpm
prepare-pr-body" to use PowerShell @' ... '@ piped to pnpm prepare-pr-body,
update the "pnpm create-pr --title '<approved title>' --body-file .tmp-pr-body"
example block to be labeled and formatted as PowerShell, and convert the cleanup
example that references "pnpm prepare-pr-body:cleanup" to PowerShell formatting
as well; ensure you replace the three bash code fences (the cat <<'EOF'
invocation, the pnpm create-pr invocation, and the pnpm prepare-pr-body:cleanup
fence) with PowerShell here-string equivalents and matching fenced blocks so
they run when CLAUDE_CODE_USE_POWERSHELL_TOOL is enabled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d0bf5ca5-dee2-4c02-8897-fe24f9c278e9
📒 Files selected for processing (2)
.claude/skills/prepare-pr/SKILL.mddocs/todo.md
| ```bash | ||
| cat <<'EOF' | pnpm prepare-pr-body | ||
| <approved PR body content> | ||
| EOF | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify 1) PowerShell tool is enabled 2) skill doc still contains Bash heredoc example
rg -n "CLAUDE_CODE_USE_POWERSHELL_TOOL|permissions" .claude/settings.json -C2
rg -n "cat <<'EOF' \\| pnpm prepare-pr-body" .claude/skills/prepare-pr/SKILL.md -C2Repository: aloekun/claude-code-hook-test
Length of output: 303
🏁 Script executed:
# Check full context around the problematic section and look for other shell examples
sed -n '100,130p' .claude/skills/prepare-pr/SKILL.md
# Look for other bash/shell code blocks in the file
rg -n "^\`\`\`(bash|sh)" .claude/skills/prepare-pr/SKILL.mdRepository: aloekun/claude-code-hook-test
Length of output: 903
🏁 Script executed:
# Get the content of all bash code blocks in the file
sed -n '113,140p' .claude/skills/prepare-pr/SKILL.mdRepository: aloekun/claude-code-hook-test
Length of output: 619
PowerShell 環境での Bash heredoc は実行不可です。すべてのシェル例を PowerShell 互換に更新してください。
.claude/settings.json で CLAUDE_CODE_USE_POWERSHELL_TOOL: "1" が有効なため、ドキュメント内の Bash コード例(lines 113–135)はそのままでは実行できません。以下の 3 つのコード ブロックをすべて PowerShell ここ文字列構文に変換する必要があります:
- Line 113–116:
cat <<'EOF' | pnpm prepare-pr-body→ PowerShell@' '@ | pnpm prepare-pr-body - Line 123–125:
pnpm create-pr --title ... - Line 133–135:
pnpm prepare-pr-body:cleanup
PowerShell への変換例
-```bash
-cat <<'EOF' | pnpm prepare-pr-body
+```powershell
+@'
<approved PR body content>
-EOF
-```
+'@ | pnpm prepare-pr-body
+```-```bash
-pnpm create-pr --title '<approved title>' --body-file .tmp-pr-body.md
-```
+```powershell
+pnpm create-pr --title '<approved title>' --body-file .tmp-pr-body.md
+```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/skills/prepare-pr/SKILL.md around lines 113 - 117, Replace the Bash
heredoc examples with PowerShell here-strings: change the block that starts with
"cat <<'EOF' | pnpm prepare-pr-body" to use PowerShell @' ... '@ piped to pnpm
prepare-pr-body, update the "pnpm create-pr --title '<approved title>'
--body-file .tmp-pr-body" example block to be labeled and formatted as
PowerShell, and convert the cleanup example that references "pnpm
prepare-pr-body:cleanup" to PowerShell formatting as well; ensure you replace
the three bash code fences (the cat <<'EOF' invocation, the pnpm create-pr
invocation, and the pnpm prepare-pr-body:cleanup fence) with PowerShell
here-string equivalents and matching fenced blocks so they run when
CLAUDE_CODE_USE_POWERSHELL_TOOL is enabled.
9f1c157 to
2c344b6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.claude/skills/prepare-pr/SKILL.md (1)
113-117:⚠️ Potential issue | 🟠 MajorPowerShell 前提環境とコード例のシェルが不一致です。
この skill は
pnpm prepare-pr-body/pnpm create-prを実行手順として提示していますが、該当コード例が Bash 前提のため、PowerShell 運用でそのまま実行できません。cat <<'EOF'は PowerShell 互換の here-string に置き換えてください。過去レビューと同種の未解消事項です。
Based on learnings: Thecli-pr-monitortool inaloekun/claude-code-hook-testis Windows-only. Hardcoded.exesuffixes are intentional. Cross-platform support is not required.#!/bin/bash # Verify shell examples and tool-mode assumptions in the current branch rg -n "CLAUDE_CODE_USE_POWERSHELL_TOOL|permissions\\.ask" .claude/settings.json -C2 rg -n "^```bash$|cat <<'EOF'|pnpm create-pr --title|pnpm prepare-pr-body:cleanup" .claude/skills/prepare-pr/SKILL.md -C2🔧 提案パッチ
-```bash -cat <<'EOF' | pnpm prepare-pr-body +```powershell +@' <approved PR body content> -EOF -``` +'@ | pnpm prepare-pr-body +``` -```bash +```powershell pnpm create-pr --title '<approved title>' --body-file .tmp-pr-body.md-
bash +powershell
pnpm prepare-pr-body:cleanupAlso applies to: 123-125, 133-135
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/prepare-pr/SKILL.md around lines 113 - 117, Replace the Bash here-doc examples with PowerShell-compatible here-strings: change the "cat <<'EOF' | pnpm prepare-pr-body" example to use a PowerShell here-string format like @' ... '@ | pnpm prepare-pr-body and update the surrounding code fences from ```bash to ```powershell; do the same conversion for the other examples that reference "pnpm create-pr --title" and "pnpm prepare-pr-body:cleanup" so all three snippets use PowerShell fences and @'... '@ piping to the pnpm commands instead of the Bash-style cat <<'EOF'.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/prepare-pr/SKILL.md:
- Around line 47-51: The fenced code blocks containing the jj commands (the
block with "jj status" / "jj log -r 'master..@' ..." and the similar block at
lines 62-64) need a language tag to satisfy markdownlint MD040; update those
fenced code blocks by adding a language identifier like "bash" (e.g., replace
``` with ```bash) so the blocks are properly annotated for linting and
readability.
---
Duplicate comments:
In @.claude/skills/prepare-pr/SKILL.md:
- Around line 113-117: Replace the Bash here-doc examples with
PowerShell-compatible here-strings: change the "cat <<'EOF' | pnpm
prepare-pr-body" example to use a PowerShell here-string format like @' ... '@ |
pnpm prepare-pr-body and update the surrounding code fences from ```bash to
```powershell; do the same conversion for the other examples that reference
"pnpm create-pr --title" and "pnpm prepare-pr-body:cleanup" so all three
snippets use PowerShell fences and @'... '@ piping to the pnpm commands instead
of the Bash-style cat <<'EOF'.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c5a69332-65fd-44e6-ad61-39d5f5192b22
📒 Files selected for processing (2)
.claude/skills/prepare-pr/SKILL.mddocs/todo.md
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/todo.md
ADR-028 (外部可視成果物の生成コマンドの実行ゲート) の運用フローを skill として明文化。 `pnpm push` 完了後の PR 作成で以下の 7 ステップを標準化する: 1. jj status + jj log -r master..@ で差分/bookmark 確認 2. commit description から PR title 初稿生成 (70 文字超は短縮、conventional prefix 維持) 3. diff + commit log から PR body 初稿生成 (Summary/Context/Validation/References) 4. Claude が提示 → AskUserQuestion で明示承認 (auto mode でも必須) 5. `pnpm prepare-pr-body` 経由で `.tmp-pr-body.md` に書き出し 6. `pnpm create-pr --title ... --body-file ...` foreground 実行 (permissions.ask で再確認) 7. `pnpm prepare-pr-body:cleanup` で一時ファイル削除 ## 設計ハイライト - **ADR-028 二層防衛の活用**: skill 内の AskUserQuestion (一次) + permissions.ask (二次) - **user-supplied text の尊重** (ADR-022): 承認済 draft の二重書き換えを禁止 - **body は必ず一時ファイル経由**: `--body "..."` 引数経由の切り詰めリスク回避 (PR #51 / memory `feedback_pnpm_create_pr_body.md`) - **automated actor から独立**: takt / cli-* の自律ループはこの skill を呼ばない ## ステータス 試験運用 (2026-04-19〜)。発火頻度・UX を半年観察して正式採用 / 改良 / 廃止を判断する。 ## ファイル - `.claude/skills/prepare-pr/SKILL.md` 新設 (178 行) ## docs/todo.md - PR-D 完了に伴い「セッション 247510ea 由来: 整備タスク群」ブロック全体を削除 - 雑務 task をリナンバー (#8 → #7) refs: ADR-028, ADR-022, PR #57 (PR-B body helper), memory `feedback_bookmark_auto_naming.md`
2c344b6 to
d53c63f
Compare
…ndle CR-RL 採用 3 件 (#183) * docs(todo): PR #182 post-merge-feedback Bundle CR-RL 採用 3 件 + 順位 165 補足追記 採用: PR #182 post-merge-feedback (2026-05-29 ユーザー承認): - 順位 167 (T1-#1): check-ci-coderabbit の RATE_LIMIT_MARKER を新フォーマット対応に更新 - 順位 168 (T2-#1): CR rate-limit detection integration test の新旧 fixture - 順位 169 (T3-#1): ADR-018 / ADR-034 に CR rate-limit format evolution 同期戦略 codify 3 件は Bundle CR-RL タグで同 PR land 推奨 (機械強制 + test 層 + 永続 ADR 層の 3 層補強)。 順位 165 補足追記: - PR #182 T2-#2 採用候補 (pnpm-create-pr-body-guard hook test) は本 165 と scope 重複のため独立 entry 化せず本 entry に集約 - supplementary fact: PR #134 で pnpm-create-pr-body-guard hook 採用判定されたが未実装の state (= stale unfulfilled adoption、feedback-reports/134.md Tier 1 #1) - 165 着手時に hook 実装済なら test 範囲を 2 層 (--body-file workaround verify + guard hook 動作 verify) に拡張 * docs(adr): 8 ADR の ephemeral todo 参照を permanent reference に置換 (A01 fix、Cross-File Reference Lifecycle 違反修正) PR #182 Phase B dogfood で検出された finding WR-2026-05-29-A01 (Severity High、Category adr-alignment) の修正。 8 永続 ADR が docs/todo*.md の section / 順位 N / Phase A-F 等の ephemeral artifact を直接参照しており、 docs-governance.md § Retirement Workflow で todo entry が削除された際に silent dead pointer 化する systemic documentation drift の構造修正。 修正方針 (analyzer 推奨 3 strategy): 1. ADR cross-references — 別 ADR に decision がある場合 2. PR # references — git log で origin が trackable な場合 3. Inlined constraints — detail が小さい場合 各 ADR の修正: - ADR-022 line 197: parenthetical pointer 削除 (operational guideline は self-contained で完結) - ADR-023 lines 54, 86: "docs/todo.md or PR description" → "PR description" (permanent artifact のみに集約) - ADR-028 line 186: "docs/todo.md #7" → "PR #59 で land、PR #62 で global skill 移管" - ADR-029 lines 191, 240, 266: task pointer 削除 + ADR-030 supersede note (本 ADR は ADR-030 partial supersede 対象、実装系譜は ADR-030 に集約) - ADR-030 line 417: Phase B-F section pointer → 各 Phase の land 済 PR # (PR #75/77/80/154) を直接列挙、 Phase E/F は priority table 参照 (specific 順位 番号は避ける) - ADR-031 line 270: Phase A-F section pointer → PR #182 + priority table (順位 8 は trackable level の言及) - ADR-033 line 111: grep procedure hardcoded list (todo.md/2/3) → glob (todo*.md) 本 ADR land 時から todo4-9 が追加されており hardcode list は既に stale - ADR-034: "todo-summary.md / todo4.md エントリ" section + "新セッションで最初に確認すべきこと" を全面再構成、4 component の land 状況を PR # primary table 化 (旧 順位 42 = PR #113 等)、 新セッション checklist を ADR-018 + memory + grep ベースに置換 修正外 (operational reference として保持): - ADR-031 lines 79, 84, 96, 121, 185, 189-191, 205, 207, 240, 242, 251, 302: workflow が todo.md に書き込む / セクション作成する behavior 記述 (pointer ではない operational description) - ADR-033 lines 1, 11, 24, 93, 100, 130, 131: ADR 本体が todo.md 管理がテーマのため intrinsic - ADR-034 lines 195-198 (Bundle b との関係 table): 順位 N と PR # / Bb-N が pair で書かれているため permanent reference (PR #) が常にあり、dead pointer リスクなし
Summary
.claude/skills/prepare-pr/SKILL.md新規 (178 行、試験運用ステータス)Context
セッション 247510ea (2026-04-18) 由来の整備タスクの最終 PR (PR-D)。
PR-A (#56, ADR 集約) / PR-B (#57, permissions.ask + body helper) / PR-C (#58, lib-jj-helpers) と連動し、
ADR-028 の二層防衛 (skill の AskUserQuestion = 一次 + permissions.ask = 二次) を運用に落とし込む。
Design highlights
.tmp-pr-body.md経由で切り詰めリスク回避 (PR fix(cli-pr-monitor): --body 複数行引数の再結合 #51 対策)Validation
~/.claude/skills/) に prepare-* 衝突なしReferences
feedback_bookmark_auto_naming.md(一次防衛層)Summary by CodeRabbit