AGENT SKILL

x-review-performance

Performance specialist review: validates N+1 queries, connection pools, async patterns, pagination, caching, timeouts, circuit breakers, and resource cleanup.

License 许可
MIT
最近更新
2026-10-27
Stars
★ 0
Forks
1

01 前言 Front Matter

name
x-review-performance
description
Performance specialist review: validates N+1 queries, connection pools, async patterns, pagination, caching, timeouts, circuit breakers, and resource cleanup.
allowed-tools
Read, Grep, Glob, Bash
argument-hint
[PR number or file paths]
fragment-slot
{ "slot": "review-specialist", "fragment-id": "perf", "fragment-order": 110 }
context-budget
light
user-invocable
true
requires-capabilities
[]

03 SKILL.md 正文

Global Output Policy

  • Language: English ONLY.
  • Tone: Technical, Direct, and Concise.
  • Efficiency: Remove all conversational fillers and greetings to save tokens.

Skill: Performance Specialist Review

Purpose

Review code changes for performance best practices: N+1 query detection, connection pool sizing, async patterns, pagination on collections, caching strategy, timeout configuration, circuit breaker usage, thread safety, resource cleanup, lazy loading, batch operations, and index usage.

When to Use

  • Pre-PR quality validation for performance concerns
  • Reviewing database query patterns
  • Checking resilience patterns (timeouts, circuit breakers)
  • Validating resource management

Triggers

  • /x-review-performance 42 -- review PR #42 for performance
  • /x-review-performance src/main/java/com/example/repository/ -- review specific paths
  • /x-review-performance -- review all current changes

Parameters

Parameter Type Required Default Description
target String No (current changes) PR number or file paths to review

Knowledge Pack References

Pack Files Purpose
resilience knowledge/resilience/index.md Circuit breaker, rate limiting, timeout, retry, bulkhead patterns

Checklist (13 Items, Max Score: /26)

Each item scores 0 (missing), 1 (partial), or 2 (fully compliant).

Query Performance (PERF-01 to PERF-02)

# Item Score
PERF-01 No N+1 queries (eager fetching or batch loading where needed) /2
PERF-02 Connection pool sized appropriately for expected load /2

Async & Concurrency (PERF-03, PERF-09)

# Item Score
PERF-03 Async processing where applicable (non-blocking I/O) /2
PERF-09 Thread safety verified (no shared mutable state without synchronization) /2

Collection & Data (PERF-04 to PERF-06)

# Item Score
PERF-04 Pagination on collection endpoints (no unbounded result sets) /2
PERF-05 Caching strategy defined for frequently accessed data /2
PERF-06 No unbounded lists in memory (streams or pagination for large datasets) /2

Resilience (PERF-07 to PERF-08)

# Item Score
PERF-07 Timeout configured on all external calls (HTTP, DB, message broker) /2
PERF-08 Circuit breaker on external service calls /2

Resource Management (PERF-10 to PERF-13)

# Item Score
PERF-10 Resource cleanup in finally/try-with-resources (connections, streams, files) /2
PERF-11 Lazy loading for expensive initializations /2
PERF-12 Batch operations for bulk data processing (not row-by-row) /2
PERF-13 Database indexes used for queried columns /2

Workflow

Step 1 -- Gather Context

Read the resilience knowledge pack:

  • knowledge/resilience/index.md

Step 2 -- Identify Changed Files

Determine scope: PR diff or specified paths. Focus on repository, service, and adapter layers.

Step 3 -- Query Analysis

Scan for N+1 patterns, missing indexes, unbounded queries.

Step 4 -- Resilience Check

Verify timeout, circuit breaker, and retry configurations on external calls.

Step 5 -- Resource Management Check

Verify proper resource cleanup, connection pool configuration, and batch operations.

Step 6 -- Concurrency Check

Check for thread safety issues, shared mutable state, and proper synchronization.

Step 7 -- Generate Report

Produce the scored report.

Output Format

ENGINEER: Performance
STORY: [story-id or change description]
SCORE: XX/26

STATUS: PASS | FAIL | PARTIAL

### PASSED
- [PERF-XX] [Item description]

### FAILED
- [PERF-XX] [Item description]
  - Finding: [file:line] [issue description]
  - Fix: [remediation guidance]

### PARTIAL
- [PERF-XX] [Item description]
  - Finding: [partial compliance details]

Error Handling

Scenario Action
No repository/service code found Report INFO: no performance-relevant code discovered
No external calls detected Skip PERF-07, PERF-08 and note N/A
No database queries detected Skip PERF-01, PERF-02, PERF-13 and note N/A

04 同仓库更多 Skills

review-bench
review-bench/edercnj_ia-dev-environment

x-parallel-eval

Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

parallelism-heuristics

Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-watch-pr-ci

Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-validate-docs

Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-system-architecture

Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-architecture

Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.

★ 0