@qwen-code/qwen-code 0.13.0-preview.0 → 0.13.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: review
3
+ description: Review changed code for correctness, security, code quality, and performance. Use when the user asks to review code changes, a PR, or specific files. Invoke with `/review`, `/review <pr-number>`, or `/review <file-path>`.
4
+ allowedTools:
5
+ - task
6
+ - run_shell_command
7
+ - grep_search
8
+ - read_file
9
+ - glob
10
+ ---
11
+
12
+ # Code Review
13
+
14
+ You are an expert code reviewer. Your job is to review code changes and provide actionable feedback.
15
+
16
+ ## Step 1: Determine what to review
17
+
18
+ Your goal here is to understand the scope of changes so you can dispatch agents effectively in Step 2. Based on the arguments provided:
19
+
20
+ - **No arguments**: Review local uncommitted changes
21
+ - Run `git diff` and `git diff --staged` to get all changes
22
+ - If both diffs are empty, inform the user there are no changes to review and stop here — do not proceed to the review agents
23
+
24
+ - **PR number or URL** (e.g., `123` or `https://github.com/.../pull/123`):
25
+ - Save the current branch name, stash any local changes (`git stash --include-untracked`), then `gh pr checkout <number>`
26
+ - Run `gh pr view <number>` and save the output (title, description, base branch, etc.) to a temp file (e.g., `/tmp/pr-review-context.md`) so agents can read it without you repeating it in each prompt
27
+ - Note the base branch (e.g., `main`) — agents will use `git diff <base>...HEAD` to get the diff and can read files directly
28
+
29
+ - **File path** (e.g., `src/foo.ts`):
30
+ - Run `git diff HEAD -- <file>` to get recent changes
31
+ - If no diff, read the file and review its current state
32
+
33
+ ## Step 2: Parallel multi-dimensional review
34
+
35
+ Launch **four parallel review agents** to analyze the changes from different angles. Each agent should focus exclusively on its dimension.
36
+
37
+ **IMPORTANT**: Do NOT paste the full diff into each agent's prompt — this duplicates it 4x. Instead, give each agent the command to obtain the diff, a concise summary of what the changes are about, and its review focus. Each agent can read files and search the codebase on its own.
38
+
39
+ ### Agent 1: Correctness & Security
40
+
41
+ Focus areas:
42
+
43
+ - Logic errors and edge cases
44
+ - Null/undefined handling
45
+ - Race conditions and concurrency issues
46
+ - Security vulnerabilities (injection, XSS, SSRF, path traversal, etc.)
47
+ - Type safety issues
48
+ - Error handling gaps
49
+
50
+ ### Agent 2: Code Quality
51
+
52
+ Focus areas:
53
+
54
+ - Code style consistency with the surrounding codebase
55
+ - Naming conventions (variables, functions, classes)
56
+ - Code duplication and opportunities for reuse
57
+ - Over-engineering or unnecessary abstraction
58
+ - Missing or misleading comments
59
+ - Dead code
60
+
61
+ ### Agent 3: Performance & Efficiency
62
+
63
+ Focus areas:
64
+
65
+ - Performance bottlenecks (N+1 queries, unnecessary loops, etc.)
66
+ - Memory leaks or excessive memory usage
67
+ - Unnecessary re-renders (for UI code)
68
+ - Inefficient algorithms or data structures
69
+ - Missing caching opportunities
70
+ - Bundle size impact
71
+
72
+ ### Agent 4: Undirected Audit
73
+
74
+ No preset dimension. Review the code with a completely fresh perspective to catch issues the other three agents may miss.
75
+ Focus areas:
76
+
77
+ - Business logic soundness and correctness of assumptions
78
+ - Boundary interactions between modules or services
79
+ - Implicit assumptions that may break under different conditions
80
+ - Unexpected side effects or hidden coupling
81
+ - Anything else that looks off — trust your instincts
82
+
83
+ ## Step 3: Restore environment and present findings
84
+
85
+ If you checked out a PR branch in Step 1, restore the original state first: check out the original branch, `git stash pop` if changes were stashed, and remove the temp file.
86
+
87
+ Then combine results from all four agents into a single, well-organized review. Use this format:
88
+
89
+ ### Summary
90
+
91
+ A 1-2 sentence overview of the changes and overall assessment.
92
+
93
+ ### Findings
94
+
95
+ Use severity levels:
96
+
97
+ - **Critical** — Must fix before merging. Bugs, security issues, data loss risks.
98
+ - **Suggestion** — Recommended improvement. Better patterns, clearer code, potential issues.
99
+ - **Nice to have** — Optional optimization. Minor style tweaks, small performance gains.
100
+
101
+ For each finding, include:
102
+
103
+ 1. **File and line reference** (e.g., `src/foo.ts:42`)
104
+ 2. **What's wrong** — Clear description of the issue
105
+ 3. **Why it matters** — Impact if not addressed
106
+ 4. **Suggested fix** — Concrete code suggestion when possible
107
+
108
+ ### Verdict
109
+
110
+ One of:
111
+
112
+ - **Approve** — No critical issues, good to merge
113
+ - **Request changes** — Has critical issues that need fixing
114
+ - **Comment** — Has suggestions but no blockers
115
+
116
+ ## Guidelines
117
+
118
+ - Be specific and actionable. Avoid vague feedback like "could be improved."
119
+ - Reference the existing codebase conventions — don't impose external style preferences.
120
+ - Focus on the diff, not pre-existing issues in unchanged code.
121
+ - Keep the review concise. Don't repeat the same point for every occurrence.
122
+ - When suggesting a fix, show the actual code change.
123
+ - Flag any exposed secrets, credentials, API keys, or tokens in the diff as **Critical**.