一键导入
prp-feature-review-agents
Multi-agent feature review — spawns parallel specialized agents for deep package analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Multi-agent feature review — spawns parallel specialized agents for deep package analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Multi-agent PR review — spawns parallel specialized agents for deep code review.
Multi-agent PR review — spawns parallel specialized agents for deep code review.
Execute an implementation plan with rigorous validation loops — typecheck, lint, test, and build after every change. TDD approach with automatic failure recovery.
Create a comprehensive implementation plan by analyzing the codebase, discovering patterns, and producing a step-by-step actionable plan document.
Execute an implementation plan with rigorous validation loops — typecheck, lint, test, and build after every change. TDD approach with automatic failure recovery.
Create a comprehensive implementation plan by analyzing the codebase, discovering patterns, and producing a step-by-step actionable plan document.
| name | prp-feature-review-agents |
| description | Multi-agent feature review — spawns parallel specialized agents for deep package analysis. |
| metadata | {"short-description":"Multi-agent feature review"} |
If your input context contains [WORKSPACE CONTEXT] (injected by a multi-agents framework),
you are running as a sub-agent. Apply these optimizations:
feature-context-*.md file path is provided in context files.All agent dispatches and result aggregation run unchanged — these are where quality comes from.
Input: $ARGUMENTS
Perform a comprehensive, senior-engineer-level review of a package or folder by spawning specialized Agent subprocesses in parallel. Each agent runs in its own isolated context window with fresh memory, enabling deep file exploration.
This command differs from $prp-feature-review (single-session sequential analysis) by spawning actual Agent subprocesses via the Agent tool. Each agent gets:
Golden Rule: Be constructive, creative, and actionable. Think like a product-minded engineer who cares about both code quality AND user value.
| Input | Interpretation |
|---|---|
packages/web | Review entire package |
src/features/auth | Review specific feature folder |
--focus code | Focus on code quality agents only |
--focus product | Focus on product-ideas-agent only |
--focus performance | Focus on performance-analyzer only |
--focus security | Focus on security-reviewer only |
--focus all | All agents (default) |
--quick | Core agents only (code, security) — skip product/perf/conditional |
ls -la {input-path} 2>/dev/null || echo "PATH_NOT_FOUND"
If path doesn't exist: STOP — "Path {input-path} not found. Verify the path and try again."
ls .prp-output/reviews/feature-context-{package-name}.md 2>/dev/null
If context exists and is recent (< 1 hour): Skip to Phase 3 (Token Optimization).
PHASE_1_CHECKPOINT:
Purpose: Extract and cache context ONCE to avoid redundant file reads across agents. Saves 60-70% tokens vs each agent exploring independently.
Skip if Phase 1 found existing recent context.
mkdir -p .prp-output/reviews
Read and extract the following in a single pass:
tree {input-path} -L 3 -I node_modulespackage.json or equivalentPath: .prp-output/reviews/feature-context-{package-name}.md
---
package: "{PACKAGE_PATH}"
extracted: {ISO_TIMESTAMP}
files_count: {N}
---
# Feature Context: {PACKAGE_NAME}
## Project Guidelines (from CLAUDE.md)
{relevant sections - coding standards, patterns, conventions}
## Package Structure
{tree output}
## Package Manifest
{package.json content}
## Key Files by Category
### Entry Points
- {list with brief description}
### Core Logic
- {list with brief description}
### UI Components (if applicable)
- {list with brief description}
## File Inventory
{complete list of files}
## Initial Observations
- {key patterns noticed}
- {technologies used}
- {architecture style}
After writing, verify the file was created:
test -f ".prp-output/reviews/feature-context-{package-name}.md" || echo "FATAL: Context file write failed"
If verification fails, STOP — do not spawn agents without a context file.
PHASE_2_CHECKPOINT:
CRITICAL: You MUST use the Agent tool to spawn these as separate subprocesses. Each agent runs in its own context window with fresh memory. Do NOT attempt to run these as sequential analysis passes in this session — that defeats the purpose of this command. If you want single-session sequential analysis, use $prp-feature-review instead.
CONTEXT_PATH = ".prp-output/reviews/feature-context-{package-name}.md"
PACKAGE_PATH = {input-path}
FOCUS = {from Phase 1 — determines which agents to spawn}
Spawn these agents simultaneously in a SINGLE message with multiple Agent tool calls:
Agent 1 — Code Quality:
Agent(
subagent_type="code-reviewer",
description="Review {PACKAGE_PATH} code quality",
prompt="Review the package at {PACKAGE_PATH} for code quality, patterns, and architecture.
Read the context file at: {CONTEXT_PATH}
Then read the actual source files for deep analysis.
Evaluate:
- Architecture & design: separation of concerns, abstractions, module boundaries
- Code patterns: naming conventions, DRY, error handling, logging
- Type safety: explicit types, generics, null safety
- Testing: coverage, edge cases, quality of assertions
- Documentation: function docs, complex logic explanations
Report findings as structured markdown:
## Strengths
{What's done well}
## Issues
| Priority | Issue | File:Line | Suggestion |
|----------|-------|-----------|------------|
## Pattern Recommendations
{Suggested improvements}
Use priorities: Critical, High, Medium, Low
Score: Code Quality {N}/10"
)
Agent 2 — Security:
Agent(
subagent_type="security-reviewer",
description="Review {PACKAGE_PATH} security",
prompt="Review the package at {PACKAGE_PATH} for security vulnerabilities.
Read the context file at: {CONTEXT_PATH}
Then read actual source files — especially auth, API handlers, input validation, config.
Check:
- Input validation: SQL/NoSQL injection, XSS, file upload restrictions
- Auth & authz: route protection, token handling, session management, RBAC
- Data protection: encryption, secrets in env vars, PII handling, logging exposure
- API security: rate limiting, CORS, API key protection, request validation
Report ONLY vulnerabilities with clear attack vectors — not theoretical issues.
Report findings as structured markdown:
## Critical Issues
{Must fix immediately}
## High Priority
{Should fix soon}
## Recommendations
{Best practices to implement}
Score: Security {N}/10"
)
Agent 3 — Product Ideas (skip if --focus code or --focus security or --quick):
Agent(
subagent_type="product-ideas-agent",
description="Brainstorm features for {PACKAGE_PATH}",
prompt="Review the package at {PACKAGE_PATH} and brainstorm product improvements.
Read the context file at: {CONTEXT_PATH}
Then read the actual source files — especially UI components, user-facing code, API endpoints.
Think like a product manager:
- What does this package do? Who are the users?
- What's missing that users would love?
- What friction could be reduced?
- What would make this 10x better?
Brainstorm categories:
- Quick Wins (< 1 day effort, high impact)
- Strategic Features (1-2 weeks, significant improvement)
- Innovation Ideas (creative differentiators)
- UX Improvements (delight users)
Report findings as structured markdown:
## Quick Wins
| Idea | Impact | Effort |
|------|--------|--------|
## Strategic Features
| Idea | Impact | Effort | Description |
|------|--------|--------|-------------|
## Innovation Ideas
{Creative suggestions}
## User Journey Improvements
{Pain points and fixes}
Score: Product Potential {N}/10"
)
Agent 4 — Performance (skip if --focus code or --focus product or --quick):
Agent(
subagent_type="performance-analyzer",
description="Analyze {PACKAGE_PATH} performance",
prompt="Analyze the package at {PACKAGE_PATH} for performance issues and optimization opportunities.
Read the context file at: {CONTEXT_PATH}
Then read actual source files — especially hot paths, database queries, API calls, render functions.
Check:
- N+1 query patterns, unnecessary async/await
- Memory leaks (uncleared listeners, growing arrays/caches)
- Heavy computations in render/hot paths, large bundle imports
- Caching opportunities, lazy loading, pagination
- API call batching, database query optimization
Report only issues with measurable impact. Include quantified estimates.
Report findings as structured markdown:
## Immediate Optimizations
| Issue | File:Line | Impact | Fix |
|-------|-----------|--------|-----|
## Architecture Improvements
{Larger refactoring opportunities}
## Monitoring Suggestions
{What to measure and track}
Score: Performance {N}/10"
)
Spawn additional agents based on what the context file reveals:
If UI/frontend files detected (.tsx, .jsx, .vue, .svelte, .css):
Agent(
subagent_type="accessibility-reviewer",
description="Review {PACKAGE_PATH} accessibility",
prompt="Review UI code in {PACKAGE_PATH} for WCAG 2.1 compliance.
Read the context file at: {CONTEXT_PATH}
Then read UI component files.
Check: keyboard navigation, screen reader support, color contrast (4.5:1 text, 3:1 large), ARIA usage, form labels, focus management.
Report findings as:
## Findings
| Priority | Issue | File:Line | Affected Users | Fix |
Score: Accessibility {N}/10"
)
If package.json or dependency files exist:
Agent(
subagent_type="dependency-analyzer",
description="Analyze {PACKAGE_PATH} dependencies",
prompt="Analyze dependencies in {PACKAGE_PATH} for security and health.
Read the context file at: {CONTEXT_PATH}
Read package.json, lock files, requirements.txt, etc.
Check: known CVEs, outdated packages with security patches, abandoned dependencies, license compliance, bundle size impact.
Report findings as:
## Findings
| Priority | Package | Issue | Remediation |
Score: Dependency Health {N}/10"
)
If error handling patterns detected (try/catch, .catch, error handlers):
Agent(
subagent_type="silent-failure-hunter",
description="Hunt silent failures in {PACKAGE_PATH}",
prompt="Hunt for silent failures in {PACKAGE_PATH}.
Read the context file at: {CONTEXT_PATH}
Then read actual source files — trace every error path.
Check: empty catch blocks, catch without logging/re-throw, generic catch(e), async without .catch, scripts without set -e.
Report findings as:
## Findings
| Priority | Issue | File:Line | Error Path | Fix |"
)
If logging/metrics/tracing patterns detected:
Agent(
subagent_type="observability-reviewer",
description="Review {PACKAGE_PATH} observability",
prompt="Review {PACKAGE_PATH} for logging, metrics, tracing, and error tracking.
Read the context file at: {CONTEXT_PATH}
Then read actual source files.
Check: structured logging, meaningful log levels, metrics for key operations, distributed tracing, error tracking integration, health checks, alert-worthy conditions.
Report findings as:
## Findings
| Priority | Issue | File:Line | Fix |
Score: Observability {N}/10"
)
If the Agent tool is NOT available (e.g., running in a tool that doesn't support subagent spawning):
Fall back to $prp-feature-review which performs all analysis sequentially in a single session. Display:
Agent tool not available — falling back to single-session sequential review.
For parallel agent review, use Claude Code or another tool that supports the Agent tool.
Running: $prp-feature-review {PACKAGE_PATH}
After all agents complete, collect their outputs.
For each agent result:
If an agent returns no findings: Note as clean.
If an agent fails or times out: Display WARNING and proceed with available results. If a core agent (code-reviewer, security-reviewer) fails, note it prominently in the report.
Two findings are duplicates when BOTH:
Merge strategy: Keep most detailed description, use highest priority, list all contributing agents.
Aggregate per-area scores from agents:
| Area | Source Agent | Score |
|---|---|---|
| Code Quality | code-reviewer | {N}/10 |
| Product Potential | product-ideas-agent | {N}/10 |
| Performance | performance-analyzer | {N}/10 |
| Security | security-reviewer | {N}/10 |
| Accessibility | accessibility-reviewer | {N}/10 (if ran) |
| Dependencies | dependency-analyzer | {N}/10 (if ran) |
| Observability | observability-reviewer | {N}/10 (if ran) |
Overall Health Score: Average of all scores that ran.
Combine all findings into a unified prioritized list:
For each item estimate effort: Quick Win (< 1 day), Small (1-3 days), Medium (1-2 weeks), Large (> 2 weeks).
Path: .prp-output/reviews/feature-review-{package-name}-{date}.md
---
package: "{PACKAGE_PATH}"
reviewed: {ISO_TIMESTAMP}
focus: "{FOCUS_AREAS}"
agents: [{list of agents that ran}]
---
# Feature & Code Review: {PACKAGE_NAME} (Multi-Agent)
**Path**: `{package-path}`
**Reviewed**: {date}
**Files Analyzed**: {count}
**Agents**: {list}
---
## Executive Summary
{3-5 sentences summarizing findings}
**Overall Health Score**: {N}/10
### Agents Dispatched
| Agent | Status | Score | Findings |
|-------|--------|-------|----------|
| code-reviewer | Completed | {N}/10 | {count} |
| security-reviewer | Completed | {N}/10 | {count} |
| product-ideas-agent | Completed | {N}/10 | {count} |
| performance-analyzer | Completed | {N}/10 | {count} |
| {conditional agents...} | ... | ... | ... |
### Area Scores
| Area | Score | Status |
|------|-------|--------|
| Code Quality | {N}/10 | {GOOD/NEEDS_WORK/CRITICAL} |
| Product Potential | {N}/10 | {GOOD/NEEDS_WORK/CRITICAL} |
| Performance | {N}/10 | {GOOD/NEEDS_WORK/CRITICAL} |
| Security | {N}/10 | {GOOD/NEEDS_WORK/CRITICAL} |
---
## Code Quality Analysis
{From code-reviewer agent}
## Product & Feature Ideas
{From product-ideas-agent}
## Performance Recommendations
{From performance-analyzer agent}
## Security Findings
{From security-reviewer agent}
## Additional Findings
{From conditional agents: accessibility, deps, errors, observability}
---
## Prioritized Action Items
### Critical (Do Now)
| Item | Type | Agent | Effort | Impact |
|------|------|-------|--------|--------|
### High Priority (This Sprint)
| Item | Type | Agent | Effort | Impact |
|------|------|-------|--------|--------|
### Medium Priority (Backlog)
| Item | Type | Agent | Effort | Impact |
|------|------|-------|--------|--------|
### Future Considerations
| Item | Type | Agent | Effort | Impact |
|------|------|-------|--------|--------|
---
## Suggested Roadmap
### Phase 1: Foundation (1-2 weeks)
{Critical fixes and quick wins}
### Phase 2: Enhancement (2-4 weeks)
{High priority improvements}
### Phase 3: Innovation (1-2 months)
{Strategic features and optimization}
## Feature Review Complete (Multi-Agent)
**Package**: `{PACKAGE_PATH}`
**Files Analyzed**: {count}
**Overall Health**: {score}/10
**Agents**: {count} dispatched
### Area Scores
| Area | Score | Top Finding |
|------|-------|-------------|
| Code Quality | {N}/10 | {one-liner} |
| Product Ideas | {N}/10 | {one-liner} |
| Performance | {N}/10 | {one-liner} |
| Security | {N}/10 | {one-liner} |
### Action Items Summary
- Critical: {count} items
- High: {count} items
- Medium: {count} items
- Low: {count} items
### Artifacts
- Full Report: `.prp-output/reviews/feature-review-{package-name}-{date}.md`
- Context File: `.prp-output/reviews/feature-context-{package-name}.md`
| Situation | Action |
|---|---|
| Path not found | STOP with error message |
| Empty package (no source files) | STOP — "No source files found in {path}" |
| Very large package (>500 files) | Focus on entry points and core logic; note "partial scan" in report |
| Context file write fails | STOP — do not spawn agents without context |
| Agent tool not available | Fall back to $prp-feature-review |
| Agent fails or times out | WARN, proceed with available results |
--quick flag | Core agents only (code-reviewer, security-reviewer) |