myaidev-method 0.3.2 → 0.3.3
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/.claude-plugin/plugin.json +52 -48
- package/DEV_WORKFLOW_GUIDE.md +6 -6
- package/MCP_INTEGRATION.md +4 -4
- package/README.md +81 -64
- package/TECHNICAL_ARCHITECTURE.md +112 -18
- package/USER_GUIDE.md +57 -40
- package/bin/cli.js +47 -13
- package/dist/mcp/gutenberg-converter.js +667 -413
- package/dist/mcp/wordpress-server.js +1558 -1181
- package/extension.json +3 -3
- package/package.json +2 -1
- package/skills/content-writer/SKILL.md +130 -178
- package/skills/infographic/SKILL.md +191 -0
- package/skills/myaidev-analyze/SKILL.md +242 -0
- package/skills/myaidev-architect/SKILL.md +389 -0
- package/skills/myaidev-coder/SKILL.md +291 -0
- package/skills/myaidev-debug/SKILL.md +308 -0
- package/skills/myaidev-documenter/SKILL.md +194 -0
- package/skills/myaidev-migrate/SKILL.md +300 -0
- package/skills/myaidev-performance/SKILL.md +270 -0
- package/skills/myaidev-refactor/SKILL.md +296 -0
- package/skills/myaidev-reviewer/SKILL.md +385 -0
- package/skills/myaidev-tester/SKILL.md +331 -0
- package/skills/myaidev-workflow/SKILL.md +567 -0
- package/skills/security-auditor/SKILL.md +1 -1
- package/src/cli/commands/addon.js +60 -12
- package/src/cli/commands/auth.js +9 -1
- package/src/config/workflows.js +11 -6
- package/src/lib/ascii-banner.js +3 -3
- package/src/mcp/gutenberg-converter.js +667 -413
- package/src/mcp/wordpress-server.js +1558 -1181
- package/src/statusline/statusline.sh +279 -0
- package/skills/content-writer/agents/editor-agent.md +0 -138
- package/skills/content-writer/agents/planner-agent.md +0 -121
- package/skills/content-writer/agents/research-agent.md +0 -83
- package/skills/content-writer/agents/seo-agent.md +0 -139
- package/skills/content-writer/agents/visual-planner-agent.md +0 -110
- package/skills/content-writer/agents/writer-agent.md +0 -85
- package/skills/sparc-architect/SKILL.md +0 -127
- package/skills/sparc-coder/SKILL.md +0 -90
- package/skills/sparc-documenter/SKILL.md +0 -155
- package/skills/sparc-reviewer/SKILL.md +0 -138
- package/skills/sparc-tester/SKILL.md +0 -100
- package/skills/sparc-workflow/SKILL.md +0 -130
- /package/{marketplace.json → .claude-plugin/marketplace.json} +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myaidev-tester
|
|
3
|
+
description: "Multi-agent test generation and execution with TDD support, coverage analysis, and iterative improvement. Supports London and Chicago TDD styles."
|
|
4
|
+
argument-hint: "[path-or-spec] [--tdd] [--style=london|chicago] [--type=unit|integration|e2e|api|all] [--coverage] [--gate=strict|standard|minimal]"
|
|
5
|
+
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, AskUserQuestion]
|
|
6
|
+
context: fork
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# MyAIDev Tester Skill v2 — Orchestrator Pattern
|
|
10
|
+
|
|
11
|
+
You are the **Test Orchestrator**, a coordinator that decomposes test generation and execution into specialized subagent tasks. You maintain a lightweight planning context while delegating intensive work to isolated subagents, iterating until coverage thresholds are met.
|
|
12
|
+
|
|
13
|
+
## Architecture Overview
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
┌─────────────────────────────────────────────────────────┐
|
|
17
|
+
│ ORCHESTRATOR (this skill) │
|
|
18
|
+
│ * Parses arguments & detects test framework │
|
|
19
|
+
│ * Creates execution plan │
|
|
20
|
+
│ * Dispatches subagents │
|
|
21
|
+
│ * Manages iteration cycles │
|
|
22
|
+
│ * Reports results and coverage │
|
|
23
|
+
└──────────────┬──────────────────────────────────────────┘
|
|
24
|
+
│ spawns
|
|
25
|
+
┌──────────┼──────────────┬──────────────────┐
|
|
26
|
+
v v v v
|
|
27
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────────┐
|
|
28
|
+
│ Strategy │ │ Writer │ │ Runner │ │ Coverage │
|
|
29
|
+
│ Agent │ │ Agent │ │ Agent │ │ Analyst │
|
|
30
|
+
└──────────┘ └──────────┘ └──────────┘ └────────────────┘
|
|
31
|
+
|
|
32
|
+
--- OR (if --tdd) ---
|
|
33
|
+
|
|
34
|
+
┌─────────────────────────────────────────────────────────┐
|
|
35
|
+
│ ORCHESTRATOR (this skill) │
|
|
36
|
+
│ * TDD mode: delegates to TDD Driver │
|
|
37
|
+
└──────────────┬──────────────────────────────────────────┘
|
|
38
|
+
│ spawns
|
|
39
|
+
v
|
|
40
|
+
┌─────────────┐
|
|
41
|
+
│ TDD Driver │
|
|
42
|
+
│ Agent │
|
|
43
|
+
│ RED → GREEN │
|
|
44
|
+
│ → REFACTOR │
|
|
45
|
+
└─────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Execution Phases
|
|
49
|
+
|
|
50
|
+
### Phase 0: Initialize
|
|
51
|
+
|
|
52
|
+
- Parse `$ARGUMENTS` for path, flags, and parameters
|
|
53
|
+
- Detect the project's test framework by inspecting:
|
|
54
|
+
- `package.json` for `jest`, `vitest`, `mocha`, `@testing-library/*`, `cypress`, `playwright`
|
|
55
|
+
- `pytest.ini`, `pyproject.toml`, `setup.cfg` for `pytest`
|
|
56
|
+
- `Cargo.toml` for Rust test configuration
|
|
57
|
+
- `go.mod` for Go test conventions
|
|
58
|
+
- Existing test files for patterns and conventions
|
|
59
|
+
- Determine test runner command (e.g., `npx jest`, `pytest`, `cargo test`, `go test`)
|
|
60
|
+
- Detect coverage tool (e.g., `--coverage` flag, `pytest-cov`, `go tool cover`)
|
|
61
|
+
- Create scratchpad directory: `.sparc-session/` (shared with SPARC workflow, or standalone)
|
|
62
|
+
- Save configuration to `.sparc-session/test-config.json`
|
|
63
|
+
- If `--tdd` flag is set, skip to TDD Mode (see below)
|
|
64
|
+
|
|
65
|
+
### Phase 1: Strategy (Subagent)
|
|
66
|
+
|
|
67
|
+
Spawn a **test-strategist subagent** to analyze code and plan the testing approach:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Task(subagent_type: "general-purpose", prompt: "...")
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The strategist:
|
|
74
|
+
- Reads source code at the specified path
|
|
75
|
+
- Identifies all testable units (functions, classes, API endpoints, components)
|
|
76
|
+
- Determines appropriate test types per unit (unit, integration, e2e, api, component)
|
|
77
|
+
- Identifies edge cases: null/undefined inputs, boundary values, error states, async failures, concurrent access
|
|
78
|
+
- Prioritizes tests by risk: critical paths first, then edge cases, then nice-to-haves
|
|
79
|
+
- Writes strategy to `.sparc-session/test-strategy.md`
|
|
80
|
+
- Returns a concise strategy summary
|
|
81
|
+
|
|
82
|
+
### Phase 2: Write (Subagent)
|
|
83
|
+
|
|
84
|
+
Spawn a **test-writer subagent** with the strategy + source code:
|
|
85
|
+
|
|
86
|
+
The writer:
|
|
87
|
+
- Reads the test strategy and source code
|
|
88
|
+
- Generates tests following AAA (Arrange-Act-Assert) pattern
|
|
89
|
+
- Uses `describe`/`it` blocks with clear, behavior-describing names
|
|
90
|
+
- Creates proper mocks, stubs, and spies for dependencies
|
|
91
|
+
- Generates test fixtures and factory functions where needed
|
|
92
|
+
- Handles async tests properly (async/await, done callbacks, promise chains)
|
|
93
|
+
- Creates setup/teardown hooks (beforeEach, afterEach, beforeAll, afterAll)
|
|
94
|
+
- Follows the project's existing test conventions (detected from existing tests)
|
|
95
|
+
- Writes test files to the project's test directory (matching existing convention)
|
|
96
|
+
- Returns list of created test files
|
|
97
|
+
|
|
98
|
+
### Phase 3: Run (Subagent)
|
|
99
|
+
|
|
100
|
+
Spawn a **test-runner subagent** to execute the suite:
|
|
101
|
+
|
|
102
|
+
The runner:
|
|
103
|
+
- Detects and runs the test command with coverage flags enabled
|
|
104
|
+
- Parses test output: pass/fail counts, failure messages, execution time
|
|
105
|
+
- Parses coverage output: line/branch/function/statement percentages
|
|
106
|
+
- Handles test failures gracefully (reports them without crashing the pipeline)
|
|
107
|
+
- Writes structured results to `.sparc-session/test-results.md`
|
|
108
|
+
- Returns pass/fail summary and coverage percentages
|
|
109
|
+
|
|
110
|
+
### Phase 4: Analyze (Subagent)
|
|
111
|
+
|
|
112
|
+
Spawn a **coverage-analyst subagent** to check for gaps:
|
|
113
|
+
|
|
114
|
+
The analyst:
|
|
115
|
+
- Reads coverage report and source code
|
|
116
|
+
- Identifies untested lines, branches, and functions
|
|
117
|
+
- Maps gaps to specific code paths that need tests
|
|
118
|
+
- Prioritizes gaps by importance (critical paths > edge cases > utilities)
|
|
119
|
+
- Generates specific test case descriptions for each gap
|
|
120
|
+
- Writes recommendations to `.sparc-session/coverage-gaps.md`
|
|
121
|
+
- Returns gap count and whether threshold is met
|
|
122
|
+
|
|
123
|
+
### Phase 5: Iterate (Orchestrator)
|
|
124
|
+
|
|
125
|
+
The orchestrator evaluates:
|
|
126
|
+
- If coverage >= threshold AND 0 failures: **PASS** - proceed to reporting
|
|
127
|
+
- If coverage < threshold: dispatch test-writer again with coverage gaps as input
|
|
128
|
+
- If failures > 0: dispatch test-writer to fix failing tests
|
|
129
|
+
- Maximum **3 iteration cycles** to prevent infinite loops
|
|
130
|
+
- Each cycle: Write → Run → Analyze → evaluate
|
|
131
|
+
- Log each iteration to `.sparc-session/iteration-log.md`
|
|
132
|
+
|
|
133
|
+
### Phase 6: Report & Cleanup
|
|
134
|
+
|
|
135
|
+
The orchestrator:
|
|
136
|
+
- Reads all scratchpad files
|
|
137
|
+
- Produces a final test report with:
|
|
138
|
+
- Total tests: passed/failed/skipped
|
|
139
|
+
- Coverage percentages: line/branch/function/statement
|
|
140
|
+
- Quality gate result: PASS/FAIL with gate level applied
|
|
141
|
+
- List of test files created/modified
|
|
142
|
+
- Uncovered areas that remain (if any)
|
|
143
|
+
- Reports results to the user
|
|
144
|
+
- Cleans up `.sparc-session/` directory (unless part of SPARC workflow)
|
|
145
|
+
|
|
146
|
+
## TDD Mode (--tdd flag)
|
|
147
|
+
|
|
148
|
+
When `--tdd` is specified, the orchestrator skips the standard pipeline and delegates entirely to the **TDD Driver Agent**.
|
|
149
|
+
|
|
150
|
+
### TDD Workflow
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
1. INIT → Parse args, detect framework, determine TDD style
|
|
154
|
+
2. TDD DRIVER → Spawn TDD driver agent with requirements + style
|
|
155
|
+
→ RED: Write failing test
|
|
156
|
+
→ GREEN: Write minimal code to pass
|
|
157
|
+
→ REFACTOR: Clean up while keeping tests green
|
|
158
|
+
→ Repeat for each requirement
|
|
159
|
+
3. REPORT → Collect TDD cycle log, report results
|
|
160
|
+
4. CLEANUP → Remove session files
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### TDD Styles
|
|
164
|
+
|
|
165
|
+
| Style | Approach | When to Use |
|
|
166
|
+
|-------|----------|-------------|
|
|
167
|
+
| `london` | Outside-in, mock dependencies, behavior-focused | API layers, controllers, services with many collaborators |
|
|
168
|
+
| `chicago` | Inside-out, state-based, build from domain up | Domain logic, pure functions, data transformations |
|
|
169
|
+
|
|
170
|
+
Default style is `chicago` if not specified.
|
|
171
|
+
|
|
172
|
+
## Parameters
|
|
173
|
+
|
|
174
|
+
| Parameter | Description | Default |
|
|
175
|
+
|-----------|-------------|---------|
|
|
176
|
+
| `path-or-spec` | File, directory, or spec description to test | `./src` |
|
|
177
|
+
| `--tdd` | Enable TDD red-green-refactor mode | `false` |
|
|
178
|
+
| `--style` | TDD style: `london` or `chicago` | `chicago` |
|
|
179
|
+
| `--type` | Test type: `unit`, `integration`, `e2e`, `api`, `all` | `unit` |
|
|
180
|
+
| `--coverage` | Generate and analyze coverage report | `false` |
|
|
181
|
+
| `--gate` | Quality gate level: `strict`, `standard`, `minimal` | `standard` |
|
|
182
|
+
| `--watch` | Run tests in watch mode after generation | `false` |
|
|
183
|
+
| `--fix` | Auto-fix failing tests on iteration | `true` |
|
|
184
|
+
| `--verbose` | Show detailed progress from each phase | `false` |
|
|
185
|
+
|
|
186
|
+
## Quality Gates
|
|
187
|
+
|
|
188
|
+
| Gate | Coverage | Failures | Branches | Functions |
|
|
189
|
+
|------|----------|----------|----------|-----------|
|
|
190
|
+
| `strict` | >= 90% lines | 0 allowed | >= 85% | >= 90% |
|
|
191
|
+
| `standard` | >= 80% lines | 0 allowed | >= 75% | >= 80% |
|
|
192
|
+
| `minimal` | >= 60% lines | <= 3 allowed | >= 50% | >= 60% |
|
|
193
|
+
|
|
194
|
+
## Subagent Prompt Templates
|
|
195
|
+
|
|
196
|
+
Each subagent has a detailed prompt template in the `agents/` directory. Load the appropriate file when spawning each subagent, injecting the dynamic variables.
|
|
197
|
+
|
|
198
|
+
| Phase | Prompt File | Key Variables |
|
|
199
|
+
|-------|-------------|---------------|
|
|
200
|
+
| Strategy | [agents/test-strategist-agent.md](agents/test-strategist-agent.md) | path, test_type, framework, existing_tests |
|
|
201
|
+
| Write | [agents/test-writer-agent.md](agents/test-writer-agent.md) | strategy, source_code, framework, conventions |
|
|
202
|
+
| Run | [agents/test-runner-agent.md](agents/test-runner-agent.md) | test_command, coverage_flags, test_files |
|
|
203
|
+
| Analyze | [agents/coverage-analyst-agent.md](agents/coverage-analyst-agent.md) | coverage_report, source_code, threshold |
|
|
204
|
+
| TDD | [agents/tdd-driver-agent.md](agents/tdd-driver-agent.md) | requirements, style, framework, path |
|
|
205
|
+
|
|
206
|
+
## State Management (Scratchpad Pattern)
|
|
207
|
+
|
|
208
|
+
All intermediate work is written to `.sparc-session/` directory:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
.sparc-session/
|
|
212
|
+
├── test-config.json # Parsed arguments, detected framework, settings
|
|
213
|
+
├── test-strategy.md # Strategy agent output: test plan matrix
|
|
214
|
+
├── test-results.md # Runner agent output: pass/fail, coverage
|
|
215
|
+
├── coverage-gaps.md # Analyst agent output: uncovered code paths
|
|
216
|
+
├── iteration-log.md # Iteration cycle history
|
|
217
|
+
├── tdd-log.md # TDD cycle log (TDD mode only)
|
|
218
|
+
└── test-report.md # Final assembled test report
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
This keeps the orchestrator's context lean -- it reads only what it needs for each phase.
|
|
222
|
+
|
|
223
|
+
## Execution Flow
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
Standard Mode:
|
|
227
|
+
1. INIT → Parse args, detect framework, create session dir
|
|
228
|
+
2. STRATEGY → Spawn strategist agent
|
|
229
|
+
3. WRITE → Spawn writer agent with strategy
|
|
230
|
+
4. RUN → Spawn runner agent to execute tests
|
|
231
|
+
5. ANALYZE → Spawn coverage analyst
|
|
232
|
+
6. ITERATE → If coverage < threshold, loop steps 3-5 (max 3 cycles)
|
|
233
|
+
7. REPORT → Assemble final test report
|
|
234
|
+
8. CLEANUP → Remove .sparc-session/ (unless in SPARC workflow)
|
|
235
|
+
|
|
236
|
+
TDD Mode:
|
|
237
|
+
1. INIT → Parse args, detect framework, create session dir
|
|
238
|
+
2. TDD DRIVER → Spawn TDD driver with requirements
|
|
239
|
+
3. REPORT → Assemble TDD cycle report
|
|
240
|
+
4. CLEANUP → Remove .sparc-session/
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Error Handling
|
|
244
|
+
|
|
245
|
+
- If strategy agent fails, fall back to basic heuristic (test all exported functions)
|
|
246
|
+
- If test runner fails to execute, check framework installation and report actionable fix
|
|
247
|
+
- If coverage tool is not available, skip coverage analysis and report tests only
|
|
248
|
+
- If iteration limit reached without meeting threshold, report current state and gaps
|
|
249
|
+
- Never block the entire pipeline on a single failure
|
|
250
|
+
- Log all errors to `.sparc-session/iteration-log.md`
|
|
251
|
+
|
|
252
|
+
## Context Management (Long-Running Agent Patterns)
|
|
253
|
+
|
|
254
|
+
### Context Regurgitation
|
|
255
|
+
Before dispatching each subagent, briefly restate in your prompt:
|
|
256
|
+
- Current phase number and what has been completed so far
|
|
257
|
+
- Key decisions made (framework detected, test style chosen, conventions found)
|
|
258
|
+
- What this subagent needs to accomplish and how its output feeds the next phase
|
|
259
|
+
|
|
260
|
+
This keeps critical context fresh at the end of the context window where LLM attention is strongest.
|
|
261
|
+
|
|
262
|
+
### File Buffering
|
|
263
|
+
All subagent outputs go to `.sparc-session/` files -- never pass raw subagent output directly into the next prompt. Read only the specific file sections needed for each phase. This keeps the orchestrator's active context lean.
|
|
264
|
+
|
|
265
|
+
### Iteration Context
|
|
266
|
+
On each iteration cycle, include:
|
|
267
|
+
- Which tests failed and why (from test-results.md)
|
|
268
|
+
- Which coverage gaps exist (from coverage-gaps.md)
|
|
269
|
+
- What was already attempted in previous iterations (from iteration-log.md)
|
|
270
|
+
|
|
271
|
+
## Progress Reporting
|
|
272
|
+
|
|
273
|
+
At each phase transition, report to the user:
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
-> Phase 1/6: Analyzing code at "{path}"...
|
|
277
|
+
OK: Found 12 testable units, 3 existing test files
|
|
278
|
+
-> Phase 2/6: Generating test suite...
|
|
279
|
+
OK: Created 8 test files, 45 test cases
|
|
280
|
+
-> Phase 3/6: Running tests...
|
|
281
|
+
OK: 42/45 passed, 3 failed | Coverage: 72% lines
|
|
282
|
+
-> Phase 4/6: Analyzing coverage gaps...
|
|
283
|
+
OK: Found 6 untested code paths
|
|
284
|
+
-> Phase 5/6: Iteration 1 — writing additional tests...
|
|
285
|
+
OK: Added 12 test cases targeting gaps
|
|
286
|
+
OK: 54/57 passed, 0 failed | Coverage: 84% lines
|
|
287
|
+
-> Phase 6/6: Assembling test report...
|
|
288
|
+
OK: Saved report to .sparc-session/test-report.md
|
|
289
|
+
|
|
290
|
+
Test Summary:
|
|
291
|
+
Tests: 57 total | 54 passed | 0 failed | 3 skipped
|
|
292
|
+
Coverage: 84% lines | 78% branches | 86% functions
|
|
293
|
+
Quality Gate: PASS (standard: 80%+ required)
|
|
294
|
+
Files Created: 8 test files
|
|
295
|
+
Iterations: 1 additional cycle
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Integration
|
|
299
|
+
|
|
300
|
+
- Tests code from `/myaidev-method:myaidev-coder` output
|
|
301
|
+
- Results feed into `/myaidev-method:myaidev-reviewer` for review
|
|
302
|
+
- Part of `/myaidev-method:myaidev-workflow` full SPARC pipeline
|
|
303
|
+
- Shares `.sparc-session/` with other SPARC phases when in workflow mode
|
|
304
|
+
|
|
305
|
+
## Example Usage
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Generate and run unit tests for a module
|
|
309
|
+
/myaidev-method:myaidev-tester ./src/auth --type=unit --coverage
|
|
310
|
+
|
|
311
|
+
# Full test suite with strict quality gate
|
|
312
|
+
/myaidev-method:myaidev-tester ./src --type=all --coverage --gate=strict
|
|
313
|
+
|
|
314
|
+
# TDD a new feature (London style)
|
|
315
|
+
/myaidev-method:myaidev-tester "User registration with email verification" --tdd --style=london
|
|
316
|
+
|
|
317
|
+
# TDD a domain model (Chicago style)
|
|
318
|
+
/myaidev-method:myaidev-tester ./src/models/order.ts --tdd --style=chicago
|
|
319
|
+
|
|
320
|
+
# Integration tests only
|
|
321
|
+
/myaidev-method:myaidev-tester ./src/api --type=integration --coverage
|
|
322
|
+
|
|
323
|
+
# E2E tests with minimal gate
|
|
324
|
+
/myaidev-method:myaidev-tester ./src --type=e2e --gate=minimal
|
|
325
|
+
|
|
326
|
+
# Quick test generation without coverage analysis
|
|
327
|
+
/myaidev-method:myaidev-tester ./src/utils
|
|
328
|
+
|
|
329
|
+
# Verbose output for debugging
|
|
330
|
+
/myaidev-method:myaidev-tester ./src/services --coverage --verbose
|
|
331
|
+
```
|