agentleFS
ayutazayutaz/piper-plus/.claude/skills/check-pr-ready/SKILL.md

check-pr-ready

Skill240 starsChanged 20 days agoMITView on GitHub

PR 作成前の最終チェックリスト (lint/test/docs/CHANGELOG/未コミット確認)。/precheck の拡張版で、ドキュメント整合性も検証します。

  • Commits and pushes

The file

Files
SKILL.md

PR 作成前 最終チェック

PR を出す前にすべての品質チェックを実行し、問題があればレポートします。 マージ可能な状態か判定する ことが目的です。

現在の状態

  • ブランチ: !git rev-parse --abbrev-ref HEAD
  • リモート差分 (dev との): !git log --oneline dev..HEAD 2>/dev/null | head -10
  • 未コミット: !git status --porcelain 2>/dev/null | head -20
  • 変更ファイル数: !git diff --name-only dev..HEAD 2>/dev/null | wc -l | tr -d ' '

実行手順 (順番通り、失敗したら停止して報告)

Phase 1: ブランチと未コミット確認

  1. ブランチが dev 以外であることを確認
  2. 未コミット変更があれば、ユーザーに確認して /commit を促す
  3. dev との差分が 1 コミット以上あることを確認 (空の PR を防ぐ)

Phase 2: コードチェック

$ARGUMENTS に skip-tests が 含まれていない 場合のみ、以下を実行:

  1. /precheck skill を実行 (lint + format + test)
    • 実装: precheck と同じロジックを直接実行 (lint + format + scope-detected tests)
  2. 失敗があれば即停止し、修正案を提示

Phase 3: ドキュメント整合性チェック

  1. CLAUDE.md 更新確認:
    • git diff dev..HEAD --name-only で大きな機能追加 (50 行以上の新規ファイル) を検出
    • 検出された場合、CLAUDE.md が同じ PR で更新されているか確認
    • 未更新なら警告 (機能の追加箇所と CLAUDE.md のセクション提案)
  2. README 更新確認:
    • 同様に、README.md / src/python_run/README.md / src/wasm/openjtalk-web/README.npm.md を確認
    • 機能名や API が変わっている場合は更新を促す
  3. CHANGELOG 更新確認:
    • CHANGELOG.md の Unreleased セクションが更新されているか確認
    • 大きな機能追加なら未更新を警告
  4. docstring カバレッジ確認 (Python の場合):
    • git diff dev..HEAD --name-only -- 'src/python_run/piper_plus/*.py' 'src/python/g2p/*.py'
    • 新規 public 関数/クラスに docstring があるかチェック (簡易)

Phase 4: PR 本文ドラフト

  1. 上記すべてが OK なら、PR 本文のドラフトを .github/pull_request_template.md の見出しどおりに生成:
    • タイトル: dev..HEAD の最初のコミット件名 (70 文字以内、 Conventional Commits の type(scope): ... 形式。 pr-metadata.yml の pr-title-check が検査する)
    • ## Summary: 各コミットの要約から 3-5 個の bullet
    • ## Affected Components / ## Type: 該当を - [x] で最低 1 個ずつ
    • ## Risk Level: patch / minor / major のうち ちょうど 1 個を - [x]
    • ## Contract Impact / ## Checklist / ## Related Issues: template の項目を埋める
    • ## Test Plan (大文字 P): 実行したチェックの結果 checklist。 空やコメントだけにしない
    • pr-metadata.yml の pr-body-validate step は Test Plan の中身、 Risk Level の 1 個、 Affected Components と Type の最低 1 個を検査し、 欠けると PR が red になる (詳細は /create-pr の「PR 本文フォーマット」)

Phase 5: 最終判定

  1. すべて緑 → 「PR 作成準備完了」と報告し、/create-pr の実行を提案 (gh pr create の直接実行は .claude/hooks/guard-bash.sh が block する)
  2. 1 つでも警告/失敗 → 修正項目をリスト化、緑にしてから再実行を促す

報告フォーマット

## PR Ready Check 結果

### Phase 1: ブランチ
- [x] ブランチ: feat/xxx (dev ではない)
- [x] 未コミット: 0 件
- [x] dev との差分: 5 コミット

### Phase 2: コードチェック
- [x] Python ruff check
- [x] Python ruff format
- [x] Python pytest (212 passed)
- [x] WASM npm test (481 passed)

### Phase 3: ドキュメント
- [x] CLAUDE.md 更新済み
- [x] README 更新済み
- [ ] ⚠️ CHANGELOG.md Unreleased 未更新

### Phase 4: PR 本文ドラフト
(生成された PR 本文)

### 判定: ⚠️ 1 件の警告あり (CHANGELOG)
修正してから再実行してください。

注意

  • ユーザーが skip-tests 引数を渡した場合は Phase 2 のみスキップ (緊急修正用)
  • pytest.ini の --cov に注意: -o addopts="" で上書き
  • 大規模機能 (>100 行) では CLAUDE.md / CHANGELOG / docs/features の更新を必須とする
  • PR 作成自体は Phase 5 の 提案だけ で、実行はユーザーに任せる (作成は /create-pr 経由)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.