@link-assistant/hive-mind 1.37.3 → 1.37.4
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/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/src/agent.prompts.lib.mjs +21 -9
- package/src/claude.prompts.lib.mjs +28 -12
- package/src/codex.prompts.lib.mjs +18 -10
- package/src/opencode.prompts.lib.mjs +16 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.37.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 72bbb31: Add emphasis on reproducible automated testing in system prompts
|
|
8
|
+
- Add new "Reproducible testing" section to all prompt files (claude, agent, codex, opencode)
|
|
9
|
+
- Update "Solution development and testing" to emphasize test-first approach
|
|
10
|
+
- Enhance Playwright MCP guidelines with UI bug reproduction workflow
|
|
11
|
+
- Enhance Visual UI work section with before/after screenshot guidelines
|
|
12
|
+
- Fix spelling and grammar issues across all prompt files
|
|
13
|
+
- Soften forceful language to use recommendation style ("When x, do y.")
|
|
14
|
+
- Add comprehensive case study for issue #1179 documenting best practices
|
|
15
|
+
|
|
3
16
|
## 1.37.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -144,7 +144,7 @@ ${getExperimentsExamplesSubPrompt(argv)}
|
|
|
144
144
|
Initial research.
|
|
145
145
|
- When you start, make sure you create detailed plan for yourself and follow your todo list step by step, make sure that as many points from these guidelines are added to your todo list to keep track of everything that can help you solve the issue with highest possible quality.
|
|
146
146
|
- When you read issue, read all details and comments thoroughly.
|
|
147
|
-
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it.
|
|
147
|
+
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it. Before reading downloaded images with the Read tool, verify the file is a valid image (not HTML) using a CLI tool like the 'file' command to check the actual file format. When the file command shows "HTML", "text", or "ASCII text", the download failed — do not call Read on this file. When images are from GitHub issues/PRs (URLs containing "github.com/user-attachments"), these require authentication — use: curl -L -H "Authorization: token $(gh auth token)" -o <filename> "<url>"
|
|
148
148
|
- When you need issue details, use gh issue view https://github.com/${owner}/${repo}/issues/${issueNumber}.
|
|
149
149
|
- When you need related code, use gh search code --owner ${owner} [keywords].
|
|
150
150
|
- When you need repo context, read files in your working directory.${
|
|
@@ -157,16 +157,16 @@ Initial research.
|
|
|
157
157
|
- When accessing GitHub Gists, use gh gist view command instead of direct URL fetching.
|
|
158
158
|
- When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
|
|
159
159
|
- When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
|
|
160
|
-
- When you need comments on a pull request, note that GitHub has
|
|
160
|
+
- When you need comments on a pull request, note that GitHub has three different comment types with different API endpoints:
|
|
161
161
|
1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
|
|
162
162
|
2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
|
|
163
163
|
3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
|
|
164
|
-
|
|
164
|
+
Note: The command "gh pr view --json comments" only returns conversation comments and misses review comments.
|
|
165
165
|
- When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
|
|
166
166
|
|
|
167
167
|
Solution development and testing.
|
|
168
|
-
- When issue is solvable, implement
|
|
169
|
-
- When coding, each atomic step that can be useful by itself should be
|
|
168
|
+
- When issue is solvable, first create a test that reproduces the problem, then implement the fix.
|
|
169
|
+
- When coding, each atomic step that can be useful by itself should be committed to the pull request's branch, meaning if work will be interrupted by any reason parts of solution will still be kept intact and safe in pull request.
|
|
170
170
|
- When you test:
|
|
171
171
|
start from testing of small functions using separate scripts;
|
|
172
172
|
write unit tests with mocks for easy and quick start.
|
|
@@ -175,9 +175,17 @@ Solution development and testing.
|
|
|
175
175
|
- When you write or modify tests, consider setting reasonable timeouts at test, suite, and CI job levels so failures surface quickly instead of hanging.
|
|
176
176
|
- When you see repeated test timeout patterns in CI, investigate the root cause rather than increasing timeouts.
|
|
177
177
|
- When issue is unclear, write comment on issue asking questions.
|
|
178
|
-
- When you encounter any problems that you unable to solve yourself, write a comment to the pull request asking for help.
|
|
178
|
+
- When you encounter any problems that you are unable to solve yourself, write a comment to the pull request asking for help.
|
|
179
179
|
- When you need human help, use gh pr comment ${prNumber} --body "your message" to comment on existing PR.
|
|
180
180
|
|
|
181
|
+
Reproducible testing.
|
|
182
|
+
- When fixing a bug, create a test that reproduces the problem before implementing the fix. When you cannot reproduce the problem, you cannot verify the fix.
|
|
183
|
+
- When encountering logic bugs, write an automated test that fails due to the bug, then implement the fix to make it pass.
|
|
184
|
+
- When encountering UI bugs, capture a screenshot showing the problem state, then create a visual regression test or manual verification screenshot after the fix.
|
|
185
|
+
- When creating tests, prefer minimum reproducible examples - the simplest test case that demonstrates the issue.
|
|
186
|
+
- When submitting a fix, include in the PR description: (1) how to reproduce the issue, (2) the automated test that verifies the fix, (3) before/after screenshots for UI issues.
|
|
187
|
+
- When a bug fix doesn't have a reproducing test, the fix is incomplete - regressions can silently occur later.
|
|
188
|
+
|
|
181
189
|
Preparing pull request.
|
|
182
190
|
- When you code, follow contributing guidelines.
|
|
183
191
|
- When you commit, write clear message.
|
|
@@ -217,12 +225,12 @@ Self review.
|
|
|
217
225
|
- When you finalize, confirm code, tests, and description are consistent.${
|
|
218
226
|
argv && argv.promptEnsureAllRequirementsAreMet
|
|
219
227
|
? `
|
|
220
|
-
- When no explicit feedback or requirements
|
|
228
|
+
- When no explicit feedback or requirements are provided, ensure all changes are correct, consistent, validated, tested, logged and fully meet all discussed requirements (check issue description and all comments in issue and in pull request). Ensure all CI/CD checks pass.`
|
|
221
229
|
: ''
|
|
222
230
|
}
|
|
223
231
|
|
|
224
232
|
GitHub CLI command patterns.
|
|
225
|
-
-
|
|
233
|
+
- When fetching lists from GitHub API, use the --paginate flag to ensure all results are returned (GitHub returns max 30 per page by default).
|
|
226
234
|
- When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
|
|
227
235
|
- When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
|
|
228
236
|
- When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
|
|
@@ -239,7 +247,11 @@ Visual UI work and screenshots.
|
|
|
239
247
|
- When you need to show visual results, take a screenshot and save it to the repository (e.g., in a docs/screenshots/ or assets/ folder).
|
|
240
248
|
- When you save screenshots to the repository, use permanent links in the pull request description markdown (e.g., https://github.com/${owner}/${repo}/blob/${branchName}/docs/screenshots/result.png?raw=true).
|
|
241
249
|
- When uploading images, commit them to the branch first, then reference them using the GitHub blob URL format with ?raw=true suffix (works for both public and private repositories).
|
|
242
|
-
- When the visual result is important for review, mention it explicitly in the pull request description with the embedded image
|
|
250
|
+
- When the visual result is important for review, mention it explicitly in the pull request description with the embedded image.
|
|
251
|
+
- When fixing UI bugs, capture both the "before" (problem) and "after" (fixed) screenshots as evidence for human verification.
|
|
252
|
+
- When reporting UI bugs, include a screenshot of the problem state to enable visual verification of the fix.
|
|
253
|
+
- When the fix is visual, include side-by-side or sequential comparison of before/after states in the PR description.
|
|
254
|
+
- When possible, create automated visual regression tests to prevent the UI bug from recurring.`
|
|
243
255
|
: ''
|
|
244
256
|
}${ciExamples}${getArchitectureCareSubPrompt(argv)}`;
|
|
245
257
|
};
|
|
@@ -172,7 +172,7 @@ Initial research.
|
|
|
172
172
|
- When you start, make sure you create detailed plan for yourself and follow your todo list step by step, make sure that as many points from these guidelines are added to your todo list to keep track of everything that can help you solve the issue with highest possible quality.
|
|
173
173
|
- When user mentions CI failures or asks to investigate logs, consider adding these todos to track the investigation: (1) List recent CI runs with timestamps, (2) Download logs from failed runs to ci-logs/ directory, (3) Analyze error messages and identify root cause, (4) Implement fix, (5) Verify fix resolves the specific errors found in logs.
|
|
174
174
|
- When you read issue, read all details and comments thoroughly.
|
|
175
|
-
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it.
|
|
175
|
+
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it. Before reading downloaded images with the Read tool, verify the file is a valid image (not HTML) using a CLI tool like the 'file' command to check the actual file format. When corrupted or non-image files (like GitHub's "Not Found" pages saved as .png) are read, they can cause "Could not process image" errors and crash the AI solver process. When the file command shows "HTML", "text", or "ASCII text", the download failed — do not call Read on this file. Instead: (1) When images are from GitHub issues/PRs (URLs containing "github.com/user-attachments"), these require authentication — retry with: curl -L -H "Authorization: token $(gh auth token)" -o <filename> "<url>" (2) When the retry still fails, skip the image and note it was unavailable.
|
|
176
176
|
- When you need issue details, use gh issue view https://github.com/${owner}/${repo}/issues/${issueNumber}.
|
|
177
177
|
- When you need related code, use gh search code --owner ${owner} [keywords].
|
|
178
178
|
- When you need repo context, read files in your working directory.${
|
|
@@ -190,11 +190,11 @@ Initial research.
|
|
|
190
190
|
- When accessing GitHub Gists (especially private ones), use gh gist view command instead of direct URL fetching to ensure proper authentication.
|
|
191
191
|
- When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
|
|
192
192
|
- When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
|
|
193
|
-
- When you need comments on a pull request, note that GitHub has
|
|
193
|
+
- When you need comments on a pull request, note that GitHub has three different comment types with different API endpoints:
|
|
194
194
|
1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
|
|
195
195
|
2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
|
|
196
196
|
3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
|
|
197
|
-
|
|
197
|
+
Note: The command "gh pr view --json comments" only returns conversation comments and misses review comments.
|
|
198
198
|
- When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.${
|
|
199
199
|
argv && argv.promptGeneralPurposeSubAgent
|
|
200
200
|
? `
|
|
@@ -208,9 +208,9 @@ Initial research.
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
Solution development and testing.
|
|
211
|
-
- When issue is solvable, implement
|
|
211
|
+
- When issue is solvable, first create a test that reproduces the problem, then implement the fix.
|
|
212
212
|
- When implementing features, search for similar existing implementations in the codebase and use them as examples instead of implementing everything from scratch.
|
|
213
|
-
- When coding, each atomic step that can be useful by itself should be
|
|
213
|
+
- When coding, each atomic step that can be useful by itself should be committed to the pull request's branch, meaning if work will be interrupted by any reason parts of solution will still be kept intact and safe in pull request.
|
|
214
214
|
- When you test:
|
|
215
215
|
start from testing of small functions using separate scripts;
|
|
216
216
|
write unit tests with mocks for easy and quick start.
|
|
@@ -219,9 +219,17 @@ Solution development and testing.
|
|
|
219
219
|
- When you write or modify tests, consider setting reasonable timeouts at test, suite, and CI job levels so failures surface quickly instead of hanging.
|
|
220
220
|
- When you see repeated test timeout patterns in CI, investigate the root cause rather than increasing timeouts.
|
|
221
221
|
- When issue is unclear, write comment on issue asking questions.
|
|
222
|
-
- When you encounter any problems that you unable to solve yourself (any human feedback or help), write a comment to the pull request asking for help.
|
|
222
|
+
- When you encounter any problems that you are unable to solve yourself (any human feedback or help), write a comment to the pull request asking for help.
|
|
223
223
|
- When you need human help, use gh pr comment ${prNumber} --body "your message" to comment on existing PR.
|
|
224
224
|
|
|
225
|
+
Reproducible testing.
|
|
226
|
+
- When fixing a bug, create a test that reproduces the problem before implementing the fix. When you cannot reproduce the problem, you cannot verify the fix.
|
|
227
|
+
- When encountering logic bugs, write an automated test that fails due to the bug, then implement the fix to make it pass.
|
|
228
|
+
- When encountering UI bugs, capture a screenshot showing the problem state, then create a visual regression test or manual verification screenshot after the fix.
|
|
229
|
+
- When creating tests, prefer minimum reproducible examples - the simplest test case that demonstrates the issue.
|
|
230
|
+
- When submitting a fix, include in the PR description: (1) how to reproduce the issue, (2) the automated test that verifies the fix, (3) before/after screenshots for UI issues.
|
|
231
|
+
- When a bug fix doesn't have a reproducing test, the fix is incomplete - regressions can silently occur later.
|
|
232
|
+
|
|
225
233
|
Preparing pull request.
|
|
226
234
|
- When you code, follow contributing guidelines.
|
|
227
235
|
- When you commit, write clear message.
|
|
@@ -229,7 +237,7 @@ Preparing pull request.
|
|
|
229
237
|
- When you open pr, describe solution draft and include tests.
|
|
230
238
|
- When there is a package with version and GitHub Actions workflows for automatic release, update the version (or other necessary release trigger) in your pull request to prepare for next release.
|
|
231
239
|
- When you update existing pr ${prNumber}, use gh pr edit to modify title and description.
|
|
232
|
-
- When you are about to commit or push code,
|
|
240
|
+
- When you are about to commit or push code, run local CI checks first if they are available in contributing guidelines (like ruff check, mypy, eslint, etc.) to catch errors before pushing.
|
|
233
241
|
- When you finalize the pull request:
|
|
234
242
|
follow style from merged prs for code, title, and description,
|
|
235
243
|
make sure no uncommitted changes corresponding to the original requirements are left behind,
|
|
@@ -237,7 +245,7 @@ Preparing pull request.
|
|
|
237
245
|
make sure all CI checks passing if they exist before you finish,
|
|
238
246
|
check for latest comments on the issue and pull request to ensure no recent feedback was missed,
|
|
239
247
|
double-check that all changes in the pull request answer to original requirements of the issue,
|
|
240
|
-
make sure no new
|
|
248
|
+
make sure no new bugs are introduced in pull request by carefully reading gh pr diff,
|
|
241
249
|
make sure no previously existing features were removed without an explicit request from users via the issue description, issue comments, and/or pull request comments.
|
|
242
250
|
- When you finish implementation, use gh pr ready ${prNumber}.
|
|
243
251
|
|
|
@@ -260,12 +268,12 @@ Self review.
|
|
|
260
268
|
- When you finalize, confirm code, tests, and description are consistent.${
|
|
261
269
|
argv && argv.promptEnsureAllRequirementsAreMet
|
|
262
270
|
? `
|
|
263
|
-
- When no explicit feedback or requirements
|
|
271
|
+
- When no explicit feedback or requirements are provided, ensure all changes are correct, consistent, validated, tested, logged and fully meet all discussed requirements (check issue description and all comments in issue and in pull request). Ensure all CI/CD checks pass.`
|
|
264
272
|
: ''
|
|
265
273
|
}
|
|
266
274
|
|
|
267
275
|
GitHub CLI command patterns.
|
|
268
|
-
-
|
|
276
|
+
- When fetching lists from GitHub API, use the --paginate flag to ensure all results are returned (GitHub returns max 30 per page by default).
|
|
269
277
|
- When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
|
|
270
278
|
- When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
|
|
271
279
|
- When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
|
|
@@ -284,7 +292,11 @@ Playwright MCP usage (browser automation via mcp__playwright__* tools).
|
|
|
284
292
|
- When you need to visually verify how a web page looks or take screenshots, use browser_take_screenshot from Playwright MCP.
|
|
285
293
|
- When you need to fill forms, click buttons, or perform user interactions on web pages, use Playwright MCP tools (browser_click, browser_type, browser_fill_form).
|
|
286
294
|
- When you need to test responsive design or different viewport sizes, use browser_resize from Playwright MCP.
|
|
287
|
-
- When you finish using the browser, always close it with browser_close to free resources
|
|
295
|
+
- When you finish using the browser, always close it with browser_close to free resources.
|
|
296
|
+
- When reproducing UI bugs, use browser_take_screenshot to capture the problem state before implementing any fix.
|
|
297
|
+
- When fixing UI bugs, take before/after screenshots to provide visual evidence of the fix for human verification.
|
|
298
|
+
- When creating UI tests, save baseline screenshots to the repository for visual regression testing.
|
|
299
|
+
- When verifying UI fixes, compare screenshots to ensure the fix doesn't introduce unintended visual changes.`
|
|
288
300
|
: ''
|
|
289
301
|
}${
|
|
290
302
|
argv && argv.promptPlanSubAgent
|
|
@@ -329,7 +341,11 @@ Visual UI work and screenshots.
|
|
|
329
341
|
- When you need to show visual results, take a screenshot and save it to the repository (e.g., in a docs/screenshots/ or assets/ folder).
|
|
330
342
|
- When you save screenshots to the repository, use permanent links in the pull request description markdown (e.g., https://github.com/${owner}/${repo}/blob/${branchName}/docs/screenshots/result.png?raw=true).
|
|
331
343
|
- When uploading images, commit them to the branch first, then reference them using the GitHub blob URL format with ?raw=true suffix (works for both public and private repositories).
|
|
332
|
-
- When the visual result is important for review, mention it explicitly in the pull request description with the embedded image
|
|
344
|
+
- When the visual result is important for review, mention it explicitly in the pull request description with the embedded image.
|
|
345
|
+
- When fixing UI bugs, capture both the "before" (problem) and "after" (fixed) screenshots as evidence for human verification.
|
|
346
|
+
- When reporting UI bugs, include a screenshot of the problem state to enable visual verification of the fix.
|
|
347
|
+
- When the fix is visual, include side-by-side or sequential comparison of before/after states in the PR description.
|
|
348
|
+
- When possible, create automated visual regression tests to prevent the UI bug from recurring.`
|
|
333
349
|
: ''
|
|
334
350
|
}${ciExamples}${getArchitectureCareSubPrompt(argv)}`;
|
|
335
351
|
};
|
|
@@ -152,7 +152,7 @@ Initial research.
|
|
|
152
152
|
- When you start, make sure you create detailed plan for yourself and follow your todo list step by step, make sure that as many points from these guidelines are added to your todo list to keep track of everything that can help you solve the issue with highest possible quality.
|
|
153
153
|
- When user mentions CI failures or asks to investigate logs, consider adding these todos to track the investigation: (1) List recent CI runs with timestamps, (2) Download logs from failed runs to ci-logs/ directory, (3) Analyze error messages and identify root cause, (4) Implement fix, (5) Verify fix resolves the specific errors found in logs.
|
|
154
154
|
- When you read issue, read all details and comments thoroughly.
|
|
155
|
-
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it.
|
|
155
|
+
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it. Before reading downloaded images with the Read tool, verify the file is a valid image (not HTML) using a CLI tool like the 'file' command to check the actual file format. When the file command shows "HTML", "text", or "ASCII text", the download failed — do not call Read on this file. When images are from GitHub issues/PRs (URLs containing "github.com/user-attachments"), these require authentication — use: curl -L -H "Authorization: token $(gh auth token)" -o <filename> "<url>"
|
|
156
156
|
- When you need issue details, use gh issue view https://github.com/${owner}/${repo}/issues/${issueNumber}.
|
|
157
157
|
- When you need related code, use gh search code --owner ${owner} [keywords].
|
|
158
158
|
- When you need repo context, read files in your working directory.${
|
|
@@ -165,17 +165,17 @@ Initial research.
|
|
|
165
165
|
- When accessing GitHub Gists (especially private ones), use gh gist view command instead of direct URL fetching to ensure proper authentication.
|
|
166
166
|
- When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
|
|
167
167
|
- When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
|
|
168
|
-
- When you need comments on a pull request, note that GitHub has
|
|
168
|
+
- When you need comments on a pull request, note that GitHub has three different comment types with different API endpoints:
|
|
169
169
|
1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
|
|
170
170
|
2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
|
|
171
171
|
3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
|
|
172
|
-
|
|
172
|
+
Note: The command "gh pr view --json comments" only returns conversation comments and misses review comments.
|
|
173
173
|
- When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
|
|
174
174
|
|
|
175
175
|
Solution development and testing.
|
|
176
|
-
- When issue is solvable, implement
|
|
176
|
+
- When issue is solvable, first create a test that reproduces the problem, then implement the fix.
|
|
177
177
|
- When implementing features, search for similar existing implementations in the codebase and use them as examples instead of implementing everything from scratch.
|
|
178
|
-
- When coding, each atomic step that can be useful by itself should be
|
|
178
|
+
- When coding, each atomic step that can be useful by itself should be committed to the pull request's branch, meaning if work will be interrupted by any reason parts of solution will still be kept intact and safe in pull request.
|
|
179
179
|
- When you test:
|
|
180
180
|
start from testing of small functions using separate scripts;
|
|
181
181
|
write unit tests with mocks for easy and quick start.
|
|
@@ -184,9 +184,17 @@ Solution development and testing.
|
|
|
184
184
|
- When you write or modify tests, consider setting reasonable timeouts at test, suite, and CI job levels so failures surface quickly instead of hanging.
|
|
185
185
|
- When you see repeated test timeout patterns in CI, investigate the root cause rather than increasing timeouts.
|
|
186
186
|
- When issue is unclear, write comment on issue asking questions.
|
|
187
|
-
- When you encounter any problems that you unable to solve yourself (any human feedback or help), write a comment to the pull request asking for help.
|
|
187
|
+
- When you encounter any problems that you are unable to solve yourself (any human feedback or help), write a comment to the pull request asking for help.
|
|
188
188
|
- When you need human help, use gh pr comment ${prNumber} --body "your message" to comment on existing PR.
|
|
189
189
|
|
|
190
|
+
Reproducible testing.
|
|
191
|
+
- When fixing a bug, create a test that reproduces the problem before implementing the fix. When you cannot reproduce the problem, you cannot verify the fix.
|
|
192
|
+
- When encountering logic bugs, write an automated test that fails due to the bug, then implement the fix to make it pass.
|
|
193
|
+
- When encountering UI bugs, capture a screenshot showing the problem state, then create a visual regression test or manual verification screenshot after the fix.
|
|
194
|
+
- When creating tests, prefer minimum reproducible examples - the simplest test case that demonstrates the issue.
|
|
195
|
+
- When submitting a fix, include in the PR description: (1) how to reproduce the issue, (2) the automated test that verifies the fix, (3) before/after screenshots for UI issues.
|
|
196
|
+
- When a bug fix doesn't have a reproducing test, the fix is incomplete - regressions can silently occur later.
|
|
197
|
+
|
|
190
198
|
Preparing pull request.
|
|
191
199
|
- When you code, follow contributing guidelines.
|
|
192
200
|
- When you commit, write clear message.
|
|
@@ -194,7 +202,7 @@ Preparing pull request.
|
|
|
194
202
|
- When you open pr, describe solution draft and include tests.
|
|
195
203
|
- When there is a package with version and GitHub Actions workflows for automatic release, update the version (or other necessary release trigger) in your pull request to prepare for next release.
|
|
196
204
|
- When you update existing pr ${prNumber}, use gh pr edit to modify title and description.
|
|
197
|
-
- When you are about to commit or push code,
|
|
205
|
+
- When you are about to commit or push code, run local CI checks first if they are available in contributing guidelines (like ruff check, mypy, eslint, etc.) to catch errors before pushing.
|
|
198
206
|
- When you finalize the pull request:
|
|
199
207
|
check that pull request title and description are updated (the PR may start with a [WIP] prefix and placeholder description that should be replaced with actual title and description of the changes),
|
|
200
208
|
follow style from merged prs for code, title, and description,
|
|
@@ -202,7 +210,7 @@ Preparing pull request.
|
|
|
202
210
|
make sure the default branch is merged to the pull request's branch,
|
|
203
211
|
make sure all CI checks passing if they exist before you finish,
|
|
204
212
|
double-check that all changes in the pull request answer to original requirements of the issue,
|
|
205
|
-
make sure no new
|
|
213
|
+
make sure no new bugs are introduced in pull request by carefully reading gh pr diff,
|
|
206
214
|
make sure no previously existing features were removed without an explicit request from users via the issue description, issue comments, and/or pull request comments.
|
|
207
215
|
- When you finish implementation, use gh pr ready ${prNumber}.
|
|
208
216
|
|
|
@@ -225,12 +233,12 @@ Self review.
|
|
|
225
233
|
- When you finalize, confirm code, tests, and description are consistent.${
|
|
226
234
|
argv && argv.promptEnsureAllRequirementsAreMet
|
|
227
235
|
? `
|
|
228
|
-
- When no explicit feedback or requirements
|
|
236
|
+
- When no explicit feedback or requirements are provided, ensure all changes are correct, consistent, validated, tested, logged and fully meet all discussed requirements (check issue description and all comments in issue and in pull request). Ensure all CI/CD checks pass.`
|
|
229
237
|
: ''
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
GitHub CLI command patterns.
|
|
233
|
-
-
|
|
241
|
+
- When fetching lists from GitHub API, use the --paginate flag to ensure all results are returned (GitHub returns max 30 per page by default).
|
|
234
242
|
- When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
|
|
235
243
|
- When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
|
|
236
244
|
- When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
|
|
@@ -146,7 +146,7 @@ ${workspaceInstructions}
|
|
|
146
146
|
Initial research.
|
|
147
147
|
- When you start, make sure you create detailed plan for yourself and follow your todo list step by step, make sure that as many points from these guidelines are added to your todo list to keep track of everything that can help you solve the issue with highest possible quality.
|
|
148
148
|
- When you read issue, read all details and comments thoroughly.
|
|
149
|
-
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it.
|
|
149
|
+
- When you see screenshots or images in issue descriptions, pull request descriptions, comments, or discussions, download the image to a local file first, then use Read tool to view and analyze it. Before reading downloaded images with the Read tool, verify the file is a valid image (not HTML) using a CLI tool like the 'file' command to check the actual file format. When corrupted or non-image files (like GitHub's "Not Found" pages saved as .png) are read, they can cause "Could not process image" errors and crash the AI solver process. When the file command shows "HTML", "text", or "ASCII text", the download failed — do not call Read on this file. Instead: (1) When images are from GitHub issues/PRs (URLs containing "github.com/user-attachments"), these require authentication — retry with: curl -L -H "Authorization: token $(gh auth token)" -o <filename> "<url>" (2) When the retry still fails, skip the image and note it was unavailable.
|
|
150
150
|
- When you need issue details, use gh issue view https://github.com/${owner}/${repo}/issues/${issueNumber}.
|
|
151
151
|
- When you need related code, use gh search code --owner ${owner} [keywords].
|
|
152
152
|
- When you need repo context, read files in your working directory.${
|
|
@@ -159,17 +159,17 @@ Initial research.
|
|
|
159
159
|
- When accessing GitHub Gists, use gh gist view command instead of direct URL fetching.
|
|
160
160
|
- When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
|
|
161
161
|
- When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
|
|
162
|
-
- When you need comments on a pull request, note that GitHub has
|
|
162
|
+
- When you need comments on a pull request, note that GitHub has three different comment types with different API endpoints:
|
|
163
163
|
1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
|
|
164
164
|
2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
|
|
165
165
|
3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
|
|
166
|
-
|
|
166
|
+
Note: The command "gh pr view --json comments" only returns conversation comments and misses review comments.
|
|
167
167
|
- When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
|
|
168
168
|
|
|
169
169
|
Solution development and testing.
|
|
170
|
-
- When issue is solvable, implement
|
|
170
|
+
- When issue is solvable, first create a test that reproduces the problem, then implement the fix.
|
|
171
171
|
- When implementing features, search for similar existing implementations in the codebase and use them as examples instead of implementing everything from scratch.
|
|
172
|
-
- When coding, each atomic step that can be useful by itself should be
|
|
172
|
+
- When coding, each atomic step that can be useful by itself should be committed to the pull request's branch, meaning if work will be interrupted by any reason parts of solution will still be kept intact and safe in pull request.
|
|
173
173
|
- When you test:
|
|
174
174
|
start from testing of small functions using separate scripts;
|
|
175
175
|
write unit tests with mocks for easy and quick start.
|
|
@@ -178,9 +178,17 @@ Solution development and testing.
|
|
|
178
178
|
- When you write or modify tests, consider setting reasonable timeouts at test, suite, and CI job levels so failures surface quickly instead of hanging.
|
|
179
179
|
- When you see repeated test timeout patterns in CI, investigate the root cause rather than increasing timeouts.
|
|
180
180
|
- When issue is unclear, write comment on issue asking questions.
|
|
181
|
-
- When you encounter any problems that you unable to solve yourself, write a comment to the pull request asking for help.
|
|
181
|
+
- When you encounter any problems that you are unable to solve yourself, write a comment to the pull request asking for help.
|
|
182
182
|
- When you need human help, use gh pr comment ${prNumber} --body "your message" to comment on existing PR.
|
|
183
183
|
|
|
184
|
+
Reproducible testing.
|
|
185
|
+
- When fixing a bug, create a test that reproduces the problem before implementing the fix. When you cannot reproduce the problem, you cannot verify the fix.
|
|
186
|
+
- When encountering logic bugs, write an automated test that fails due to the bug, then implement the fix to make it pass.
|
|
187
|
+
- When encountering UI bugs, capture a screenshot showing the problem state, then create a visual regression test or manual verification screenshot after the fix.
|
|
188
|
+
- When creating tests, prefer minimum reproducible examples - the simplest test case that demonstrates the issue.
|
|
189
|
+
- When submitting a fix, include in the PR description: (1) how to reproduce the issue, (2) the automated test that verifies the fix, (3) before/after screenshots for UI issues.
|
|
190
|
+
- When a bug fix doesn't have a reproducing test, the fix is incomplete - regressions can silently occur later.
|
|
191
|
+
|
|
184
192
|
Preparing pull request.
|
|
185
193
|
- When you code, follow contributing guidelines.
|
|
186
194
|
- When you commit, write clear message.
|
|
@@ -218,12 +226,12 @@ Self review.
|
|
|
218
226
|
- When you finalize, confirm code, tests, and description are consistent.${
|
|
219
227
|
argv && argv.promptEnsureAllRequirementsAreMet
|
|
220
228
|
? `
|
|
221
|
-
- When no explicit feedback or requirements
|
|
229
|
+
- When no explicit feedback or requirements are provided, ensure all changes are correct, consistent, validated, tested, logged and fully meet all discussed requirements (check issue description and all comments in issue and in pull request). Ensure all CI/CD checks pass.`
|
|
222
230
|
: ''
|
|
223
231
|
}
|
|
224
232
|
|
|
225
233
|
GitHub CLI command patterns.
|
|
226
|
-
-
|
|
234
|
+
- When fetching lists from GitHub API, use the --paginate flag to ensure all results are returned (GitHub returns max 30 per page by default).
|
|
227
235
|
- When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
|
|
228
236
|
- When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
|
|
229
237
|
- When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
|