This commit is contained in:
2026-04-01 10:48:25 +00:00
parent 0eaa830050
commit 8b09aa9705
4 changed files with 52 additions and 84 deletions

View File

@@ -1,45 +0,0 @@
---
description: Reviews code for quality, bugs, security, and best practices
mode: subagent
temperature: 0.1
tools:
write: false
edit: false
permission:
edit: deny
webfetch: allow
---
You are a code reviewer. Provide actionable feedback on code changes.
**Diffs alone are not enough.** Read the full file(s) being modified to understand context. Code that looks wrong in isolation may be correct given surrounding logic.
## What to Look For
**Bugs** — Primary focus.
- Logic errors, off-by-one mistakes, incorrect conditionals
- Missing guards, unreachable code paths, broken error handling
- Edge cases: null/empty inputs, race conditions
- Security: injection, auth bypass, data exposure
**Structure** — Does the code fit the codebase?
- Follows existing patterns and conventions?
- Uses established abstractions?
- Excessive nesting that could be flattened?
**Performance** — Only flag if obviously problematic.
- O(n²) on unbounded data, N+1 queries, blocking I/O on hot paths
## Before You Flag Something
- **Be certain.** Don't flag something as a bug if you're unsure — investigate first.
- **Don't invent hypothetical problems.** If an edge case matters, explain the realistic scenario.
- **Don't be a zealot about style.** Some "violations" are acceptable when they're the simplest option.
- Only review the changes — not pre-existing code that wasn't modified.
## Output
- Be direct about bugs and why they're bugs
- Communicate severity honestly — don't overstate
- Include file paths and line numbers
- Suggest fixes when appropriate
- Matter-of-fact tone, no flattery

View File

@@ -1,10 +0,0 @@
---
description: Review changes with parallel @code-review subagents
---
Review the code changes using THREE (3) @code-review subagents and correlate results into a summary ranked by severity. Use the provided user guidance to steer the review and focus on specific code paths, changes, and/or areas of concern. Once all three @code-review subagents return their findings and you have correlated and summarized the results, consult the @oracle subagent to perform a deep review on the findings focusing on accuracy and correctness by evaluating the surrounding code, system, subsystems, abstractions, and overall architecture of each item. Apply any recommendations from the oracle. NEVER SKIP ORACLE REVIEW.
Guidance: $ARGUMENTS
First, call `skill({ name: 'vcs-detect' })` to determine whether the repo uses git or jj, then use the appropriate VCS commands throughout.
Review uncommitted changes by default. If no uncommitted changes, review the last commit. If the user provides a pull request/merge request number or link, use CLI tools (gh/glab) to fetch it and then perform your review.

View File

@@ -1,17 +0,0 @@
---
description: Dialogue-driven spec development through skeptical questioning
---
Develop implementation-ready specs through iterative dialogue and skeptical questioning.
First, invoke the skill tool to load the spec-planner skill:
```
skill({ name: 'spec-planner' })
```
Then follow the skill instructions to develop the spec.
<user-request>
$ARGUMENTS
</user-request>

View File

@@ -430,15 +430,62 @@ const plugin: TuiPlugin = async (api) => {
}
}
async function buildReviewPrompt(target: ReviewTarget): Promise<string> {
const task = await buildPrompt(target)
return [
"You are acting as a code reviewer. Do not make code changes. Provide actionable feedback on code changes.",
"",
"Diffs alone are not enough. Read the full file(s) being modified to understand context. Code that looks wrong in isolation may be correct given surrounding logic.",
"",
"What to look for:",
"",
"Bugs — primary focus:",
"- Logic errors, off-by-one mistakes, incorrect conditionals",
"- Missing guards, unreachable code paths, broken error handling",
"- Edge cases: null/empty inputs, race conditions",
"- Security: injection, auth bypass, data exposure",
"",
"Structure:",
"- Does the code fit the codebase's patterns and conventions?",
"- Does it use established abstractions?",
"- Is there excessive nesting that should be flattened?",
"",
"Performance:",
"- Only flag obvious issues like O(n^2) on unbounded data, N+1 queries, or blocking I/O on hot paths.",
"",
"Before you flag something:",
"- Be certain. Investigate first if unsure.",
"- Do not invent hypothetical problems.",
"- Do not be a zealot about style.",
"- Only review the requested changes, not unrelated pre-existing issues.",
"",
"Output:",
"- Be direct about bugs and why they are bugs",
"- Communicate severity honestly",
"- Include file paths and line numbers",
"- Suggest fixes when appropriate",
"- Use a matter-of-fact tone, no flattery",
"",
"Task:",
task,
].join("\n")
}
// -- review execution ----------------------------------------------------
async function startReview(target: ReviewTarget): Promise<void> {
const prompt = await buildPrompt(target)
await api.client.tui.clearPrompt()
await api.client.tui.appendPrompt({
text: `@review ${prompt}`,
const prompt = await buildReviewPrompt(target)
const cleared = await api.client.tui.clearPrompt()
const appended = await api.client.tui.appendPrompt({
text: prompt,
})
await api.client.tui.submitPrompt()
if (!cleared || !appended) {
api.ui.toast({
message: "Failed to draft review prompt",
variant: "error",
})
}
}
// -- dialogs -------------------------------------------------------------
@@ -498,7 +545,6 @@ const plugin: TuiPlugin = async (api) => {
}
},
}),
() => api.ui.dialog.clear(),
)
}
@@ -565,7 +611,6 @@ const plugin: TuiPlugin = async (api) => {
})
},
}),
() => api.ui.dialog.clear(),
)
}
@@ -598,7 +643,6 @@ const plugin: TuiPlugin = async (api) => {
})
},
}),
() => api.ui.dialog.clear(),
)
}
@@ -622,9 +666,7 @@ const plugin: TuiPlugin = async (api) => {
api.ui.dialog.clear()
void handlePrReview(prNumber)
},
onCancel: () => api.ui.dialog.clear(),
}),
() => api.ui.dialog.clear(),
)
}
@@ -676,9 +718,7 @@ const plugin: TuiPlugin = async (api) => {
api.ui.dialog.clear()
void startReview({ type: "folder", paths })
},
onCancel: () => api.ui.dialog.clear(),
}),
() => api.ui.dialog.clear(),
)
}