create-pr スキルを追加#1494
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughTrainLCD StationAPI向けのPR作成スキル手順ドキュメントを新規追加。入力仕様と推論規則、base==head時の救済、既存PR判定による新規/更新切替、差分からの変更種別判定、テンプレ準拠の本文組立てと安全なghコマンド実行手順を定義します。 ChangesPR作成スキル手順ドキュメント
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 15 minutes and 16 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
.claude/skills/create-pr/SKILL.md (1)
154-166: ⚡ Quick win更新モードの「節ごと置換」ルールに、見出し境界の定義がないため壊れやすいです。
更新モードは「既存本文を節ごとに分割し、部分的に書き換える」(Line 154-167)としていますが、Claude側の実装は “節境界” の検出が曖昧だとミスります。最低限、「
##見出しで切る」「該当見出しから次の同レベル見出し直前までを対象」といった境界定義を追記すると、散文を壊さない運用が安定します。✅ 追記案(ドキュメント差分)
-156~ 既存本文を節ごとに分割し、以下のルールで部分的に書き換える。人間が書き込んだ散文は壊さない。 +156~ 既存本文を節ごとに分割し、以下のルールで部分的に書き換える。人間が書き込んだ散文は壊さない。 + - 節境界は Markdown の見出し `## <節名>` で検出し、「当該 `##` 見出し直後〜次の `##` 見出し直前」までをその節として置換対象にする。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/create-pr/SKILL.md around lines 154 - 166, 「更新モード(節ごと置換)」の境界定義が欠けているため見出し検出を明確にしてください:ドキュメントの「更新モード(既存 PR の本文を再生成)」ルールに「節はレベル2見出し(`##`)で分割する」「該当見出しから次の同レベル見出し直前までをその節とみなす」「見出しがない先頭部分はプレアンブルとして扱う」「見出しレベルが混在する場合は同レベル(`##`)のみで区切る」という明文化を追加し、該当箇所(「更新モード(既存 PR の本文を再生成)」の節定義)を更新してください。
🤖 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/create-pr/SKILL.md:
- Around line 83-85: 文書内で「Step 2(更新モード)」と「Step 5」のタイトル方針が矛盾して読めるため、両箇所(Step 2
の「タイトルは既存のものを尊重(ユーザー推論より優先)」と Step 5 の「毎回スコープ整合性を再評価し、必要なら --title
を反映」)を統一して、優先順位を明文化してください。具体的には Step 2 の文を「既存の PR タイトルを原則尊重するが、Step 5
のスコープ整合性チェックで重大な不整合があればタイトルを更新する可能性がある」旨に書き換え、Step 5
の文にも「既存タイトルは原則維持されるが、スコープ不一致で明確な改善が見込める場合は --title
を上書き適用する」と追記して一貫性を持たせてください。これにより「既存を尊重する」ことを優先しつつ「整合性チェックでの更新」を明確化します。
- Around line 45-49: The rescue procedure around base==head is ambiguous about
which files to include when doing "git switch -c" -> "git add <files>" -> "git
commit"; update the text to require that tracked changes (both staged and
unstaged) and any unpushed commits are preserved, and explicitly state the
policy for untracked files (either include them or not). Specify the concrete
user choice: e.g. "to preserve only tracked changes, add tracked files (git add
-u) then commit; to also include untracked files, add all changes (git add -A)
then commit", and update both the current git-switch/commit paragraph and the
similar block at 62-69 to use the same wording and commands ("git switch -c",
"git add <files>", "git commit") so readers know exactly which files will be
moved to the new branch.
- Around line 20-22: 関連Issue節の組み立てで変数 related_issue を常に "Closes `#N`"
として出力しているため元の接頭語(Closes/Fixes/Refs)が失われている件について、PR本文を作るロジック(関連Issue節を組み立てている箇所)を修正して
related_issue の値をそのまま出力するように変更してください:つまり related_issue が与えられていれば先頭に "Closes"
を付け替えるのではなく、入力された文字列("Closes `#N`" / "Fixes `#N`" / "Refs `#N`"
のいずれか)をそのまま使うか、必要なら正規表現で接頭語を抽出して再利用する実装に置き換えてください(参照シンボル: related_issue および
PR本文組立てロジック/関連Issue節のレンダリング部分)。
- Around line 175-193: The example uses BODY_FILE=/tmp/pr-body-<pr-or-branch>.md
which breaks when branch names contain '/' (e.g. feature/foo) — change the
snippet to generate a safe filename by slugifying the branch/ref into REF_SLUG
(replace '/' with '_' or similar), then set
BODY_FILE="/tmp/pr-body-${REF_SLUG}.md" and keep the existing trap 'rm -f
"$BODY_FILE"' and the gh pr create block using BODY_FILE; update the example
lines around BODY_FILE, REF_SLUG, trap and the gh call (references: BODY_FILE,
REF_SLUG, trap, gh pr create) accordingly.
---
Nitpick comments:
In @.claude/skills/create-pr/SKILL.md:
- Around line 154-166:
「更新モード(節ごと置換)」の境界定義が欠けているため見出し検出を明確にしてください:ドキュメントの「更新モード(既存 PR
の本文を再生成)」ルールに「節はレベル2見出し(`##`)で分割する」「該当見出しから次の同レベル見出し直前までをその節とみなす」「見出しがない先頭部分はプレアンブルとして扱う」「見出しレベルが混在する場合は同レベル(`##`)のみで区切る」という明文化を追加し、該当箇所(「更新モード(既存
PR の本文を再生成)」の節定義)を更新してください。
🪄 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: 33d40411-2b2b-45c7-b20a-aab8426bf000
📒 Files selected for processing (1)
.claude/skills/create-pr/SKILL.md
Fixes Applied SuccessfullyFixed 1 file based on 5 CodeRabbit feedback item(s). Files modified:
Issues addressed:
Commit: The latest autofix changes are on the |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/create-pr/SKILL.md:
- Around line 21-22: Update the SKILL.md wording to prevent the "テスト" checklist
from incorrectly implying commands ran: clarify that skip_checks only controls
checkbox display and does not guarantee cargo fmt / clippy / test were executed
in Step 1, and add a rule for the 「テスト」 section (referencing skip_checks, Step
1, and cargo fmt/clippy/test) that if there are no code changes the checklist
must not be marked as done (or must include a footnote explaining omission), and
apply the same clarification to the duplicate paragraph referenced around lines
152-153.
- Around line 20-21: Clarify that when building the "関連Issue" section the value
of related_issue takes absolute precedence: if related_issue is non-empty use it
(preserve any prefix like "Closes"/"Fixes"/"Refs"; if it is only digits, prepend
"Closes"), and only when related_issue is empty fall back to extracting an issue
reference from the commit subject; update the wording wherever related_issue
behavior is described (the `related_issue` entry and the "関連Issue" section,
including the repeated occurrence around lines 153-154) to state this single
precedence rule in one concise sentence.
- Around line 177-178: REF_SLUG currently only replaces '/' via tr which leaves
other unsafe characters (newlines, control chars, spaces, non-ASCII, very long
names) usable in the temp filename; update the slugification of REF_SLUG to
normalize git ref names into a safe filename charset: strip newlines/control
chars, replace any character not in A-Za-z0-9._- with '_', collapse repeated '_'
and trim leading/trailing '_' and optionally limit length (e.g. 255 chars).
Apply this stronger sanitization wherever REF_SLUG is constructed (the places
using tr/sed for slugification referenced in the diff) and document the rule in
the guidance text so temp file creation uses only the safe-char-set.
- Around line 166-167: The "関連Issue" guidance in SKILL.md can produce duplicate
entries when commit subjects already include the same "Closes `#N`" lines; update
the text for the table row that starts with "関連Issue" to explicitly de-duplicate
by checking the PR/body for existing identical "Closes `#N`" (or equivalent)
before appending—i.e., change the sentence "コミット件名に新規 `Closes `#N`` 等があれば追記。" to
describe the de-dup rule: only append when the exact `Closes `#N`` (or same issue
reference) is not already present in the PR body, and include a short note about
normalizing formats (e.g., `Closes `#N``, `close `#N``) before comparison.
🪄 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: 7de7cb99-bc4c-4d4c-a488-63b1a69e3278
📒 Files selected for processing (1)
.claude/skills/create-pr/SKILL.md
Fixes Applied SuccessfullyFixed 1 file based on 4 CodeRabbit feedback item(s). Files modified:
Issues addressed:
Commit: The latest autofix changes are on the |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.claude/skills/create-pr/SKILL.md (1)
168-168: ⚡ Quick win重複チェックロジックの実装方法を明示してください。
Line 168 で「
Closes/closes/Fixes/fixes/Refs/refsを同一視し、空白・記号差は無視して#N単位で照合」と記載していますが、具体的な照合アルゴリズム(正規表現、正規化手順など)が示されていません。実装者が独自の解釈で実装すると、重複検出の精度にばらつきが出る可能性があります。
♻️ 推奨される改善案
- | 関連Issue | 既存内容を尊重。コミット件名に `Closes/Fixes/Refs `#N`` があり、かつ既存本文中に同一の Issue 番号 `#N` を指す表現が存在しない場合のみ追記(重複は作らない。比較時は `Closes` / `closes` / `Fixes` / `fixes` / `Refs` / `refs` を同一視し、空白・記号差は無視して `#N` 単位で照合)。 | + | 関連Issue | 既存内容を尊重。コミット件名に `Closes/Fixes/Refs `#N`` があり、かつ既存本文中に同一の Issue 番号 `#N` を指す表現が存在しない場合のみ追記(重複は作らない。照合方法: 既存本文と新規エントリの両方から正規表現 `(?i)\b(close[sd]?|fix(e[sd])?|refs?)\s*#(\d+)` で Issue 番号を抽出し、番号 `\3` が一致すれば重複と判定)。 |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/create-pr/SKILL.md at line 168, Implement a deterministic duplicate-check by normalizing commit message text and extracting issue tokens: 1) normalize whitespace and punctuation by replacing all runs of whitespace and ASCII punctuation around keywords with a single space and lowercasing the whole string; 2) treat the words "closes", "fixes", "refs" as equivalent (lowercase match); 3) use a regex like /(?:\b(?:closes|fixes|refs)\b)[\s:,-]*#?(\d+)/ig to extract all numeric issue IDs after any of those keywords and also a fallback regex /#(\d+)/g to catch bare references; 4) collect all matched numeric IDs, convert to integers, deduplicate by numeric value, and then check whether any of those integers appear in the existing PR/body references (after the same normalization) before adding—this ensures identical IDs (e.g., "#12", " `#12`,", "Closes: `#12`") are treated the same and avoids duplicates for the symbols "Closes/Fixes/Refs" and token "#N".
🤖 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/create-pr/SKILL.md:
- Around line 72-76:
「コードに変更が無ければ省略可」の表現が曖昧なので、品質チェックの省略条件を明確化してください:具体的に「コード」は手順3で定義している「コード本体パス」に含まれるファイル群を指すと明示し(例:ソースコード、ビルド/依存設定、テストコードなど)、そのいずれにも変更がない場合にのみチェックを省略できると記述を置き換えてください。また手順3の「コード本体パス」を参照する文言を追加して読者が混同しないように誘導してください(つまり「コード本体パス」を省略条件の定義として明記する)。
- Line 96: The "大原則" list erroneously includes the path pattern `data/**`, which
contradicts the "コード本体パス" rules and the separate data-change rules that use
`data/**/*.csv`; remove `data/**` from the "大原則" list so it aligns with the
"コード本体パス" section and keep `data/**` handling only in the dedicated data-change
rules (the paragraphs referencing `data/**/*.csv` and the statement that
`data/**` changes enable the data-change gate).
- Around line 153-154: Clarify how to determine whether "Step 1で cargo
チェックを実行していない" by explicitly documenting the decision logic and where it is set:
state that Step 1 (base/head 整合性チェック) must compute and emit a boolean (e.g.,
cargo_checks_run) based on whether any code/data paths changed (the same path
set used in Step 3's "コード本体パス" check) or by an explicit user flag, and then have
the later logic for skip_checks read that boolean; update the text around "Step
1" and the lines referencing skip_checks / Step 3 to say "if cargo_checks_run is
false (no code/data changes detected) then set all three checks OFF and append a
short note '省略: コード変更なし', otherwise obey skip_checks" so implementers can locate
this via the symbols Step 1, Step 3, and skip_checks.
---
Nitpick comments:
In @.claude/skills/create-pr/SKILL.md:
- Line 168: Implement a deterministic duplicate-check by normalizing commit
message text and extracting issue tokens: 1) normalize whitespace and
punctuation by replacing all runs of whitespace and ASCII punctuation around
keywords with a single space and lowercasing the whole string; 2) treat the
words "closes", "fixes", "refs" as equivalent (lowercase match); 3) use a regex
like /(?:\b(?:closes|fixes|refs)\b)[\s:,-]*#?(\d+)/ig to extract all numeric
issue IDs after any of those keywords and also a fallback regex /#(\d+)/g to
catch bare references; 4) collect all matched numeric IDs, convert to integers,
deduplicate by numeric value, and then check whether any of those integers
appear in the existing PR/body references (after the same normalization) before
adding—this ensures identical IDs (e.g., "#12", " `#12`,", "Closes: `#12`") are
treated the same and avoids duplicates for the symbols "Closes/Fixes/Refs" and
token "#N".
🪄 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: e05c08fb-d113-485b-9818-76bc95ec5847
📒 Files selected for processing (1)
.claude/skills/create-pr/SKILL.md
Fixes Applied SuccessfullyFixed 1 file based on 3 CodeRabbit feedback item(s). Files modified:
Issues addressed:
Commit: The latest autofix changes are on the |
概要
このリポジトリでの PR 作成手順を一本化する Claude Code スキル
create-prを追加します。.github/pull_request_template.mdとCONTRIBUTING.mdのブランチ命名規則、pr_labeler.ymlの自動ラベル付与に整合する形で、タイトル推論・変更の種類判定・本文組み立てを自動化します。変更の種類
変更内容
.claude/skills/create-pr/SKILL.mdを新規追加base == headのときにfeature/fix/data/chore/release/の命名規則で新規ブランチへ退避する手順を明文化gh pr create --body-file/gh pr edit --body-fileで一時ファイル経由で渡す運用に統一(バッククォート escape 事故の構造的回避)と、trapでのクリーンアップを規定テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit