Commit cf94718
committed
fix: enforce analyze-first flow for 'create test cases for X' triggers
The agent was bypassing the analyze step entirely when users said 'create
test cases for Standard Calculator', running 'spectra ai generate --suite
standard --count 5' directly. Two root causes:
1. Both the SKILL and agent prompt declared '--count {n} (default: 5)',
which the LLM latched onto and fabricated --count=5 even when the
user gave no number.
2. The 'ALWAYS analyze first' rule had no explicit list of trigger
phrases. Users say 'create test cases for X' just as often as
'generate tests for X', and the agent was reading 'create' as a
direct command.
Fix:
- Add a 'MANDATORY analyze-first triggers' section to both files with
an explicit phrase list ('create test cases for X', 'generate tests
for X', 'add tests to X', 'test the X module', etc.)
- Remove '(default: 5)' from the --count flag description in both
files. New rule: never invent a count; pass it ONLY if the user said
an explicit number, or use analysis.recommended after the analyze
step returns
- Add explicit 'do NOT pass --count on the analyze call' guidance
Agent file at 127 lines (under the 140 limit). 1453 tests still passing.1 parent fe19def commit cf94718
File tree
2 files changed
+41
-2
lines changed- src/Spectra.CLI/Skills/Content
- Agents
- Skills
2 files changed
+41
-2
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
| |||
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | | - | |
| 38 | + | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
15 | 37 | | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
19 | 41 | | |
20 | 42 | | |
21 | 43 | | |
22 | | - | |
| 44 | + | |
23 | 45 | | |
24 | 46 | | |
25 | 47 | | |
| |||
36 | 58 | | |
37 | 59 | | |
38 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
39 | 66 | | |
40 | 67 | | |
41 | 68 | | |
| |||
0 commit comments