---
name: review-code-review
description: Automated code review for security, design tokens, and accessibility. Checks for XSS, hardcoded colors, missing ARIA attributes. Returns JSON with issues.
---
# review-code-review - Automated Code Review
Quick code review checking for common issues.
## Input Schema
```json
{
"project_dir": "/path/to/project",
"ticket_id": "TICKET-XXX",
"files": ["src/components/Foo.js"],
"checks": ["security", "design_tokens", "accessibility", "data_contracts"]
}
```
## Review Checks
### Security (CRITICAL)
| Pattern | Severity | Fix |
|---------|----------|-----|
| `innerHTML = ` with variable | HIGH | Use `textContent` or DOM APIs |
| `eval()` with external data | CRITICAL | Remove, use safe alternatives |
| `document.write()` | MEDIUM | Use DOM APIs |
| Hardcoded credentials | CRITICAL | Move to env vars |
| `onclick="..."` inline handlers | MEDIUM | Use addEventListener |
### Design Tokens
| Pattern | Severity | Fix |
|---------|----------|-----|
| Hardcoded hex colors (`#fff`) | HIGH | Use `var(--color-*)` |
| Hardcoded px values | MEDIUM | Use `var(--spacing-*)` |
| Magic numbers in CSS | MEDIUM | Extract to design tokens |
| Inline styles with colors | HIGH | Use CSS classes |
### Accessibility
| Pattern | Severity | Fix |
|---------|----------|-----|
| `
` without `alt` | HIGH | Add `alt` attribute |
| Icon without `aria-label` | MEDIUM | Add label for screen readers |
| Non-semantic elements for buttons | HIGH | Use `