qaa-agent 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/.claude/commands/create-test.md +40 -0
- package/.claude/commands/qa-analyze.md +60 -0
- package/.claude/commands/qa-audit.md +37 -0
- package/.claude/commands/qa-blueprint.md +54 -0
- package/.claude/commands/qa-fix.md +36 -0
- package/.claude/commands/qa-from-ticket.md +88 -0
- package/.claude/commands/qa-gap.md +54 -0
- package/.claude/commands/qa-pom.md +36 -0
- package/.claude/commands/qa-pyramid.md +37 -0
- package/.claude/commands/qa-report.md +38 -0
- package/.claude/commands/qa-start.md +33 -0
- package/.claude/commands/qa-testid.md +54 -0
- package/.claude/commands/qa-validate.md +54 -0
- package/.claude/commands/update-test.md +58 -0
- package/.claude/settings.json +19 -0
- package/.claude/skills/qa-bug-detective/SKILL.md +122 -0
- package/.claude/skills/qa-repo-analyzer/SKILL.md +88 -0
- package/.claude/skills/qa-self-validator/SKILL.md +109 -0
- package/.claude/skills/qa-template-engine/SKILL.md +113 -0
- package/.claude/skills/qa-testid-injector/SKILL.md +93 -0
- package/.claude/skills/qa-workflow-documenter/SKILL.md +87 -0
- package/CLAUDE.md +543 -0
- package/README.md +418 -0
- package/agents/qa-pipeline-orchestrator.md +1217 -0
- package/agents/qaa-analyzer.md +508 -0
- package/agents/qaa-bug-detective.md +444 -0
- package/agents/qaa-executor.md +618 -0
- package/agents/qaa-planner.md +374 -0
- package/agents/qaa-scanner.md +422 -0
- package/agents/qaa-testid-injector.md +583 -0
- package/agents/qaa-validator.md +450 -0
- package/bin/install.cjs +176 -0
- package/bin/lib/commands.cjs +709 -0
- package/bin/lib/config.cjs +307 -0
- package/bin/lib/core.cjs +497 -0
- package/bin/lib/frontmatter.cjs +299 -0
- package/bin/lib/init.cjs +989 -0
- package/bin/lib/milestone.cjs +241 -0
- package/bin/lib/model-profiles.cjs +60 -0
- package/bin/lib/phase.cjs +911 -0
- package/bin/lib/roadmap.cjs +306 -0
- package/bin/lib/state.cjs +748 -0
- package/bin/lib/template.cjs +222 -0
- package/bin/lib/verify.cjs +842 -0
- package/bin/qaa-tools.cjs +607 -0
- package/package.json +34 -0
- package/templates/failure-classification.md +391 -0
- package/templates/gap-analysis.md +409 -0
- package/templates/pr-template.md +48 -0
- package/templates/qa-analysis.md +381 -0
- package/templates/qa-audit-report.md +465 -0
- package/templates/qa-repo-blueprint.md +636 -0
- package/templates/scan-manifest.md +312 -0
- package/templates/test-inventory.md +582 -0
- package/templates/testid-audit-report.md +354 -0
- package/templates/validation-report.md +243 -0
|
@@ -0,0 +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 };
|