@protolabsai/proto 0.14.0
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.
- package/LICENSE +203 -0
- package/README.md +286 -0
- package/dist/bundled/adversarial-verification/SKILL.md +98 -0
- package/dist/bundled/brainstorming/SKILL.md +171 -0
- package/dist/bundled/coding-agent-standards/SKILL.md +67 -0
- package/dist/bundled/dispatching-parallel-agents/SKILL.md +193 -0
- package/dist/bundled/executing-plans/SKILL.md +77 -0
- package/dist/bundled/finishing-a-development-branch/SKILL.md +213 -0
- package/dist/bundled/loop/SKILL.md +61 -0
- package/dist/bundled/qc-helper/SKILL.md +151 -0
- package/dist/bundled/qc-helper/docs/_meta.ts +30 -0
- package/dist/bundled/qc-helper/docs/common-workflow.md +571 -0
- package/dist/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
- package/dist/bundled/qc-helper/docs/configuration/auth.md +366 -0
- package/dist/bundled/qc-helper/docs/configuration/memory.md +0 -0
- package/dist/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
- package/dist/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
- package/dist/bundled/qc-helper/docs/configuration/settings.md +652 -0
- package/dist/bundled/qc-helper/docs/configuration/themes.md +160 -0
- package/dist/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
- package/dist/bundled/qc-helper/docs/extension/_meta.ts +9 -0
- package/dist/bundled/qc-helper/docs/extension/extension-releasing.md +121 -0
- package/dist/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
- package/dist/bundled/qc-helper/docs/extension/introduction.md +303 -0
- package/dist/bundled/qc-helper/docs/features/_meta.ts +18 -0
- package/dist/bundled/qc-helper/docs/features/approval-mode.md +263 -0
- package/dist/bundled/qc-helper/docs/features/arena.md +218 -0
- package/dist/bundled/qc-helper/docs/features/checkpointing.md +77 -0
- package/dist/bundled/qc-helper/docs/features/commands.md +312 -0
- package/dist/bundled/qc-helper/docs/features/headless.md +318 -0
- package/dist/bundled/qc-helper/docs/features/hooks.md +343 -0
- package/dist/bundled/qc-helper/docs/features/language.md +139 -0
- package/dist/bundled/qc-helper/docs/features/lsp.md +453 -0
- package/dist/bundled/qc-helper/docs/features/mcp.md +281 -0
- package/dist/bundled/qc-helper/docs/features/sandbox.md +241 -0
- package/dist/bundled/qc-helper/docs/features/scheduled-tasks.md +139 -0
- package/dist/bundled/qc-helper/docs/features/skills.md +289 -0
- package/dist/bundled/qc-helper/docs/features/sub-agents.md +307 -0
- package/dist/bundled/qc-helper/docs/features/token-caching.md +29 -0
- package/dist/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
- package/dist/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
- package/dist/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
- package/dist/bundled/qc-helper/docs/integration-github-action.md +241 -0
- package/dist/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
- package/dist/bundled/qc-helper/docs/integration-vscode.md +39 -0
- package/dist/bundled/qc-helper/docs/integration-zed.md +72 -0
- package/dist/bundled/qc-helper/docs/overview.md +64 -0
- package/dist/bundled/qc-helper/docs/quickstart.md +273 -0
- package/dist/bundled/qc-helper/docs/reference/_meta.ts +4 -0
- package/dist/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
- package/dist/bundled/qc-helper/docs/reference/sdk-api.md +524 -0
- package/dist/bundled/qc-helper/docs/support/Uninstall.md +42 -0
- package/dist/bundled/qc-helper/docs/support/_meta.ts +6 -0
- package/dist/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
- package/dist/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
- package/dist/bundled/receiving-code-review/SKILL.md +226 -0
- package/dist/bundled/requesting-code-review/SKILL.md +115 -0
- package/dist/bundled/review/SKILL.md +123 -0
- package/dist/bundled/subagent-driven-development/SKILL.md +292 -0
- package/dist/bundled/subagent-driven-development/code-quality-reviewer-prompt.md +27 -0
- package/dist/bundled/subagent-driven-development/implementer-prompt.md +113 -0
- package/dist/bundled/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/dist/bundled/systematic-debugging/SKILL.md +305 -0
- package/dist/bundled/test-driven-development/SKILL.md +396 -0
- package/dist/bundled/using-git-worktrees/SKILL.md +223 -0
- package/dist/bundled/using-superpowers/SKILL.md +117 -0
- package/dist/bundled/verification-before-completion/SKILL.md +147 -0
- package/dist/bundled/writing-plans/SKILL.md +159 -0
- package/dist/bundled/writing-skills/SKILL.md +716 -0
- package/dist/cli.js +483432 -0
- package/dist/sandbox-macos-permissive-closed.sb +32 -0
- package/dist/sandbox-macos-permissive-open.sb +27 -0
- package/dist/sandbox-macos-permissive-proxied.sb +37 -0
- package/dist/sandbox-macos-restrictive-closed.sb +93 -0
- package/dist/sandbox-macos-restrictive-open.sb +96 -0
- package/dist/sandbox-macos-restrictive-proxied.sb +98 -0
- package/dist/vendor/ripgrep/COPYING +3 -0
- package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/dist/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/package.json +143 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
This guide provides solutions to common issues and debugging tips, including topics on:
|
|
4
|
+
|
|
5
|
+
- Authentication or login errors
|
|
6
|
+
- Frequently asked questions (FAQs)
|
|
7
|
+
- Debugging tips
|
|
8
|
+
- Existing GitHub Issues similar to yours or creating new Issues
|
|
9
|
+
|
|
10
|
+
## Authentication or login errors
|
|
11
|
+
|
|
12
|
+
- **Error: `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `UNABLE_TO_VERIFY_LEAF_SIGNATURE`, or `unable to get local issuer certificate`**
|
|
13
|
+
- **Cause:** You may be on a corporate network with a firewall that intercepts and inspects SSL/TLS traffic. This often requires a custom root CA certificate to be trusted by Node.js.
|
|
14
|
+
- **Solution:** Set the `NODE_EXTRA_CA_CERTS` environment variable to the absolute path of your corporate root CA certificate file.
|
|
15
|
+
- Example: `export NODE_EXTRA_CA_CERTS=/path/to/your/corporate-ca.crt`
|
|
16
|
+
|
|
17
|
+
- **Error: `Device authorization flow failed: fetch failed`**
|
|
18
|
+
- **Cause:** Node.js could not reach Qwen OAuth endpoints (often a proxy or SSL/TLS trust issue). When available, Qwen Code will also print the underlying error cause (for example: `UNABLE_TO_VERIFY_LEAF_SIGNATURE`).
|
|
19
|
+
- **Solution:**
|
|
20
|
+
- Confirm you can access `https://chat.qwen.ai` from the same machine/network.
|
|
21
|
+
- If you are behind a proxy, set it via `qwen --proxy <url>` (or the `proxy` setting in `settings.json`).
|
|
22
|
+
- If your network uses a corporate TLS inspection CA, set `NODE_EXTRA_CA_CERTS` as described above.
|
|
23
|
+
|
|
24
|
+
- **Issue: Unable to display UI after authentication failure**
|
|
25
|
+
- **Cause:** If authentication fails after selecting an authentication type, the `security.auth.selectedType` setting may be persisted in `settings.json`. On restart, the CLI may get stuck trying to authenticate with the failed auth type and fail to display the UI.
|
|
26
|
+
- **Solution:** Clear the `security.auth.selectedType` configuration item in your `settings.json` file:
|
|
27
|
+
- Open `~/.qwen/settings.json` (or `./.qwen/settings.json` for project-specific settings)
|
|
28
|
+
- Remove the `security.auth.selectedType` field
|
|
29
|
+
- Restart the CLI to allow it to prompt for authentication again
|
|
30
|
+
|
|
31
|
+
## Frequently asked questions (FAQs)
|
|
32
|
+
|
|
33
|
+
- **Q: How do I update Qwen Code to the latest version?**
|
|
34
|
+
- A: If you installed it globally via `npm`, update it using the command `npm install -g @qwen-code/qwen-code@latest`. If you compiled it from source, pull the latest changes from the repository, and then rebuild using the command `npm run build`.
|
|
35
|
+
|
|
36
|
+
- **Q: Where are the Qwen Code configuration or settings files stored?**
|
|
37
|
+
- A: The Qwen Code configuration is stored in two `settings.json` files:
|
|
38
|
+
1. In your home directory: `~/.qwen/settings.json`.
|
|
39
|
+
2. In your project's root directory: `./.qwen/settings.json`.
|
|
40
|
+
|
|
41
|
+
Refer to [Qwen Code Configuration](../configuration/settings) for more details.
|
|
42
|
+
|
|
43
|
+
- **Q: Why don't I see cached token counts in my stats output?**
|
|
44
|
+
- A: Cached token information is only displayed when cached tokens are being used. This feature is available for API key users (Qwen API key or Google Cloud Vertex AI) but not for OAuth users (such as Google Personal/Enterprise accounts like Google Gmail or Google Workspace, respectively). This is because the Qwen Code Assist API does not support cached content creation. You can still view your total token usage using the `/stats` command.
|
|
45
|
+
|
|
46
|
+
## Common error messages and solutions
|
|
47
|
+
|
|
48
|
+
- **Error: `EADDRINUSE` (Address already in use) when starting an MCP server.**
|
|
49
|
+
- **Cause:** Another process is already using the port that the MCP server is trying to bind to.
|
|
50
|
+
- **Solution:**
|
|
51
|
+
Either stop the other process that is using the port or configure the MCP server to use a different port.
|
|
52
|
+
|
|
53
|
+
- **Error: Command not found (when attempting to run Qwen Code with `qwen`).**
|
|
54
|
+
- **Cause:** The CLI is not correctly installed or it is not in your system's `PATH`.
|
|
55
|
+
- **Solution:**
|
|
56
|
+
The update depends on how you installed Qwen Code:
|
|
57
|
+
- If you installed `qwen` globally, check that your `npm` global binary directory is in your `PATH`. You can update using the command `npm install -g @qwen-code/qwen-code@latest`.
|
|
58
|
+
- If you are running `qwen` from source, ensure you are using the correct command to invoke it (e.g. `node packages/cli/dist/index.js ...`). To update, pull the latest changes from the repository, and then rebuild using the command `npm run build`.
|
|
59
|
+
|
|
60
|
+
- **Error: `MODULE_NOT_FOUND` or import errors.**
|
|
61
|
+
- **Cause:** Dependencies are not installed correctly, or the project hasn't been built.
|
|
62
|
+
- **Solution:**
|
|
63
|
+
1. Run `npm install` to ensure all dependencies are present.
|
|
64
|
+
2. Run `npm run build` to compile the project.
|
|
65
|
+
3. Verify that the build completed successfully with `npm run start`.
|
|
66
|
+
|
|
67
|
+
- **Error: "Operation not permitted", "Permission denied", or similar.**
|
|
68
|
+
- **Cause:** When sandboxing is enabled, Qwen Code may attempt operations that are restricted by your sandbox configuration, such as writing outside the project directory or system temp directory.
|
|
69
|
+
- **Solution:** Refer to the [Configuration: Sandboxing](../features/sandbox) documentation for more information, including how to customize your sandbox configuration.
|
|
70
|
+
|
|
71
|
+
- **Qwen Code is not running in interactive mode in "CI" environments**
|
|
72
|
+
- **Issue:** Qwen Code does not enter interactive mode (no prompt appears) if an environment variable starting with `CI_` (e.g. `CI_TOKEN`) is set. This is because the `is-in-ci` package, used by the underlying UI framework, detects these variables and assumes a non-interactive CI environment.
|
|
73
|
+
- **Cause:** The `is-in-ci` package checks for the presence of `CI`, `CONTINUOUS_INTEGRATION`, or any environment variable with a `CI_` prefix. When any of these are found, it signals that the environment is non-interactive, which prevents the CLI from starting in its interactive mode.
|
|
74
|
+
- **Solution:** If the `CI_` prefixed variable is not needed for the CLI to function, you can temporarily unset it for the command. e.g. `env -u CI_TOKEN qwen`
|
|
75
|
+
|
|
76
|
+
- **DEBUG mode not working from project .env file**
|
|
77
|
+
- **Issue:** Setting `DEBUG=true` in a project's `.env` file doesn't enable debug mode for the CLI.
|
|
78
|
+
- **Cause:** The `DEBUG` and `DEBUG_MODE` variables are automatically excluded from project `.env` files to prevent interference with the CLI behavior.
|
|
79
|
+
- **Solution:** Use a `.qwen/.env` file instead, or configure the `advanced.excludedEnvVars` setting in your `settings.json` to exclude fewer variables.
|
|
80
|
+
|
|
81
|
+
## IDE Companion not connecting
|
|
82
|
+
|
|
83
|
+
- Ensure VS Code has a single workspace folder open.
|
|
84
|
+
- Restart the integrated terminal after installing the extension so it inherits:
|
|
85
|
+
- `QWEN_CODE_IDE_WORKSPACE_PATH`
|
|
86
|
+
- `QWEN_CODE_IDE_SERVER_PORT`
|
|
87
|
+
- If running in a container, verify `host.docker.internal` resolves. Otherwise, map the host appropriately.
|
|
88
|
+
- Reinstall the companion with `/ide install` and use “Qwen Code: Run” in the Command Palette to verify it launches.
|
|
89
|
+
|
|
90
|
+
## Exit Codes
|
|
91
|
+
|
|
92
|
+
The Qwen Code uses specific exit codes to indicate the reason for termination. This is especially useful for scripting and automation.
|
|
93
|
+
|
|
94
|
+
| Exit Code | Error Type | Description |
|
|
95
|
+
| --------- | -------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| 41 | `FatalAuthenticationError` | An error occurred during the authentication process. |
|
|
97
|
+
| 42 | `FatalInputError` | Invalid or missing input was provided to the CLI. (non-interactive mode only) |
|
|
98
|
+
| 44 | `FatalSandboxError` | An error occurred with the sandboxing environment (e.g. Docker, Podman, or Seatbelt). |
|
|
99
|
+
| 52 | `FatalConfigError` | A configuration file (`settings.json`) is invalid or contains errors. |
|
|
100
|
+
| 53 | `FatalTurnLimitedError` | The maximum number of conversational turns for the session was reached. (non-interactive mode only) |
|
|
101
|
+
|
|
102
|
+
## Debugging Tips
|
|
103
|
+
|
|
104
|
+
- **CLI debugging:**
|
|
105
|
+
- Use the `--verbose` flag (if available) with CLI commands for more detailed output.
|
|
106
|
+
- Check the CLI logs, often found in a user-specific configuration or cache directory.
|
|
107
|
+
|
|
108
|
+
- **Core debugging:**
|
|
109
|
+
- Check the server console output for error messages or stack traces.
|
|
110
|
+
- Increase log verbosity if configurable.
|
|
111
|
+
- Use Node.js debugging tools (e.g. `node --inspect`) if you need to step through server-side code.
|
|
112
|
+
|
|
113
|
+
- **Tool issues:**
|
|
114
|
+
- If a specific tool is failing, try to isolate the issue by running the simplest possible version of the command or operation the tool performs.
|
|
115
|
+
- For `run_shell_command`, check that the command works directly in your shell first.
|
|
116
|
+
- For _file system tools_, verify that paths are correct and check the permissions.
|
|
117
|
+
|
|
118
|
+
- **Pre-flight checks:**
|
|
119
|
+
- Always run `npm run preflight` before committing code. This can catch many common issues related to formatting, linting, and type errors.
|
|
120
|
+
|
|
121
|
+
## Existing GitHub Issues similar to yours or creating new Issues
|
|
122
|
+
|
|
123
|
+
If you encounter an issue that was not covered here in this _Troubleshooting guide_, consider searching the Qwen Code [Issue tracker on GitHub](https://github.com/QwenLM/qwen-code/issues). If you can't find an issue similar to yours, consider creating a new GitHub Issue with a detailed description. Pull requests are also welcome!
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: receiving-code-review
|
|
3
|
+
description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review Reception
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Code review requires technical evaluation, not emotional performance.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
|
|
13
|
+
|
|
14
|
+
## The Response Pattern
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
WHEN receiving code review feedback:
|
|
18
|
+
|
|
19
|
+
1. READ: Complete feedback without reacting
|
|
20
|
+
2. UNDERSTAND: Restate requirement in own words (or ask)
|
|
21
|
+
3. VERIFY: Check against codebase reality
|
|
22
|
+
4. EVALUATE: Technically sound for THIS codebase?
|
|
23
|
+
5. RESPOND: Technical acknowledgment or reasoned pushback
|
|
24
|
+
6. IMPLEMENT: One item at a time, test each
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Forbidden Responses
|
|
28
|
+
|
|
29
|
+
**NEVER:**
|
|
30
|
+
|
|
31
|
+
- "You're absolutely right!" (explicit CLAUDE.md violation)
|
|
32
|
+
- "Great point!" / "Excellent feedback!" (performative)
|
|
33
|
+
- "Let me implement that now" (before verification)
|
|
34
|
+
|
|
35
|
+
**INSTEAD:**
|
|
36
|
+
|
|
37
|
+
- Restate the technical requirement
|
|
38
|
+
- Ask clarifying questions
|
|
39
|
+
- Push back with technical reasoning if wrong
|
|
40
|
+
- Just start working (actions > words)
|
|
41
|
+
|
|
42
|
+
## Handling Unclear Feedback
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
IF any item is unclear:
|
|
46
|
+
STOP - do not implement anything yet
|
|
47
|
+
ASK for clarification on unclear items
|
|
48
|
+
|
|
49
|
+
WHY: Items may be related. Partial understanding = wrong implementation.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
your human partner: "Fix 1-6"
|
|
56
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
57
|
+
|
|
58
|
+
❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
|
|
59
|
+
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Source-Specific Handling
|
|
63
|
+
|
|
64
|
+
### From your human partner
|
|
65
|
+
|
|
66
|
+
- **Trusted** - implement after understanding
|
|
67
|
+
- **Still ask** if scope unclear
|
|
68
|
+
- **No performative agreement**
|
|
69
|
+
- **Skip to action** or technical acknowledgment
|
|
70
|
+
|
|
71
|
+
### From External Reviewers
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
BEFORE implementing:
|
|
75
|
+
1. Check: Technically correct for THIS codebase?
|
|
76
|
+
2. Check: Breaks existing functionality?
|
|
77
|
+
3. Check: Reason for current implementation?
|
|
78
|
+
4. Check: Works on all platforms/versions?
|
|
79
|
+
5. Check: Does reviewer understand full context?
|
|
80
|
+
|
|
81
|
+
IF suggestion seems wrong:
|
|
82
|
+
Push back with technical reasoning
|
|
83
|
+
|
|
84
|
+
IF can't easily verify:
|
|
85
|
+
Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
|
|
86
|
+
|
|
87
|
+
IF conflicts with your human partner's prior decisions:
|
|
88
|
+
Stop and discuss with your human partner first
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**your human partner's rule:** "External feedback - be skeptical, but check carefully"
|
|
92
|
+
|
|
93
|
+
## YAGNI Check for "Professional" Features
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
IF reviewer suggests "implementing properly":
|
|
97
|
+
grep codebase for actual usage
|
|
98
|
+
|
|
99
|
+
IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
|
|
100
|
+
IF used: Then implement properly
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
|
|
104
|
+
|
|
105
|
+
## Implementation Order
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
FOR multi-item feedback:
|
|
109
|
+
1. Clarify anything unclear FIRST
|
|
110
|
+
2. Then implement in this order:
|
|
111
|
+
- Blocking issues (breaks, security)
|
|
112
|
+
- Simple fixes (typos, imports)
|
|
113
|
+
- Complex fixes (refactoring, logic)
|
|
114
|
+
3. Test each fix individually
|
|
115
|
+
4. Verify no regressions
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## When To Push Back
|
|
119
|
+
|
|
120
|
+
Push back when:
|
|
121
|
+
|
|
122
|
+
- Suggestion breaks existing functionality
|
|
123
|
+
- Reviewer lacks full context
|
|
124
|
+
- Violates YAGNI (unused feature)
|
|
125
|
+
- Technically incorrect for this stack
|
|
126
|
+
- Legacy/compatibility reasons exist
|
|
127
|
+
- Conflicts with your human partner's architectural decisions
|
|
128
|
+
|
|
129
|
+
**How to push back:**
|
|
130
|
+
|
|
131
|
+
- Use technical reasoning, not defensiveness
|
|
132
|
+
- Ask specific questions
|
|
133
|
+
- Reference working tests/code
|
|
134
|
+
- Involve your human partner if architectural
|
|
135
|
+
|
|
136
|
+
**Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
|
|
137
|
+
|
|
138
|
+
## Acknowledging Correct Feedback
|
|
139
|
+
|
|
140
|
+
When feedback IS correct:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
✅ "Fixed. [Brief description of what changed]"
|
|
144
|
+
✅ "Good catch - [specific issue]. Fixed in [location]."
|
|
145
|
+
✅ [Just fix it and show in the code]
|
|
146
|
+
|
|
147
|
+
❌ "You're absolutely right!"
|
|
148
|
+
❌ "Great point!"
|
|
149
|
+
❌ "Thanks for catching that!"
|
|
150
|
+
❌ "Thanks for [anything]"
|
|
151
|
+
❌ ANY gratitude expression
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
|
|
155
|
+
|
|
156
|
+
**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
|
|
157
|
+
|
|
158
|
+
## Gracefully Correcting Your Pushback
|
|
159
|
+
|
|
160
|
+
If you pushed back and were wrong:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
|
|
164
|
+
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
|
|
165
|
+
|
|
166
|
+
❌ Long apology
|
|
167
|
+
❌ Defending why you pushed back
|
|
168
|
+
❌ Over-explaining
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
State the correction factually and move on.
|
|
172
|
+
|
|
173
|
+
## Common Mistakes
|
|
174
|
+
|
|
175
|
+
| Mistake | Fix |
|
|
176
|
+
| ---------------------------- | ----------------------------------- |
|
|
177
|
+
| Performative agreement | State requirement or just act |
|
|
178
|
+
| Blind implementation | Verify against codebase first |
|
|
179
|
+
| Batch without testing | One at a time, test each |
|
|
180
|
+
| Assuming reviewer is right | Check if breaks things |
|
|
181
|
+
| Avoiding pushback | Technical correctness > comfort |
|
|
182
|
+
| Partial implementation | Clarify all items first |
|
|
183
|
+
| Can't verify, proceed anyway | State limitation, ask for direction |
|
|
184
|
+
|
|
185
|
+
## Real Examples
|
|
186
|
+
|
|
187
|
+
**Performative Agreement (Bad):**
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Reviewer: "Remove legacy code"
|
|
191
|
+
❌ "You're absolutely right! Let me remove that..."
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Technical Verification (Good):**
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Reviewer: "Remove legacy code"
|
|
198
|
+
✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**YAGNI (Good):**
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
|
|
205
|
+
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Unclear Item (Good):**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
your human partner: "Fix items 1-6"
|
|
212
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
213
|
+
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## GitHub Thread Replies
|
|
217
|
+
|
|
218
|
+
When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
|
|
219
|
+
|
|
220
|
+
## The Bottom Line
|
|
221
|
+
|
|
222
|
+
**External feedback = suggestions to evaluate, not orders to follow.**
|
|
223
|
+
|
|
224
|
+
Verify. Question. Then implement.
|
|
225
|
+
|
|
226
|
+
No performative agreement. Technical rigor always.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requesting-code-review
|
|
3
|
+
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Requesting Code Review
|
|
7
|
+
|
|
8
|
+
Dispatch superpowers:code-reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
|
|
9
|
+
|
|
10
|
+
**Core principle:** Review early, review often.
|
|
11
|
+
|
|
12
|
+
## When to Request Review
|
|
13
|
+
|
|
14
|
+
**Mandatory:**
|
|
15
|
+
|
|
16
|
+
- After each task in subagent-driven development
|
|
17
|
+
- After completing major feature
|
|
18
|
+
- Before merge to main
|
|
19
|
+
|
|
20
|
+
**Optional but valuable:**
|
|
21
|
+
|
|
22
|
+
- When stuck (fresh perspective)
|
|
23
|
+
- Before refactoring (baseline check)
|
|
24
|
+
- After fixing complex bug
|
|
25
|
+
|
|
26
|
+
## How to Request
|
|
27
|
+
|
|
28
|
+
**1. Get git SHAs:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
|
|
32
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**2. Dispatch code-reviewer subagent:**
|
|
36
|
+
|
|
37
|
+
Use the Agent tool with subagent_type: "deepcode", fill template at `code-reviewer.md`
|
|
38
|
+
|
|
39
|
+
**Placeholders:**
|
|
40
|
+
|
|
41
|
+
- `{WHAT_WAS_IMPLEMENTED}` - What you just built
|
|
42
|
+
- `{PLAN_OR_REQUIREMENTS}` - What it should do
|
|
43
|
+
- `{BASE_SHA}` - Starting commit
|
|
44
|
+
- `{HEAD_SHA}` - Ending commit
|
|
45
|
+
- `{DESCRIPTION}` - Brief summary
|
|
46
|
+
|
|
47
|
+
**3. Act on feedback:**
|
|
48
|
+
|
|
49
|
+
- Fix Critical issues immediately
|
|
50
|
+
- Fix Important issues before proceeding
|
|
51
|
+
- Note Minor issues for later
|
|
52
|
+
- Push back if reviewer is wrong (with reasoning)
|
|
53
|
+
|
|
54
|
+
## Example
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
[Just completed Task 2: Add verification function]
|
|
58
|
+
|
|
59
|
+
You: Let me request code review before proceeding.
|
|
60
|
+
|
|
61
|
+
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
|
|
62
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
63
|
+
|
|
64
|
+
[Dispatch superpowers:code-reviewer subagent]
|
|
65
|
+
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
|
|
66
|
+
PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
|
|
67
|
+
BASE_SHA: a7981ec
|
|
68
|
+
HEAD_SHA: 3df7661
|
|
69
|
+
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
70
|
+
|
|
71
|
+
[Subagent returns]:
|
|
72
|
+
Strengths: Clean architecture, real tests
|
|
73
|
+
Issues:
|
|
74
|
+
Important: Missing progress indicators
|
|
75
|
+
Minor: Magic number (100) for reporting interval
|
|
76
|
+
Assessment: Ready to proceed
|
|
77
|
+
|
|
78
|
+
You: [Fix progress indicators]
|
|
79
|
+
[Continue to Task 3]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Integration with Workflows
|
|
83
|
+
|
|
84
|
+
**Subagent-Driven Development:**
|
|
85
|
+
|
|
86
|
+
- Review after EACH task
|
|
87
|
+
- Catch issues before they compound
|
|
88
|
+
- Fix before moving to next task
|
|
89
|
+
|
|
90
|
+
**Executing Plans:**
|
|
91
|
+
|
|
92
|
+
- Review after each batch (3 tasks)
|
|
93
|
+
- Get feedback, apply, continue
|
|
94
|
+
|
|
95
|
+
**Ad-Hoc Development:**
|
|
96
|
+
|
|
97
|
+
- Review before merge
|
|
98
|
+
- Review when stuck
|
|
99
|
+
|
|
100
|
+
## Red Flags
|
|
101
|
+
|
|
102
|
+
**Never:**
|
|
103
|
+
|
|
104
|
+
- Skip review because "it's simple"
|
|
105
|
+
- Ignore Critical issues
|
|
106
|
+
- Proceed with unfixed Important issues
|
|
107
|
+
- Argue with valid technical feedback
|
|
108
|
+
|
|
109
|
+
**If reviewer wrong:**
|
|
110
|
+
|
|
111
|
+
- Push back with technical reasoning
|
|
112
|
+
- Show code/tests that prove it works
|
|
113
|
+
- Request clarification
|
|
114
|
+
|
|
115
|
+
See template at: requesting-code-review/code-reviewer.md
|
|
@@ -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**.
|