improve: enhance code-reviewer agent with actionable review practices#492
Merged
Conversation
- Remove fake JSON communication protocol blocks (request_type/status JSON) - Add Review Setup section with concrete diff-scope commands - Add Automated Pre-Checks section (npm audit, pip-audit, cargo audit, secret grep) - Add Diff-First Reading Strategy with thresholds (<20, 20-100, >100 files) - Replace noun-list checklist with imperative behavioral instructions per category - Add Language-Specific Checks with concrete anti-patterns for TypeScript, Python, Rust, Go, SQL - Add Output Format section with four-level severity classification (CRITICAL/HIGH/MEDIUM/LOW) - Add Review Summary template with [N] placeholders and merge recommendation - Replace hardcoded "47 files, 2 critical issues" delivery text with template Automated review cycle | Co-Authored-By: Claude Code <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
| Metric | Count |
|---|---|
| Total Components | 759 |
| ✅ Passed | 360 |
| ❌ Failed | 399 |
| 1000 |
❌ Failed Components (Top 5)
| Component | Errors | Warnings | Score |
|---|---|---|---|
vercel-edge-function |
3 | 4 | 81/100 |
prompt-engineer |
2 | 0 | 90/100 |
neon-expert |
2 | 2 | 88/100 |
agent-overview |
2 | 1 | 89/100 |
unused-code-cleaner |
2 | 1 | 89/100 |
...and 394 more failed component(s)
📊 View Full Report for detailed error messages and all components
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cli-tool/components/agents/development-tools/code-reviewer.md">
<violation number="1" location="cli-tool/components/agents/development-tools/code-reviewer.md:18">
P3: The hardcoded-secrets pre-check claims to scan changed files, but the command runs a repo-wide grep. This contradicts the instruction and can add unnecessary work or false positives. Pipe the changed file list into grep so the command matches the stated scope.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| Before reading code, run available tooling to surface quick wins: | ||
|
|
||
| - Dependency CVEs: run `npm audit`, `pip-audit`, or `cargo audit` depending on the project | ||
| - Hardcoded secrets: run `grep -rE "(api_key|secret|password|token)\s*=\s*['\"][^'\"]{8,}" --include="*.py" --include="*.ts" --include="*.js"` on changed files |
Contributor
There was a problem hiding this comment.
P3: The hardcoded-secrets pre-check claims to scan changed files, but the command runs a repo-wide grep. This contradicts the instruction and can add unnecessary work or false positives. Pipe the changed file list into grep so the command matches the stated scope.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cli-tool/components/agents/development-tools/code-reviewer.md, line 18:
<comment>The hardcoded-secrets pre-check claims to scan changed files, but the command runs a repo-wide grep. This contradicts the instruction and can add unnecessary work or false positives. Pipe the changed file list into grep so the command matches the stated scope.</comment>
<file context>
@@ -6,24 +6,110 @@ tools: Read, Write, Edit, Bash, Glob, Grep
+Before reading code, run available tooling to surface quick wins:
+
+- Dependency CVEs: run `npm audit`, `pip-audit`, or `cargo audit` depending on the project
+- Hardcoded secrets: run `grep -rE "(api_key|secret|password|token)\s*=\s*['\"][^'\"]{8,}" --include="*.py" --include="*.ts" --include="*.js"` on changed files
+- Recent commit context: run `git log --oneline -5` to understand what changed and why
+
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated Component Improvement
Component: cli-tool/components/agents/development-tools/code-reviewer.md
Stats: #1 trending agent, 16,401 total downloads, 1,062/week
Changes
Research Summary
The code-reviewer is the #1 trending agent. The main gaps were: fake JSON protocol blocks suggesting non-existent inter-agent communication, noun-heavy checklists with no behavioral instructions, vague language-specific guidance, and hardcoded file counts. These improvements make the agent's behavior deterministic and its output format predictable.
Validation
Automated review cycle by Component Improvement Loop
Summary by cubic
Enhanced the code-reviewer agent with a practical review workflow and standardized output to produce clear, actionable feedback. Removes the fake JSON protocol and scales the process for large diffs.
git diff --name-only HEAD~1); removed fake JSON protocol.npm audit,pip-audit,cargo audit, secrets grep) with graceful fallback.file:line, Risk/Fix) and a parameterized Review Summary. Area: components (cli-tool/components/); no new components; nodocs/components.jsonregen; no new env vars or secrets.Written for commit b658762. Summary will update on new commits.