Policy Review AI
Review the current file or all uncommitted changes against:
- a baseline code review policy
- a repo-specific policy file
- either a VS Code language model or Anthropic
Features
- Review Current File button in the editor title bar
- Review Uncommitted Changes button in Source Control
- Repo policy file auto-loading from one of:
.ai-review-policy.md
.review-policy.md
.github/review-policy.md
.copilot/instructions.md
- Provider selection:
vscode-lm for Copilot / VS Code model access
anthropic for direct Anthropic API use
Install locally without packaging
- Copy this folder to your VS Code extensions directory.
- Windows:
%USERPROFILE%\\.vscode\\extensions\\local-dev.policy-review-ai-0.0.1
- macOS:
~/.vscode/extensions/local-dev.policy-review-ai-0.0.1
- Linux:
~/.vscode/extensions/local-dev.policy-review-ai-0.0.1
- Reload VS Code.
- Open Command Palette and run one of:
Policy Review: Review Current File
Policy Review: Review Uncommitted Changes
Package as VSIX
If you want a .vsix file:
npm install -g @vscode/vsce
cd policy-review-ai
vsce package
Then install the generated .vsix from VS Code.
Configuration
Use GitHub Copilot / VS Code model access
Set:
policyReview.provider = vscode-lm
Optional:
policyReview.vscodeLmVendor = copilot
policyReview.vscodeLmFamily = gpt-4o
If no model matches the hints, clear the hints and try again.
Use Anthropic directly
Set:
policyReview.provider = anthropic
Then run:
Policy Review: Set Anthropic API Key
Or set policyReview.anthropicApiKey directly.
Recommended repo policy file
Create .ai-review-policy.md in your repo root:
# Project review policy
- Follow existing naming and dependency-injection conventions.
- Preserve backward compatibility for public service contracts.
- Validate auth, tenant, user, and telemetry handling.
- Treat cancellation, async streaming, and nullability as high-signal concerns.
- Prefer minimal, safe changes over large refactors in review comments.
Notes
- For uncommitted review, the extension uses Git commands from the local repository.
- For current file review, it includes the file's current content and its Git diff when available.
- The extension is plain JavaScript, so there is no build step.