xiaohongshu
xiaohongshu
gh-pr-auto-detector
Automatically detects GitHub PR mentions (URLs, #123, owner/repo#123) and intelligently fetches condensed context via gh-pr-analyzer subagent when needed for the conversation
Full skill instructions
You have access to a skill that seamlessly integrates GitHub Pull Request context into conversations without polluting the main context window with huge PR payloads.
Enhance user conversations by:
Full GitHub URLs:
https://github.com/[owner]/[repo]/pull/[number]https://github.com/anthropics/claude-code/pull/123https://github.com/owner/repo/pull/456Short Form (owner/repo#number):
[owner]/[repo]#\d+anthropics/claude-code#123, owner/repo#456Hash-only (#number):
#\d+#123, #456Explicit Mentions:
Multiple PRs:
Direct questions:
Review requests:
Status checks:
Implementation requests:
Problem-solving:
Comparisons:
Past tense (already done):
Passive listing:
Technical identifiers:
Casual reference:
Already fetched this session:
Based on user's question, determine which PR aspects to fetch:
include_reviews: true, include_ci: trueinclude_reviews: true, include_ci: falseinclude_reviews: false, include_ci: trueinclude_reviews: false, include_ci: falseLook for GitHub PR patterns:
For full URLs:
owner/repo#numberFor owner/repo#number:
For #number only:
For each detected PR, ask yourself:
Does the user's request require understanding this PR?
Is this just a passing mention?
Have I already fetched this PR?
Task tool calls with "gh-pr-analyzer"Determine what aspects the user needs:
Full context signals:
Reviews focus signals:
CI focus signals:
Default: When unclear, fetch full context (reviews + CI)
When you determine context IS needed:
First, acknowledge detection:
📋 **[PR Auto-Detector]** Detected PR reference: [owner/repo#number or #number]
⏳ Fetching PR details...
Use the Task tool to spawn gh-pr-analyzer subagent:
Tool: Task
Parameters:
prompt: "Fetch and summarize GitHub PR: [owner/repo#number or URL]
Options: include_reviews=[true/false], include_ci=[true/false]"
subagent_type: "schovi:gh-pr-auto-detector:gh-pr-analyzer"
description: "Fetching GitHub PR context"
Examples:
Full context (default):
prompt: "Fetch and summarize GitHub PR: anthropics/claude-code#123"
Reviews only:
prompt: "Fetch and summarize GitHub PR: anthropics/claude-code#123
Options: include_reviews=true, include_ci=false"
CI only:
prompt: "Fetch and summarize GitHub PR: https://github.com/owner/repo/pull/456
Options: include_reviews=false, include_ci=true"
CRITICAL formatting rules:
owner/repo#number OR full URLWhat you'll receive:
The gh-pr-analyzer subagent will return a structured summary (~800-1000 tokens) with visual wrappers:
╭─────────────────────────────────────╮
│ 🔗 PR ANALYZER │
╰─────────────────────────────────────╯
# GitHub PR Summary: owner/repo#123
## Core Information
- PR: #123 - Title
- Author: username
- Status: open | merged | closed
- Base: main ← Head: feature-branch
- URL: https://github.com/owner/repo/pull/123
## Description
[Condensed description, max 500 chars]
## Code Changes
- Files changed: 15 (+250, -100)
- Key files: [Top 5 files by changes]
## CI/CD Status (if requested)
- Overall: ✅ passing | ❌ failing | ⏳ pending
- Failed checks: [Details if any]
## Reviews (if requested)
- Review decision: APPROVED | CHANGES_REQUESTED | PENDING
- Latest reviews: [Max 3 most recent]
- Key comments: [Max 5 significant comments]
## Analysis Notes
[Subagent's assessment]
After receiving the summary, acknowledge completion:
✅ **[PR Auto-Detector]** PR details fetched successfully
Integrate the summary information into your response:
Acknowledge you fetched it:
"I've fetched PR #123 details..." "Based on the pull request..." "Looking at anthropics/claude-code#123..."
Use the context:
Stay concise:
If user mentions multiple PRs (e.g., "Compare #123 and #456"):
Prioritize:
Fetch sequentially:
1. Spawn subagent for #123
2. Wait for response
3. Spawn subagent for #456
4. Wait for response
5. Use both summaries for comparison
Limit:
Step 1: Check conversation history
Step 2: Check current working directory
git remote get-url originowner/repo#numberStep 3: Ask user if context unclear
"I see you mentioned #123. Which repository is this PR in? (e.g., owner/repo#123)"
User: "What's #123 about?"
Your process:
/Users/schovi/productboard/frontendgit remote get-url originhttps://github.com/productboard/frontend.git → productboard/frontendproductboard/frontend#123Track what you've fetched:
When you fetch a PR, remember it for this session:
How to check:
Benefits:
Re-fetch scenarios: When to fetch again even if already fetched:
Respond to user:
"I couldn't fetch #123 - it might not exist or you may not have access. Can you verify the PR number and repository?"
Possible reasons:
Respond to user:
"You mentioned #123, but I need the repository. Please specify as owner/repo#123 or provide a full GitHub URL."
Your action:
Respond to user:
"I encountered an error fetching the PR. Can you provide the key details about this pull request?"
Continue conversation:
gh CLI not authenticated:Respond to user:
"GitHub CLI (
gh) is not authenticated. Please rungh auth loginto enable PR fetching."
Fallback:
Respond to user:
"Fetching PR #123 is taking longer than expected. While that completes, can you tell me what specific aspect you need help with?"
Proceed in parallel:
If user explicitly runs a command that fetches PRs:
✅ Let the command handle PR fetching
✅ The command will:
✅ Your role:
If user casually mentions PRs in other contexts:
✅ Your skill activates
Understand the architecture:
You (Main Claude with Skill)
↓ detect PR mention
↓ evaluate context need
↓ classify intent (reviews/CI/full)
↓ determine repository context
↓ spawn subagent via Task tool
↓
gh-pr-analyzer Subagent (Isolated Context)
↓ fetches huge PR payload via gh CLI
↓ analyzes and extracts essence
↓ burns tokens privately
↓ returns 800-1000 token summary
↓
You receive clean summary
↓ integrate into response
↓ main context stays clean!
Your responsibilities:
gh-pr-analyzer subagent's responsibilities:
Separation of concerns = clean architecture
User: "What is anthropics/claude-code#123 about?"
Your Process:
Your Response:
📋 [PR Auto-Detector] Detected PR reference: anthropics/claude-code#123 ⏳ Fetching PR details...
[After subagent returns]
✅ [PR Auto-Detector] PR details fetched successfully
"I've fetched anthropics/claude-code#123. This PR adds support for MCP servers in Claude Code. The PR includes 15 file changes (+250, -100 lines), primarily in the server integration layer. The CI is passing and the PR has been approved by 2 reviewers. Based on the description..."
User: "Did the tests pass on #456?"
Your Process:
productboard/frontendproductboard/frontend#456Your Response:
📋 [PR Auto-Detector] Detected PR reference: #456 ⏳ Resolving repository context and fetching CI status...
[After subagent returns]
✅ [PR Auto-Detector] CI status fetched successfully
"I've checked the CI status for productboard/frontend#456. The build is currently failing - the 'test-suite' check failed with 3 test errors in the authentication module. The linter and type checks passed successfully. Here are the failing tests..."
User: "Review https://github.com/owner/repo/pull/789"
Your Process:
Your Response:
📋 [PR Auto-Detector] Detected PR reference: https://github.com/owner/repo/pull/789 ⏳ Fetching full PR context for review...
[After subagent returns]
✅ [PR Auto-Detector] PR details fetched successfully
"I've reviewed owner/repo#789. This PR refactors the authentication flow to use JWT tokens. Here's my analysis:
Code Changes: The PR modifies 8 files, primarily in the auth/ directory. The changes look well-structured and include comprehensive tests.
CI Status: All checks are passing ✅
Existing Reviews: One reviewer requested changes regarding error handling in the token refresh logic. I agree with that feedback.
Additional Observations: [detailed review feedback]..."
User: "I merged #123 yesterday, now working on #124"
Your Process:
Your Response (if just informing):
"Great progress on #123! What would you like help with regarding #124?" [Don't fetch either PR yet - wait for user to ask specific question]
Your Response (if asking for help):
"Great! Now for #124, let me fetch the details..." [Fetch #124 only, with appropriate focus]
User: "Compare the approaches in #123 and anthropics/claude-code#456"
Your Process:
productboard/frontendproductboard/frontend#123 and anthropics/claude-code#456Your Response:
📋 [PR Auto-Detector] Detected PR references: #123, anthropics/claude-code#456 ⏳ Fetching both PRs for comparison...
[After first subagent returns] ✅ productboard/frontend#123 fetched ⏳ Fetching anthropics/claude-code#456...
[After second subagent returns] ✅ anthropics/claude-code#456 fetched
"productboard/frontend#123 implements authentication using session cookies, while anthropics/claude-code#456 uses JWT tokens. Key differences:
#123 (session cookies):
- Pros: [analysis]
- Cons: [analysis]
anthropics/claude-code#456 (JWT):
- Pros: [analysis]
- Cons: [analysis]
For your use case, I'd recommend [recommendation with rationale]..."
User: "The PR-123 endpoint is returning 500 errors"
Your Process:
Your Response:
"Let me help debug the PR-123 endpoint. Can you share the error logs or stack trace?" [No PR fetch - "PR-123" is just an endpoint name here]
User (earlier): "Review #123" You: [Fetched anthropics/claude-code#123, provided review]
User (later): "Can you also check if #123 affects the authentication flow?"
Your Process:
Your Response:
"Based on the #123 PR I reviewed earlier (adds MCP server support), let me analyze how it interacts with the authentication flow... [analysis based on previously fetched context]" [No redundant fetch - reused previous context]
User: "What's #123 about?"
Your Process (no git context available):
Your Response:
"You mentioned #123 - which repository is this PR in? Please specify as
owner/repo#123or provide the full GitHub URL." [Wait for user to clarify before fetching]
Your goal: Seamlessly enhance conversations with GitHub PR context when needed.
Balance:
Trust the architecture:
Activation is automatic:
Good luck making GitHub PR integration seamless! 🚀
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience