validate
Check code for anti-patterns, metrics, and standards compliance. Returns a quality score, critical issues, warnings, and a pass/needs-work verdict.
Instructions
Analyze code against coding standards with language-aware checks and heuristic fallback.
WHEN TO USE:
After writing code, to check for issues
During iterative development
Before calling verify for final approval
PERFORMS ANALYSIS:
Detects anti-patterns (empty catch, hardcoded secrets, etc.)
Measures method/class lengths where supported
Checks for interfaces and tests
Calculates quality score
RETURNS:
Score (0-100)
CRITICAL issues (must fix)
WARNINGS (should fix)
Metrics (lines, methods, tests, etc.)
PASSED/NEEDS WORK verdict
EXAMPLE: validate({ code: "public class UserService { ... }", task_type: "feature" })
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code to validate | |
| task_type | No | Type of task for context-aware validation (optional) |