Receber por email
← Voltar para o catálogo

review

Realiza revisão de código multiagente para arquivos Python locais, diretórios ou diferenças do git, cobrindo arquitetura, testes, desempenho, documentação, lint, segurança e design de API. O escopo são arquivos-fonte Python na árvore de trabalho local, excluindo projetos sem arquivos Python.

20estrelas
Atualizado há 4 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add Borda/AI-Rig

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/review-mpsxjc9q/svg)](https://www.skillteca.com.br/skills/review-mpsxjc9q)

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

<objective>

Comprehensive code review of local files or working-tree diff. Spawn specialized sub-agents in parallel, consolidate findings into structured feedback with severity levels.

NOT for: GitHub PR review (use /oss:review <PR#> (requires oss plugin)); GitHub thread analysis or PR reply drafting (use /oss:analyse <PR#> (requires oss plugin)); implementation (use /develop:feature or /develop:fix); .claude/ config changes (use /foundry:manage (requires foundry plugin) or /foundry:audit (requires foundry plugin)); non-Python-only projects (zero Python source files — pure JS/TS/Go/Rust) — review toolchain assumes Python/pytest; for polyglot projects with Python source, reviews Python files only.

</objective>

<inputs>

  • $ARGUMENTS: optional file path or directory to review.
  • Path given: review those files
  • Omitted: review current git diff (git diff HEAD — staged + unstaged vs HEAD)
  • Scope: Python source only. Non-Python file (YAML, JSON, shell script, etc.) → state out of scope, suggest appropriate tool. No findings.
  • --no-challenge: skip adversarial review (challenger runs by default)
  • --codemap: enable structural context from codemap index (off by default)
  • --semble: enable semble semantic search companion (off by default)

PR#/filename disambiguation gate (execute BEFORE Step 1): tighten classification — valid PR# is positive integer with no extension and no existing file at that path. Filenames that look like numbers (e.g. 42.py) must NOT trigger PR mode.

TOKEN="$ARGUMENTS"
if [[ "$TOKEN" =~ ^[0-9]+$ ]] && [ ! -e "$TOKEN" ]; then
    # Strict PR mode: bare positive integer, no extension, no existing path
    echo "PR number detected — checking oss plugin availability"
    [ -f "$(ls -td ~/.claude/plugins/cache/borda-ai-rig/oss/*/skills/review/SKILL.md 2>/dev/null | head -1)" ] && OSS_AVAILABLE=true || OSS_AVAILABLE=false  # timeout: 5000
elif [ -f "$TOKEN" ]; then
    # File mode: valid path, even if it looks numeric (e.g. `42.py`)
    OSS_AVAILABLE=skip
elif [[ "$TOKEN" =~ ^#[0-9]+$ ]] && [ ! -e "$TOKEN" ]; then
    # `#NNN` form — also PR-like
    echo "PR number detected — checking oss plugin availability"
    [ -f "$(ls -td ~/.claude/plugins/cache/borda-ai-rig/oss/*/skills/review/SKILL.md 2>/dev/null | head -1)" ] && OSS_AVAILABLE=true || OSS_AVAILABLE=false  # timeout: 5000
else
    OSS_AVAILABLE=skip
fi

If $OSS_AVAILABLE is skip: proceed to Step 1 normally (path / diff / dir mode).

If $OSS_AVAILABLE is true: call AskUserQuestion tool: "Looks like you passed a PR/issue number. Did you mean to run /oss:review $ARGUMENTS (requires oss plugin) to review that PR?" Options: (a) "Yes — launch /oss:review $ARGUMENTS" → strip develop-specific flags (--team, --issue, --dry-run, --local) from $ARGUMENTS before forwarding; call Skill(skill="oss:review", args="<stripped-args>"); (b) "No — review local code at a path instead" → ask for path to review.

If $OSS_AVAILABLE is false: call AskUserQuestion tool: "Looks like you passed a PR/issue number, but the oss plugin is not installed — /oss:review unavailable. Did you mean to review local code instead?" Options: (a) "Yes — provide a local file or directory path to review"; (b) "I need oss plugin" → inform user: install with claude plugin install oss@borda-ai-rig.

</inputs>

<constants>

CHALLENGE_ENABLED=true # set to false via --no-challenge CODEMAP_ENABLED=false # set to true via --codemap SEMBLE_ENABLED=false # set to true via --semble CODEX_TIMEOUT=120000 # hard cap (ms) on Codex co-review spawn — prevent indefinite hang

</constants>

<workflow>

<!-- Shared pattern with oss:review — coordinate on agent spawn logic, file-handoff, consolidation changes -->

<!-- Agent resolution: see _DEV_SHARED/agent-resolution.md (mounted by develop plugin init) -->

Agent Resolution

_PATHS=$(python "${CLAUDE_PLUGIN_ROOT:-plugins/develop}/bin/dev_shared_resolve.py" --foundry 2>/dev/null)  # timeout: 5000
_DEV_SHARED=$(echo "$_PATHS" | head -1)
_FOUNDRY_SHARED=$(echo "$_PATHS" | tail -1)

Read $_DEV_SHARED/agent-resolution.md. Contains: foundry check + fallback table. If foundry not installed: use table to substitute each foundry:X with general-purpose. Agents this skill uses: foundry:sw-engineer, foundry:qa-specialist, foundry:perf-optimizer, foundry:doc-scribe, foundry:linting-expert, foundry:solution-architect, foundry:challenger.

Read $_DEV_SHARED/task-hygiene.md.

Flag parsing

Strip flags from $ARGUMENTS before using as path:

REVIEW_ARGS="$ARGUMENTS"
[[ "$REVIEW_ARGS" == *"--no-challenge"* ]] && { CHALLENGE_ENABLED=false; REVIEW_ARGS="${REVIEW_ARGS//--no-challenge/}"; }
[[ "$REVIEW_ARGS" == *"--codemap"* ]]      && { CODEMAP_ENABLED=true;    REVIEW_ARGS="${REVIEW_ARGS//--codemap/}"; }
[[ "$REVIEW_ARGS" == *"--semble"* ]]       && { SEMBLE_ENABLED=true;     REVIEW_ARGS="${REVIEW_ARGS//--semble/}"; }
REVIEW_ARGS="${REVIEW_ARGS#"${REVIEW_ARGS%%[![:space:]]*}"}"  # trim leading whitespace

Unsupported flag check — after all supported flags extracted, scan $ARGUMENTS for remaining --<token> tokens. If found: print ! Unknown flag(s): \--<token>\. Supported: \--no-challenge\, \--codemap\, \--semble\. then invoke AskUserQuestion — (a) Abort (stop, re-invoke with correct flags) · (b) Continue ignoring (skip unknown flags, proceed). On Abort: stop.

# Preflight: fail early if requested tool not available
if [ "$CODEMAP_ENABLED" = "true" ]; then
    if ! command -v scan-query >/dev/null 2>&1; then
        printf "! --codemap requested but codemap plugin not installed.\n  Install: claude plugin install codemap@borda-ai-rig\n"; exit 1
    fi
    _PROJ=$(git rev-parse --show-toplevel 2>/dev/null | xargs basename)  # timeout: 3000
    if [ ! -f ".cache/scan/${_PROJ}.json" ]; then
        printf "! --codemap requested but no index found for project '%s'.\n  Build index: /codemap:scan-codebase\n" "$_PROJ"; exit 1
    fi
fi

If SEMBLE_ENABLED=true: verify mcp__semble__search in available tools. If not: print ! --semble requested but semble MCP server not configured. Configure: claude mcp add semble -s user -- uvx --from "semble[mcp]" semble and stop.

Use $REVIEW_ARGS (not $ARGUMENTS) as path for rest of workflow.

Step 1: Identify scope

if [ -n "$REVIEW_ARGS" ]; then
    # Path given directly — collect Python files under it
    TARGET="$REVIEW_ARGS"
    echo "Reviewing: $TARGET"
else
    # No argument — review current working-tree diff vs HEAD
    git diff HEAD --name-only  # timeout: 3000
    TARGET="working-tree diff ($(git diff HEAD --name-only 2>/dev/null | grep '\.py$' | wc -l | tr -d ' ') Python files)"  # timeout: 3000
fi

Filter to Python files only. No Python files → exit early (DMI skill — prose "stop" not executable; bash exit is the only enforceable mechanism):

# Check if diff contains any Python files — if not, exit early  # timeout: 5000
if [ -n "$REVIEW_ARGS" ]; then
    # Path mode: check target for .py files
    PYTHON_FILES=$(find "$REVIEW_ARGS" -name '*.py' -type f 2>/dev/null | head -1)
else
    # Diff mode
    PYTHON_FILES=$(git diff --name-only HEAD 2>/dev/null | grep '\.py$' | head -1)
fi
if [ -z "$PYTHON_FILES" ]; then
    echo "! Diff contains non-Python files only. This skill is scoped to Python. For other languages, use a general-purpose code reviewer."
    exit 0
fi

Non-Python impact check: after filtering, scan diff for high-impact non-Python changes, warn in report header:

  • pyproject.toml, setup.cfg, requirements*.txt → "⚠ dependency changes detected — not reviewed; verify Python imports still resolve"
  • Dockerfile, docker-compose*.yml → "⚠ container config changes detected — not reviewed"
  • .yaml, .toml, *.json in config directories → "⚠ config changes detected — not reviewed"

Out of scope but must be flagged — dependen

Compartilhar X LinkedIn