{
  "version": "act 1.0.17",
  "slug": "code-review",
  "name": "code-review",
  "description": "Review code for bugs, complexity, unused symbols, and structural issues using AST-aware analysis. Use when reviewing PRs, checking code quality, finding dead code, analyzing function complexity, auditing a codebase, or checking for type errors. Works across TypeScript, Python, Rust, Go, and 14 more languages.",
  "url": "https://act101.ai/docs/skills/code-review",
  "body_md": "# Code Review with act\n\nAnalyze code for issues using act's 8 query tools.\n\n## Start Here\n\nCheck workspace status first \u2014 some tools require LSP:\n```\nstatus()\n```\n\n## Exploration Pattern\n\nFor systematic file exploration, use a two-pass approach: parser-only tools first (`skeleton`, `symbols`), then LSP tools (`diagnostics`, `references`, `callers`). Start broad (directory skeletons), narrow (file symbols), then deep (reference chains).\n\n## Core Review Tools\n\n### Always available (parser-only)\n\n**skeleton** \u2014 Get file structure. Shows function signatures, class declarations, nesting depth.\n```\nskeleton(file=\"src/auth/login.ts\")\n```\n\n**symbols** \u2014 List all symbols with kinds and locations. Spot missing exports, large symbol counts.\n```\nsymbols(file=\"src/auth/login.ts\")\n```\n\n### Requires LSP\n\n**diagnostics** \u2014 Compiler/linter errors, warnings, hints. The primary bug-finding tool.\n```\ndiagnostics(file=\"src/auth/login.ts\")\n```\n\n**references** \u2014 Find all references to a symbol. Detect unused exports (0 external references).\n```\nreferences(symbol=\"validateToken\", file=\"src/auth/token.ts\")\n```\n\n**callers** \u2014 Find functions that call a symbol. Understand coupling and blast radius.\n```\ncallers(symbol=\"processPayment\", file=\"src/billing.ts\")\n```\n\n**definition** \u2014 Jump to where a symbol is defined. Trace imports to source.\n```\ndefinition(symbol=\"UserService\", file=\"src/api.ts\", line=15, column=10)\n```\n\n**get_type** \u2014 Get the inferred type at a position. Check type correctness.\n```\nget_type(file=\"src/api.ts\", line=42, column=12)\n```\n\n## Review Workflow\n\n### For a single file\n1. `diagnostics` \u2014 get all errors/warnings\n2. `skeleton` \u2014 check structure (function sizes, nesting)\n3. `symbols` \u2014 check symbol density and naming\n\n### For a directory/module\n1. `skeleton` on each file \u2014 build structural overview\n2. `diagnostics` on each file \u2014 collect all issues\n3. `references` on exports \u2014 find unused public API\n4. `callers` on key functions \u2014 check coupling\n\n### For a PR (changed files)\n1. `diagnostics` on each changed file\n2. `skeleton` on changed files \u2014 check new structure\n3. `references` on renamed/moved symbols \u2014 verify all references updated\n4. `callers` on modified functions \u2014 assess impact\n\n## What to Look For\n\n| Signal | Tool | Severity |\n|--------|------|----------|\n| Compiler errors | diagnostics | Error |\n| Type mismatches | diagnostics, get_type | Error |\n| Unused imports/variables | diagnostics | Warning |\n| Function >50 lines | skeleton | Warning |\n| Function >5 parameters | skeleton | Warning |\n| Nesting depth >4 | skeleton | Warning |\n| Symbol with 0 references | references | Info |\n| High caller count (>10) | callers | Info |\n\n## Advanced Patterns\n\nSee [review-patterns.md](references/review-patterns.md) for detailed review checklists and multi-file analysis strategies.\n\n## Error Recovery\n\nSee [error-recovery.md](references/error-recovery.md) for handling LSP failures, file-not-found, and ambiguous symbols.\n\n## Output Format\n\nReport findings grouped by severity:\n\n```\n## Review: src/auth/login.ts\n\n### Errors (2)\n- Line 45: Type 'string' is not assignable to type 'number' [diagnostics]\n- Line 72: Cannot find name 'authConfig' [diagnostics]\n\n### Warnings (3)\n- Line 15-80: Function `handleLogin` is 65 lines (>50 threshold) [skeleton]\n- Line 23: Unused import 'lodash' [diagnostics]\n- Line 90: `validateToken` has 0 external references \u2014 possibly dead code [references]\n\n### Info (1)\n- `processAuth` called from 12 locations \u2014 high coupling [callers]\n```"
}