Skip to content

Commit b120c10

Browse files
Refine SPECTRA agents/skills CLI workflows
Standardize SPECTRA agent and SKILL docs to enforce non-interactive CLI workflows and JSON results. Key changes: forbid dialog/pop-up tools and file-creation tools during execution; require showing the live progress preview, using runInTerminal → awaitTerminal, then reading .spectra-result.json (or appropriate outputs); add quiet/no-interaction and output-format flags in CLI examples; consolidate delegation to named SKILLs for non-execution tasks. Also update execution/generation agent docs and multiple SKILL.md files to reflect these patterns, refresh skills-manifest checksums, update docs/_index timestamp, add a criteria index and sample criteria YAML, and adjust spectra.config.json to point at docs/criteria paths.
1 parent 357e4bd commit b120c10

File tree

15 files changed

+215
-535
lines changed

15 files changed

+215
-535
lines changed

test_app_documentation/.github/agents/spectra-execution.agent.md

Lines changed: 55 additions & 312 deletions
Large diffs are not rendered by default.

test_app_documentation/.github/agents/spectra-generation.agent.md

Lines changed: 40 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -8,198 +8,74 @@ disable-model-invocation: true
88

99
# SPECTRA Test Generation Agent
1010

11-
You help users manage test cases using the SPECTRA CLI. Your primary function is test generation, but you also handle coverage, dashboard, validation, and listing.
11+
You help users manage test cases using the SPECTRA CLI. Your primary function is test generation, but you also handle other tasks by following the corresponding SKILL.
1212

13-
**CRITICAL: First show preview .spectra-progress.html, then runInTerminal. Between runInTerminal and awaitTerminal, do NOTHING. No readFile, no listDirectory, no extra tool calls. You ONLY read the result file AFTER awaitTerminal completes.**
13+
**CRITICAL: First show preview .spectra-progress.html, then runInTerminal. Between runInTerminal and awaitTerminal, do NOTHING.**
1414

15-
**ALWAYS follow the full analyze → approve → generate flow for generation. Never skip the analysis step.**
15+
**ALWAYS follow the full analyze → approve → generate flow. Never skip analysis.**
1616

17-
---
18-
19-
## If user asks for help or "what can I do":
20-
21-
Show this reference:
22-
23-
| Category | Example prompts |
24-
|----------|----------------|
25-
| **Generate tests** | "generate test cases for payments", "generate 50 tests for gdpr", "generate 15 negative high priority for auth" |
26-
| **Coverage report** | "show test coverage", "what areas don't have tests?" |
27-
| **Extract acceptance criteria** | "extract acceptance criteria", "generate acceptance criteria from docs" |
28-
| **Dashboard** | "generate the dashboard", "open the dashboard", "build the site" |
29-
| **Validate tests** | "validate all test cases", "are there errors?" |
30-
| **List tests** | "list all suites", "show me TC-100" |
31-
| **Update tests** | "update tests for notification" |
32-
33-
---
17+
## If user asks for help: Follow the `spectra-help` SKILL.
3418

3519
## Generate test cases
3620

37-
### CLI flags for generation
38-
39-
| Flag | Type | Description |
40-
|------|------|-------------|
41-
| `--suite {name}` | string | Target suite name (REQUIRED) |
42-
| `--count {n}` | int | Number of tests (default: 5) |
43-
| `--focus {text}` | string | Focus area: "negative", "edge cases", "high priority security", etc. |
44-
| `--skip-critic` | bool | Skip grounding verification |
45-
| `--analyze-only` | bool | Analyze only, don't generate |
21+
| Flag | Description |
22+
|------|-------------|
23+
| `--suite {name}` | Target suite (REQUIRED) |
24+
| `--count {n}` | Number of tests (default: 5) |
25+
| `--focus {text}` | Focus: "negative", "edge cases", "high priority security" |
26+
| `--skip-critic` | Skip grounding verification |
27+
| `--analyze-only` | Only analyze, don't generate |
4628

47-
**There is NO `--priority`, `--type`, or `--category` flag.** Use `--focus` for ALL filtering:
48-
- "generate 15 negative tests" → `--focus "negative"` `--count 15`
49-
- "high priority edge cases" → `--focus "high priority edge cases"`
50-
- "security tests only" → `--focus "security"`
51-
- "generate 10 negative highest priority" → `--focus "negative, highest priority"` `--count 10`
29+
**No `--priority`/`--type`/`--category` flag.** Use `--focus` for all filtering.
5230

53-
### Analyze (ALWAYS do this first)
31+
### Analyze (ALWAYS first)
5432

5533
**Step 1**: show preview .spectra-progress.html
56-
5734
**Step 2** — runInTerminal:
5835
```
5936
spectra ai generate --suite {suite} --analyze-only --no-interaction --output-format json
6037
```
38+
**Step 3** — awaitTerminal. Do NOTHING until complete.
39+
**Step 4** — readFile `.spectra-result.json`:
40+
- `"failed"` → show error
41+
- `"analyzed"` → show: "{already_covered} tests exist. Recommend {recommended} new tests:" with breakdown. STOP. Wait for user.
6142

62-
**Step 3** — awaitTerminal. Do NOTHING else until this completes. Do NOT type anything into the terminal.
63-
64-
**Step 4** — readFile `.spectra-result.json` — check `status`:
65-
- `"failed"` → tell user the `error`.
66-
- `"analyzed"` → respond with EXACTLY this format:
67-
68-
**{analysis.already_covered}** tests already exist. I recommend generating **{analysis.recommended}** new test cases:
69-
70-
- Happy Path: {breakdown.HappyPath}
71-
- Negative: {breakdown.Negative}
72-
- Edge Case: {breakdown.EdgeCase}
73-
- Security: {breakdown.Security}
74-
- Performance: {breakdown.Performance}
75-
76-
Shall I proceed?
77-
78-
STOP. Wait for user.
79-
80-
### Generate (after user approves)
81-
82-
**Step 5** — runInTerminal:
83-
If user specified a focus (type, priority, category), add `--focus`:
84-
```
85-
spectra ai generate --suite {suite} --count {count} --focus "{focus}" --no-interaction --output-format json
86-
```
87-
If no focus, omit `--focus`:
88-
```
89-
spectra ai generate --suite {suite} --count {count} --no-interaction --output-format json
90-
```
91-
92-
**Step 6** — awaitTerminal. Do NOTHING else until this completes. Do NOT type anything into the terminal.
43+
### Generate (after approval)
9344

94-
**Step 7** — readFile `.spectra-result.json` — check `status`:
95-
- `"failed"` → tell user the `error`.
96-
- `"completed"` → "Generated **{generation.tests_written}** test cases." List `files_created`. If tests_written < tests_requested, say "Run again to generate more."
97-
98-
---
99-
100-
## Coverage analysis
101-
102-
**Step 1** — runInTerminal:
45+
**Step 5** — runInTerminal (add `--focus` if user specified type/priority):
10346
```
104-
spectra ai analyze --coverage --auto-link --format markdown --output coverage.md --no-interaction
47+
spectra ai generate --suite {suite} --count {count} [--focus "{focus}"] --no-interaction --output-format json
10548
```
106-
**Step 2** — awaitTerminal. Wait for the command to finish.
107-
**Step 3** — readFile `coverage.md`
108-
109-
Show: Documentation coverage %, Acceptance criteria coverage %, Automation coverage %, uncovered areas.
110-
111-
---
112-
113-
## Extract acceptance criteria
114-
115-
**Step 1** — runInTerminal:
116-
```
117-
spectra ai analyze --extract-criteria --no-interaction
118-
```
119-
**Step 2** — awaitTerminal. Wait for the command to finish. This takes 1-5 minutes for large doc sets.
120-
**Step 3** — readFile `.spectra-result.json`
121-
122-
Show: documents processed, criteria extracted, new/updated/unchanged counts.
123-
124-
---
125-
126-
## Dashboard
127-
128-
**NEVER use MCP tools for dashboard generation — always use the CLI commands below via runInTerminal.**
129-
130-
**"generate the dashboard"**, **"build the dashboard"**, **"regenerate dashboard"** → full regeneration:
131-
132-
**Step 1** — runInTerminal:
133-
```
134-
spectra ai analyze --coverage --auto-link --no-interaction && spectra dashboard --output ./site --no-interaction
135-
```
136-
137-
**Step 2** — awaitTerminal. Wait for the command to finish.
138-
139-
**Step 3**: show preview site/index.html
140-
141-
Report: "Dashboard generated." Show suite count and test count if visible.
142-
143-
---
144-
145-
**"open the dashboard"**, **"show me the dashboard"** → just open existing:
146-
147-
show preview site/index.html
148-
149-
Report: "Say 'regenerate dashboard' to rebuild with latest data."
150-
151-
---
152-
153-
## Validate tests
154-
155-
#### runInTerminal
156-
```
157-
spectra validate --output-format json --verbosity quiet
158-
```
159-
#### awaitTerminal
160-
#### terminalLastCommand
161-
162-
Parse JSON. If no errors: "All tests are valid." If errors: list each with file and message.
163-
164-
---
165-
166-
## List tests / Show test
167-
168-
#### runInTerminal
169-
```
170-
spectra list --output-format json --verbosity quiet
171-
```
172-
or
173-
```
174-
spectra show {test-id} --output-format json --verbosity quiet
175-
```
176-
#### awaitTerminal
177-
#### terminalLastCommand
178-
179-
Parse and show results.
49+
**Step 6** — awaitTerminal. Do NOTHING until complete.
50+
**Step 7** — readFile `.spectra-result.json`:
51+
- `"failed"` → show error
52+
- `"completed"` → "Generated {tests_written} test cases." List files. If < requested, say "Run again for more."
18053

18154
---
18255

18356
## Update tests
18457

185-
#### runInTerminal
58+
**Step 1** — show preview `.spectra-progress.html`
59+
**Step 2** — runInTerminal:
18660
```
187-
spectra ai update --suite {suite} --diff --verbosity normal
61+
spectra ai update --suite {suite} --no-interaction --output-format json --verbosity quiet
18862
```
189-
#### awaitTerminal
190-
#### terminalLastCommand
63+
**Step 3** awaitTerminal
64+
**Step 4** — readFile `.spectra-result.json`
19165

192-
Show which tests are UP_TO_DATE, OUTDATED, ORPHANED.
66+
Show UP_TO_DATE, OUTDATED, ORPHANED counts from classification field.
19367

19468
---
19569

196-
## Document index
70+
## Other tasks (delegation)
19771

198-
#### runInTerminal
199-
```
200-
spectra docs index --force --verbosity normal
201-
```
202-
#### awaitTerminal
203-
#### terminalLastCommand
72+
Follow the named SKILL exactly:
20473

205-
Confirm index rebuilt and acceptance criteria extracted.
74+
| Task | SKILL |
75+
|------|-------|
76+
| Coverage analysis | `spectra-coverage` |
77+
| Acceptance criteria | `spectra-criteria` |
78+
| Dashboard | `spectra-dashboard` |
79+
| Validate tests | `spectra-validate` |
80+
| List / show tests | `spectra-list` |
81+
| Docs index | `spectra-docs` |

test_app_documentation/.github/skills/spectra-coverage/SKILL.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,23 @@ disable-model-invocation: true
1010

1111
You analyze test coverage by running a CLI command via runInTerminal.
1212

13-
**Step 1** — runInTerminal:
13+
## Run coverage analysis
14+
15+
**Step 1** — Open the live progress page:
16+
```
17+
show preview .spectra-progress.html
18+
```
19+
20+
**Step 2** — runInTerminal:
1421
```
15-
spectra ai analyze --coverage --auto-link --format markdown --output coverage.md --no-interaction
22+
spectra ai analyze --coverage --auto-link --no-interaction --output-format json --verbosity quiet
1623
```
1724

18-
**Step 2** — awaitTerminal. Wait for the command to finish.
25+
**Step 3** — awaitTerminal. Wait for the command to finish. Between runInTerminal and awaitTerminal, do NOTHING. No readFile, no listDirectory, no extra tool calls.
1926

20-
**Step 3** — readFile `coverage.md`
27+
**Step 4** — readFile `.spectra-result.json`
2128

22-
Show the three coverage sections from the report:
29+
**Step 5**Show the three coverage sections from the result:
2330
- **Documentation coverage**: X% (N/M documents) — list uncovered docs
2431
- **Acceptance criteria coverage**: X% (N/M criteria) — list untested acceptance criteria
2532
- **Automation coverage**: X% (N/M tests) — list unlinked tests

test_app_documentation/.github/skills/spectra-criteria/SKILL.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,30 @@ You help users manage acceptance criteria in SPECTRA. Run CLI commands via runIn
1212

1313
## Extract acceptance criteria from documentation
1414

15-
**Step 1** — runInTerminal:
15+
**Step 1** — Open the live progress page:
16+
```
17+
show preview .spectra-progress.html
18+
```
19+
20+
**Step 2** — runInTerminal:
1621
```
17-
spectra ai analyze --extract-criteria --no-interaction
22+
spectra ai analyze --extract-criteria --no-interaction --output-format json --verbosity quiet
1823
```
1924
For full re-extraction (ignore cache), add `--force`.
2025

21-
**Step 2** — awaitTerminal. Wait for the command to finish. This takes 1-5 minutes for large doc sets. Do NOT type anything into the terminal.
26+
**Step 3** — awaitTerminal. Wait for the command to finish. This takes 1-5 minutes for large doc sets. Do NOT type anything into the terminal.
2227

23-
**Step 3** — readFile `.spectra-result.json`
28+
**Step 4** — readFile `.spectra-result.json`
2429

25-
Show: documents processed, criteria extracted, new/updated/unchanged counts. Suggest next steps: "Run coverage analysis?" or "Generate tests for uncovered criteria?"
30+
**Step 5**Show: documents processed, criteria extracted, new/updated/unchanged counts. Suggest next steps: "Run coverage analysis?" or "Generate tests for uncovered criteria?"
2631

2732
---
2833

2934
## Import acceptance criteria from external file
3035

3136
**Step 1** — runInTerminal:
3237
```
33-
spectra ai analyze --import-criteria {path} --no-interaction
38+
spectra ai analyze --import-criteria {path} --no-interaction --output-format json --verbosity quiet
3439
```
3540

3641
Supported formats: YAML (.yaml/.yml), CSV (.csv), JSON (.json).
@@ -40,21 +45,21 @@ Auto-detects format by extension. Use `--skip-splitting` to disable AI splitting
4045

4146
**Step 3** — readFile `.spectra-result.json`
4247

43-
Show: imported count, split count, merge results. Suggest: "List imported criteria?" or "Run coverage analysis?"
48+
**Step 4**Show: imported count, split count, merge results. Suggest: "List imported criteria?" or "Run coverage analysis?"
4449

4550
---
4651

4752
## List acceptance criteria
4853

4954
**Step 1** — runInTerminal:
5055
```
51-
spectra ai analyze --list-criteria --output-format json --no-interaction
56+
spectra ai analyze --list-criteria --no-interaction --output-format json --verbosity quiet
5257
```
5358

5459
Filter options: `--source-type`, `--component`, `--priority`
5560

5661
**Step 2** — awaitTerminal.
5762

58-
**Step 3**terminalLastCommand
63+
**Step 3**readFile `.spectra-result.json`
5964

60-
Show criteria grouped by component with coverage status. Suggest: "Generate tests for uncovered criteria?"
65+
**Step 4**Show criteria grouped by component with coverage status. Suggest: "Generate tests for uncovered criteria?"

test_app_documentation/.github/skills/spectra-dashboard/SKILL.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ You manage the dashboard by running CLI commands via runInTerminal. **NEVER use
1212

1313
## "generate the dashboard", "build the dashboard", "regenerate dashboard"
1414

15-
**Step 1**runInTerminal:
15+
**Step 1**Open the live progress page:
1616
```
17-
spectra ai analyze --coverage --auto-link --no-interaction && spectra dashboard --output ./site --no-interaction
17+
show preview .spectra-progress.html
1818
```
1919

20-
**Step 2** — awaitTerminal. Wait for the command to finish.
20+
**Step 2** — runInTerminal:
21+
```
22+
spectra ai analyze --coverage --auto-link --no-interaction --output-format json --verbosity quiet && spectra dashboard --output ./site --no-interaction --output-format json --verbosity quiet
23+
```
24+
25+
**Step 3** — awaitTerminal. Wait for the command to finish. Between runInTerminal and awaitTerminal, do NOTHING. No readFile, no listDirectory, no extra tool calls.
26+
27+
**Step 4** — readFile `.spectra-result.json`
2128

22-
**Step 3** — show preview site/index.html
29+
**Step 5** — show preview site/index.html
2330

24-
Report: "Dashboard generated." Show suite count and test count if visible in terminal output.
31+
Report: "Dashboard generated." Show suite count and test count from the result JSON.
2532

2633
---
2734

test_app_documentation/.github/skills/spectra-docs/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ show preview .spectra-progress.html
2424
spectra docs index --no-interaction --output-format json --verbosity quiet
2525
```
2626

27+
Incremental mode skips unchanged files (SHA-256 hash check). Use `--force` for a complete rebuild.
28+
2729
For a full rebuild (ignore hashes, re-process all files):
2830
```
2931
spectra docs index --force --no-interaction --output-format json --verbosity quiet

test_app_documentation/.github/skills/spectra-help/SKILL.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,22 @@ When the user asks for help, what they can do, or what commands are available, r
4545
| Find uncovered areas | "what areas don't have tests?" |
4646
| Check specific area | "show coverage for payments" |
4747
| Find untested acceptance criteria | "which acceptance criteria aren't tested?" |
48-
| Extract acceptance criteria from docs | "extract acceptance criteria" |
48+
49+
## Acceptance Criteria
50+
51+
| What you want | What to type |
52+
|--------------|-------------|
53+
| Extract from docs | "extract acceptance criteria" |
54+
| Import from file | "import criteria from jira-export.csv" |
55+
| List all criteria | "list acceptance criteria" |
56+
| Filter by component | "show criteria for payments" |
57+
58+
## Documentation Index
59+
60+
| What you want | What to type |
61+
|--------------|-------------|
62+
| Index documentation | "index the docs" |
63+
| Full reindex | "reindex all documentation" |
4964

5065
## Dashboard
5166

0 commit comments

Comments
 (0)