Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问许可证需确认审计通过

code-review代码审查

Agent Skill

用于搭建或维护带检索增强的 RAG 工作流,适合让 Agent 处理知识库问答、向量检索、来源引用和事实核查。它可以辅助整理数据接入、Embedding、向量库、召回参数和回答生成流程。使用时需要确认数据来源、更新频率、召回阈值和引用展示方式,避免把未命中的资料或过期内容包装成确定事实。

总安装

494

周安装

21

GitHub Stars

11,384

下载量

173
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/vectorize-io/hindsight --skill code-review

简介

用于代码审查与协作信息管理,适合在开发过程中检查代码变更、Issue 和 Pull Request。

  • 适用于需要围绕仓库状态、代码质量和团队协作进行整理和分析的场景。
  • 可结合项目现有规范和构建流程,辅助定位问题并生成改进建议。
  • 使用时需注意权限范围和文件读写操作,避免误改关键分支或敏感信息。
  • 安装前建议确认仓库维护状态和网络访问权限,防止触发意外命令执行。

SKILL.md

Code Review

Review all changed code against the project's quality standards and coding conventions.

Code Standards

Read and internalize these standards before writing code. The review steps below verify compliance.

Python Style

  • Python 3.11+, type hints required
  • Async throughout (asyncpg, async FastAPI)
  • Pydantic models for request/response
  • Ruff for linting (line-length 120)
  • No Python files at project root - maintain clean directory structure
  • Never use multi-item tuple return values — not even for internal/private functions. Always use a dataclass or Pydantic model. No exceptions, no "it's just two values" shortcuts. If a function returns more than one value, define a named type for it.

Type Safety with Pydantic Models

NEVER use raw dict types for structured data — this applies to all code, including internal helpers and private functions. If the dict has known keys, it must be a dataclass or Pydantic model:

  • Use Pydantic BaseModel for all data structures passed between functions
  • Use @dataclass for lightweight internal data containers when Pydantic validation isn't needed
  • Add @field_validator for type coercion (e.g., ensuring datetimes are timezone-aware)
  • Avoid dict.get() patterns - use typed model attributes instead
  • Parse external data (JSON, API responses) into Pydantic models at the boundary
  • This catches type errors at parse time, not deep in business logic
  • The only acceptable dict usage is for truly dynamic/unknown keys (e.g., arbitrary metadata, JSON blobs with no fixed schema)
# BAD - error-prone dict access
def process(data: dict) -> str:
    return data.get("name", "")  # No validation, silent failures

# GOOD - typed and validated
class UserData(BaseModel):
    name: str
    created_at: datetime

    @field_validator("created_at", mode="before")
    @classmethod
    def ensure_tz_aware(cls, v):
        if isinstance(v, str):
            v = datetime.fromisoformat(v.replace("Z", "+00:00"))
        if v.tzinfo is None:
            return v.replace(tzinfo=timezone.utc)
        return v

def process(data: UserData) -> str:
    return data.name  # Type-safe, validated at construction

TypeScript Style

  • Next.js App Router for control plane
  • Tailwind CSS with shadcn/ui components

Code Comments

  • Always comment non-trivial technical decisions with the reasoning behind the choice. If someone would ask "why is it done this way?", there should be a comment.
  • Keep comments up to date with history — when changing an approach, update the comment to explain what was tried before and why it was changed. Comments serve as a tracker of previous implementations that likely had problems.
  • Don't comment obvious code — only where the "why" isn't self-evident from the code itself.
# BAD - no context for future readers
results = await asyncio.gather(*tasks, return_exceptions=True)

# GOOD - explains the non-obvious choice
# Use return_exceptions=True to avoid cancelling sibling tasks on failure.
# Previously we used TaskGroup but it cancelled all tasks when one failed,
# causing partial writes that left orphaned entity links (see #412).
results = await asyncio.gather(*tasks, return_exceptions=True)

Branch Hygiene

  • Always start new feature branches from origin/main — rebase to ensure a clean base.
  • Only include commits relevant to the PR/branch/feature — no unrelated changes. If the branch contains commits that don't belong, they must be removed before merging.

General Principles

  • Don't add features, refactor code, or make "improvements" beyond what was asked
  • Don't add unnecessary error handling for impossible scenarios
  • Don't create helpers or abstractions for one-time operations
  • No backwards-compatibility hacks (unused vars, re-exports, "removed" comments)
  • Three similar lines of code is better than a premature abstraction

Review Steps

1. Check branch hygiene

  • Run git log --oneline main..HEAD to list all commits on the branch.
  • Verify every commit is relevant to the feature/PR. Flag any unrelated commits.
  • Check the branch is based on a recent origin/main (no stale base).

2. Identify changed files

Run git diff --name-only HEAD (unstaged) and git diff --cached --name-only (staged) to get all changed files. If there are no local changes, diff against the base branch using git diff main...HEAD --name-only and git diff main...HEAD to review all commits on the current branch.

3. Run linters

./scripts/hooks/lint.sh

Report any failures. Do NOT fix them yourself — just report.

4. Check for dead code

For each changed Python file, check for:

  • Unused imports (Ruff should catch these, but verify)
  • Functions/methods/classes that were added but are never called from anywhere
  • Variables assigned but never read
  • Commented-out code blocks that should be removed

For each changed TypeScript file, check for:

  • Unused imports
  • Unused variables or functions
  • Commented-out code

5. Check type safety (Python)

For each changed Python file, check for violations:

  • No raw dict for structured data — must use Pydantic model or dataclass, even for internal/private functions (only exception: truly dynamic/unknown keys)
  • No multi-item tuple returns — must use dataclass or Pydantic model, even for internal/private functions (no exceptions)
  • Missing type hints on function parameters and return types
  • Missing @field_validator for datetime fields that should be timezone-aware

6. Check for missing tests

For each new or significantly changed function/endpoint/class:

  • Check if there is a corresponding test addition or update
  • New API endpoints MUST have integration tests
  • New utility functions MUST have unit tests
  • Bug fixes SHOULD have a regression test

Flag any new logic that lacks test coverage.

7. Check API consistency

If any files in hindsight-api-slim/hindsight_api/api/ were changed:

  • Were the OpenAPI specs regenerated? (./scripts/generate-openapi.sh)
  • Were the client SDKs regenerated? (./scripts/generate-clients.sh)
  • Were the control plane proxy routes updated? (hindsight-control-plane/src/app/api/)

8. Check code comments

For each non-trivial change:

  • New non-obvious logic — is there a comment explaining the reasoning?
  • Changed approach — does the comment include what was done before and why it changed?
  • Stale comments — do existing comments near the changed code still accurately describe the behavior?

9. Check integration completeness

If any files in hindsight-integrations/ were added or changed, verify:

  • Tests exist — the integration must have tests that simulate/exercise the external framework (not just pure unit tests of helpers). Check for a tests/ directory with meaningful test files.
  • CI job exists — check .github/workflows/test.yml for a corresponding test-<name>-integration job. If missing, flag it.
  • Release process — check that the integration name is in the VALID_INTEGRATIONS array in scripts/release-integration.sh. If missing, flag it.
  • Code standards — the integration code must follow all Python style rules (type hints, no raw dicts, no tuple returns, etc.).

10. Check MCP tool registration completeness

If any new MCP tools were added or existing tools renamed in hindsight-api-slim/hindsight_api/mcp_tools.py:

  • _ALL_TOOLS set in mcp_tools.py — must include the new tool name
  • tools_to_register default set in register_mcp_tools() in mcp_tools.py — must include the new tool name
  • _SINGLE_BANK_TOOLS set in hindsight-api-slim/hindsight_api/api/mcp.py — must include the new tool if it is bank-scoped (not a bank-management tool like list_banks/create_bank)
  • MCP_TOOL_GROUPS in hindsight-control-plane/src/components/bank-config-view.tsx — must include the new tool in the appropriate group for the UI tool selector
  • Tool count assertions in tests (e.g., test_mcp_tools.py) — must be updated to reflect the new count

11. Review against other coding standards

Check the diff for violations of the standards listed above:

  • Python files at project root (not allowed)
  • Missing async patterns (should be async throughout)
  • Pydantic models for request/response
  • Line length > 120 chars
  • New features/code beyond what was asked (over-engineering)
  • Unnecessary error handling for impossible scenarios
  • Premature abstractions or speculative helpers
  • Backwards-compatibility hacks (unused vars, re-exports, "removed" comments)

12. Report findings

Present a clear summary organized by severity:

Must fix — issues that will break CI or violate hard project rules:

  • Unrelated commits on the branch
  • Lint failures
  • Missing type hints on public functions
  • Raw dict usage for structured data (including internal code)
  • Multi-item tuple returns (including internal code)
  • Missing tests for new endpoints
  • New integration missing tests, CI job, or release-integration.sh entry

Should fix — issues that hurt code quality:

  • Dead code / unused imports missed by linter
  • Missing tests for non-trivial utility functions
  • Over-engineering beyond the task scope

Note — observations that may or may not need action:

  • API changes that might need client regeneration
  • Patterns that deviate from nearby code style

For each finding, include the file path, line number, and a brief explanation.

Do NOT auto-fix any issues. Report all findings and let the user decide what to address. If there are no findings, confirm the code looks good.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.51%
按下载量换算63

Claude

30.38%
按下载量换算53

Cursor

17.99%
按下载量换算31

Gemini CLI

9.31%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills