Skip to content

Commit 7a6fee0

Browse files
authored
chore: improve test-discovery skill with PR documentation standards and TUI E2E guidance (#365)
https://claude.ai/code/session_01AkMKqcoyJ1vURZ4crtpEZu
1 parent d486295 commit 7a6fee0

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

.claude/commands/test-discovery.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,28 @@ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>"
217217
git push -u origin HEAD
218218
gh pr create --title "test: [area] — [what's being tested]" --body "$(cat <<'EOF'
219219
### What does this PR do?
220-
Adds tests for [area] discovered by hourly test sweep.
220+
221+
[Write a clear, well-structured description. Do NOT use a one-liner. Include:]
222+
223+
**For each module/file tested, provide:**
224+
- The module name and source file path
225+
- WHY it was untested and WHY it matters (what user-facing risk does this cover?)
226+
- A brief list of the specific scenarios covered (e.g., "push-before-next ordering", "error propagation")
227+
228+
**Example format:**
229+
230+
**1. `AsyncQueue` and `work()` — `src/util/queue.ts`** (10 new tests)
231+
232+
These utilities power streaming result delivery and concurrent task processing. Zero tests existed. New coverage includes:
233+
- Push/next resolution ordering and async iterator correctness
234+
- Concurrency limit enforcement in `work()`
235+
- Error propagation from workers
236+
237+
**2. `State.invalidate` — `src/project/state.ts`** (2 new tests)
238+
239+
This `altimate_change` clears cached state after config changes. Coverage includes:
240+
- Invalidated entry is re-initialized on next access
241+
- No-op on nonexistent key
221242
222243
### Type of change
223244
- [x] New feature (non-breaking change which adds functionality)
@@ -226,7 +247,12 @@ Adds tests for [area] discovered by hourly test sweep.
226247
N/A — proactive test coverage
227248
228249
### How did you verify your code works?
229-
`bun test test/[path]` — all pass
250+
251+
[List each test file and its pass count, e.g.:]
252+
```
253+
bun test test/util/queue.test.ts # 10 pass
254+
bun test test/project/state.test.ts # 7 pass (5 existing + 2 new)
255+
```
230256
231257
### Checklist
232258
- [x] I have added tests that prove my fix is effective or that my feature works
@@ -247,3 +273,5 @@ Send `shutdown_request` to the critic. Delete the team.
247273
6. **Critic must approve.** Don't commit tests the critic rejected.
248274
7. **Check existing tests first.** Run `grep -r "describe.*[feature]" packages/opencode/test/` before writing.
249275
8. **Branch protection.** Always use a feature branch + PR. Never push to main.
276+
9. **TUI impact check.** Whenever your tests touch code that feeds into the TUI (session state, config, skills, tools, MCP, provider changes), check whether the TUI could be affected. If so, add or extend E2E tests that exercise the TUI path — e.g., verifying that dialog rendering, skill listing, or config display still work after the change. The TUI is the primary user interface; regressions there are high-visibility. Look at existing TUI tests in `packages/opencode/test/config/tui.test.ts` for patterns.
277+
10. **PR descriptions must be well-documented.** Never submit a one-liner PR body. Each PR must clearly explain what modules were tested, why they were untested, what user-facing risk the new tests mitigate, and the specific scenarios covered. See the PR template in Phase 5 for the expected format.

0 commit comments

Comments
 (0)