qaa-agent 1.6.2 → 1.6.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.
Files changed (73) hide show
  1. package/.claude/commands/create-test.md +164 -164
  2. package/.claude/commands/qa-audit.md +37 -37
  3. package/.claude/commands/qa-blueprint.md +54 -54
  4. package/.claude/commands/qa-fix.md +36 -36
  5. package/.claude/commands/qa-from-ticket.md +24 -24
  6. package/.claude/commands/qa-gap.md +20 -20
  7. package/.claude/commands/qa-map.md +47 -47
  8. package/.claude/commands/qa-pom.md +36 -36
  9. package/.claude/commands/qa-pr.md +23 -23
  10. package/.claude/commands/qa-pyramid.md +37 -37
  11. package/.claude/commands/qa-report.md +38 -38
  12. package/.claude/commands/qa-research.md +33 -33
  13. package/.claude/commands/qa-start.md +22 -22
  14. package/.claude/commands/qa-testid.md +19 -19
  15. package/.claude/commands/qa-validate.md +42 -42
  16. package/.claude/commands/update-test.md +58 -58
  17. package/.claude/settings.json +20 -20
  18. package/.claude/skills/qa-bug-detective/SKILL.md +122 -122
  19. package/.claude/skills/qa-learner/SKILL.md +150 -150
  20. package/.claude/skills/qa-repo-analyzer/SKILL.md +88 -88
  21. package/.claude/skills/qa-self-validator/SKILL.md +109 -109
  22. package/.claude/skills/qa-template-engine/SKILL.md +113 -113
  23. package/.claude/skills/qa-testid-injector/SKILL.md +93 -93
  24. package/.claude/skills/qa-workflow-documenter/SKILL.md +87 -87
  25. package/.mcp.json +8 -8
  26. package/CHANGELOG.md +71 -71
  27. package/CLAUDE.md +553 -553
  28. package/agents/qa-pipeline-orchestrator.md +1378 -1378
  29. package/agents/qaa-analyzer.md +524 -524
  30. package/agents/qaa-bug-detective.md +446 -446
  31. package/agents/qaa-codebase-mapper.md +935 -935
  32. package/agents/qaa-e2e-runner.md +415 -415
  33. package/agents/qaa-executor.md +651 -651
  34. package/agents/qaa-planner.md +390 -390
  35. package/agents/qaa-project-researcher.md +319 -319
  36. package/agents/qaa-scanner.md +424 -424
  37. package/agents/qaa-testid-injector.md +585 -585
  38. package/agents/qaa-validator.md +452 -452
  39. package/bin/install.cjs +198 -198
  40. package/bin/lib/commands.cjs +709 -709
  41. package/bin/lib/config.cjs +307 -307
  42. package/bin/lib/core.cjs +497 -497
  43. package/bin/lib/frontmatter.cjs +299 -299
  44. package/bin/lib/init.cjs +989 -989
  45. package/bin/lib/milestone.cjs +241 -241
  46. package/bin/lib/model-profiles.cjs +60 -60
  47. package/bin/lib/phase.cjs +911 -911
  48. package/bin/lib/roadmap.cjs +306 -306
  49. package/bin/lib/state.cjs +748 -748
  50. package/bin/lib/template.cjs +222 -222
  51. package/bin/lib/verify.cjs +842 -842
  52. package/bin/qaa-tools.cjs +607 -607
  53. package/docs/COMMANDS.md +341 -341
  54. package/docs/DEMO.md +182 -182
  55. package/docs/TESTING.md +156 -156
  56. package/package.json +41 -41
  57. package/templates/failure-classification.md +391 -391
  58. package/templates/gap-analysis.md +409 -409
  59. package/templates/pr-template.md +48 -48
  60. package/templates/qa-analysis.md +381 -381
  61. package/templates/qa-audit-report.md +465 -465
  62. package/templates/qa-repo-blueprint.md +636 -636
  63. package/templates/scan-manifest.md +312 -312
  64. package/templates/test-inventory.md +582 -582
  65. package/templates/testid-audit-report.md +354 -354
  66. package/templates/validation-report.md +243 -243
  67. package/workflows/qa-analyze.md +296 -296
  68. package/workflows/qa-from-ticket.md +536 -536
  69. package/workflows/qa-gap.md +303 -303
  70. package/workflows/qa-pr.md +389 -389
  71. package/workflows/qa-start.md +1168 -1168
  72. package/workflows/qa-testid.md +356 -356
  73. package/workflows/qa-validate.md +295 -295
@@ -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 };