Repository navigation
feat(verify): add related files verification to prevent missed updates - #14
Chachamaru127 wants to merge 1 commit into
Conversation
Walkthrough実装後に見落とされた関連ファイルの自動検出機能「verify-related-files」を追加し、チェンジログ、ワークフロー(Phase 1/Phase 3)、およびスキルドキュメントに統合。関数シグネチャ、型/インターフェース、エクスポート、設定の不整合を検出する仕様を追加。 Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as 開発者
participant Orch as /work ワークフロー
participant Skill as verify-related-files
participant Git as Git(diff)
participant LSP as LSP/リファレンス
participant CI as ビルド/コミット
Dev->>Orch: 実装完了を報告
Orch->>Skill: 実装ファイルを渡して検証開始
Skill->>Git: git diff で変更ファイル取得
Skill->>LSP: 参照/呼び出し元を問い合わせ(任意)
LSP-->>Skill: 参照結果返却
Git-->>Skill: 変更ファイルリスト返却
Skill->>Orch: 関連ファイル検出結果(critical/warn/info)
Orch->>Dev: 結果を表示(修正 or 継続)
Dev->>CI: 修正後ビルド・コミット(Phase 3 で最終検証)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 14-22: Update the package/version metadata and changelog to
reflect the new release: change the VERSION file value from 2.9.22 to 2.9.23,
update the "version" field in plugin.json to 2.9.23, replace the "##
[Unreleased]" header in CHANGELOG.md with "## [2.9.23] - 2026-01-23" (use
current date if different), update the bottom reference link for [Unreleased] to
point to v2.9.23...HEAD, and add a new reference link line for [2.9.23]:
https://github.com/Chachamaru127/claude-code-harness/compare/v2.9.22...v2.9.23.
🧹 Nitpick comments (3)
skills/verify/references/verify-related-files.md (1)
105-113: マークダウンの改善提案: コードブロックに言語識別子を追加複数のコードブロック(行105、139、170、194、204、213、238、252、278)で言語識別子が省略されています。シンタックスハイライトとアクセシビリティ向上のため、言語識別子の追加を推奨します。
♻️ 修正案
行105-113のブロック例:
-``` +```text 変更された関数/型を特定 ↓ LSP find-references を実行 ↓ 全参照箇所をリスト化 ↓ 未編集の参照箇所を警告同様に、他の該当箇所(行139、170、194、204、213、238、252、278)にも適用してください。 </details> Based on learnings, markdownlintの警告を解消することで、ドキュメントの品質と一貫性が向上します。 </blockquote></details> <details> <summary>skills/verify/SKILL.md (1)</summary><blockquote> `160-208`: **Step 1.5の追加が適切です。** 関連ファイル検証のステップが明確に文書化されています: - 実装完了後の適切なタイミングでの実行 - 出力例が具体的でわかりやすい - 重要度判定テーブルが明確 - 参照ドキュメントへのリンクあり マークダウンの改善提案: コードブロック(行164、182)に言語識別子(`text` または `markdown`)の追加を推奨しますが、必須ではありません。 </blockquote></details> <details> <summary>commands/core/work.md (1)</summary><blockquote> `514-537`: **新セクションの追加が有用です。** 実装後の関連ファイルチェックに関する詳細なガイダンスが追加されています: - 検出対象が明確(関数シグネチャ、interface/型、export、設定) - 出力例が具体的で理解しやすい - ユーザーアクション選択肢が明示されている マークダウンの改善: コードブロック(行516、525)に言語識別子の追加を推奨します。 <details> <summary>♻️ 修正案</summary> ```diff -``` +```text Run related files verification: → Detect function signature changes → check callers ...```diff -``` +```text 📋 Related Files Verification ...</details> </blockquote></details> </blockquote></details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| ### Added | ||
|
|
||
| - **Related files verification** (`verify-related-files`) - Automatically checks for missed file updates after implementation | ||
| - Detects function signature changes → warns about unchecked callers | ||
| - Detects interface/type changes → warns about implementation inconsistencies | ||
| - Detects export changes → warns about broken imports | ||
| - Detects config changes → warns about unsynchronized related configs | ||
| - Integrated into `/work` flow (Phase 1 self-review and Phase 3 pre-commit) | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Check the CHANGELOG.md structure and content
cat CHANGELOG.md | head -40Repository: Chachamaru127/claude-code-harness
Length of output: 1310
🏁 Script executed:
# Look for pipeline/CI configuration files
find . -type f \( -name "*.yml" -o -name "*.yaml" \) -path "*/.github/*" -o -path "*/.gitlab*" | head -20Repository: Chachamaru127/claude-code-harness
Length of output: 150
🏁 Script executed:
# Check for any npm/package scripts or configuration that might validate changelog
if [ -f "package.json" ]; then
cat package.json | grep -A 10 -B 10 "changelog\|version\|release"
fiRepository: Chachamaru127/claude-code-harness
Length of output: 59
🏁 Script executed:
# Check the validate-plugin.yml for changelog validation logic
cat .github/workflows/validate-plugin.ymlRepository: Chachamaru127/claude-code-harness
Length of output: 1022
🏁 Script executed:
# Check benchmark.yml as well
cat .github/workflows/benchmark.ymlRepository: Chachamaru127/claude-code-harness
Length of output: 6145
🏁 Script executed:
# Look for any scripts that might validate changelog
find . -type f -name "*changelog*" -o -name "*validate*" -o -name "*check*" | grep -E "\.(js|sh|py)$" | head -20Repository: Chachamaru127/claude-code-harness
Length of output: 496
🏁 Script executed:
# Search for changelog validation in the codebase
rg "CHANGELOG.md not updated" --type yaml --type js --type shRepository: Chachamaru127/claude-code-harness
Length of output: 59
🏁 Script executed:
# Check the version bump script that's failing
cat ./scripts/ci/check-version-bump.shRepository: Chachamaru127/claude-code-harness
Length of output: 2594
🏁 Script executed:
# Also check if there's a VERSION file
cat VERSION 2>/dev/null || echo "VERSION file not found"Repository: Chachamaru127/claude-code-harness
Length of output: 83
🏁 Script executed:
# Check git status or recent changes to understand what triggered the version bump check
git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "Cannot get git diff"Repository: Chachamaru127/claude-code-harness
Length of output: 96
🏁 Script executed:
# Check the plugin.json to see version there
if [ -f "plugin.json" ]; then
cat plugin.json | head -20
fiRepository: Chachamaru127/claude-code-harness
Length of output: 59
🏁 Script executed:
# Let's verify what files changed in this PR by checking git status
git status --short 2>/dev/null | head -20Repository: Chachamaru127/claude-code-harness
Length of output: 114
🏁 Script executed:
# Check if there are any recent commits to understand the PR context
git log --oneline -10 2>/dev/null || echo "Cannot get git log"Repository: Chachamaru127/claude-code-harness
Length of output: 155
🏁 Script executed:
# Check if there's a plugin.json file
if [ -f "plugin.json" ]; then
cat plugin.json | head -25
fiRepository: Chachamaru127/claude-code-harness
Length of output: 59
🏁 Script executed:
# Let's understand what the actual code changes are - check what files exist in key directories
find commands/ skills/ templates/ scripts/ hooks/ agents/ workflows/ -type f 2>/dev/null | head -20 || echo "Some directories may not exist"Repository: Chachamaru127/claude-code-harness
Length of output: 691
🏁 Script executed:
# Check what files changed related to the verify-related-files feature
git show --name-status eb0ff16 2>/dev/null | head -30 || echo "Cannot get commit details"Repository: Chachamaru127/claude-code-harness
Length of output: 1212
🏁 Script executed:
# Let's verify what the actual git diff shows for this PR
git diff HEAD~1 HEAD --name-only 2>/dev/null || echo "Cannot get diff"Repository: Chachamaru127/claude-code-harness
Length of output: 92
🏁 Script executed:
# Check if the commit actually contains files in the monitored directories
git show eb0ff16 --name-only 2>/dev/null | grep -E "^(commands|skills|templates|scripts|hooks|agents|workflows)/" || echo "No files in monitored paths"Repository: Chachamaru127/claude-code-harness
Length of output: 8830
🏁 Script executed:
# Let's check plugin.json to see if version is defined there
find . -name "plugin.json" -type f 2>/dev/null -exec cat {} \;Repository: Chachamaru127/claude-code-harness
Length of output: 1165
🏁 Script executed:
# Let's check the CHANGELOG structure more carefully to understand the format
head -60 CHANGELOG.mdRepository: Chachamaru127/claude-code-harness
Length of output: 1934
🏁 Script executed:
# Check if there are any related files that indicate this is meant to be released
ls -la | grep -i release
cat .github/workflows/validate-plugin.yml | grep -A 5 -B 5 "version"Repository: Chachamaru127/claude-code-harness
Length of output: 831
🏁 Script executed:
# Simulate the version bump check to see exact failure
bash ./scripts/ci/check-version-bump.sh 2>&1 || trueRepository: Chachamaru127/claude-code-harness
Length of output: 211
🏁 Script executed:
# Let's manually check if VERSION differs from the base
# Simulate the check by looking at what git shows
echo "Current VERSION content:"
cat VERSION
echo ""
echo "Base VERSION (from HEAD~1):"
git show HEAD~1:VERSION 2>/dev/null || echo "(Cannot retrieve)"
echo ""
echo "Checking if code changed in monitored directories..."
git diff --name-only HEAD~1 HEAD -- commands/ skills/ templates/ scripts/ hooks/ agents/ workflows/ 2>/dev/null | wc -l
echo "files changed in monitored paths"Repository: Chachamaru127/claude-code-harness
Length of output: 244
🏁 Script executed:
# Also check if there's a reference link section at the bottom of CHANGELOG
tail -20 CHANGELOG.mdRepository: Chachamaru127/claude-code-harness
Length of output: 1723
バージョンの更新が必要です(VERSION、plugin.json、CHANGELOG)
パイプラインが検出している通り、コード変更があるにもかかわらずバージョンが更新されていません。commands/、skills/、templates/、scripts/、hooks/、agents/、workflows/ のいずれかに変更があった場合、以下の対応が必須です:
- VERSION ファイル を
2.9.22→2.9.23に更新 - plugin.json の version フィールドを
2.9.23に更新 - CHANGELOG.md の
## [Unreleased]を## [2.9.23] - 2026-01-23に変更(現在の日付を使用) - CHANGELOG 下部の参照リンク を以下のように更新:
[Unreleased]リンクをv2.9.23...HEADに変更- 新しく
[2.9.23]: https://github.com/Chachamaru127/claude-code-harness/compare/v2.9.22...v2.9.23を追加
マージ前にこれらの変更を完了してください。
🤖 Prompt for AI Agents
In `@CHANGELOG.md` around lines 14 - 22, Update the package/version metadata and
changelog to reflect the new release: change the VERSION file value from 2.9.22
to 2.9.23, update the "version" field in plugin.json to 2.9.23, replace the "##
[Unreleased]" header in CHANGELOG.md with "## [2.9.23] - 2026-01-23" (use
current date if different), update the bottom reference link for [Unreleased] to
point to v2.9.23...HEAD, and add a new reference link line for [2.9.23]:
https://github.com/Chachamaru127/claude-code-harness/compare/v2.9.22...v2.9.23.
Add a new verification step that automatically checks for missed file updates after implementation: - Detect function signature changes → warn about unchecked callers - Detect interface/type changes → warn about implementation inconsistencies - Detect export changes → warn about broken imports - Detect config changes → warn about unsynchronized related configs Integrated into /work flow: - Phase 1: Related-check added to task-worker self-review loop - Phase 3: Final related files verification before commit Co-Authored-By: Claude <noreply@anthropic.com>
eb0ff16 to
5b74579
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@skills/verify/references/verify-related-files.md`:
- Around line 332-337:
markdownlintが報告する「言語指定の欠落」対応として、対象のMarkdown内のバックティックコードブロックに適切な言語タグを付与してください:フローチャートや出力例には
`text`(または内容に応じた適切なタグ)、シェルコマンドには `bash` を付けるように、verify-related-files.md
内の該当ブロック(指摘された複数箇所とLine 336も含む)を全て手動で確認して修正し、単純に空の ```
を置換する一括スクリプトを使う場合でも各ブロックの内容を確認してから実行してください。
In `@skills/verify/SKILL.md`:
- Around line 164-178: In the SKILL.md fenced code blocks containing the
ASCII-art flowchart, add a language tag to each opening fence (e.g., replace ```
with ```text or ```plaintext) and for any actual Mermaid diagrams use
```mermaid; locate the multi-line fence containing the "編集ファイルを取得" ASCII-art and
update its opening fence to ```text (or ```mermaid if you convert it to a
Mermaid diagram) so markdownlint no longer flags missing language on the code
fences.
♻️ Duplicate comments (1)
CHANGELOG.md (1)
46-51: LGTM! 機能説明が明確で適切です関連ファイル検証機能の説明が分かりやすく記載されています:
- 4つの検出パターンが明確
/workフローへの統合ポイント(Phase 1/Phase 3)が具体的- 既存のCHANGELOG形式に準拠
Note: 過去のレビューコメントで指摘されているバージョン更新(VERSION、plugin.json、CHANGELOG.md)については、既に別のコメントで指摘済みです。
🧹 Nitpick comments (2)
skills/verify/SKILL.md (1)
87-90: ステップ番号の整合性を確認してください新しいStep 1.5の挿入により、既存ステップが再番号されていますが、番号に飛びがあります:
- Step 3: (Claude-mem有効時)過去のエラーパターンを検索
- Step 5: 上記の「機能詳細」から適切な参照ファイルを読む ← Step 4が欠落
- Step 6: その内容に従って検証/復旧実行
🔢 推奨する修正案
連番に修正することをお勧めします:
-3. **(Claude-mem 有効時)過去のエラーパターンを検索** -5. 上記の「機能詳細」から適切な参照ファイルを読む -6. その内容に従って検証/復旧実行 +3. **(Claude-mem 有効時)過去のエラーパターンを検索** +4. 上記の「機能詳細」から適切な参照ファイルを読む +5. その内容に従って検証/復旧実行または、すべてを小数点記法に統一:
- Step 0
- Step 1
- Step 1.5
- Step 2
- Step 3
- Step 4
skills/verify/references/verify-related-files.md (1)
67-83: TypeScript/JavaScript検索パターンの精度を向上できます現在のgrep例は基本的ですが、以下の点で改善可能です:
- Line 78:
grep -r "import.*{.*functionName.*}"は{の前後に改行がある場合にマッチしません- Line 81:
grep -r ": TypeName"は型アノテーション以外(コメント内など)もマッチする可能性があります🔍 より正確な検索パターン案
ripgrep (rg) を使用した場合の改善例:
# Named import の検索(改行対応) rg -U 'import\s*\{[^}]*\bfunctionName\b[^}]*\}' --type ts --type tsx # 型アノテーションの検索(コメント除外) rg ':\s*TypeName\b' --type ts --type tsx -g '!*.md' # または ast-grep での検索(より正確) ast-grep --pattern 'import { $$$, functionName, $$$ } from $_'ドキュメント内で「grepの例は基本的なもので、ripgrepやast-grepを使用するとより正確」と注記を追加することを推奨します。
| ## 注意事項 | ||
|
|
||
| - LSP が利用可能な場合は grep より LSP を優先する | ||
| - 大量の関連ファイルがある場合は重要度でフィルタリング | ||
| - CI/CD と連携して自動チェックも検討 | ||
| - 偽陽性(関係ないのに警告)は許容、偽陰性(漏れ)は最小化 |
There was a problem hiding this comment.
フォーマット修正をまとめて対応してください
markdownlintが複数のコードブロックで言語指定の欠落を報告しています。一括で修正することをお勧めします。
📝 修正が必要な箇所(全13箇所)
以下のコードブロックに言語指定を追加してください:
フローチャート/出力例 (text を推奨):
- Line 105-113
- Line 139-146
- Line 169-177
- Line 194-200
- Line 213-220
- Line 239-247
- Line 252-274
- Line 279-298
Bash/シェルコマンド (bash を推奨):
- Line 93 (実際にはこの行にコードブロックなし、静的解析の誤検出の可能性)
一括修正例:
# すべてのフローチャート/出力例ブロックを検索して修正
sed -i 's/^```$/```text/g' skills/verify/references/verify-related-files.mdただし、手動で各ブロックの内容を確認し、適切な言語指定を選択することを推奨します。
Note: Line 336も同様に言語指定が必要です(偽陽性の可能性あり)。
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
336-336: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In `@skills/verify/references/verify-related-files.md` around lines 332 - 337,
markdownlintが報告する「言語指定の欠落」対応として、対象のMarkdown内のバックティックコードブロックに適切な言語タグを付与してください:フローチャートや出力例には
`text`(または内容に応じた適切なタグ)、シェルコマンドには `bash` を付けるように、verify-related-files.md
内の該当ブロック(指摘された複数箇所とLine 336も含む)を全て手動で確認して修正し、単純に空の ```
を置換する一括スクリプトを使う場合でも各ブロックの内容を確認してから実行してください。
| ``` | ||
| 編集ファイルを取得 | ||
| ↓ | ||
| ┌─────────────────────────────────────────┐ | ||
| │ 関連ファイル検証 │ | ||
| ├─────────────────────────────────────────┤ | ||
| │ 変更パターンを分析: │ | ||
| │ ├── 関数シグネチャ変更 → 呼び出し元確認 │ | ||
| │ ├── 型/interface変更 → 実装箇所確認 │ | ||
| │ ├── export削除 → import文確認 │ | ||
| │ └── 設定変更 → 関連設定ファイル確認 │ | ||
| └─────────────────────────────────────────┘ | ||
| ↓ | ||
| 修正漏れ候補を警告 | ||
| ``` |
There was a problem hiding this comment.
フェンスコードブロックに言語指定を追加してください
markdownlintが指摘している通り、フェンスコードブロックに言語指定がありません。
📝 修正案
-```
+```text
編集ファイルを取得
↓
┌─────────────────────────────────────────┐または、フローチャート用の言語指定:
-```
+```mermaidただし、ASCIIアート形式のフローチャートの場合は text または plaintext が適切です。
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| 編集ファイルを取得 | |
| ↓ | |
| ┌─────────────────────────────────────────┐ | |
| │ 関連ファイル検証 │ | |
| ├─────────────────────────────────────────┤ | |
| │ 変更パターンを分析: │ | |
| │ ├── 関数シグネチャ変更 → 呼び出し元確認 │ | |
| │ ├── 型/interface変更 → 実装箇所確認 │ | |
| │ ├── export削除 → import文確認 │ | |
| │ └── 設定変更 → 関連設定ファイル確認 │ | |
| └─────────────────────────────────────────┘ | |
| ↓ | |
| 修正漏れ候補を警告 | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
164-164: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In `@skills/verify/SKILL.md` around lines 164 - 178, In the SKILL.md fenced code
blocks containing the ASCII-art flowchart, add a language tag to each opening
fence (e.g., replace ``` with ```text or ```plaintext) and for any actual
Mermaid diagrams use ```mermaid; locate the multi-line fence containing the
"編集ファイルを取得" ASCII-art and update its opening fence to ```text (or ```mermaid if
you convert it to a Mermaid diagram) so markdownlint no longer flags missing
language on the code fences.
Merged features: - Automatic detection of missed updates after implementation - Function signature change detection - Interface/type change warnings - Export modification alerts - Config change verification Integrated into /work workflow (Phase 1 and Phase 3) https://claude.ai/code/session_01GgwkKJXFZpZWdh1etQbvaw
|
This PR's content (Related files verification) has already been merged into main as part of v2.9.24. Closing as duplicate. |
Add a new verification step that automatically checks for missed file updates after implementation:
Integrated into /work flow:
Summary by CodeRabbit
新機能
ドキュメント
✏️ Tip: You can customize this high-level summary in your review settings.