qa-workflow-cc 1.0.0
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/README.md +461 -0
- package/VERSION +1 -0
- package/bin/install.js +116 -0
- package/commands/qa/continue.md +77 -0
- package/commands/qa/full.md +149 -0
- package/commands/qa/init.md +105 -0
- package/commands/qa/resume.md +91 -0
- package/commands/qa/status.md +66 -0
- package/package.json +28 -0
- package/skills/qa/SKILL.md +420 -0
- package/skills/qa/references/continuation-format.md +58 -0
- package/skills/qa/references/exit-criteria.md +53 -0
- package/skills/qa/references/lifecycle.md +181 -0
- package/skills/qa/references/model-profiles.md +77 -0
- package/skills/qa/templates/agent-skeleton.md +733 -0
- package/skills/qa/templates/component-test.md +1088 -0
- package/skills/qa/templates/domain-research-queries.md +101 -0
- package/skills/qa/templates/domain-security-profiles.md +182 -0
- package/skills/qa/templates/e2e-test.md +1200 -0
- package/skills/qa/templates/nielsen-heuristics.md +274 -0
- package/skills/qa/templates/performance-benchmarks-base.md +321 -0
- package/skills/qa/templates/qa-report-template.md +271 -0
- package/skills/qa/templates/security-checklist-owasp.md +451 -0
- package/skills/qa/templates/stop-points/bootstrap-complete.md +36 -0
- package/skills/qa/templates/stop-points/certified.md +25 -0
- package/skills/qa/templates/stop-points/escalated.md +32 -0
- package/skills/qa/templates/stop-points/fix-ready.md +43 -0
- package/skills/qa/templates/stop-points/phase-transition.md +4 -0
- package/skills/qa/templates/stop-points/status-dashboard.md +32 -0
- package/skills/qa/templates/test-standards.md +652 -0
- package/skills/qa/templates/unit-test.md +998 -0
- package/skills/qa/templates/visual-regression.md +418 -0
- package/skills/qa/workflows/bootstrap.md +45 -0
- package/skills/qa/workflows/decision-gate.md +66 -0
- package/skills/qa/workflows/fix-execute.md +132 -0
- package/skills/qa/workflows/fix-plan.md +52 -0
- package/skills/qa/workflows/report-phase.md +64 -0
- package/skills/qa/workflows/test-phase.md +86 -0
- package/skills/qa/workflows/verify-phase.md +65 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# QA Lifecycle Reference
|
|
2
|
+
|
|
3
|
+
Phase definitions, state machine, edge cases, and operational rules for the QA orchestrator.
|
|
4
|
+
|
|
5
|
+
## Lifecycle Overview
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/qa:full
|
|
9
|
+
│
|
|
10
|
+
├─ Phase 0: Bootstrap (if needed)
|
|
11
|
+
│ └─ Writes cycle-state: phase="bootstrap_complete"
|
|
12
|
+
├─ Phase 1: Load Resources
|
|
13
|
+
├─ Phase 2: Parse Scope
|
|
14
|
+
│ └─ /qa:resume reads cycle-state → routes to correct phase
|
|
15
|
+
│
|
|
16
|
+
╔═══════════════════════════════════════╗
|
|
17
|
+
║ CYCLE LOOP (max 3 iterations) ║
|
|
18
|
+
║ ║
|
|
19
|
+
║ Phase 3: Execute Tests ║
|
|
20
|
+
║ └─ Saves raw results to disk ║
|
|
21
|
+
║ Phase 4: Consolidate Report ║
|
|
22
|
+
║ └─ Reads from saved raw results ║
|
|
23
|
+
║ Phase 5: Decision Gate ║
|
|
24
|
+
║ ├─ PASS → Phase 8 (certify) ║
|
|
25
|
+
║ ├─ FAIL → Phase 6 (plan fixes) ║
|
|
26
|
+
║ └─ STUCK → Phase 9 (escalate) ║
|
|
27
|
+
║ ║
|
|
28
|
+
║ Phase 6: Plan Fixes ║
|
|
29
|
+
║ └─ ■ STOP — present plan ║
|
|
30
|
+
║ user runs: /qa:continue ║
|
|
31
|
+
║ ║
|
|
32
|
+
║ Phase 7: Execute Fixes ║ ← /qa:continue enters here
|
|
33
|
+
║ └─ Batch checkpoints per priority ║
|
|
34
|
+
║ Phase 7b: Verify (type-check + ║
|
|
35
|
+
║ build + re-test failed) ║
|
|
36
|
+
║ └─ GOTO Phase 3 (next cycle) ║
|
|
37
|
+
║ ║
|
|
38
|
+
╚═══════════════════════════════════════╝
|
|
39
|
+
│
|
|
40
|
+
Phase 8: Certification (all pass)
|
|
41
|
+
Phase 9: Escalation (stuck after 3 cycles)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Key principle:** After the user approves fixes (`/qa:continue`), Phases 7→7b→3→4→5 run autonomously. If the next cycle still has failures, Phases 6→STOP happens again. The user only ever sees stop points, never intermediate states.
|
|
45
|
+
|
|
46
|
+
**State management:** Every phase writes to `cycle-state.json` BEFORE executing, following the GSD "write state before execute" pattern. If context resets at any point, `/qa:resume` reads the state file and re-enters at the correct phase.
|
|
47
|
+
|
|
48
|
+
## Phase Value Semantics
|
|
49
|
+
|
|
50
|
+
| Phase | Meaning |
|
|
51
|
+
|-------|---------|
|
|
52
|
+
| `bootstrap_complete` | Profile and agents generated, ready for first QA cycle |
|
|
53
|
+
| `testing` | Test agents spawned, may still be running |
|
|
54
|
+
| `testing_complete` | All agents returned, raw results saved to disk |
|
|
55
|
+
| `reporting_complete` | Consolidated report written, ready for decision gate |
|
|
56
|
+
| `awaiting_fix_approval` | Fix plan written, waiting for user to run `/qa:continue` |
|
|
57
|
+
| `fixing` | Fix execution in progress (check `batchProgress` for details) |
|
|
58
|
+
| `verifying` | Post-fix verification running |
|
|
59
|
+
| `certified` | All exit criteria passed — terminal state |
|
|
60
|
+
| `escalated` | Stuck defects — manual intervention needed — terminal state |
|
|
61
|
+
|
|
62
|
+
## cycle-state.json Schema
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"cycle": 1,
|
|
67
|
+
"date": "YYYY-MM-DD",
|
|
68
|
+
"scope": "full",
|
|
69
|
+
"phase": "bootstrap_complete|testing|testing_complete|reporting_complete|awaiting_fix_approval|fixing|verifying|certified|escalated",
|
|
70
|
+
"verdict": "PASS|FAIL",
|
|
71
|
+
"decision": "PASS|FAIL|ESCALATE",
|
|
72
|
+
"summary": {
|
|
73
|
+
"totalTests": 0,
|
|
74
|
+
"passing": 0,
|
|
75
|
+
"failing": 0,
|
|
76
|
+
"skipped": 0,
|
|
77
|
+
"passRate": 0.0
|
|
78
|
+
},
|
|
79
|
+
"defects": {
|
|
80
|
+
"critical": 0,
|
|
81
|
+
"major": 0,
|
|
82
|
+
"minor": 0,
|
|
83
|
+
"cosmetic": 0,
|
|
84
|
+
"total": 0
|
|
85
|
+
},
|
|
86
|
+
"failedTestIds": [],
|
|
87
|
+
"openDefectIds": [],
|
|
88
|
+
"blockedDefectIds": [],
|
|
89
|
+
"fixPlanPath": "docs/qa-reports/fix-plan-cycle-{N}.md",
|
|
90
|
+
"rawResultsDir": "docs/qa-reports/cycle-{N}-raw/",
|
|
91
|
+
"agentTasks": [],
|
|
92
|
+
"batchProgress": {
|
|
93
|
+
"completedBatches": [],
|
|
94
|
+
"currentBatch": null,
|
|
95
|
+
"batchResults": {}
|
|
96
|
+
},
|
|
97
|
+
"previousCycles": [],
|
|
98
|
+
"exitCriteria": {}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Resume Logic (`/qa:resume`)
|
|
103
|
+
|
|
104
|
+
1. Read `docs/qa-reports/cycle-state.json`
|
|
105
|
+
2. If file missing → error: "No QA state found. Run `/qa:full` to start."
|
|
106
|
+
3. If file is corrupt or unreadable → error: "State file corrupt. Options: `/qa:full` (fresh start) or `/qa:cycle-{N}` (re-test)"
|
|
107
|
+
4. Route based on `state.phase`:
|
|
108
|
+
|
|
109
|
+
| state.phase | Resume Action |
|
|
110
|
+
|-------------|---------------|
|
|
111
|
+
| `bootstrap_complete` | → Phase 1 (load resources, then Phase 3) |
|
|
112
|
+
| `testing` | → Phase 3 (check for raw results in `docs/qa-reports/cycle-{N}-raw/`; re-spawn missing agents) |
|
|
113
|
+
| `testing_complete` | → Phase 4 (consolidate from saved raw results) |
|
|
114
|
+
| `reporting_complete` | → Phase 5 (re-evaluate decision gate) |
|
|
115
|
+
| `awaiting_fix_approval` | → Output fix plan summary + stop (same as Phase 6 stop) |
|
|
116
|
+
| `fixing` | → Phase 7 (skip completed batches per `state.batchProgress`) |
|
|
117
|
+
| `verifying` | → Phase 7b (re-run verification) |
|
|
118
|
+
| `certified` | → Output: "Already certified. Run `/qa:full cycle-{N+1}` for new cycle." |
|
|
119
|
+
| `escalated` | → Output: "Escalated. Review `docs/qa-reports/escalation-*.md`" |
|
|
120
|
+
|
|
121
|
+
**Resume error messages:**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
If state.phase == "testing" AND state.agentTasks exist:
|
|
125
|
+
→ "Previous test agents may still be running. Re-spawning test phase."
|
|
126
|
+
|
|
127
|
+
If state.phase == "fixing" AND state.batchProgress.currentBatch exists:
|
|
128
|
+
→ "Resuming fix execution from batch {currentBatch}. Skipping completed: {completedBatches}"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Continue Logic (`/qa:continue`)
|
|
132
|
+
|
|
133
|
+
1. Read `docs/qa-reports/cycle-state.json`
|
|
134
|
+
2. Verify `state.phase` is `"awaiting_fix_approval"` — if not, error: "No pending fix plan. Run `/qa:full` instead."
|
|
135
|
+
3. Read the fix plan from `state.fixPlanPath`
|
|
136
|
+
4. Jump directly to Phase 7: Execute Fixes
|
|
137
|
+
|
|
138
|
+
## Cycle-N Logic (`/qa:full cycle-N`)
|
|
139
|
+
|
|
140
|
+
1. Set cycle number to N
|
|
141
|
+
2. Read previous cycle report if exists (for regression comparison)
|
|
142
|
+
3. Jump to Phase 3: Execute Tests — runs ALL tests, not just previously failed ones
|
|
143
|
+
4. Report compares results against previous cycle to show improvement
|
|
144
|
+
|
|
145
|
+
## Edge Cases
|
|
146
|
+
|
|
147
|
+
| Scenario | Handling |
|
|
148
|
+
|----------|---------|
|
|
149
|
+
| **No PRD found** | Infer features from route files + components; mark `prdExists: false`; all tests P1; optionally offer requirements discovery (Phase 0.5) |
|
|
150
|
+
| **No API/backend** | Skip security auditor; security focuses on client-side |
|
|
151
|
+
| **Single app (not monorepo)** | Single entry in `apps[]` with `path: "."` |
|
|
152
|
+
| **Existing `.claude/agents/qa-*.md`** | Check mtime vs profile; skip if newer (user customized) |
|
|
153
|
+
| **No test runner detected** | Default to vitest; note `"testing.autoDetected": false` |
|
|
154
|
+
| **context7 unavailable** | Graceful fallback; generate without latest docs |
|
|
155
|
+
| **Profile stale (>30 days)** | Prompt user: "QA profile is N days old. Re-scan?" |
|
|
156
|
+
| **No tenant isolation detected** | Skip tenant isolation audit; focus on auth and OWASP |
|
|
157
|
+
| **`/qa:continue` with no pending plan** | Error: "No pending fix plan. Run `/qa:full` to start a new cycle." |
|
|
158
|
+
| **`/qa:continue` after manual fixes** | Works — Phase 7 reads fix plan but skips fixes already applied, then Phase 7b verifies |
|
|
159
|
+
| **`/qa:resume` with no state file** | Error: "No QA state found. Run `/qa:full` to start." |
|
|
160
|
+
| **`/qa:resume` with corrupt state** | Error: "State file corrupt. Options: `/qa:full` (fresh start) or `/qa:full cycle-{N}` (re-test)" |
|
|
161
|
+
| **Context reset during Phase 3** | `/qa:resume` → re-enters Phase 3, checks for saved raw results in `cycle-{N}-raw/`, re-spawns missing agents |
|
|
162
|
+
| **Context reset during Phase 7 batch** | `/qa:resume` → reads `batchProgress`, skips completed batches, resumes current batch |
|
|
163
|
+
| **Context reset after Phase 6 stop** | `/qa:continue` works as normal (state + fix plan both persisted to disk) |
|
|
164
|
+
| **Cycle 1 has 0 failures** | Skip Phases 6-7, go straight to Phase 8 certification |
|
|
165
|
+
| **All fixes blocked in Phase 7** | Still proceeds to Phase 7b verification, then next cycle catches remaining issues |
|
|
166
|
+
|
|
167
|
+
## Important Rules
|
|
168
|
+
|
|
169
|
+
- NEVER skip the security audit if multi-tenancy is detected
|
|
170
|
+
- Always verify type-check and build pass after fixes
|
|
171
|
+
- Each cycle should improve the pass rate — if not, investigate why
|
|
172
|
+
- The test matrix is the source of truth — don't invent tests not in the matrix
|
|
173
|
+
- Keep reports concise but include evidence for every failure
|
|
174
|
+
- All profile-driven: read paths, commands, and scopes from qa-profile.json
|
|
175
|
+
- The ONLY user-facing stop point is fix plan approval (Phase 6 → `/qa:continue`)
|
|
176
|
+
- Phase 8 (certification) and Phase 9 (escalation) are terminal — they output and stop
|
|
177
|
+
- Between cycles, do NOT stop — Phase 7b flows into Phase 3 automatically
|
|
178
|
+
- Every phase MUST write to `cycle-state.json` BEFORE executing (GSD "write state before execute" pattern)
|
|
179
|
+
- Raw test results MUST be saved to `docs/qa-reports/cycle-{N}-raw/` — never rely on agent memory across phases
|
|
180
|
+
- `/qa:resume` reads `cycle-state.json` and routes to the correct phase — all phases must be resumable
|
|
181
|
+
- `blockedDefectIds` persists across cycles — excluded from fix plans, included in escalation reports
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# QA Model Profiles
|
|
2
|
+
|
|
3
|
+
Model profiles control which Claude model each QA agent uses. Mirrors GSD's model profile system.
|
|
4
|
+
|
|
5
|
+
## Profile Definitions
|
|
6
|
+
|
|
7
|
+
| Agent | `quality` | `balanced` | `budget` |
|
|
8
|
+
|-------|-----------|------------|----------|
|
|
9
|
+
| qa-test-executor | opus | sonnet | sonnet |
|
|
10
|
+
| qa-security-auditor | opus | sonnet | sonnet |
|
|
11
|
+
| qa-ux-optimizer | opus | sonnet | haiku |
|
|
12
|
+
| qa-report-writer | sonnet | sonnet | haiku |
|
|
13
|
+
| qa-fix-planner | opus | opus | sonnet |
|
|
14
|
+
| qa-verifier | opus | sonnet | sonnet |
|
|
15
|
+
| fix-implementer | sonnet | sonnet | sonnet |
|
|
16
|
+
| anthropic-docs-researcher | sonnet | haiku | haiku |
|
|
17
|
+
| stack-research | sonnet | haiku | haiku |
|
|
18
|
+
| security-research | sonnet | haiku | haiku |
|
|
19
|
+
| ux-research | sonnet | haiku | haiku |
|
|
20
|
+
|
|
21
|
+
## Profile Philosophy
|
|
22
|
+
|
|
23
|
+
**quality** — Maximum reasoning power
|
|
24
|
+
- Opus for all test execution and security (where detection matters)
|
|
25
|
+
- Opus for fix planning (architecture decisions)
|
|
26
|
+
- Sonnet for report writing and fix implementation (follows instructions)
|
|
27
|
+
- Use when: quota available, security-critical projects, safety-critical domains
|
|
28
|
+
|
|
29
|
+
**balanced** (default) — Smart allocation
|
|
30
|
+
- Opus only for fix planning (where architecture decisions happen)
|
|
31
|
+
- Sonnet for test execution, security, verification (needs reasoning)
|
|
32
|
+
- Sonnet for report writing (needs synthesis)
|
|
33
|
+
- Haiku for research agents (web search + summarize)
|
|
34
|
+
- Use when: normal development, good balance of quality and cost
|
|
35
|
+
|
|
36
|
+
**budget** — Minimal Opus usage
|
|
37
|
+
- Sonnet for anything that writes code or runs tests
|
|
38
|
+
- Haiku for research and reports
|
|
39
|
+
- Use when: conserving quota, high-volume work, less critical phases
|
|
40
|
+
|
|
41
|
+
## Resolution Logic
|
|
42
|
+
|
|
43
|
+
Orchestrator commands (`/qa:full`, `/qa:continue`, `/qa:resume`) resolve model before spawning:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
1. Read .claude/qa-profile.json
|
|
47
|
+
2. Get config.model_profile (default: "balanced")
|
|
48
|
+
3. Look up agent in table above
|
|
49
|
+
4. Pass model parameter to Task call
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
Set in `.claude/qa-profile.json`:
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"config": {
|
|
58
|
+
"model_profile": "balanced"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Override per-invocation is not supported — change the profile config to switch.
|
|
64
|
+
|
|
65
|
+
## Design Rationale
|
|
66
|
+
|
|
67
|
+
**Why Opus for qa-fix-planner?**
|
|
68
|
+
Fix planning involves root cause analysis, blast radius assessment, and architecture-aware fix routing. Model quality has the highest impact here.
|
|
69
|
+
|
|
70
|
+
**Why Sonnet for qa-test-executor in balanced?**
|
|
71
|
+
Test execution follows structured test matrices and runs automated tests. The matrix provides the reasoning; execution is verification.
|
|
72
|
+
|
|
73
|
+
**Why Opus for qa-security-auditor in quality?**
|
|
74
|
+
Security auditing requires nuanced reasoning about data flow, tenant isolation, and edge cases. Missing a vulnerability is high-cost.
|
|
75
|
+
|
|
76
|
+
**Why Haiku for research agents in balanced?**
|
|
77
|
+
Research agents run WebSearch queries and summarize results. This is information retrieval, not reasoning.
|