Code Review & Standards Audit
Perform automated architectural, security, and contract audits on pull requests and local working trees before merge.
The Problem
Human reviewers miss subtle edge cases (unhandled async rejections, SQL injection vulnerabilities, broken API contract changes), while manual review bottlenecks release velocity.
Who It Is For
Tech leads, senior engineers, and PR reviewers automating pre-merge code reviews.
Prerequisites & Tools
- Git repository with staged or uncommitted changes
- Configured DevWorkflow MCP
| Tool / Command | Type | Role in Tutorial |
|---|---|---|
| audit | mcp | Audit working tree, diffs, API contracts, and security against engineering standards |
| analyze_change | mcp | Explain rule violations, change impact, and recommended tests |
| apply_safe_fix | mcp | Apply worktree-fenced deterministic AF-0/AF-1 fixes with rollback |
Example Task Contract
Exact start_task payload representing this workflow in DevWorkflow local-first governance.
{
"description": "Audit checkout service pull request for API contract stability and security compliance",
"type": "refactor",
"plan": [
"Audit modified endpoint schemas in routes/checkout.js",
"Verify absence of unparameterized database queries",
"Confirm backward compatibility for mobile clients"
],
"definitionOfDone": [
"Zero SQL injection or secret leak vulnerabilities detected",
"API contract audit passes without breaking existing schema",
"Automated review summary posted to PR notes"
]
}Step-by-Step Tutorial Workflow
Follow these sequential actions with validated copyable commands and expected outputs.
Run Code & Contract Audit
Instruct the AI to inspect current changes for standards violations and security flaws.
{
"target": "HEAD~1..HEAD"
}Review Audit Report
Examine detected smells, contract breaking changes, and cyclomatic complexity warnings.
git diff --stat HEAD~14 files changed, 112 insertions(+), 18 deletions(-)
Audit: 0 critical vulnerabilities · 0 contract breaks · 1 refactor opportunityApply Safe Automated Fixes
Use apply_safe_fix or refactor the highlighted regions before committing.
npm testAll tests passed.Verification Steps
Verify that your work genuinely satisfies the task contract before closing.