Repository navigation
feat: 5観点コードレビューとレビュールール配布を既存コマンドに統合 #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -620,6 +620,43 @@ PR 作成前のチェック項目を検証: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ✅ すべてのチェック項目が設定済み | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ⚠️ 不足している項目あり(詳細をリスト) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### 3.3.1 Code Review Rules Check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| コードレビュー基準の設定状況を確認: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 実行内容: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.claude/rules/code-review-standards.md` の存在確認 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.claude/rules/development-standards.md` の存在確認 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.claude/rules/git-conventions.md` の存在確認 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - config リポジトリのルールファイルとの差分確認(config リポジトリ自身は除く) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+623
to
+633
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ルール検証対象と同期対象の不一致でドリフトが残ります。 このセクションでは 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 結果: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ✅ すべてのレビュールールが設定済み | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ⚠️ 不足しているルールあり(詳細をリスト) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 🔄 config リポジトリとの差分あり(更新推奨ファイルをリスト) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MODE が `full` の場合: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 不足ルールを config リポジトリからコピー | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 差分があるファイルについて更新を提案 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+642
to
+643
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This section says Useful? React with 👍 / 👎. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # config リポジトリのパスを取得(このリポジトリ自身なら SKIP) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CONFIG_REPO="$(git -C /path/to/config rev-parse --show-toplevel 2>/dev/null)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ルールファイルの存在確認 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RULES_DIR=".claude/rules" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REQUIRED_RULES=("code-review-standards.md" "development-standards.md" "git-conventions.md") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for rule in "${REQUIRED_RULES[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f "${RULES_DIR}/${rule}" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "⚠️ Missing: ${RULES_DIR}/${rule}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+645
to
+658
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. サンプルスクリプトが実行不能・仕様不足です。 Line 647 の 🔧 提案差分(実行可能な最小版)-# config リポジトリのパスを取得(このリポジトリ自身なら SKIP)
-CONFIG_REPO="$(git -C /path/to/config rev-parse --show-toplevel 2>/dev/null)"
+# config リポジトリのパスを探索(このリポジトリ自身は SKIP)
+CONFIG_REPO=""
+for p in "$HOME/develop/github.com/keito4/config" "$HOME/ghq/github.com/keito4/config" "$HOME/src/github.com/keito4/config"; do
+ [ -d "$p/.claude/rules" ] && CONFIG_REPO="$p" && break
+done
+
+REPO_NAME=$(gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null || echo "")
+if [ "$REPO_NAME" = "keito4/config" ]; then
+ echo "⏭️ Skip rules diff check on config repository itself"
+else
+ for rule in "${REQUIRED_RULES[@]}"; do
+ if [ -f "${RULES_DIR}/${rule}" ] && [ -f "${CONFIG_REPO}/.claude/rules/${rule}" ]; then
+ diff -q "${CONFIG_REPO}/.claude/rules/${rule}" "${RULES_DIR}/${rule}" >/dev/null 2>&1 || \
+ echo "🔄 Diff detected: ${RULES_DIR}/${rule}"
+ fi
+ done
+fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### 3.4 CLAUDE.md Symlink Check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CLAUDE.md が AGENTS.md へのシンボリックリンクであることを確認: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2716,6 +2753,7 @@ fi | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── .editorconfig: ✅ Configured (or 🔧 Generated) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── scripts: ✅ All standard scripts defined (or ⚠️ Missing: test, lint) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── Pre-PR Checklist: ✅ CI workflow exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── Code Review Rules: ✅ All rules configured (or ⚠️ Missing rules) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── CLAUDE.md: ✅ Symlink to AGENTS.md | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── AGENTS.md: ✅ Auto-generated sections up to date (or 🔧 Updated) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── CI/CD: ✅ Standard level configured | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,36 @@ | ||
| このコードを10個の改善案を出してください。 | ||
| 以下の5観点でこのコードをレビューしてください。 | ||
|
|
||
| ## 5観点レビュー | ||
|
|
||
| ### 観点一覧 | ||
|
|
||
| | 観点 | チェック内容 | | ||
| | ----------------- | -------------------------------------------------------------- | | ||
| | **Security** | SQLインジェクション, XSS, 機密情報露出, 入力バリデーション不足 | | ||
| | **Performance** | N+1クエリ, 不要な再レンダリング, メモリリーク, 不要な再計算 | | ||
| | **Quality** | 命名, 単一責任, テストカバレッジ, エラーハンドリング | | ||
| | **Accessibility** | ARIA属性, キーボードナビゲーション, カラーコントラスト | | ||
| | **AI Residuals** | モック残骸, ハードコード値, スキップされたテスト, 仮実装 | | ||
|
|
||
| ### Severity 基準 | ||
|
|
||
| | Severity | 定義 | Verdict への影響 | | ||
| | ------------------ | ------------------------------------------------------ | ----------------------- | | ||
| | **critical** | セキュリティ脆弱性、データ損失リスク、本番障害の可能性 | 1件でも REQUEST_CHANGES | | ||
| | **major** | 既存機能の破壊、仕様との矛盾、テスト不通過 | 1件でも REQUEST_CHANGES | | ||
| | **minor** | 命名改善、コメント不足、スタイル不統一 | verdict に影響しない | | ||
| | **recommendation** | ベストプラクティス提案、将来の改善案 | verdict に影響しない | | ||
|
|
||
| ### 出力フォーマット | ||
|
|
||
| 各観点について以下の形式で出力してください: | ||
|
|
||
| ``` | ||
| ## [観点名] | ||
| - [severity] [指摘内容] (ファイル名:行番号) | ||
| ``` | ||
|
Comment on lines
+54
to
+149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fenced code block に言語指定を付けてください。 Line 28 のコードフェンスは markdownlint (MD040) 的に 🔧 Proposed fix-```
+```text
## [観点名]
- [severity] [指摘内容] (ファイル名:行番号)🧰 Tools🪛 markdownlint-cli2 (0.22.0)[warning] 28-28: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents
Comment on lines
+125
to
+149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Output template block should declare a fence language. Line 125 should specify a language ( 🔧 Proposed fix-```
+```markdown
## Code Review Result
**Verdict**: APPROVE / REQUEST_CHANGES
@@
### AI Residuals Summary
(Step 3 の検出結果サマリ)🧰 Tools🪛 markdownlint-cli2 (0.22.0)[warning] 125-125: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
|
|
||
| 最後に総合 verdict を以下のいずれかで明示してください: | ||
|
|
||
| - **APPROVE**: minor / recommendation のみ | ||
| - **REQUEST_CHANGES**: critical / major が1件以上 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| paths: | ||
| - '**/*' | ||
| --- | ||
|
|
||
| # Code Review Standards | ||
|
|
||
| ## 5観点レビュー | ||
|
|
||
| コードレビュー時は以下の5観点で評価する。 | ||
|
|
||
| | 観点 | チェック内容 | | ||
| | ----------------- | -------------------------------------------------------------- | | ||
| | **Security** | SQLインジェクション, XSS, 機密情報露出, 入力バリデーション不足 | | ||
| | **Performance** | N+1クエリ, 不要な再レンダリング, メモリリーク, 不要な再計算 | | ||
| | **Quality** | 命名, 単一責任, テストカバレッジ, エラーハンドリング | | ||
| | **Accessibility** | ARIA属性, キーボードナビゲーション, カラーコントラスト | | ||
| | **AI Residuals** | モック残骸, ハードコード値, スキップされたテスト, 仮実装 | | ||
|
|
||
| ## Severity 判定基準 | ||
|
|
||
| 各指摘を以下の severity に分類し、verdict を決定する。 | ||
|
|
||
| | Severity | 定義 | Verdict への影響 | | ||
| | ------------------ | ------------------------------------------------------ | ----------------------- | | ||
| | **critical** | セキュリティ脆弱性、データ損失リスク、本番障害の可能性 | 1件でも REQUEST_CHANGES | | ||
| | **major** | 既存機能の破壊、仕様との矛盾、テスト不通過 | 1件でも REQUEST_CHANGES | | ||
| | **minor** | 命名改善、コメント不足、スタイル不統一 | verdict に影響しない | | ||
| | **recommendation** | ベストプラクティス提案、将来の改善案 | verdict に影響しない | | ||
|
|
||
| minor / recommendation のみの場合は APPROVE を返す。「あったほうが良い改善」は REQUEST_CHANGES の理由にならない。 | ||
|
|
||
| ## AI Residuals 検出パターン | ||
|
|
||
| | Severity | パターン | | ||
| | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | | ||
| | **major** | `localhost` / `127.0.0.1` の接続先, `it.skip` / `describe.skip` / `test.skip`, ハードコードされた秘密情報, dev/staging 固定 URL | | ||
| | **minor** | `mockData`, `dummy`, `fakeData`, `TODO`, `FIXME` | | ||
| | **recommendation** | `temporary implementation`, `replace later`, `placeholder` などの仮実装コメント | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ Development infrastructure template repository providing DevContainer images, CI | |
| | `/pre-pr-checklist` | (no description) | | ||
| | `/repo-maintenance` | Comprehensive repository maintenance - run all health checks and updates | | ||
| | `/security-credential-scan` | (no description) | | ||
| | `/security-review` | (no description) | | ||
| | `/security-review` | 5観点コードレビュー(Security / Performance / Quality / Accessibility / AI Residuals) | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The command table now advertises Useful? React with 👍 / 👎. |
||
| | `/setup-ci` | Setup comprehensive CI/CD workflows for your repository | | ||
| | `/setup-doppler` | Setup Doppler secret management with dev/dev_personal configuration | | ||
| | `/setup-husky` | (no description) | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
仕様記述と実装が乖離しています(5観点レビュー未実装)。
Line 24-35 と Line 71-78 では
/pre-pr-checklistが5観点レビューを実行・表示する前提ですが、script/pre-pr-checklist.sh:45-122には該当処理がなく、現状は Quality Checks / PR Analysis / Branch Status のみです。ユーザーに誤った期待を与えるため、(1) スクリプト実装を追加するか、実装完了まで (2) 本ドキュメントを「手動レビュー項目」表現に落とす必要があります。Also applies to: 71-78
🧰 Tools
🪛 LanguageTool
[grammar] ~34-~34: Ensure spelling is correct
Context: ...ritical / major の指摘があれば REQUEST_CHANGES 相当として扱い、PR作成前に修正必須とする。 minor / recommendation のみなら APPROVE 相当として通過。 ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents