Program: Code Review
Input Contract
The assignment JSON contains:
{
"path": "src/",
"doc_type": "review",
"review_focus": "security|performance|quality|all",
"file_manifest": [{"name": "auth.ts", "size": 2048}, ...],
"plain": false,
"budget": {"max_files": 30, "max_lines_per_file": 500}
}
Analysis Phase
Read files from the manifest. Do NOT re-enumerate -- the station already ran Glob.
Priority read order:
- Configuration files (
package.json, tsconfig.json, biome.json, .eslintrc*) -- establish project conventions
- Entry/index files (
index.ts, main.ts) -- understand module structure
- Source files ordered by size descending (larger files are more likely to contain issues)
- Test files (for coverage gaps, test quality)
For each source file, check based on review_focus:
Focus: security
- Injection vulnerabilities (SQL, command, path traversal)
- Unsafe
eval(), Function(), innerHTML, dangerouslySetInnerHTML
- Hardcoded secrets, API keys, credentials
- Missing input validation at system boundaries
- Insecure cryptographic usage
- Prototype pollution risks
- Unvalidated redirects
- Missing authentication/authorization checks
Focus: performance
- Unnecessary re-renders (React components without memoization where needed)
- N+1 query patterns
- Unbounded loops or recursion
- Missing pagination on data fetching
- Large synchronous operations that should be async
- Memory leaks (event listeners not cleaned up, unclosed resources)
- Inefficient data structures (array lookups where Maps/Sets would be better)
- Bundle size concerns (large imports that could be tree-shaken)
Focus: quality
- Dead code (unused exports, unreachable branches)
- Code duplication (similar logic in multiple places)
- Overly complex functions (deep nesting, long parameter lists, excessive branching)
- Missing error handling at system boundaries
- Inconsistent naming or style (relative to project conventions from config files)
- Type safety issues (
any types, missing null checks, unsafe casts)
- Poor abstraction (god functions, feature envy, inappropriate coupling)
- Missing or misleading documentation on public APIs
Focus: all
- Run all three categories above
- Prioritize findings by severity across categories
Severity Classification
- Critical: Security vulnerabilities, data loss risks, crashes, race conditions
- Warning: Performance issues, maintainability concerns, potential bugs
- Info: Style inconsistencies, minor improvements, suggestions
Output Template
Generate a code review report:
## Code Review Report
### Summary
| Category | Critical | Warning | Info |
|----------|----------|---------|------|
| Security | {N} | {N} | {N} |
| Performance | {N} | {N} | {N} |
| Quality | {N} | {N} | {N} |
| **Total** | **{N}** | **{N}** | **{N}** |
### Critical Issues
#### {issue_title}
**File**: `{file_path}:{line_number}`
**Category**: {security|performance|quality}
{description of the issue}
```{language}
// Current code
{problematic code snippet}
Suggested fix:
{suggested replacement}
Warnings
{issue_title}
File: {file_path}:{line_number}
Category: {security|performance|quality}
{description}
Info
{issue_title}
File: {file_path}:{line_number}
Category: {security|performance|quality}
{description}
## Rules
- **No false positives over completeness.** Only report issues you are confident about. When uncertain, omit rather than guess.
- **Attribute every finding.** Every issue must reference a specific file and line number.
- **No editorializing.** Report what is wrong and how to fix it. Do not lecture about best practices in general.
- **Respect the focus.** If `review_focus` is `security`, do not report quality issues unless they are also security-relevant.
- **Actionable fixes.** Every critical and warning issue should include a concrete suggested fix, not just a description.
- **Cross-reference conventions.** Check findings against project config (tsconfig strictness, biome rules, etc.). Do not flag things the project has explicitly configured to allow.
- **Omit empty sections.** If no critical issues exist, omit the Critical Issues section entirely.
---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/nathanvale) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->
1---2name: nathanvale-side-quest-plugins-code-review3description: Program: Code Review4---56# Program: Code Review78## Input Contract910The assignment JSON contains:1112```json13{14 "path": "src/",15 "doc_type": "review",16 "review_focus": "security|performance|quality|all",17 "file_manifest": [{"name": "auth.ts", "size": 2048}, ...],18 "plain": false,19 "budget": {"max_files": 30, "max_lines_per_file": 500}20}21```2223## Analysis Phase2425Read files from the manifest. Do NOT re-enumerate -- the station already ran Glob.2627**Priority read order:**281. Configuration files (`package.json`, `tsconfig.json`, `biome.json`, `.eslintrc*`) -- establish project conventions292. Entry/index files (`index.ts`, `main.ts`) -- understand module structure303. Source files ordered by size descending (larger files are more likely to contain issues)314. Test files (for coverage gaps, test quality)3233**For each source file, check based on `review_focus`:**3435### Focus: `security`36- Injection vulnerabilities (SQL, command, path traversal)37- Unsafe `eval()`, `Function()`, `innerHTML`, `dangerouslySetInnerHTML`38- Hardcoded secrets, API keys, credentials39- Missing input validation at system boundaries40- Insecure cryptographic usage41- Prototype pollution risks42- Unvalidated redirects43- Missing authentication/authorization checks4445### Focus: `performance`46- Unnecessary re-renders (React components without memoization where needed)47- N+1 query patterns48- Unbounded loops or recursion49- Missing pagination on data fetching50- Large synchronous operations that should be async51- Memory leaks (event listeners not cleaned up, unclosed resources)52- Inefficient data structures (array lookups where Maps/Sets would be better)53- Bundle size concerns (large imports that could be tree-shaken)5455### Focus: `quality`56- Dead code (unused exports, unreachable branches)57- Code duplication (similar logic in multiple places)58- Overly complex functions (deep nesting, long parameter lists, excessive branching)59- Missing error handling at system boundaries60- Inconsistent naming or style (relative to project conventions from config files)61- Type safety issues (`any` types, missing null checks, unsafe casts)62- Poor abstraction (god functions, feature envy, inappropriate coupling)63- Missing or misleading documentation on public APIs6465### Focus: `all`66- Run all three categories above67- Prioritize findings by severity across categories6869## Severity Classification7071- **Critical**: Security vulnerabilities, data loss risks, crashes, race conditions72- **Warning**: Performance issues, maintainability concerns, potential bugs73- **Info**: Style inconsistencies, minor improvements, suggestions7475## Output Template7677Generate a code review report:7879```markdown80## Code Review Report8182### Summary8384| Category | Critical | Warning | Info |85|----------|----------|---------|------|86| Security | {N} | {N} | {N} |87| Performance | {N} | {N} | {N} |88| Quality | {N} | {N} | {N} |89| **Total** | **{N}** | **{N}** | **{N}** |9091### Critical Issues9293#### {issue_title}9495**File**: `{file_path}:{line_number}`96**Category**: {security|performance|quality}9798{description of the issue}99100```{language}101// Current code102{problematic code snippet}103```104105**Suggested fix:**106```{language}107{suggested replacement}108```109110---111112### Warnings113114#### {issue_title}115116**File**: `{file_path}:{line_number}`117**Category**: {security|performance|quality}118119{description}120121---122123### Info124125#### {issue_title}126127**File**: `{file_path}:{line_number}`128**Category**: {security|performance|quality}129130{description}131```132133## Rules134135- **No false positives over completeness.** Only report issues you are confident about. When uncertain, omit rather than guess.136- **Attribute every finding.** Every issue must reference a specific file and line number.137- **No editorializing.** Report what is wrong and how to fix it. Do not lecture about best practices in general.138- **Respect the focus.** If `review_focus` is `security`, do not report quality issues unless they are also security-relevant.139- **Actionable fixes.** Every critical and warning issue should include a concrete suggested fix, not just a description.140- **Cross-reference conventions.** Check findings against project config (tsconfig strictness, biome rules, etc.). Do not flag things the project has explicitly configured to allow.141- **Omit empty sections.** If no critical issues exist, omit the Critical Issues section entirely.142143---144> Converted and distributed by [TomeVault](https://tomevault.io/claim/nathanvale) — claim your Tome and manage your conversions.145<!-- tomevault:4.0:skill_md:2026-04-15 -->