Agent Skills in Claude Code and Visual Studio Code: Setup, Benefits, Risks, and a Step-by-Step Example
Imagine this ideal workflow: A PR is posted. Within minutes, an AI tool posts an automated first review catching syntax errors, missing null checks, and known security patterns. Then a human reviewer reads the code knowing that basic hygiene issues are already handled, and focuses their energy on design decisions, business logic correctness, architectural considerations, and team mentoring. This is the future of code review — but only if humans stay firmly in control of the process and decision-making.
The ideal architecture looks like:
PR posted
↓
AI first review (surface issues: syntax, security patterns, null checks)
↓
Human reviewer (deep issues: design, business logic, context)
↓
Approve and merge
This division of labor lets AI do what it's genuinely good at — finding known patterns and surface-level issues quickly and consistently — while humans focus on what only humans can do: understanding context, business requirements, architectural tradeoffs, and team dynamics.
Tools like CodeRabbit automatically review PRs when posted. Setup is straightforward. Add a `.coderabbit.yaml` file to your project root:
language: "en"
tone_instructions: "Professional, concise"
reviews:
profile: chill # comment tone: assertive / chill
high_level_summary: true
request_changes_workflow: false
path_instructions:
- path: "src/api/**"
instructions: |
Always check whether API endpoints require authentication.
Responses must be wrapped in ApiResponse<T> wrapper.
Report security issues as [Required].
- path: "src/services/**"
instructions: |
The service layer must not contain direct HTTP-related code.
Services should not handle response formatting.
Focus on business logic correctness.
- path: "src/models/**"
instructions: |
Check that models properly validate their state.
Immutability is preferred where possible.
The `path_instructions` section is the key. You're telling AI about your team's specific conventions. Now AI can point out endpoints missing authentication checks, services that violate layer separation, or models that need validation.
Even without a dedicated AI review tool, you can paste code directly to Claude with well-crafted prompts:
Review the code below, focusing on:
1. Security vulnerabilities (SQL injection, XSS, missing authentication)
2. Missing error handling (null returns, exception handling)
3. Performance issues (N+1, full scans)
4. Readability (variable names, function names)
Comment format:
- [Required]: Things that must be fixed
- [Suggestion]: Things that would be good to improve
- Include the reason and direction for improvement in each comment
Our team conventions:
- API responses are always wrapped in { success, data, error } shape
- The service layer does not directly return HTTP status codes
- Endpoints that require authentication must have @PreAuthorize
- Error logs always include userId and requestId
[paste code here]
By including team conventions in the prompt, AI will catch convention violations automatically. Save this prompt as a template. Reuse it for each PR review.
AI is reliable and consistent at these. It catches things humans skim over. It doesn't get tired or distracted.
A human reviewer should review AI's findings before they're shared with the author. Not all AI suggestions should become PR comments.
AI sees the code as it is now. It doesn't know that a magic number `1` exists for legacy database compatibility, or that an unusual pattern was intentionally added to work around a specific bug in an external library from three years ago.
Human reviewers carry institutional memory and understand the historical context that led to current architecture.
async function applyPromotion(userId, promoCode) {
const promo = await promoRepository.findByCode(promoCode);
if (!promo || promo.isExpired()) {
throw new InvalidPromoError();
}
await userRepository.applyPromo(userId, promo);
}AI sees this as technically sound. But the planning document says: "Promotions only apply to new users within 7 days of signup." That business requirement isn't in the code.
AI can't read planning documents or requirements specs.
When reviewing architecture questions — "Should this be event-based or synchronous?" — AI can point out SRP violations but can't discuss the tradeoffs that require experience: scalability implications, eventual consistency costs, debugging difficulty, team familiarity with patterns.
What AI quietly passes over can be more dangerous than what it flags. Domain knowledge-dependent edge cases that AI doesn't know to check:
async function transferPoints(from, to, points) {
await pointRepository.deduct(from, points);
// If this fails, points disappear
await pointRepository.add(to, points);
}AI might not recognize that these two operations MUST be atomic. It requires transaction handling. This requires understanding the domain — financial operations must be atomic.
Confusion and dysfunction arise when teams don't explicitly divide roles. "Did AI check this already?" "Should I also check it?"
Be explicit in your PR checklist and guidelines:
## AI Review (CodeRabbit)
- [ ] AI review comments checked
- [ ] Fix [Required] items
- [ ] Resolve false positives with reasoning
- [ ] Do NOT merge based only on AI approval
## Human Reviewer
- [ ] Business logic correctness
- [ ] Team convention consistency
- [ ] Domain edge cases
- [ ] Performance (consider production data scale)
- [ ] Architectural alignment
- [ ] Mentor junior developers with explanations
This clarity prevents the dangerous mindset of "AI passed it, so it's fine."
Step 1: Let AI go first. Don't review human-style yet. Let the AI tool do its surface-level scan. Accept or dispute its findings, but don't skip this step.
Step 2: Resolve false positives. If AI flags something that isn't actually a problem in your context, document why. This trains the AI and creates documentation for future team members.
Step 3: Human review with fresh eyes. Now that surface issues are handled, focus on architecture, business logic, and context.
Step 4: Merge confidence. The code has been reviewed at both levels — surface and deep.
Generic AI review is less valuable than AI configured for your team's specific patterns and conventions. Invest time in:
An hour spent configuring AI review saves hundreds of hours over a year.
AI review tools sometimes flag things that aren't actually problems in your context:
False Positive 1: "Unused variable" — Actually, it's used in a different build configuration or will be used soon when related code lands.
False Positive 2: "Long function" — The function is long but each section is simple and removing sections makes it incomprehensible.
False Positive 3: "Too many parameters" — Yes, 6 parameters. But this is an internal function and all are essential.
False Positive 4: "Missing error handling" — Error is handled at a higher layer or logged appropriately.
When you encounter false positives, document them in your AI configuration:
## AI Review False Positives Log
- "Long functions" flag: Internal coordinator functions are allowed to be long if each section is clear
- "Too many parameters" flag: Internal functions can have many parameters if external-facing ones don't
- "Unused variables" flag: Allow in test fixtures and configuration blocks
This helps your team and trains your AI tool over time.
As AI handles null checks, syntax issues, and simple patterns, human reviewers' role doesn't shrink — it fundamentally elevates to higher-value work. Humans focus on:
The role of code reviewer becomes more valuable and strategic, not less. The best reviewers aren't those who catch typos — they're those who prevent architecture mistakes, catch business logic errors, and mentor their team to higher levels of craftsmanship.
Practical setup steps:
This gradual approach prevents frustration and poor initial impressions.
Comments
Post a Comment