From 0f3674a5c2a46e3253e6f7f494e1221c6fe07e6d Mon Sep 17 00:00:00 2001 From: Shivam Gawali Date: Sat, 25 Oct 2025 20:08:58 +0530 Subject: [PATCH 1/3] feat: add PR Impact Analyzer prompt Intermediate prompt that analyzes pull requests by combining GitHub data fetching with Developer code analysis to generate structured impact reports with risk assessment and actionable review priorities. Signed-off-by: Shivam Gawali --- .../data/prompts/pr-impact-analyzer.json | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json diff --git a/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json new file mode 100644 index 000000000000..d03bb12e61cb --- /dev/null +++ b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json @@ -0,0 +1,29 @@ +{ + "id": "github-dev-pr-impact-analyzer", + "title": "PR Impact Analysis Report", + "description": "Analyzes pull requests using GitHub to fetch PR data and Developer to examine code changes, generating structured impact reports with risk assessment and review priorities", + "category": "technical", + "job": "engineering", + "example_prompt": "Analyze PR #247 in myorg/backend-api. Use GitHub to fetch the PR details, diff, and commits. Then use Developer to analyze the code changes and identify: (1) what systems are affected, (2) potential risks or breaking changes, (3) missing tests, and (4) what reviewers should prioritize. Format as a structured report with actionable items.", + "example_result": "# PR #247 Impact Analysis: Rate Limiting Implementation\n\n## Extension Integration\n1. **GitHub Extension** → Fetched PR metadata, file diffs, and commit history\n2. **Developer Extension** → Analyzed code changes, dependencies, and test coverage\n\n---\n\n## 📊 Quick Summary\n- **Files Changed:** 12 (+456 / -89 lines)\n- **Author:** @sarah-dev\n- **Commits:** 8\n- **Overall Risk:** 🟡 MEDIUM\n\n## 🎯 Systems Affected\n\n### Critical Impact\n**Authentication System** 🔴 HIGH RISK\n- Files: `src/auth/middleware.ts`, `src/auth/rate-limiter.ts`\n- Impact: All 40+ authenticated endpoints\n- Risk: Core auth flow modification\n\n**Database Schema** 🟡 MEDIUM RISK\n- Files: `migrations/2024_add_rate_limit_tracking.sql`\n- Impact: New table, affects backups\n- Risk: Requires migration coordination\n\n### Moderate Impact\n**API Responses** 🟢 LOW RISK\n- Files: `src/utils/response-formatter.ts`\n- Impact: New 429 status code handling\n- Risk: Isolated, backward compatible\n\n## ⚠️ Risks Detected\n\n### 🔴 Must Fix Before Merge\n1. **Redis Connection Pool**\n - Issue: No connection pooling config\n - Risk: Connection exhaustion under load\n - Fix: Add `maxConnections` in `src/config/redis.ts`\n\n2. **Missing Tests**\n - Issue: `rate-limiter.ts` has no test file\n - Risk: Untested edge cases\n - Fix: Add `__tests__/rate-limiter.test.ts`\n\n### 🟡 Should Address\n3. **Hardcoded Limits**\n - Issue: Rate limits in code (line 45)\n - Risk: Can't adjust per environment\n - Fix: Move to `.env` config\n\n4. **API Contract**\n - Issue: New `X-RateLimit-*` headers not documented\n - Risk: Client compatibility\n - Fix: Update OpenAPI spec\n\n## ✅ What's Good\n- Clean module separation\n- Comprehensive logging\n- Redis fallback handling\n\n## 📋 Review Checklist\n\n### Before Approval\n- [ ] Redis pool configuration added\n- [ ] Integration tests for rate limiter\n- [ ] Config moved to environment variables\n- [ ] API docs updated with new headers\n\n### Security Review\n- [ ] Rate limit bypass logic for admins\n- [ ] Error messages don't leak sensitive data\n- [ ] Database migration rollback tested\n\n### Performance Review\n- [ ] Load test with concurrent requests\n- [ ] Redis failover scenario tested\n- [ ] Monitor rate limit metrics in dashboard\n\n## 🔗 Dependencies\n```diff\n+ redis@4.6.7\n+ ioredis@5.3.2\n express@4.18.2 → 4.19.0 (security patch)\n```\n\n## 💡 Action Items\n\n**For Author (@sarah-dev):**\n1. Add integration tests (high priority)\n2. Configure Redis connection pool\n3. Move rate limits to environment config\n4. Update API documentation\n\n**For Reviewers:**\n- @backend-lead: Security & auth flow review (30-45 min)\n- @devops: Redis infrastructure & migration (20 min)\n- @qa-team: Test coverage verification (15 min)\n\n**Estimated Review Time:** 45-60 minutes\n\n---\n**Analysis Method:**\n- GitHub extension fetched PR data, diffs, and commit metadata\n- Developer extension analyzed code structure, dependencies, and patterns\n- Cross-referenced changes against codebase architecture", + "extensions": [ + { + "name": "GitHub", + "command": "npx -y @modelcontextprotocol/server-github", + "is_builtin": false, + "environmentVariables": [ + { + "name": "GITHUB_PERSONAL_ACCESS_TOKEN", + "description": "", + "required": true + } + ] + }, + { + "name": "Developer", + "command": "developer", + "is_builtin": true, + "environmentVariables": [] + } + ] +} From 4d139d8e1cb5105cfce65449f94d7374046d7f3a Mon Sep 17 00:00:00 2001 From: Shivam Gawali Date: Sun, 26 Oct 2025 21:12:55 +0530 Subject: [PATCH 2/3] fix: update to official GitHub MCP server Changed from archived @modelcontextprotocol/server-github to the official @github/github-mcp-server as recommended by maintainer. Signed-off-by: Shivam Gawali --- .../pages/prompt-library/data/prompts/pr-impact-analyzer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json index d03bb12e61cb..e744defede62 100644 --- a/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json +++ b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json @@ -9,7 +9,7 @@ "extensions": [ { "name": "GitHub", - "command": "npx -y @modelcontextprotocol/server-github", + "command": "npx -y @github/github-mcp-server", "is_builtin": false, "environmentVariables": [ { From ad7cead1b76019a8ca51fe05cb6d24d11832f40e Mon Sep 17 00:00:00 2001 From: Shivam Gawali Date: Sun, 26 Oct 2025 21:18:05 +0530 Subject: [PATCH 3/3] fix: use official Docker-based GitHub MCP server Changed from npx to Docker-based installation using ghcr.io/github/github-mcp-server as documented in the official GitHub MCP server repository. This follows the maintainer's recommendation to use the official MCP server instead of the archived one. Signed-off-by: Shivam Gawali --- .../data/prompts/pr-impact-analyzer.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json index e744defede62..cdf662712253 100644 --- a/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json +++ b/documentation/src/pages/prompt-library/data/prompts/pr-impact-analyzer.json @@ -9,7 +9,15 @@ "extensions": [ { "name": "GitHub", - "command": "npx -y @github/github-mcp-server", + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "-e", + "GITHUB_PERSONAL_ACCESS_TOKEN", + "ghcr.io/github/github-mcp-server" + ], "is_builtin": false, "environmentVariables": [ {