feat: Context7スキルをインストーラーに追加 - #466
Conversation
ライブラリドキュメント取得のためのContext7 MCPを導入: - プロジェクトレベル(.mcp.json)に追加 - DevContainerイメージにグローバル設定として組み込み Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review
判定: patch is incorrect
|
📝 WalkthroughWalkthroughThe PR extends agent skills documentation and configuration by adding Context7 skill documentation to the main guide, registering the new "intellectronica/agent-skills" repository in the skills list, and configuring its installation requirements. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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: 2
🤖 Fix all issues with AI agents
In @.devcontainer/Dockerfile:
- Line 107: The Dockerfile currently overwrites the global MCP config by copying
.devcontainer/mcp.json to /home/vscode/.claude/.mcp.json, which removes five
servers; change this so the container either copies a merged config or performs
a merge at startup: update the COPY step to place the file somewhere
non-destructive (e.g., /home/vscode/.claude/mcp.dev.json) and add a startup
script (or modify the entrypoint) that reads both /home/vscode/.claude/.mcp.json
and the dev file and merges entries (preserving servers named in the project's
.mcp.json such as context7, playwright, o3, linear, github, figma) before
writing the combined result back to /home/vscode/.claude/.mcp.json;
alternatively, replace .devcontainer/mcp.json with a full config that includes
all six servers so COPY --chown=vscode:vscode .devcontainer/mcp.json
/home/vscode/.claude/.mcp.json no longer drops servers.
In @.devcontainer/mcp.json:
- Around line 1-9: Update the mcpServers entry for "context7" to pin the package
in the args array (e.g., "@upstash/context7-mcp@1.x.x") instead of the floating
package, and add the missing server entries present in the project-level config:
"playwright", "o3", "linear", "github", and "figma" under "mcpServers" so this
devcontainer becomes a complete global MCP config; preserve the same shape/keys
("type", "command", "args") used by "context7" when adding those servers and
ensure their "command" is "npx" and "args" point to the appropriate package
names (pinned) for each server.
🧹 Nitpick comments (1)
.mcp.json (1)
3-7: Consider pinning@upstash/context7-mcpto a specific version.The package is currently unpinned, which risks silent breakage from upstream changes. Pin to a stable version like
1.0.17to ensure reproducible builds and better supply-chain security.Suggested fix
"context7": { "type": "stdio", "command": "npx", - "args": ["-y", "@upstash/context7-mcp"] + "args": ["-y", "@upstash/context7-mcp@1.0.17"] },
Claude Code レビューこのPRを詳細にレビューしました。以下の観点から評価とフィードバックを提供します。 🚨 重大な問題(Must Fix)1. 既存MCP設定の上書きによる機能退行問題: 影響:
推奨修正案: 参照:
|
| 項目 | 評価 |
|---|---|
| コード品質 | |
| セキュリティ | |
| テストカバレッジ | |
| ドキュメント | ℹ️ 基本的(補強推奨) |
判定: ⛔ 修正が必要 - 問題1(既存MCP設定の上書き)を解決してからマージしてください
🤖 Generated by Claude Sonnet 4.5 via PR review workflow
- CLAUDE.mdに自動トリガー条件を明記 - permissionsにContext7ツールを追加(確認不要化) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ライブラリ・フレームワークのドキュメント参照時に自動トリガーされる スキルを追加。Context7 MCPを使用して最新情報を取得する。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Review: Context7 MCP サーバー追加総合評価✅ 承認可能 - 良い追加機能ですが、1つの重大な問題があります。 🔴 Critical Issueツール名の不一致問題: CLAUDE.mdで使用手順に記載されているツール名が実際のツール名と一致していません。 .claude/CLAUDE.md:131 で使用されているツール名:
.devcontainer/claude-settings.json:235 の実際のツール名:
影響: ドキュメント通りに実行しようとすると、存在しないツールを呼び出すことになり、機能が使えません。 修正方法: CLAUDE.mdの使用手順を以下に修正してください: ### 使用手順
1. `resolve-library-id` でライブラリIDを取得
2. `query-docs` で最新ドキュメントを取得
3. 取得した情報に基づいて回答✅ Code Quality良い点
改善提案1. ドキュメントの充実 (優先度: 中)CLAUDE.mdに追加された内容は良いですが、以下の情報があるとより親切です: ### 制限事項
- 1質問あたり最大3回までの呼び出し制限
- 機密情報(APIキー、パスワード等)をクエリに含めないことこれはMCPツールの使用上の注意として、システムプロンプトに記載されている重要な制約です。 2. Dockerfileのコメント (優先度: 低).devcontainer/Dockerfile:107 に追加された行にコメントがあると、後から見た人にわかりやすいです: # Copy MCP server configuration for Context7
COPY --chown=vscode:vscode .devcontainer/mcp.json /home/vscode/.claude/.mcp.json🔒 Security✅ 問題なし
🧪 Test CoveragePRのTest planにチェックボックスがありますが:
推奨:
⚡ Performance✅ 問題なし
📋 CLAUDE.md準拠チェック
🎯 アクションアイテム必須
推奨
総評Context7 MCPの追加は、ライブラリドキュメント参照を自動化する優れた機能追加です。設定も適切でセキュリティリスクもありません。 ただし、ツール名の不一致は必ず修正してください。これを修正すれば、自信を持って承認できます。 お疲れ様でした! 🚀 |
|
(aside) |
|
Claude finished @keito4's task in 5m 28s —— View job 修正完了 ✅タスク一覧
修正内容レビューで指摘された3つの重大な問題を修正しました: 1. 🔧
|
PR Review: Context7 MCPサーバー追加概要Context7 MCPサーバーをプロジェクトに統合し、ライブラリドキュメントの自動取得機能を追加するPRです。全体的な実装方針は良好ですが、重大なバグと改善すべき点があります。 🚨 Critical Issues1. ツール名の不一致(重大なバグ)場所:
問題: 該当箇所: 影響:
修正方法:
|
Context7はMCPサーバー形式のため、.mcp.jsonでの設定のみに統一。 agent-skills形式(skills.txt)には非対応。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
コードレビュー結果✅ 良い点
|
| 基準 | 状態 | 備考 |
|---|---|---|
| Conventional Commits | ✅ | feat: プレフィックス使用 |
| Diff サイズ | ✅ | 76行追加、0行削除 |
| CI/CD | ✅ | GitGuardian Pass |
| ドキュメント更新 | ツール名の不一致あり | |
| テスト | 手動テストプランのみ(自動テストなし) |
🎯 推奨アクション
- 必須:
.claude/CLAUDE.md:131のツール名を修正(query-docs→get-library-docs) - 推奨: 修正後、Context7ツールの動作確認を実施
- 推奨: PRマージ後、実際の使用例をREADMEやドキュメントに追加
総評
Context7 MCPの追加は有用な機能追加ですが、ドキュメントのツール名不一致は修正が必要です。それ以外の実装は適切で、コード品質基準を満たしています。
📝 Generated by Claude Code Review
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.devcontainer/claude-settings.json:
- Around line 234-235: Replace the obsolete permission entry
"mcp__context7__get-library-docs" with the correct tool name
"mcp__context7__query-docs" to match `@upstash/context7-mcp`@2.1.1; update the
array entry near "mcp__context7__resolve-library-id" so the JSON uses
"mcp__context7__query-docs" instead of the removed "get-library-docs".
| "mcp__context7__resolve-library-id", | ||
| "mcp__context7__get-library-docs", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
@upstash/context7-mcp 2.1.1 tool names query-docs
💡 Result:
For @upstash/context7-mcp v2.1.1, the MCP tool names you can call are:
resolve-library-id(find the Context7libraryIdfor a given library) [1]query-docs(fetch relevant docs/snippets for alibraryIdand a natural-languagequery) [1]
Notes:
- Starting in v2.0.0,
get-library-docswas removed and replaced byquery-docs[2].
Sources: [1] [2]
Update line 235 to use the correct tool name for @upstash/context7-mcp@2.1.1.
Line 235 references get-library-docs, which was removed in v2.0.0 and replaced by query-docs. Update the permission entry to "mcp__context7__query-docs" to match the actual tool exposed by the package.
🤖 Prompt for AI Agents
In @.devcontainer/claude-settings.json around lines 234 - 235, Replace the
obsolete permission entry "mcp__context7__get-library-docs" with the correct
tool name "mcp__context7__query-docs" to match `@upstash/context7-mcp`@2.1.1;
update the array entry near "mcp__context7__resolve-library-id" so the JSON uses
"mcp__context7__query-docs" instead of the removed "get-library-docs".
- intellectronica/agent-skills をskills.txtに追加 - install-skills.shにcontext7のマッピングを追加 - MCP関連の設定を削除(.devcontainer/mcp.json等) - CLAUDE.mdのContext7ガイドラインをスキル用に更新 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7035e21 to
15691db
Compare
コードレビュー結果✅ 全体評価Context7スキルの追加により、Claude Codeが最新のライブラリドキュメントを参照できるようになる有用な変更です。実装は適切で、リポジトリの品質基準を満たしています。 📋 詳細レビュー1. コード品質 ✅良い点:
提案:
2. セキュリティ 🔒確認済み:
注意点:
3. パフォーマンス ⚡影響:
4. テストカバレッジ 🧪現状:
推奨事項: # 以下のテストを実行することを推奨
# 1. DevContainerでのスキルインストール確認
npx skills list -g | grep context7
# 2. Context7スキルの動作確認
# Claudeに「Prismaのマイグレーション方法は?」と質問して、
# Context7スキルが呼び出されることを確認5. ドキュメント 📚良い点:
改善提案:
6. CLAUDE.md準拠性 ✅確認済み:
🐛 潜在的な問題問題1: CLAUDE.mdのセクション構造の不整合場所: 問題2: 使用手順の記述が誤解を招く可能性場所: 🎯 修正推奨事項(優先度順)高優先度なし(CI は全て PASS しており、機能的な問題はありません) 中優先度
低優先度
✨ 総合評価承認推奨: ✅ はい(軽微な修正を推奨しますが、現状でもマージ可能) 理由:
次のステップ:
🤖 Generated by Claude Code Review |
スキルのSKILL.mdが自動的に読み込まれるため不要 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request Review概要Context7スキル(intellectronica/agent-skills)をスキルインストーラーに追加する変更です。全体的に良好な実装ですが、いくつかの改善提案があります。 ✅ 良い点
🔍 改善提案1. Test Planの実行確認PR本文のTest Planにチェックボックスがありますが、実際のテスト結果が記載されていません: ## Test plan
- [ ] DevContainerビルド時にContext7スキルがインストールされることを確認
- [ ] `npx skills add intellectronica/agent-skills` が正常に動作することを確認推奨事項:
2. スキルの説明の精度向上
# === Context7 ===
# ライブラリ・フレームワークの最新ドキュメント取得提案:
3. 潜在的なエッジケース
"intellectronica/agent-skills")
check_skills=("context7")
;;確認事項:
4. ドキュメント更新提案:
🔒 セキュリティ・パフォーマンス
📋 チェックリスト(CLAUDE.md準拠)
🎯 マージ前のアクション
総評全体的に良好な実装です。 既存のパターンに従っており、CIも通過しています。Test Planの実行確認とドキュメントの充実により、さらに品質が向上します。 マージ判断は、上記「マージ前のアクション」の必須項目完了後を推奨します。 📝 Review by Claude Code - CLAUDE.md準拠 |
|
🎉 This PR is included in version 1.72.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
変更内容
.claude/skills/skills.txtintellectronica/agent-skillsを追加script/install-skills.shTest plan
npx skills add intellectronica/agent-skillsが正常に動作することを確認🤖 Generated with Claude Code