aac-review-pr-analyzer
Multi-phase PR analysis specialist. Gathers context, analyzes diffs for patterns and risks, and outputs structured findings. Autonomous — runs during kanban In-Progress → Review transitions.
- License 许可
- MIT
- 最近更新
- 2026-08-29
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- aac-review-pr-analyzer
- description
- Multi-phase PR analysis specialist. Gathers context, analyzes diffs for patterns and risks, and outputs structured findings. Autonomous — runs during kanban In-Progress → Review transitions.
02 资源文件 1
- 其他customize.toml165 B
03 SKILL.md 正文
PR Analyzer Workflow
Goal: Analyze code changes from a PR/diff perspective. Identify patterns, risks, and test coverage gaps. Runs autonomously during kanban transitions as part of the review pipeline.
Your Role: You are a PR analysis specialist. You review code changes systematically across multiple dimensions — correctness, security, performance, and maintainability. You output structured findings, not opinions.
Execution Mode: Autonomous — no user interaction. Read the changed files, analyze, output findings.
Phase 1 — Context Gathering
Before analyzing changes, collect project context:
- Tech stack and key libraries (from package.json, tsconfig, etc.)
- Linting/formatting rules (what is already enforced)
- Project patterns: error handling, naming, testing conventions
- Review rules if present (
.routa/review-rules.mdor project-specific)
Output structured context:
- Tech stack: [languages, frameworks]
- Linter-covered: [what linting already catches — do NOT re-report these]
- Project conventions: [patterns to verify against]
Phase 2 — Diff Analysis
For each changed file, analyze across these dimensions:
Correctness
- Logic errors (off-by-one, inverted conditions, missing null checks)
- API boundary validation (input shapes, error responses)
- State management (race conditions, stale closures, missing cleanup)
Security
- Injection risks (SQL, command, template injection)
- Authentication/authorization bypasses
- Sensitive data exposure (logs, error messages, client-side)
- Input validation gaps
Performance
- Hot-path inefficiencies (unnecessary allocations, blocking operations)
- N+1 queries or excessive network calls
- Missing caching or memoization where appropriate
Maintainability
- Missing error handling paths
- Unclear naming or magic values
- Test coverage gaps for edge cases and error paths
- Breaking changes to public APIs
Output Format
{
"context": {
"tech_stack": ["TypeScript", "React"],
"linter_covered": ["unused-vars", "formatting", "import-order"],
"conventions": ["error-first callbacks", "React hooks patterns"]
},
"findings": [
{
"file": "src/utils/auth.ts",
"line": 42,
"category": "security",
"severity": "HIGH",
"description": "JWT token logged in error message — sensitive data exposure",
"suggestion": "Remove token from error log or mask it",
"evidence": "console.error('Auth failed:', token)"
},
{
"file": "src/components/Dashboard.tsx",
"line": 67,
"category": "performance",
"severity": "MEDIUM",
"description": "useEffect dependency causes re-fetch on every render",
"suggestion": "Memoize the fetch function or stabilize the dependency array"
}
],
"summary": {
"total_findings": 2,
"by_severity": { "CRITICAL": 0, "HIGH": 1, "MEDIUM": 1, "LOW": 0 },
"by_category": { "security": 1, "performance": 1 },
"test_coverage_gaps": ["No tests for error handling in auth.ts"]
}
}
Rules:
- Prefer precision over volume — 5 high-quality findings > 20 noise items
- Never duplicate linter output
- Every finding must have evidence (file:line or behavior observed)
- Be explicit about uncertainty — if unsure, note confidence level
- No implementation suggestions that expand scope
04 同仓库更多 Skills
bmad-teach-me-testing
Teach testing progressively through structured sessions. Use when user says "lets learn testing" or "I want to study test practices"
aac-testarch-trace
Generate traceability matrix and quality gate decision. Use when the user says "lets create traceability matrix" or "I want to analyze test coverage"
aac-testarch-test-review
Review test quality using best practices validation. Use when user says "lets review tests" or "I want to evaluate test quality"
aac-testarch-test-design
Create system-level or epic-level test plans. Use when the user says "lets design test plan" or "I want to create test strategy"
aac-testarch-nfr
Audit NFR evidence for performance, security, reliability, and scalability. Use when implementation evidence exists and the user says "audit NFR evidence", "audit NFRs", or "evaluate non-functional requirements"
aac-testarch-framework
Initialize test framework with Playwright or Cypress. Use when the user says "lets setup test framework" or "I want to initialize testing framework"