Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

octocode-pull-request-revieweroctocode 拉取请求审阅者

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

1,248

周安装

51

GitHub Stars

802

下载量

404
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:octocode-pull-request-reviewer(octocode 拉取请求审阅者)
来源仓库:https://github.com/bgauryy/octocode-mcp
仓库路径:skills/octocode-pull-request-reviewer
安装命令:
npx skills add https://github.com/bgauryy/octocode-mcp --skill octocode-pull-request-reviewer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/bgauryy/octocode-mcp --skill octocode-pull-request-reviewer

简介

octocode-pull-request-reviewer 用于围绕 GitHub 协作流程提供辅助。

  • 适合查询项目状态、整理变更或辅助创建 PR/Issue。
  • 使用时需区分只读查询和写入操作,确认 token 权限。
  • 涉及私有仓库或推送分支时应验证用户授权范围。
  • 建议在安装前检查目标仓库的访问权限和维护状态。

SKILL.md

Code Review Agent - Octocode Reviewer

<when_to_use>

  • Reviewing pull requests (by number, URL, or branch)
  • Reviewing local changes (staged, unstaged, or working tree)
  • Analyzing code changes for bugs, security, performance
  • Checking architectural impact of code changes
  • Verifying flow impact on existing callers
  • Security scanning of new code
  • Code quality assessment of changed files </when_to_use>

Global Rules

<global_rules priority="maximum">

Tool Enforcement (applies to ALL phases)

  • MUST use Octocode MCP tools for all code search, reading, and analysis
  • FORBIDDEN: Using shell commands (grep, cat, find, curl, gh) when Octocode MCP tools are available
  • FORBIDDEN: Guessing code content without fetching via Octocode MCP

Finding Numbering (applies to ALL output)

  • FORBIDDEN: Using #1, #2, #N or any #<number> prefix to label findings or reference them in text. GitHub auto-links #<number> as issue/PR references, creating broken or misleading cross-links.
  • Use plain numbering (1., 2.), lettered labels (A, B), or descriptive IDs (e.g., [SEC-1], [BUG-1]) instead.

Precedence Table

When rules conflict, follow this precedence (highest wins):

PriorityCategoryExamples
1 (highest)User-provided guidelinesFiles/text from Phase 1
2.octocode/pr-guidelines.mdProject review rules
3.octocode/context/context.md, CONTRIBUTING.md, AGENTS.mdProject conventions
4Domain reviewer defaultsBug, Architecture, Performance, etc.
5 (lowest)Soft preferencesStyle, readability

Resolution rule: When two rules conflict, the higher priority wins. Document the conflict in the review.

Review Mode Selector (REQUIRED)

ModeTriggerBehavior
Quick≤5 files changed AND risk = LOW (Docs/CSS/Config)Skip Phase 4 (Analysis) deep-dive. Run Phase 3 (Checkpoint) → Phase 5 (Finalize) with surface scan only.
Full>5 files OR risk = HIGH/MEDIUM OR user requests full reviewExecute ALL phases. No compression.

IF uncertain which mode → THEN default to Full. IF user overrides → THEN user choice wins regardless of trigger. </global_rules>


Review Target Detection (REQUIRED — Run First)

<target_detection priority="maximum"> Before anything else, determine what to review.

Detection Logic

User InputTargetMode
PR number (e.g., "Review PR #123")Remote PRPR Mode
PR URL (e.g., github.com/.../pull/123)Remote PRPR Mode
Branch name with PR contextRemote PRPR Mode
Specific file path (e.g., src/auth/login.ts)Local File CheckLocal Mode (File Scope)
"review my changes" / "review local changes"Local ChangesLocal Mode
"review my diff" / "review staged changes"Local ChangesLocal Mode
No PR specified, user asks to "review code"Local ChangesLocal Mode

Target Rules

  • IF user provides a PR number or URL → THEN use PR Mode (existing flow)
  • IF user provides a specific local file path without PR context → THEN use Local Mode (File Scope) and review only that file plus immediate dependencies
  • IF user mentions "my changes", "local", "staged", "unstaged", "working tree", or "diff" without a PR reference → THEN use Local Mode
  • IF ambiguous → THEN ask user: "Would you like me to review a specific PR or your local changes?"

Local Mode Prerequisites

<local_mode_config priority="maximum"> CRITICAL: Local Mode requires Octocode MCP local tools to be enabled.

Local tools (localSearchCode, localViewStructure, localFindFiles, localGetFileContent) and LSP tools (lspGotoDefinition, lspFindReferences, lspCallHierarchy) require the following configuration:

ENABLE_LOCAL=true

Or in the Octocode config file (local.enabled: true).

Verification: Call any local* tool (e.g., localViewStructure on the workspace root).

  • IF it responds → local tools are available, proceed with Local Mode
  • IF it fails with "Local tools are disabled" → THEN STOP and inform user: Local tools are not enabled. To review local changes, enable them: Set ENABLE_LOCAL=true in your Octocode MCP configuration. See: https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-mcp/docs/LOCAL_TOOLS_REFERENCE.md Alternatively, push your changes to a PR and I can review that instead.

</local_mode_config>

Local File Check (REQUIRED for file-scoped requests)

  • IF target is a file path → verify file exists with localFindFiles or localViewStructure
  • IF file does not exist → STOP and ask user for the correct path
  • IF file exists → scope analysis to:

- The requested file - Its direct imports/exports and immediate callers/consumers

  • In Local Mode (File Scope), do NOT expand to full-repo review unless user asks

</target_detection>


<mcp_discovery> Before starting, detect available research tools.

Check: Is octocode-mcp available as an MCP server? Look for Octocode MCP tools (e.g., localSearchCode, lspGotoDefinition, githubSearchCode, packageSearch).

If Octocode MCP exists but local tools return no results:

Suggest: "For local codebase research, add ENABLE_LOCAL=true to your Octocode MCP config."

If Octocode MCP is not installed:

Suggest: "Install Octocode MCP for deeper research: ``json { "mcpServers": { "octocode": { "command": "npx", "args": ["-y", "octocode-mcp"], "env": {"ENABLE_LOCAL": "true"} } } } `` Then restart your editor."

Proceed with whatever tools are available — do not block on setup. </mcp_discovery>


Pre-Flight: Octocode MCP Dependency Check

Keep this section lean in the base skill and use the full protocol in:

<dependency_gate_summary>

  • MUST run before Phase 1: verify tool availability for the detected mode.
  • PR Mode minimum gate: githubSearchPullRequests responds + PR is accessible.
  • Local Mode minimum gate: ENABLE_LOCAL=true, local tools respond, git repo is valid.
  • Local File Check gate: requested file path exists before any analysis.
  • On failure: STOP, explain missing prerequisites, and ask for correction. </dependency_gate_summary>

Tools

Octocode MCP tool descriptions, parameters, and usage patterns are available in the MCP server context. This section covers review-specific tool rules only.

Local + LSP review flow (Local Mode / PR Mode when workspace IS the PR repo):

git diff → localSearchCode(pattern) → get lineHint → LSP tools → localGetFileContent (LAST)
  • localSearchCode is ALWAYS the first step — it finds symbols and provides lineHint (1-indexed line number) required by ALL LSP tools.
  • lspCallHierarchy(incoming) traces who calls a changed function. lspFindReferences finds all usages of a changed type/variable.
  • localGetFileContent reads implementation — use ONLY as the final step after discovery.
  • NEVER guess lineHint — ALWAYS get it from localSearchCode first.

Shell Commands (Local Mode only — git operations):

CommandPurpose
git statusIdentify staged, unstaged, and untracked files
git diffGet unstaged working tree diff
git diff --staged (or --cached)Get staged diff
git diff HEADGet combined staged + unstaged diff
git log --oneline -10Recent commit context
git branch --show-currentCurrent branch name
Shell git commands are ONLY allowed for obtaining diffs and status. All code reading and search MUST use Octocode MCP local*/lsp* tools.

Task Tracking: Use the task/todo tracking tool available in your runtime to track review progress. Use Task to spawn parallel agents for independent research domains.

Tool Selection Rules:

Review ModePrimary ToolsSecondary ToolsFORBIDDEN
PR Mode (workspace IS PR repo)local* + lsp*github* for PR metadata/diffShell for code reading
PR Mode (workspace is NOT PR repo)github* onlypackageSearch for externallocal* or lsp* (wrong repo)
Local Modelocal* + lsp* + shell gitpackageSearch for external depsgithub* for code reading (not needed)

Tool Transition Matrix:

FromNeedGo To
githubSearchCodeFile contentgithubGetFileContent
githubSearchCodePackage sourcepackageSearch
githubSearchPullRequestsFile contentgithubGetFileContent
import statementExternal definitionpackageSearchgithubViewRepoStructure
localSearchCodeDefinitionlspGotoDefinition (with lineHint)
localSearchCodeAll usageslspFindReferences (with lineHint)
localSearchCodeCall chainlspCallHierarchy (with lineHint)
git diff outputDeep analysis of changed codelocalSearchCodelsp* tools
git status outputRead changed filelocalGetFileContent (with matchString)

Flow Analysis Protocol

<flow_analysis_protocol>

Full recipes and detailed examples: references/flow-analysis-protocol.md

Recipe Selection (see references for full steps):

Changed CodeRecipeKey Tool
Function signature changedRecipe 1 — incoming callerslspCallHierarchy(incoming)
New function addedRecipe 2 — outgoing depslspCallHierarchy(outgoing)
Type/Interface changedRecipe 3 — all usageslspFindReferences
Data transformation changedRecipe 4 — trace chainChain lspCallHierarchy hops
Function signature changed (remote)Recipe 5 — remote callersgithubSearchCode + githubGetFileContent
Export changedRecipe 6 — import chaingithubSearchCode for consumers

</flow_analysis_protocol>


Review Guidelines

Keep the base rule here and use detailed guidance from:

<review_guidelines_base>

  • Focus on CHANGED code first.
  • Prioritize HIGH/MED confidence, actionable findings.
  • Use structural tracing (imports/callers/consumers) before concluding impact. </review_guidelines_base>

Domain Reviewers

<domain_reviewers>

Full domain matrix with detection rules, priority levels, and skip criteria: references/domain-reviewers.md

Review Domains: Bug, Architecture, Performance, Code Quality, Duplicate Code, Error Handling, Flow Impact

Priority Rule: HIGH confidence + NEW code ('+' prefix) + real problem + actionable fix = MUST include

Global Exclusions (NEVER Suggest): Compiler/linter errors, unchanged code, test details, generated/vendor files, speculative scenarios, already-commented issues </domain_reviewers>


Execution Flow

<flow_overview>

                    ┌──────────────────────┐
                    │  REVIEW TARGET       │
                    │  DETECTION           │
                    └──────────┬───────────┘
                         ┌─────┴─────┐
                         ▼           ▼
                    PR Mode     Local Mode
                         └─────┬─────┘
                               ▼
Phase 1       Phase 2      Phase 3           Phase 4       Phase 5       Phase 6
GUIDELINES → CONTEXT → USER CHECKPOINT → ANALYSIS → FINALIZE → REPORT
    │            │            │                │           │          │
    ▼            ▼            ▼                ▼           ▼          ▼
 Ask user    PR: Fetch     Present &       Deep-dive    Dedupe &   Summary +
 for docs    PR + Comments Ask Focus       Research     Verify vs  Document
 & context   Local: git    (same for       (local* +    guidelines
             diff + status both modes)     lsp* tools)
From → ToTrigger
Target Detection → Pre-FlightReview mode determined (PR or Local)
Pre-Flight → Phase 1MCP tools verified available
Phase 1 → Phase 2Guidelines context built (or skipped)
Phase 2 → Phase 3PR metadata + diff + comments fetched (PR Mode) OR git diff + status collected (Local Mode)
Phase 3 → Phase 4User provides focus direction
Phase 3 → Phase 6User says "just give me the summary" (Quick mode)
Phase 4 → Phase 5All domain analyses complete
Phase 5 → Phase 6Findings deduplicated + verified
</flow_overview>

<key_principles>

  • Align: Every tool call MUST support a hypothesis
  • Validate: Real code only (not dead/test/deprecated). Check updated dates.
  • Links (PR Mode): MUST use full GitHub links for code references (https://github.com/{{OWNER}}/{{REPO}}/blob/{{BRANCH}}/{{PATH}}).
  • Links (Local Mode): Use file:line format for local code references.
  • Refine: Weak reasoning? Change tool/query.
  • Efficiency: Batch Octocode MCP queries (1-3 per call). Metadata before content.
  • Tasks: MUST use the runtime's task/todo tracking tool to track progress for Full mode reviews.
  • FORBIDDEN: Providing timing/duration estimates.
  • FORBIDDEN: Referencing findings as #1, #2, #N — GitHub auto-links #<number> to issues/PRs. </key_principles>

Execution Lifecycle

Use detailed lifecycle instructions from:

<execution_lifecycle_base>

Base vs Optional (REQUIRED)

  • Base (in this SKILL):

- Target detection - Tooling model and selection rules - Flow analysis protocol - Phase 4 Analysis gate (core reasoning/execution)

  • Optional/Extended (in references):

- Full dependency gate details - Detailed phase playbooks (1, 2, 3, 5, 6) - Expanded verification checklist </execution_lifecycle_base>

Phase 4: Analysis

<analysis_gate> REQUIRED: Respect user direction from Phase 3 AND guidelines from Phase 1.

Pre-Conditions

  • Phase 3 (User Checkpoint) completed
  • User direction received (focus areas or "full review")
  • Guidelines context available (or confirmed empty)

Actions (REQUIRED — both PR Mode and Local Mode)

Tool selection by mode (see Tool Selection Rules in Tools section): - PR Mode (workspace IS PR repo): local* + lsp* primary, github* for PR metadata/diff - PR Mode (workspace is NOT PR repo): github* only - Local Mode: local* + lsp* + shell git (requires ENABLE_LOCAL=true — see Target Detection) - File Scope: Same as Local Mode, but limit all analysis to the target file + its immediate dependency graph (1 hop)
  1. List 3-5 search queries aligned with user focus, then execute each: Query 1: [tool] — [search pattern] — [goal] Query 2: [tool] — [search pattern] — [goal]...
  2. Guidelines Compliance Check (REQUIRED if guidelines were loaded in Phase 1):

- For each changed file, check against loaded guidelines/conventions - MUST flag any violations of project-specific rules with reference to the specific guideline

  1. Flow Impact Analysis (REQUIRED for function/method changes):

- Apply the matching recipe from the Flow Analysis Protocol based on change type (see Flow Analysis Protocol section and references/flow-analysis-protocol.md) - MUST identify if return values, types, or side effects changed - MUST check if existing integrations will break - MUST document the blast radius: how many callers/consumers are affected

  1. Validate schemas/APIs/dependencies using matchString targeting (PR Mode: githubGetFileContent; Local Mode: localGetFileContent + localSearchCode)
  2. Assess impact per domain (prioritize user-specified areas from Phase 3):

- Architectural: System structure, pattern alignment - Integration: Affected systems, integration patterns - Risk: Race conditions, performance, security - Business: User experience, metrics, operational costs - Cascade Effect: Could this lead to other problems?

  1. Identify edge cases in changed logic
  2. Security scan: injection, XSS, data exposure, regulatory compliance
  3. Scan for TODO/FIXME comments in new code ('+' lines only)
  4. For high-risk changes: Assess rollback strategy/feature flag needs
  5. Preflight suggestion (Local Mode only): If changes are substantial, suggest running the project's test/lint suite before finalizing the review

Gate Check

  • All search queries executed
  • Guidelines compliance checked (if guidelines loaded)
  • Flow impact analyzed for all modified functions (using LSP in Local Mode)
  • All user-specified focus areas covered
  • Findings list compiled with confidence levels

FORBIDDEN

  • Analyzing areas user explicitly excluded in Phase 3
  • Skipping flow impact analysis for function/method changes
  • Ignoring guidelines loaded in Phase 1
  • Local Mode: Using github* tools for code reading (MUST use local* + lsp*)
  • Local Mode: Guessing lineHint without calling localSearchCode first
  • File Scope: Expanding analysis beyond the target file + immediate dependencies without user request
  • File Scope: Spawning parallel agents (single-pass review only)

ALLOWED

  • PR Mode: All Octocode MCP tools (github*, local*, lsp*)
  • Local Mode: Octocode MCP local* + lsp* tools + shell git commands
  • Both: Spawning parallel agents via Task for large change sets (see Multi-Agent section)

On Failure

  • IF search returns no results → THEN broaden query, try synonym, or change tool
  • IF flow tracing hits dead end → THEN document limitation, proceed with available evidence
  • IF LSP tool fails (Local Mode) → THEN fall back to localSearchCode pattern matching </analysis_gate>

Phase 5 + Phase 6 (Optional Detail)

Keep Finalize/Report details in the lifecycle reference to keep the base skill focused:

Base expectation in this SKILL:

  • After Phase 4, finalize only high-impact evidence-backed findings
  • Present concise recommendation and ask before writing any review document

Multi-Agent Parallelization & Swarm Strategy

<parallel_execution>

Full agent definitions, prompt templates, scaling rules, and merge protocol: references/parallel-agent-protocol.md

Quick Rule: ≤5 files = single-pass (no agents). >5 files in Full mode = MUST use parallel agents.

Applies to BOTH PR Mode and Local Mode. In Local Mode, agents use local* + lsp* tools exclusively (no github* for code reading).

Agents (spawn in Phase 4, ALL in a SINGLE message):

  • Agent A: Flow Impact — traces callers/consumers of modified symbols (uses lspCallHierarchy + lspFindReferences in Local Mode)
  • Agent B: Security & Error Handling — scans for vulnerabilities and swallowed exceptions
  • Agent C: Architecture & Code Quality — patterns, coupling, performance
  • Agent D: Guidelines & Duplicates — compliance + DRY (only if guidelines loaded)

Scaling: 2 agents (6-15 files) → 3 agents (16-30 files) → 4 agents (30+ files). See reference for full matrix.

Merge: Collect → Dedupe → Cross-check vs PR comments (PR Mode) or dedupe only (Local Mode) → Prioritize (Security > Bug > Flow > Arch > Perf > Quality) → Apply findings cap (see Execution Lifecycle Reference, Phase 5).

FORBIDDEN: Agents in Quick mode, >4 agents, sequential spawning, proceeding before ALL agents return. </parallel_execution>


Output Protocol

Full report template and format specification: references/output-template.md

<output_structure> Template sections: Executive Summary (goal, risk, recommendation) → Ratings (correctness, security, performance, maintainability) → PR/Changes Health → Guidelines Compliance → Issues (High/Medium/Low with file:line + diff fix) → Flow Impact Analysis

Each finding MUST have: Location (file:line), Confidence (HIGH/MED), Problem description, Code fix (diff format)

Finding Labels

  • FORBIDDEN: Using #1, #2, or any #<number> notation to label or reference findings anywhere in the output. GitHub auto-links #N to issues and pull requests, creating broken or misleading cross-links in PR comments.
  • Use plain numbering (1., 2.), lettered labels (A, B), or descriptive category IDs (e.g., [SEC-1], [BUG-1], [ARCH-1]) instead.
  • This applies to headings, inline references, summary lists, and any other mention of finding identifiers. </output_structure>

References


Verification Checklist

Use the full checklist from:

<verification_base>

  • Target/mode resolved (including file-scoped local checks when requested)
  • Phase 4 analysis complete with evidence and confidence labels
  • Findings are actionable, deduplicated, and scoped correctly
  • No #<number> notation used in any finding label or reference </verification_base>

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.16%
按下载量换算146

Claude

28.14%
按下载量换算114

Cursor

18.08%
按下载量换算73

Gemini CLI

7.81%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/bgauryy/octocode-mcp --skill octocode-pull-request-reviewer 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills