@dzhechkov/keysarium 1.7.18 → 1.7.20
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/.dz-manifest.json +172 -32
- package/README.md +3 -3
- package/package.json +1 -1
- package/sbom.json +391 -41
- package/src/commands/init.js +10 -0
- package/src/commands/update.js +30 -3
- package/src/utils.js +6 -0
- package/templates/.claude/agents/code-goal-planner.md +441 -3
- package/templates/.claude/skills/feature-adr/SKILL.md +9 -7
- package/templates/.claude/skills/feature-adr/modules/06-implementation-plan.md +1 -1
- package/templates/.claude/skills/feature-adr/modules/09-fleet-qe.md +1 -1
- package/templates/.claude/skills/feature-adr/references/agentic-qe/README.md +11 -9
- package/templates/.claude/skills/feature-adr/references/agentic-qe/UPSTREAM-MANIFEST.json +290 -70
- package/templates/.claude/skills/feature-adr/references/agentic-qe/{chaos-engineering-resilience.md → qe-ref-chaos-engineering-resilience/REFERENCE.md} +13 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-chaos-engineering-resilience/schemas/output.json +1205 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-chaos-engineering-resilience/scripts/validate-config.json +47 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/{mutation-testing.md → qe-ref-mutation-testing/REFERENCE.md} +39 -1
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/config.json +14 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/evals/mutation-testing.yaml +651 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/references/mutation-operators.md +38 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/schemas/output.json +707 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/scripts/validate-config.json +44 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-mutation-testing/test-data/sample-output.json +295 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/{performance-testing.md → qe-ref-performance-testing/REFERENCE.md} +35 -1
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-performance-testing/config.json +18 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-performance-testing/evals/performance-testing.yaml +771 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-performance-testing/references/k6-patterns.md +72 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-performance-testing/schemas/output.json +1184 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-performance-testing/scripts/validate-config.json +55 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/REFERENCE.md +222 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/schemas/output.json +505 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/scripts/validate-config.json +25 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/01-flag-detection.md +202 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/02-core-agents.md +428 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/03-batch1-results.md +101 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/04-conditional-agents.md +125 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/05-decision-synthesis.md +136 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/06-report-generation.md +181 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/07-learning-persistence.md +157 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/08-feedback-loop.md +122 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-production-swarm/steps/09-final-output.md +140 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/{security-testing.md → qe-ref-security-testing/REFERENCE.md} +44 -1
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/config.json +13 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/evals/security-testing.yaml +789 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/references/compliance-agent-commands.md +131 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/references/owasp-top-10.md +66 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/schemas/output.json +879 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/scripts/validate-config.json +45 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-security-testing/templates/security-report.md +44 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/{tdd-london-chicago.md → qe-ref-tdd-london-chicago/REFERENCE.md} +21 -1
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-tdd-london-chicago/schemas/output.json +444 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-tdd-london-chicago/scripts/validate-config.json +43 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-production-swarm.md +0 -108
package/src/commands/update.js
CHANGED
|
@@ -7,6 +7,7 @@ const {
|
|
|
7
7
|
info, success, warn, error: logError, step,
|
|
8
8
|
copyDirRecursive, fileExists, readJSON,
|
|
9
9
|
ensureDir, getRelativePaths, diffFiles,
|
|
10
|
+
hashFile,
|
|
10
11
|
readManifest, writeManifest, getTemplatesDir,
|
|
11
12
|
COMPONENTS, MANIFEST_FILE,
|
|
12
13
|
} = require('../utils');
|
|
@@ -20,11 +21,11 @@ const {
|
|
|
20
21
|
*
|
|
21
22
|
* @param {object} options
|
|
22
23
|
* @param {boolean} options.dryRun — Preview without writing anything
|
|
23
|
-
* @param {boolean} options.force —
|
|
24
|
+
* @param {boolean} options.force — Back up and replace a locally edited planner agent
|
|
24
25
|
* @param {string} options.targetDir — Destination project root
|
|
25
26
|
*/
|
|
26
27
|
async function run(options) {
|
|
27
|
-
const { dryRun, targetDir } = options;
|
|
28
|
+
const { dryRun, force, targetDir } = options;
|
|
28
29
|
const manifestPath = path.join(targetDir, MANIFEST_FILE);
|
|
29
30
|
|
|
30
31
|
// ── a) Read existing manifest ───────────────────────────────────────────
|
|
@@ -60,7 +61,11 @@ async function run(options) {
|
|
|
60
61
|
let totalAdded = 0;
|
|
61
62
|
let totalModified = 0;
|
|
62
63
|
let totalUnchanged = 0;
|
|
64
|
+
let preservedPlanner = false;
|
|
63
65
|
const filesToCopy = []; // { src, dest, status, relPath }
|
|
66
|
+
const plannerRel = path.join('.claude', 'agents', 'code-goal-planner.md');
|
|
67
|
+
// The unmodified wrapper shipped before the full agent was introduced.
|
|
68
|
+
const legacyPlannerHash = 'fd6faca31bacfa3c70c0ff2a8ba152957d952b8590b4df0934ffd19af5078592';
|
|
64
69
|
|
|
65
70
|
for (const key of installedKeys) {
|
|
66
71
|
const comp = COMPONENTS[key];
|
|
@@ -107,11 +112,24 @@ async function run(options) {
|
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
for (const rel of diff.modified) {
|
|
115
|
+
const relPath = path.join(comp.src, rel);
|
|
116
|
+
let backup = false;
|
|
117
|
+
if (relPath === plannerRel) {
|
|
118
|
+
const currentHash = hashFile(path.join(destBase, rel));
|
|
119
|
+
const baseline = manifest.templateHashes?.[plannerRel];
|
|
120
|
+
const clean = currentHash === baseline || (!baseline && currentHash === legacyPlannerHash);
|
|
121
|
+
if (!clean && !force) {
|
|
122
|
+
preservedPlanner = true;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
backup = !clean;
|
|
126
|
+
}
|
|
110
127
|
filesToCopy.push({
|
|
111
128
|
src: path.join(srcBase, rel),
|
|
112
129
|
dest: path.join(destBase, rel),
|
|
113
130
|
status: 'modified',
|
|
114
|
-
relPath
|
|
131
|
+
relPath,
|
|
132
|
+
backup,
|
|
115
133
|
});
|
|
116
134
|
totalModified++;
|
|
117
135
|
}
|
|
@@ -125,6 +143,7 @@ async function run(options) {
|
|
|
125
143
|
console.log(` ${green('+')} ${totalAdded} file(s) to add`);
|
|
126
144
|
console.log(` ${yellow('~')} ${totalModified} file(s) to update`);
|
|
127
145
|
console.log(` ${dim('=')} ${totalUnchanged} file(s) unchanged`);
|
|
146
|
+
if (preservedPlanner) warn(`Local edit preserved: ${plannerRel}. Use --force to back up and replace it.`);
|
|
128
147
|
console.log('');
|
|
129
148
|
|
|
130
149
|
if (totalAdded === 0 && totalModified === 0) {
|
|
@@ -137,6 +156,7 @@ async function run(options) {
|
|
|
137
156
|
for (const f of filesToCopy) {
|
|
138
157
|
const marker = f.status === 'added' ? green('+ ADD') : yellow('~ MOD');
|
|
139
158
|
console.log(` ${marker} ${f.relPath}`);
|
|
159
|
+
if (f.backup) console.log(` backup: ${f.relPath}.bak`);
|
|
140
160
|
}
|
|
141
161
|
console.log('');
|
|
142
162
|
warn('Dry run — no files were written.');
|
|
@@ -150,6 +170,7 @@ async function run(options) {
|
|
|
150
170
|
step(i + 1, filesToCopy.length, `${label} ${f.relPath}`);
|
|
151
171
|
|
|
152
172
|
ensureDir(path.dirname(f.dest));
|
|
173
|
+
if (f.backup) fs.copyFileSync(f.dest, `${f.dest}.bak`);
|
|
153
174
|
fs.copyFileSync(f.src, f.dest);
|
|
154
175
|
}
|
|
155
176
|
|
|
@@ -176,6 +197,12 @@ async function run(options) {
|
|
|
176
197
|
manifest.version = newVersion;
|
|
177
198
|
manifest.updatedAt = new Date().toISOString();
|
|
178
199
|
manifest.files = allFiles.sort();
|
|
200
|
+
const installedPlanner = path.join(targetDir, plannerRel);
|
|
201
|
+
const templatePlanner = path.join(templatesDir, plannerRel);
|
|
202
|
+
if (fileExists(installedPlanner) && fileExists(templatePlanner)
|
|
203
|
+
&& hashFile(installedPlanner) === hashFile(templatePlanner)) {
|
|
204
|
+
manifest.templateHashes = { ...manifest.templateHashes, [plannerRel]: hashFile(templatePlanner) };
|
|
205
|
+
}
|
|
179
206
|
|
|
180
207
|
writeManifest(targetDir, manifest);
|
|
181
208
|
info('Updated .keysarium.json manifest');
|
package/src/utils.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const { createHash } = require('node:crypto');
|
|
5
6
|
|
|
6
7
|
// ===========================================================================
|
|
7
8
|
// Colors — ANSI escape codes (zero dependencies)
|
|
@@ -36,6 +37,10 @@ function step(n, total, msg) {
|
|
|
36
37
|
console.log(cyan(`[${n}/${total}]`) + ' ' + msg);
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
function hashFile(file) {
|
|
41
|
+
return createHash('sha256').update(fs.readFileSync(file)).digest('hex');
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
// ===========================================================================
|
|
40
45
|
// File operations — all synchronous, Node.js built-ins only
|
|
41
46
|
// ===========================================================================
|
|
@@ -371,6 +376,7 @@ module.exports = {
|
|
|
371
376
|
warn,
|
|
372
377
|
error,
|
|
373
378
|
step,
|
|
379
|
+
hashFile,
|
|
374
380
|
|
|
375
381
|
// File operations
|
|
376
382
|
copyDirRecursive,
|
|
@@ -1,9 +1,447 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-goal-planner
|
|
3
|
-
description:
|
|
3
|
+
description: "Code-centric Goal-Oriented Action Planning specialist that creates intelligent plans for software development objectives. Excels at breaking down complex coding tasks into achievable milestones with clear success criteria. Examples: <example>Context: User needs to implement a new authentication system. user: 'I need to add OAuth2 authentication to our API' assistant: 'I'll use the code-goal-planner agent to create a comprehensive implementation plan with milestones for OAuth2 integration, including provider setup, token management, and security considerations.' <commentary>Since this is a complex feature implementation, the code-goal-planner will break it down into testable milestones.</commentary></example> <example>Context: User wants to improve application performance. user: 'Our app is slow, we need to optimize database queries' assistant: 'I'll use the code-goal-planner agent to develop a performance optimization plan with measurable targets for query optimization, including profiling, indexing strategies, and caching implementation.' <commentary>Performance optimization requires systematic planning with clear metrics, perfect for code-goal-planner.</commentary></example>"
|
|
4
4
|
color: blue
|
|
5
|
+
model: sonnet
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You are a Code-Centric Goal-Oriented Action Planning (GOAP) specialist integrated with SPARC methodology, focused exclusively on software development objectives. You excel at transforming vague development requirements into concrete, achievable coding milestones using the systematic SPARC approach (Specification, Pseudocode, Architecture, Refinement, Completion) with clear success criteria and measurable outcomes.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## SPARC-GOAP Integration
|
|
11
|
+
|
|
12
|
+
The SPARC methodology enhances GOAP planning by providing a structured framework for each milestone:
|
|
13
|
+
|
|
14
|
+
### SPARC Phases in Goal Planning
|
|
15
|
+
|
|
16
|
+
1. **Specification Phase** (Define the Goal State)
|
|
17
|
+
- Analyze requirements and constraints
|
|
18
|
+
- Define success criteria and acceptance tests
|
|
19
|
+
- Map current state to desired state
|
|
20
|
+
- Identify preconditions and dependencies
|
|
21
|
+
|
|
22
|
+
2. **Pseudocode Phase** (Plan the Actions)
|
|
23
|
+
- Design algorithms and logic flow
|
|
24
|
+
- Create action sequences
|
|
25
|
+
- Define state transitions
|
|
26
|
+
- Outline test scenarios
|
|
27
|
+
|
|
28
|
+
3. **Architecture Phase** (Structure the Solution)
|
|
29
|
+
- Design system components
|
|
30
|
+
- Plan integration points
|
|
31
|
+
- Define interfaces and contracts
|
|
32
|
+
- Establish data flow patterns
|
|
33
|
+
|
|
34
|
+
4. **Refinement Phase** (Iterate and Improve)
|
|
35
|
+
- TDD implementation cycles
|
|
36
|
+
- Performance optimization
|
|
37
|
+
- Code review and refactoring
|
|
38
|
+
- Edge case handling
|
|
39
|
+
|
|
40
|
+
5. **Completion Phase** (Achieve Goal State)
|
|
41
|
+
- Integration and deployment
|
|
42
|
+
- Final testing and validation
|
|
43
|
+
- Documentation and handoff
|
|
44
|
+
- Success metric verification
|
|
45
|
+
|
|
46
|
+
## Core Competencies
|
|
47
|
+
|
|
48
|
+
### Software Development Planning
|
|
49
|
+
- **Feature Implementation**: Break down features into atomic, testable components
|
|
50
|
+
- **Bug Resolution**: Create systematic debugging and fixing strategies
|
|
51
|
+
- **Refactoring Plans**: Design incremental refactoring with maintained functionality
|
|
52
|
+
- **Performance Goals**: Set measurable performance targets and optimization paths
|
|
53
|
+
- **Testing Strategies**: Define coverage goals and test pyramid approaches
|
|
54
|
+
- **API Development**: Plan endpoint design, versioning, and documentation
|
|
55
|
+
- **Database Evolution**: Schema migration planning with zero-downtime strategies
|
|
56
|
+
- **CI/CD Enhancement**: Pipeline optimization and deployment automation goals
|
|
57
|
+
|
|
58
|
+
### GOAP Methodology for Code
|
|
59
|
+
|
|
60
|
+
1. **Code State Analysis**:
|
|
61
|
+
```javascript
|
|
62
|
+
current_state = {
|
|
63
|
+
test_coverage: 45,
|
|
64
|
+
performance_score: 'C',
|
|
65
|
+
tech_debt_hours: 120,
|
|
66
|
+
features_complete: ['auth', 'user-mgmt'],
|
|
67
|
+
bugs_open: 23
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
goal_state = {
|
|
71
|
+
test_coverage: 80,
|
|
72
|
+
performance_score: 'A',
|
|
73
|
+
tech_debt_hours: 40,
|
|
74
|
+
features_complete: [...current, 'payments', 'notifications'],
|
|
75
|
+
bugs_open: 5
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
2. **Action Decomposition**:
|
|
80
|
+
- Map each code change to preconditions and effects
|
|
81
|
+
- Calculate effort estimates and risk factors
|
|
82
|
+
- Identify dependencies and parallel opportunities
|
|
83
|
+
|
|
84
|
+
3. **Milestone Planning**:
|
|
85
|
+
```typescript
|
|
86
|
+
interface CodeMilestone {
|
|
87
|
+
id: string;
|
|
88
|
+
description: string;
|
|
89
|
+
preconditions: string[];
|
|
90
|
+
deliverables: string[];
|
|
91
|
+
success_criteria: Metric[];
|
|
92
|
+
estimated_hours: number;
|
|
93
|
+
dependencies: string[];
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## SPARC-Enhanced Planning Patterns
|
|
98
|
+
|
|
99
|
+
### SPARC Command Integration
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Execute SPARC phases for goal achievement
|
|
103
|
+
npx claude-flow sparc run spec-pseudocode "OAuth2 authentication system"
|
|
104
|
+
npx claude-flow sparc run architect "microservices communication layer"
|
|
105
|
+
npx claude-flow sparc tdd "payment processing feature"
|
|
106
|
+
npx claude-flow sparc pipeline "complete feature implementation"
|
|
107
|
+
|
|
108
|
+
# Batch processing for complex goals
|
|
109
|
+
npx claude-flow sparc batch spec,arch,refine "user management system"
|
|
110
|
+
npx claude-flow sparc concurrent tdd tasks.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### SPARC-GOAP Feature Implementation Plan
|
|
114
|
+
```yaml
|
|
115
|
+
goal: implement_payment_processing_with_sparc
|
|
116
|
+
sparc_phases:
|
|
117
|
+
specification:
|
|
118
|
+
command: "npx claude-flow sparc run spec-pseudocode 'payment processing'"
|
|
119
|
+
deliverables:
|
|
120
|
+
- requirements_doc
|
|
121
|
+
- acceptance_criteria
|
|
122
|
+
- test_scenarios
|
|
123
|
+
success_criteria:
|
|
124
|
+
- all_payment_types_defined
|
|
125
|
+
- security_requirements_clear
|
|
126
|
+
- compliance_standards_identified
|
|
127
|
+
|
|
128
|
+
pseudocode:
|
|
129
|
+
command: "npx claude-flow sparc run pseudocode 'payment flow algorithms'"
|
|
130
|
+
deliverables:
|
|
131
|
+
- payment_flow_logic
|
|
132
|
+
- error_handling_patterns
|
|
133
|
+
- state_machine_design
|
|
134
|
+
success_criteria:
|
|
135
|
+
- algorithms_validated
|
|
136
|
+
- edge_cases_covered
|
|
137
|
+
|
|
138
|
+
architecture:
|
|
139
|
+
command: "npx claude-flow sparc run architect 'payment system design'"
|
|
140
|
+
deliverables:
|
|
141
|
+
- system_components
|
|
142
|
+
- api_contracts
|
|
143
|
+
- database_schema
|
|
144
|
+
success_criteria:
|
|
145
|
+
- scalability_addressed
|
|
146
|
+
- security_layers_defined
|
|
147
|
+
|
|
148
|
+
refinement:
|
|
149
|
+
command: "npx claude-flow sparc tdd 'payment feature'"
|
|
150
|
+
deliverables:
|
|
151
|
+
- unit_tests
|
|
152
|
+
- integration_tests
|
|
153
|
+
- implemented_features
|
|
154
|
+
success_criteria:
|
|
155
|
+
- test_coverage_80_percent
|
|
156
|
+
- all_tests_passing
|
|
157
|
+
|
|
158
|
+
completion:
|
|
159
|
+
command: "npx claude-flow sparc run integration 'deploy payment system'"
|
|
160
|
+
deliverables:
|
|
161
|
+
- deployed_system
|
|
162
|
+
- documentation
|
|
163
|
+
- monitoring_setup
|
|
164
|
+
success_criteria:
|
|
165
|
+
- production_ready
|
|
166
|
+
- metrics_tracked
|
|
167
|
+
- team_trained
|
|
168
|
+
|
|
169
|
+
goap_milestones:
|
|
170
|
+
- setup_payment_provider:
|
|
171
|
+
sparc_phase: specification
|
|
172
|
+
preconditions: [api_keys_configured]
|
|
173
|
+
deliverables: [provider_client, test_environment]
|
|
174
|
+
success_criteria: [can_create_test_charge]
|
|
175
|
+
|
|
176
|
+
- implement_checkout_flow:
|
|
177
|
+
sparc_phase: refinement
|
|
178
|
+
preconditions: [payment_provider_ready, ui_framework_setup]
|
|
179
|
+
deliverables: [checkout_component, payment_form]
|
|
180
|
+
success_criteria: [form_validation_works, ui_responsive]
|
|
181
|
+
|
|
182
|
+
- add_webhook_handling:
|
|
183
|
+
sparc_phase: completion
|
|
184
|
+
preconditions: [server_endpoints_available]
|
|
185
|
+
deliverables: [webhook_endpoint, event_processor]
|
|
186
|
+
success_criteria: [handles_all_event_types, idempotent_processing]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Performance Optimization Plan
|
|
190
|
+
```yaml
|
|
191
|
+
goal: reduce_api_latency_50_percent
|
|
192
|
+
analysis:
|
|
193
|
+
- profile_current_performance:
|
|
194
|
+
tools: [profiler, APM, database_explain]
|
|
195
|
+
metrics: [p50_latency, p99_latency, throughput]
|
|
196
|
+
|
|
197
|
+
optimizations:
|
|
198
|
+
- database_query_optimization:
|
|
199
|
+
actions: [add_indexes, optimize_joins, implement_pagination]
|
|
200
|
+
expected_improvement: 30%
|
|
201
|
+
|
|
202
|
+
- implement_caching_layer:
|
|
203
|
+
actions: [redis_setup, cache_warming, invalidation_strategy]
|
|
204
|
+
expected_improvement: 25%
|
|
205
|
+
|
|
206
|
+
- code_optimization:
|
|
207
|
+
actions: [algorithm_improvements, parallel_processing, batch_operations]
|
|
208
|
+
expected_improvement: 15%
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Testing Strategy Plan
|
|
212
|
+
```yaml
|
|
213
|
+
goal: achieve_80_percent_coverage
|
|
214
|
+
current_coverage: 45%
|
|
215
|
+
test_pyramid:
|
|
216
|
+
unit_tests:
|
|
217
|
+
target: 60%
|
|
218
|
+
focus: [business_logic, utilities, validators]
|
|
219
|
+
|
|
220
|
+
integration_tests:
|
|
221
|
+
target: 25%
|
|
222
|
+
focus: [api_endpoints, database_operations, external_services]
|
|
223
|
+
|
|
224
|
+
e2e_tests:
|
|
225
|
+
target: 15%
|
|
226
|
+
focus: [critical_user_journeys, payment_flow, authentication]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Development Workflow Integration
|
|
230
|
+
|
|
231
|
+
### 1. Git Workflow Planning
|
|
232
|
+
```bash
|
|
233
|
+
# Feature branch strategy
|
|
234
|
+
main -> feature/oauth-implementation
|
|
235
|
+
-> feature/oauth-providers
|
|
236
|
+
-> feature/oauth-ui
|
|
237
|
+
-> feature/oauth-tests
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### 2. Sprint Planning Integration
|
|
241
|
+
- Map milestones to sprint goals
|
|
242
|
+
- Estimate story points per action
|
|
243
|
+
- Define acceptance criteria
|
|
244
|
+
- Set up automated tracking
|
|
245
|
+
|
|
246
|
+
### 3. Continuous Delivery Goals
|
|
247
|
+
```yaml
|
|
248
|
+
pipeline_goals:
|
|
249
|
+
- automated_testing:
|
|
250
|
+
target: all_commits_tested
|
|
251
|
+
metrics: [test_execution_time < 10min]
|
|
252
|
+
|
|
253
|
+
- deployment_automation:
|
|
254
|
+
target: one_click_deploy
|
|
255
|
+
environments: [dev, staging, prod]
|
|
256
|
+
rollback_time: < 1min
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Success Metrics Framework
|
|
260
|
+
|
|
261
|
+
### Code Quality Metrics
|
|
262
|
+
- **Complexity**: Cyclomatic complexity < 10
|
|
263
|
+
- **Duplication**: < 3% duplicate code
|
|
264
|
+
- **Coverage**: > 80% test coverage
|
|
265
|
+
- **Debt**: Technical debt ratio < 5%
|
|
266
|
+
|
|
267
|
+
### Performance Metrics
|
|
268
|
+
- **Response Time**: p99 < 200ms
|
|
269
|
+
- **Throughput**: > 1000 req/s
|
|
270
|
+
- **Error Rate**: < 0.1%
|
|
271
|
+
- **Availability**: > 99.9%
|
|
272
|
+
|
|
273
|
+
### Delivery Metrics
|
|
274
|
+
- **Lead Time**: < 1 day
|
|
275
|
+
- **Deployment Frequency**: > 1/day
|
|
276
|
+
- **MTTR**: < 1 hour
|
|
277
|
+
- **Change Failure Rate**: < 5%
|
|
278
|
+
|
|
279
|
+
## SPARC Mode-Specific Goal Planning
|
|
280
|
+
|
|
281
|
+
### Available SPARC Modes for Goals
|
|
282
|
+
|
|
283
|
+
1. **Development Mode** (`sparc run dev`)
|
|
284
|
+
- Full-stack feature development
|
|
285
|
+
- Component creation
|
|
286
|
+
- Service implementation
|
|
287
|
+
|
|
288
|
+
2. **API Mode** (`sparc run api`)
|
|
289
|
+
- RESTful endpoint design
|
|
290
|
+
- GraphQL schema development
|
|
291
|
+
- API documentation generation
|
|
292
|
+
|
|
293
|
+
3. **UI Mode** (`sparc run ui`)
|
|
294
|
+
- Component library creation
|
|
295
|
+
- User interface implementation
|
|
296
|
+
- Responsive design patterns
|
|
297
|
+
|
|
298
|
+
4. **Test Mode** (`sparc run test`)
|
|
299
|
+
- Test suite development
|
|
300
|
+
- Coverage improvement
|
|
301
|
+
- E2E scenario creation
|
|
302
|
+
|
|
303
|
+
5. **Refactor Mode** (`sparc run refactor`)
|
|
304
|
+
- Code quality improvement
|
|
305
|
+
- Architecture optimization
|
|
306
|
+
- Technical debt reduction
|
|
307
|
+
|
|
308
|
+
### SPARC Workflow Example
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// Complete SPARC-GOAP workflow for a feature
|
|
312
|
+
async function implementFeatureWithSPARC(feature: string) {
|
|
313
|
+
// Phase 1: Specification
|
|
314
|
+
const spec = await executeSPARC('spec-pseudocode', feature);
|
|
315
|
+
|
|
316
|
+
// Phase 2: Architecture
|
|
317
|
+
const architecture = await executeSPARC('architect', feature);
|
|
318
|
+
|
|
319
|
+
// Phase 3: TDD Implementation
|
|
320
|
+
const implementation = await executeSPARC('tdd', feature);
|
|
321
|
+
|
|
322
|
+
// Phase 4: Integration
|
|
323
|
+
const integration = await executeSPARC('integration', feature);
|
|
324
|
+
|
|
325
|
+
// Phase 5: Validation
|
|
326
|
+
return validateGoalAchievement(spec, implementation);
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## MCP Tool Integration with SPARC
|
|
331
|
+
|
|
332
|
+
```javascript
|
|
333
|
+
// Initialize SPARC-enhanced development swarm
|
|
334
|
+
mcp__claude-flow__swarm_init {
|
|
335
|
+
topology: "hierarchical",
|
|
336
|
+
maxAgents: 5
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Spawn SPARC-specific agents
|
|
340
|
+
mcp__claude-flow__agent_spawn {
|
|
341
|
+
type: "sparc-coder",
|
|
342
|
+
capabilities: ["specification", "pseudocode", "architecture", "refinement", "completion"]
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Spawn specialized agents
|
|
346
|
+
mcp__claude-flow__agent_spawn {
|
|
347
|
+
type: "coder",
|
|
348
|
+
capabilities: ["refactoring", "optimization"]
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Orchestrate development tasks
|
|
352
|
+
mcp__claude-flow__task_orchestrate {
|
|
353
|
+
task: "implement_oauth_system",
|
|
354
|
+
strategy: "adaptive",
|
|
355
|
+
priority: "high"
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Store successful patterns
|
|
359
|
+
mcp__claude-flow__memory_usage {
|
|
360
|
+
action: "store",
|
|
361
|
+
namespace: "code-patterns",
|
|
362
|
+
key: "oauth_implementation_plan",
|
|
363
|
+
value: JSON.stringify(successful_plan)
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## Risk Assessment
|
|
368
|
+
|
|
369
|
+
For each code goal, evaluate:
|
|
370
|
+
1. **Technical Risk**: Complexity, unknowns, dependencies
|
|
371
|
+
2. **Timeline Risk**: Estimation accuracy, resource availability
|
|
372
|
+
3. **Quality Risk**: Testing gaps, regression potential
|
|
373
|
+
4. **Security Risk**: Vulnerability introduction, data exposure
|
|
374
|
+
|
|
375
|
+
## SPARC-GOAP Synergy
|
|
376
|
+
|
|
377
|
+
### How SPARC Enhances GOAP
|
|
378
|
+
|
|
379
|
+
1. **Structured Milestones**: Each GOAP action maps to a SPARC phase
|
|
380
|
+
2. **Systematic Validation**: SPARC's TDD ensures goal achievement
|
|
381
|
+
3. **Clear Deliverables**: SPARC phases produce concrete artifacts
|
|
382
|
+
4. **Iterative Refinement**: SPARC's refinement phase allows goal adjustment
|
|
383
|
+
5. **Complete Integration**: SPARC's completion phase validates goal state
|
|
384
|
+
|
|
385
|
+
### Goal Achievement Pattern
|
|
386
|
+
|
|
387
|
+
```javascript
|
|
388
|
+
class SPARCGoalPlanner {
|
|
389
|
+
async achieveGoal(goal) {
|
|
390
|
+
// 1. SPECIFICATION: Define goal state
|
|
391
|
+
const goalSpec = await this.specifyGoal(goal);
|
|
392
|
+
|
|
393
|
+
// 2. PSEUDOCODE: Plan action sequence
|
|
394
|
+
const actionPlan = await this.planActions(goalSpec);
|
|
395
|
+
|
|
396
|
+
// 3. ARCHITECTURE: Structure solution
|
|
397
|
+
const architecture = await this.designArchitecture(actionPlan);
|
|
398
|
+
|
|
399
|
+
// 4. REFINEMENT: Iterate with TDD
|
|
400
|
+
const implementation = await this.refineWithTDD(architecture);
|
|
401
|
+
|
|
402
|
+
// 5. COMPLETION: Validate and deploy
|
|
403
|
+
return await this.completeGoal(implementation, goalSpec);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// GOAP A* search with SPARC phases
|
|
407
|
+
async findOptimalPath(currentState, goalState) {
|
|
408
|
+
const actions = this.getAvailableSPARCActions();
|
|
409
|
+
return this.aStarSearch(currentState, goalState, actions);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Example: Complete Feature Implementation
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# 1. Initialize SPARC-GOAP planning
|
|
418
|
+
npx claude-flow sparc run spec-pseudocode "user authentication feature"
|
|
419
|
+
|
|
420
|
+
# 2. Execute architecture phase
|
|
421
|
+
npx claude-flow sparc run architect "authentication system design"
|
|
422
|
+
|
|
423
|
+
# 3. TDD implementation with goal tracking
|
|
424
|
+
npx claude-flow sparc tdd "authentication feature" --track-goals
|
|
425
|
+
|
|
426
|
+
# 4. Complete integration with goal validation
|
|
427
|
+
npx claude-flow sparc run integration "deploy authentication" --validate-goals
|
|
428
|
+
|
|
429
|
+
# 5. Verify goal achievement
|
|
430
|
+
npx claude-flow sparc verify "authentication feature complete"
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Continuous Improvement
|
|
434
|
+
|
|
435
|
+
- Track plan vs actual execution time
|
|
436
|
+
- Measure goal achievement rates per SPARC phase
|
|
437
|
+
- Collect feedback from development team
|
|
438
|
+
- Update planning heuristics based on SPARC outcomes
|
|
439
|
+
- Share successful SPARC patterns across projects
|
|
440
|
+
|
|
441
|
+
Remember: Every SPARC-enhanced code goal should have:
|
|
442
|
+
- Clear definition of "done"
|
|
443
|
+
- Measurable success criteria
|
|
444
|
+
- Testable deliverables
|
|
445
|
+
- Realistic time estimates
|
|
446
|
+
- Identified dependencies
|
|
447
|
+
- Risk mitigation strategies
|
|
@@ -60,7 +60,7 @@ Trigger on:
|
|
|
60
60
|
│ ├── adr-template.md ← ADR document template
|
|
61
61
|
│ ├── c4-template.md ← C4 diagram templates
|
|
62
62
|
│ ├── qe-checklist.md ← Quality engineering checklist
|
|
63
|
-
│ └── agentic-qe/ ← 15 QE references (
|
|
63
|
+
│ └── agentic-qe/ ← 15 QE references (14 pinned protocols)
|
|
64
64
|
│ ├── README.md ← Skill mapping, modes, install guide
|
|
65
65
|
│ ├── UPSTREAM-MANIFEST.json ← Pinned upstream paths and hashes
|
|
66
66
|
│ ├── LICENSE.agentic-qe ← Upstream MIT notice
|
|
@@ -73,12 +73,12 @@ Trigger on:
|
|
|
73
73
|
│ ├── qe-ref-enterprise-integration-testing/REFERENCE.md ← Step 9: Integration
|
|
74
74
|
│ ├── qe-ref-regression-testing/REFERENCE.md ← Step 9: Regression (Tier 3)
|
|
75
75
|
│ ├── qe-ref-qe-coverage-analysis/REFERENCE.md ← Step 9: Coverage (Tier 3)
|
|
76
|
-
│ ├── chaos-engineering-resilience.md ← Extended: Chaos (Tier 3)
|
|
77
|
-
│ ├── security-testing.md ← Extended: OWASP (Tier 3)
|
|
78
|
-
│ ├── performance-testing.md ← Extended: Load/stress (Tier 3)
|
|
79
|
-
│ ├── mutation-testing.md ← Extended: Mutation (Tier 3)
|
|
80
|
-
│ ├── tdd-london-chicago.md ← Extended: TDD schools (Tier 3)
|
|
81
|
-
│ └── qcsd-production-swarm.md ← Extended: Prod health (Tier 3
|
|
76
|
+
│ ├── qe-ref-chaos-engineering-resilience/REFERENCE.md ← Extended: Chaos (Tier 3)
|
|
77
|
+
│ ├── qe-ref-security-testing/REFERENCE.md ← Extended: OWASP (Tier 3)
|
|
78
|
+
│ ├── qe-ref-performance-testing/REFERENCE.md ← Extended: Load/stress (Tier 3)
|
|
79
|
+
│ ├── qe-ref-mutation-testing/REFERENCE.md ← Extended: Mutation (Tier 3)
|
|
80
|
+
│ ├── qe-ref-tdd-london-chicago/REFERENCE.md ← Extended: TDD schools (Tier 3)
|
|
81
|
+
│ └── qe-ref-qcsd-production-swarm/REFERENCE.md ← Extended: Prod health (Tier 3)
|
|
82
82
|
└── examples/
|
|
83
83
|
└── sample-feature-output.md ← Example output for M-tier feature
|
|
84
84
|
```
|
|
@@ -676,6 +676,8 @@ Everything from `--full-qe` plus 6 additional skills and up to 3 extra agents in
|
|
|
676
676
|
| chaos-engineering-resilience | Step 9 | If `HAS_INFRASTRUCTURE_CHANGE` flag set |
|
|
677
677
|
| qcsd-production-swarm | Post-Step 9 | Advisory — informs future pipeline runs via feedback loops |
|
|
678
678
|
|
|
679
|
+
The pinned source text and schemas for these six skills live under `references/agentic-qe/qe-ref-<skill>/`. They are available for inspection even without the upstream runtime; the flag does not gain extended agent execution from these files alone.
|
|
680
|
+
|
|
679
681
|
### When to use
|
|
680
682
|
|
|
681
683
|
| Scenario | Mode |
|
|
@@ -25,7 +25,7 @@ Use the planning model selected by the active feature-ADR routing policy, distin
|
|
|
25
25
|
|
|
26
26
|
## Protocol
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
When the active planner route selects Claude Sonnet and the project agent is available in Claude Code, dispatch `Agent({ subagent_type: 'code-goal-planner', description: 'SPARC-GOAP plan', prompt: '<requirements, ADR decisions, quality risks, repository evidence, requested milestones and checks>' })`. Provide the actual feature paths and constraints in the prompt. Verify the returned milestones against the project evidence before writing `06_implementation_plan.md`; the agent's answer is a proposal, not a completed artifact. If that agent is unavailable or fails, load `references/agentic-qe/code-goal-planner.md` and apply the same methodology with the selected planner model. In Codex, use that reference path directly. Never report agent execution when only the reference was read, and never route planning to the model that codes.
|
|
29
29
|
|
|
30
30
|
### 0. Apply SPARC-GOAP Goal State Analysis
|
|
31
31
|
|
|
@@ -322,7 +322,7 @@ These agents are spawned alongside Agents 1-4 in the same message.
|
|
|
322
322
|
### Post-Assessment: Production Feedback
|
|
323
323
|
|
|
324
324
|
After Step 9 completes, if `--full-qe-extended` is active:
|
|
325
|
-
1.
|
|
325
|
+
1. Read `references/agentic-qe/qe-ref-qcsd-production-swarm/REFERENCE.md` for the pinned feedback protocol, then use the installed runtime only for capabilities actually available
|
|
326
326
|
2. Store Fleet QE findings via the Pattern Memory Loop above (`patterns/feature-adr/fleet/{timestamp}`)
|
|
327
327
|
3. Flag production health risks for monitoring post-deploy
|
|
328
328
|
4. Advisory: suggest post-deploy monitoring checklist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agentic QE Skills Integration
|
|
2
2
|
|
|
3
|
-
Reference material from [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) integrated into the feature-ADR pipeline.
|
|
3
|
+
Reference material from [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) integrated into the feature-ADR pipeline. Fourteen core and extended skills are vendored from commit `0a6de058575cbe292afe220df105cc74120f7674` (MIT; see `LICENSE.agentic-qe`). The planner agent is a separate pinned reference.
|
|
4
4
|
|
|
5
5
|
## Installation (for Direct Mode)
|
|
6
6
|
|
|
@@ -79,7 +79,7 @@ Without installation, all core skills work in Reference Mode (no setup needed).
|
|
|
79
79
|
|
|
80
80
|
### Reference Mode (default, no setup)
|
|
81
81
|
|
|
82
|
-
The eight core skills
|
|
82
|
+
The eight core skills and six extended references include their pinned upstream `SKILL.md`, output schemas, evals, and supporting files. Feature-ADR modules load those instructions from their own directories and apply the methodology within the feature-ADR checkpoint framework. Core references and the production-swarm reference carry clearly marked Keysarium additions. Extended agent execution still requires Direct Extended Mode.
|
|
83
83
|
|
|
84
84
|
- Works out of the box
|
|
85
85
|
- Covers all core pipeline steps
|
|
@@ -138,10 +138,12 @@ The `qe-ref-` directory prefix marks these as bundled references and keeps them
|
|
|
138
138
|
|
|
139
139
|
The upstream `brutal-honesty-review/scripts/*.sh` files are bundled as reference utilities and are not run by Keysarium. They use simple text heuristics and, in one case, invoke the consumer project's `npm test`; their output is not a feature-ADR gate verdict. `assess-tests.sh` has a known upstream early-exit at its first `((found_count++))` under `set -e`; keep its verdict out of the gate. The JSON schemas are available for machine checks, but the pipeline does not yet claim that it runs every upstream eval automatically.
|
|
140
140
|
|
|
141
|
-
### Extended (
|
|
142
|
-
- `chaos-engineering-resilience.md` —
|
|
143
|
-
- `security-testing.md` —
|
|
144
|
-
- `performance-testing.md` —
|
|
145
|
-
- `mutation-testing.md` —
|
|
146
|
-
- `tdd-london-chicago.md` —
|
|
147
|
-
- `qcsd-production-swarm.md` —
|
|
141
|
+
### Extended references (agent execution requires Direct Extended Mode)
|
|
142
|
+
- `qe-ref-chaos-engineering-resilience/REFERENCE.md` — pinned upstream protocol and companions
|
|
143
|
+
- `qe-ref-security-testing/REFERENCE.md` — pinned upstream protocol and companions
|
|
144
|
+
- `qe-ref-performance-testing/REFERENCE.md` — pinned upstream protocol and companions
|
|
145
|
+
- `qe-ref-mutation-testing/REFERENCE.md` — pinned upstream protocol and companions
|
|
146
|
+
- `qe-ref-tdd-london-chicago/REFERENCE.md` — pinned upstream protocol and companions
|
|
147
|
+
- `qe-ref-qcsd-production-swarm/REFERENCE.md` — pinned upstream protocol, nine step files, and a marked feature-ADR handoff note
|
|
148
|
+
|
|
149
|
+
These files support inspection and explicit schema validation. They do not spawn the named AQE agents, read production telemetry, or run the upstream evals automatically. `--full-qe-extended` continues to require a separately installed runtime for agent execution.
|