qaa-agent 1.6.2 → 1.7.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.
Files changed (78) hide show
  1. package/.mcp.json +8 -8
  2. package/CHANGELOG.md +93 -71
  3. package/CLAUDE.md +553 -553
  4. package/agents/qa-pipeline-orchestrator.md +1378 -1378
  5. package/agents/qaa-analyzer.md +539 -524
  6. package/agents/qaa-bug-detective.md +479 -446
  7. package/agents/qaa-codebase-mapper.md +935 -935
  8. package/agents/qaa-discovery.md +384 -0
  9. package/agents/qaa-e2e-runner.md +416 -415
  10. package/agents/qaa-executor.md +651 -651
  11. package/agents/qaa-planner.md +405 -390
  12. package/agents/qaa-project-researcher.md +319 -319
  13. package/agents/qaa-scanner.md +424 -424
  14. package/agents/qaa-testid-injector.md +643 -585
  15. package/agents/qaa-validator.md +490 -452
  16. package/bin/install.cjs +200 -198
  17. package/bin/lib/commands.cjs +709 -709
  18. package/bin/lib/config.cjs +307 -307
  19. package/bin/lib/core.cjs +497 -497
  20. package/bin/lib/frontmatter.cjs +299 -299
  21. package/bin/lib/init.cjs +989 -989
  22. package/bin/lib/milestone.cjs +241 -241
  23. package/bin/lib/model-profiles.cjs +60 -60
  24. package/bin/lib/phase.cjs +911 -911
  25. package/bin/lib/roadmap.cjs +306 -306
  26. package/bin/lib/state.cjs +748 -748
  27. package/bin/lib/template.cjs +222 -222
  28. package/bin/lib/verify.cjs +842 -842
  29. package/bin/qaa-tools.cjs +607 -607
  30. package/commands/qa-audit.md +119 -0
  31. package/commands/qa-create-test.md +288 -0
  32. package/commands/qa-fix.md +147 -0
  33. package/commands/qa-map.md +137 -0
  34. package/{.claude/commands → commands}/qa-pr.md +23 -23
  35. package/{.claude/commands → commands}/qa-start.md +22 -22
  36. package/{.claude/commands → commands}/qa-testid.md +19 -19
  37. package/docs/COMMANDS.md +341 -341
  38. package/docs/DEMO.md +182 -182
  39. package/docs/TESTING.md +156 -156
  40. package/package.json +6 -7
  41. package/{.claude/settings.json → settings.json} +1 -2
  42. package/templates/failure-classification.md +391 -391
  43. package/templates/gap-analysis.md +409 -409
  44. package/templates/pr-template.md +48 -48
  45. package/templates/qa-analysis.md +381 -381
  46. package/templates/qa-audit-report.md +465 -465
  47. package/templates/qa-repo-blueprint.md +636 -636
  48. package/templates/scan-manifest.md +312 -312
  49. package/templates/test-inventory.md +582 -582
  50. package/templates/testid-audit-report.md +354 -354
  51. package/templates/validation-report.md +243 -243
  52. package/workflows/qa-analyze.md +296 -296
  53. package/workflows/qa-from-ticket.md +536 -536
  54. package/workflows/qa-gap.md +309 -303
  55. package/workflows/qa-pr.md +389 -389
  56. package/workflows/qa-start.md +1192 -1168
  57. package/workflows/qa-testid.md +384 -356
  58. package/workflows/qa-validate.md +299 -295
  59. package/.claude/commands/create-test.md +0 -164
  60. package/.claude/commands/qa-audit.md +0 -37
  61. package/.claude/commands/qa-blueprint.md +0 -54
  62. package/.claude/commands/qa-fix.md +0 -36
  63. package/.claude/commands/qa-from-ticket.md +0 -24
  64. package/.claude/commands/qa-gap.md +0 -20
  65. package/.claude/commands/qa-map.md +0 -47
  66. package/.claude/commands/qa-pom.md +0 -36
  67. package/.claude/commands/qa-pyramid.md +0 -37
  68. package/.claude/commands/qa-report.md +0 -38
  69. package/.claude/commands/qa-research.md +0 -33
  70. package/.claude/commands/qa-validate.md +0 -42
  71. package/.claude/commands/update-test.md +0 -58
  72. package/.claude/skills/qa-learner/SKILL.md +0 -150
  73. /package/{.claude/skills → skills}/qa-bug-detective/SKILL.md +0 -0
  74. /package/{.claude/skills → skills}/qa-repo-analyzer/SKILL.md +0 -0
  75. /package/{.claude/skills → skills}/qa-self-validator/SKILL.md +0 -0
  76. /package/{.claude/skills → skills}/qa-template-engine/SKILL.md +0 -0
  77. /package/{.claude/skills → skills}/qa-testid-injector/SKILL.md +0 -0
  78. /package/{.claude/skills → skills}/qa-workflow-documenter/SKILL.md +0 -0
@@ -1,222 +1,222 @@
1
- /**
2
- * Template — Template selection and fill operations
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const { normalizePhaseName, findPhaseInternal, generateSlugInternal, toPosixPath, output, error } = require('./core.cjs');
8
- const { reconstructFrontmatter } = require('./frontmatter.cjs');
9
-
10
- function cmdTemplateSelect(cwd, planPath, raw) {
11
- if (!planPath) {
12
- error('plan-path required');
13
- }
14
-
15
- try {
16
- const fullPath = path.join(cwd, planPath);
17
- const content = fs.readFileSync(fullPath, 'utf-8');
18
-
19
- // Simple heuristics
20
- const taskMatch = content.match(/###\s*Task\s*\d+/g) || [];
21
- const taskCount = taskMatch.length;
22
-
23
- const decisionMatch = content.match(/decision/gi) || [];
24
- const hasDecisions = decisionMatch.length > 0;
25
-
26
- // Count file mentions
27
- const fileMentions = new Set();
28
- const filePattern = /`([^`]+\.[a-zA-Z]+)`/g;
29
- let m;
30
- while ((m = filePattern.exec(content)) !== null) {
31
- if (m[1].includes('/') && !m[1].startsWith('http')) {
32
- fileMentions.add(m[1]);
33
- }
34
- }
35
- const fileCount = fileMentions.size;
36
-
37
- let template = 'templates/summary-standard.md';
38
- let type = 'standard';
39
-
40
- if (taskCount <= 2 && fileCount <= 3 && !hasDecisions) {
41
- template = 'templates/summary-minimal.md';
42
- type = 'minimal';
43
- } else if (hasDecisions || fileCount > 6 || taskCount > 5) {
44
- template = 'templates/summary-complex.md';
45
- type = 'complex';
46
- }
47
-
48
- const result = { template, type, taskCount, fileCount, hasDecisions };
49
- output(result, raw, template);
50
- } catch (e) {
51
- // Fallback to standard
52
- output({ template: 'templates/summary-standard.md', type: 'standard', error: e.message }, raw, 'templates/summary-standard.md');
53
- }
54
- }
55
-
56
- function cmdTemplateFill(cwd, templateType, options, raw) {
57
- if (!templateType) { error('template type required: summary, plan, or verification'); }
58
- if (!options.phase) { error('--phase required'); }
59
-
60
- const phaseInfo = findPhaseInternal(cwd, options.phase);
61
- if (!phaseInfo || !phaseInfo.found) { output({ error: 'Phase not found', phase: options.phase }, raw); return; }
62
-
63
- const padded = normalizePhaseName(options.phase);
64
- const today = new Date().toISOString().split('T')[0];
65
- const phaseName = options.name || phaseInfo.phase_name || 'Unnamed';
66
- const phaseSlug = phaseInfo.phase_slug || generateSlugInternal(phaseName);
67
- const phaseId = `${padded}-${phaseSlug}`;
68
- const planNum = (options.plan || '01').padStart(2, '0');
69
- const fields = options.fields || {};
70
-
71
- let frontmatter, body, fileName;
72
-
73
- switch (templateType) {
74
- case 'summary': {
75
- frontmatter = {
76
- phase: phaseId,
77
- plan: planNum,
78
- subsystem: '[primary category]',
79
- tags: [],
80
- provides: [],
81
- affects: [],
82
- 'tech-stack': { added: [], patterns: [] },
83
- 'key-files': { created: [], modified: [] },
84
- 'key-decisions': [],
85
- 'patterns-established': [],
86
- duration: '[X]min',
87
- completed: today,
88
- ...fields,
89
- };
90
- body = [
91
- `# Phase ${options.phase}: ${phaseName} Summary`,
92
- '',
93
- '**[Substantive one-liner describing outcome]**',
94
- '',
95
- '## Performance',
96
- '- **Duration:** [time]',
97
- '- **Tasks:** [count completed]',
98
- '- **Files modified:** [count]',
99
- '',
100
- '## Accomplishments',
101
- '- [Key outcome 1]',
102
- '- [Key outcome 2]',
103
- '',
104
- '## Task Commits',
105
- '1. **Task 1: [task name]** - `hash`',
106
- '',
107
- '## Files Created/Modified',
108
- '- `path/to/file.ts` - What it does',
109
- '',
110
- '## Decisions & Deviations',
111
- '[Key decisions or "None - followed plan as specified"]',
112
- '',
113
- '## Next Phase Readiness',
114
- '[What\'s ready for next phase]',
115
- ].join('\n');
116
- fileName = `${padded}-${planNum}-SUMMARY.md`;
117
- break;
118
- }
119
- case 'plan': {
120
- const planType = options.type || 'execute';
121
- const wave = parseInt(options.wave) || 1;
122
- frontmatter = {
123
- phase: phaseId,
124
- plan: planNum,
125
- type: planType,
126
- wave,
127
- depends_on: [],
128
- files_modified: [],
129
- autonomous: true,
130
- user_setup: [],
131
- must_haves: { truths: [], artifacts: [], key_links: [] },
132
- ...fields,
133
- };
134
- body = [
135
- `# Phase ${options.phase} Plan ${planNum}: [Title]`,
136
- '',
137
- '## Objective',
138
- '- **What:** [What this plan builds]',
139
- '- **Why:** [Why it matters for the phase goal]',
140
- '- **Output:** [Concrete deliverable]',
141
- '',
142
- '## Context',
143
- '@.planning/PROJECT.md',
144
- '@.planning/ROADMAP.md',
145
- '@.planning/STATE.md',
146
- '',
147
- '## Tasks',
148
- '',
149
- '<task type="code">',
150
- ' <name>[Task name]</name>',
151
- ' <files>[file paths]</files>',
152
- ' <action>[What to do]</action>',
153
- ' <verify>[How to verify]</verify>',
154
- ' <done>[Definition of done]</done>',
155
- '</task>',
156
- '',
157
- '## Verification',
158
- '[How to verify this plan achieved its objective]',
159
- '',
160
- '## Success Criteria',
161
- '- [ ] [Criterion 1]',
162
- '- [ ] [Criterion 2]',
163
- ].join('\n');
164
- fileName = `${padded}-${planNum}-PLAN.md`;
165
- break;
166
- }
167
- case 'verification': {
168
- frontmatter = {
169
- phase: phaseId,
170
- verified: new Date().toISOString(),
171
- status: 'pending',
172
- score: '0/0 must-haves verified',
173
- ...fields,
174
- };
175
- body = [
176
- `# Phase ${options.phase}: ${phaseName} — Verification`,
177
- '',
178
- '## Observable Truths',
179
- '| # | Truth | Status | Evidence |',
180
- '|---|-------|--------|----------|',
181
- '| 1 | [Truth] | pending | |',
182
- '',
183
- '## Required Artifacts',
184
- '| Artifact | Expected | Status | Details |',
185
- '|----------|----------|--------|---------|',
186
- '| [path] | [what] | pending | |',
187
- '',
188
- '## Key Link Verification',
189
- '| From | To | Via | Status | Details |',
190
- '|------|----|----|--------|---------|',
191
- '| [source] | [target] | [connection] | pending | |',
192
- '',
193
- '## Requirements Coverage',
194
- '| Requirement | Status | Blocking Issue |',
195
- '|-------------|--------|----------------|',
196
- '| [req] | pending | |',
197
- '',
198
- '## Result',
199
- '[Pending verification]',
200
- ].join('\n');
201
- fileName = `${padded}-VERIFICATION.md`;
202
- break;
203
- }
204
- default:
205
- error(`Unknown template type: ${templateType}. Available: summary, plan, verification`);
206
- return;
207
- }
208
-
209
- const fullContent = `---\n${reconstructFrontmatter(frontmatter)}\n---\n\n${body}\n`;
210
- const outPath = path.join(cwd, phaseInfo.directory, fileName);
211
-
212
- if (fs.existsSync(outPath)) {
213
- output({ error: 'File already exists', path: toPosixPath(path.relative(cwd, outPath)) }, raw);
214
- return;
215
- }
216
-
217
- fs.writeFileSync(outPath, fullContent, 'utf-8');
218
- const relPath = toPosixPath(path.relative(cwd, outPath));
219
- output({ created: true, path: relPath, template: templateType }, raw, relPath);
220
- }
221
-
222
- module.exports = { cmdTemplateSelect, cmdTemplateFill };
1
+ /**
2
+ * Template — Template selection and fill operations
3
+ */
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const { normalizePhaseName, findPhaseInternal, generateSlugInternal, toPosixPath, output, error } = require('./core.cjs');
8
+ const { reconstructFrontmatter } = require('./frontmatter.cjs');
9
+
10
+ function cmdTemplateSelect(cwd, planPath, raw) {
11
+ if (!planPath) {
12
+ error('plan-path required');
13
+ }
14
+
15
+ try {
16
+ const fullPath = path.join(cwd, planPath);
17
+ const content = fs.readFileSync(fullPath, 'utf-8');
18
+
19
+ // Simple heuristics
20
+ const taskMatch = content.match(/###\s*Task\s*\d+/g) || [];
21
+ const taskCount = taskMatch.length;
22
+
23
+ const decisionMatch = content.match(/decision/gi) || [];
24
+ const hasDecisions = decisionMatch.length > 0;
25
+
26
+ // Count file mentions
27
+ const fileMentions = new Set();
28
+ const filePattern = /`([^`]+\.[a-zA-Z]+)`/g;
29
+ let m;
30
+ while ((m = filePattern.exec(content)) !== null) {
31
+ if (m[1].includes('/') && !m[1].startsWith('http')) {
32
+ fileMentions.add(m[1]);
33
+ }
34
+ }
35
+ const fileCount = fileMentions.size;
36
+
37
+ let template = 'templates/summary-standard.md';
38
+ let type = 'standard';
39
+
40
+ if (taskCount <= 2 && fileCount <= 3 && !hasDecisions) {
41
+ template = 'templates/summary-minimal.md';
42
+ type = 'minimal';
43
+ } else if (hasDecisions || fileCount > 6 || taskCount > 5) {
44
+ template = 'templates/summary-complex.md';
45
+ type = 'complex';
46
+ }
47
+
48
+ const result = { template, type, taskCount, fileCount, hasDecisions };
49
+ output(result, raw, template);
50
+ } catch (e) {
51
+ // Fallback to standard
52
+ output({ template: 'templates/summary-standard.md', type: 'standard', error: e.message }, raw, 'templates/summary-standard.md');
53
+ }
54
+ }
55
+
56
+ function cmdTemplateFill(cwd, templateType, options, raw) {
57
+ if (!templateType) { error('template type required: summary, plan, or verification'); }
58
+ if (!options.phase) { error('--phase required'); }
59
+
60
+ const phaseInfo = findPhaseInternal(cwd, options.phase);
61
+ if (!phaseInfo || !phaseInfo.found) { output({ error: 'Phase not found', phase: options.phase }, raw); return; }
62
+
63
+ const padded = normalizePhaseName(options.phase);
64
+ const today = new Date().toISOString().split('T')[0];
65
+ const phaseName = options.name || phaseInfo.phase_name || 'Unnamed';
66
+ const phaseSlug = phaseInfo.phase_slug || generateSlugInternal(phaseName);
67
+ const phaseId = `${padded}-${phaseSlug}`;
68
+ const planNum = (options.plan || '01').padStart(2, '0');
69
+ const fields = options.fields || {};
70
+
71
+ let frontmatter, body, fileName;
72
+
73
+ switch (templateType) {
74
+ case 'summary': {
75
+ frontmatter = {
76
+ phase: phaseId,
77
+ plan: planNum,
78
+ subsystem: '[primary category]',
79
+ tags: [],
80
+ provides: [],
81
+ affects: [],
82
+ 'tech-stack': { added: [], patterns: [] },
83
+ 'key-files': { created: [], modified: [] },
84
+ 'key-decisions': [],
85
+ 'patterns-established': [],
86
+ duration: '[X]min',
87
+ completed: today,
88
+ ...fields,
89
+ };
90
+ body = [
91
+ `# Phase ${options.phase}: ${phaseName} Summary`,
92
+ '',
93
+ '**[Substantive one-liner describing outcome]**',
94
+ '',
95
+ '## Performance',
96
+ '- **Duration:** [time]',
97
+ '- **Tasks:** [count completed]',
98
+ '- **Files modified:** [count]',
99
+ '',
100
+ '## Accomplishments',
101
+ '- [Key outcome 1]',
102
+ '- [Key outcome 2]',
103
+ '',
104
+ '## Task Commits',
105
+ '1. **Task 1: [task name]** - `hash`',
106
+ '',
107
+ '## Files Created/Modified',
108
+ '- `path/to/file.ts` - What it does',
109
+ '',
110
+ '## Decisions & Deviations',
111
+ '[Key decisions or "None - followed plan as specified"]',
112
+ '',
113
+ '## Next Phase Readiness',
114
+ '[What\'s ready for next phase]',
115
+ ].join('\n');
116
+ fileName = `${padded}-${planNum}-SUMMARY.md`;
117
+ break;
118
+ }
119
+ case 'plan': {
120
+ const planType = options.type || 'execute';
121
+ const wave = parseInt(options.wave) || 1;
122
+ frontmatter = {
123
+ phase: phaseId,
124
+ plan: planNum,
125
+ type: planType,
126
+ wave,
127
+ depends_on: [],
128
+ files_modified: [],
129
+ autonomous: true,
130
+ user_setup: [],
131
+ must_haves: { truths: [], artifacts: [], key_links: [] },
132
+ ...fields,
133
+ };
134
+ body = [
135
+ `# Phase ${options.phase} Plan ${planNum}: [Title]`,
136
+ '',
137
+ '## Objective',
138
+ '- **What:** [What this plan builds]',
139
+ '- **Why:** [Why it matters for the phase goal]',
140
+ '- **Output:** [Concrete deliverable]',
141
+ '',
142
+ '## Context',
143
+ '@.planning/PROJECT.md',
144
+ '@.planning/ROADMAP.md',
145
+ '@.planning/STATE.md',
146
+ '',
147
+ '## Tasks',
148
+ '',
149
+ '<task type="code">',
150
+ ' <name>[Task name]</name>',
151
+ ' <files>[file paths]</files>',
152
+ ' <action>[What to do]</action>',
153
+ ' <verify>[How to verify]</verify>',
154
+ ' <done>[Definition of done]</done>',
155
+ '</task>',
156
+ '',
157
+ '## Verification',
158
+ '[How to verify this plan achieved its objective]',
159
+ '',
160
+ '## Success Criteria',
161
+ '- [ ] [Criterion 1]',
162
+ '- [ ] [Criterion 2]',
163
+ ].join('\n');
164
+ fileName = `${padded}-${planNum}-PLAN.md`;
165
+ break;
166
+ }
167
+ case 'verification': {
168
+ frontmatter = {
169
+ phase: phaseId,
170
+ verified: new Date().toISOString(),
171
+ status: 'pending',
172
+ score: '0/0 must-haves verified',
173
+ ...fields,
174
+ };
175
+ body = [
176
+ `# Phase ${options.phase}: ${phaseName} — Verification`,
177
+ '',
178
+ '## Observable Truths',
179
+ '| # | Truth | Status | Evidence |',
180
+ '|---|-------|--------|----------|',
181
+ '| 1 | [Truth] | pending | |',
182
+ '',
183
+ '## Required Artifacts',
184
+ '| Artifact | Expected | Status | Details |',
185
+ '|----------|----------|--------|---------|',
186
+ '| [path] | [what] | pending | |',
187
+ '',
188
+ '## Key Link Verification',
189
+ '| From | To | Via | Status | Details |',
190
+ '|------|----|----|--------|---------|',
191
+ '| [source] | [target] | [connection] | pending | |',
192
+ '',
193
+ '## Requirements Coverage',
194
+ '| Requirement | Status | Blocking Issue |',
195
+ '|-------------|--------|----------------|',
196
+ '| [req] | pending | |',
197
+ '',
198
+ '## Result',
199
+ '[Pending verification]',
200
+ ].join('\n');
201
+ fileName = `${padded}-VERIFICATION.md`;
202
+ break;
203
+ }
204
+ default:
205
+ error(`Unknown template type: ${templateType}. Available: summary, plan, verification`);
206
+ return;
207
+ }
208
+
209
+ const fullContent = `---\n${reconstructFrontmatter(frontmatter)}\n---\n\n${body}\n`;
210
+ const outPath = path.join(cwd, phaseInfo.directory, fileName);
211
+
212
+ if (fs.existsSync(outPath)) {
213
+ output({ error: 'File already exists', path: toPosixPath(path.relative(cwd, outPath)) }, raw);
214
+ return;
215
+ }
216
+
217
+ fs.writeFileSync(outPath, fullContent, 'utf-8');
218
+ const relPath = toPosixPath(path.relative(cwd, outPath));
219
+ output({ created: true, path: relPath, template: templateType }, raw, relPath);
220
+ }
221
+
222
+ module.exports = { cmdTemplateSelect, cmdTemplateFill };