@dzhechkov/keysarium 1.7.15 → 1.7.19

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 (83) hide show
  1. package/.dz-manifest.json +214 -54
  2. package/README.md +29 -6
  3. package/README.ru.md +17 -0
  4. package/package.json +3 -3
  5. package/sbom.json +455 -55
  6. package/src/cli.js +32 -2
  7. package/src/commands/doctor.js +25 -1
  8. package/src/commands/init.js +56 -12
  9. package/src/commands/update.js +30 -3
  10. package/src/utils.js +7 -0
  11. package/templates/.agents/skills/casarium/SKILL.md +29 -0
  12. package/templates/.claude/agents/code-goal-planner.md +447 -0
  13. package/templates/.claude/commands/casarium.md +3 -1
  14. package/templates/.claude/commands/cjm-prototype.md +2 -2
  15. package/templates/.claude/commands/research.md +4 -1
  16. package/templates/.claude/rules/checkpoint-protocol.md +2 -1
  17. package/templates/.claude/rules/research-quality.md +11 -6
  18. package/templates/.claude/shards/phase-2-research.shard.md +12 -8
  19. package/templates/.claude/shards/phase-25-cjm.shard.md +5 -3
  20. package/templates/.claude/skills/feature-adr/SKILL.md +17 -15
  21. package/templates/.claude/skills/feature-adr/modules/03-adr.md +1 -1
  22. package/templates/.claude/skills/feature-adr/modules/03.5-ideation-swarm.md +1 -1
  23. package/templates/.claude/skills/feature-adr/modules/06-implementation-plan.md +2 -2
  24. package/templates/.claude/skills/feature-adr/modules/08-qe.md +1 -1
  25. package/templates/.claude/skills/feature-adr/modules/09-fleet-qe.md +12 -12
  26. package/templates/.claude/skills/feature-adr/references/agentic-qe/LICENSE.agentic-qe +21 -0
  27. package/templates/.claude/skills/feature-adr/references/agentic-qe/README.md +20 -16
  28. package/templates/.claude/skills/feature-adr/references/agentic-qe/UPSTREAM-MANIFEST.json +246 -0
  29. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/README.md +218 -0
  30. package/templates/.claude/skills/feature-adr/references/agentic-qe/{brutal-honesty-review.md → qe-ref-brutal-honesty-review/REFERENCE.md} +14 -1
  31. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/resources/assessment-rubrics.md +295 -0
  32. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/resources/review-template.md +102 -0
  33. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/schemas/output.json +291 -0
  34. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/assess-code.sh +179 -0
  35. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/assess-tests.sh +223 -0
  36. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/validate-config.json +34 -0
  37. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/REFERENCE.md +758 -0
  38. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -0
  39. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/schemas/output.json +74 -0
  40. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/scripts/validate-config.json +25 -0
  41. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/REFERENCE.md +226 -0
  42. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -0
  43. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/schemas/output.json +568 -0
  44. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/scripts/validate-config.json +25 -0
  45. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
  46. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
  47. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
  48. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
  49. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
  50. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
  51. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
  52. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/08-final-output.md +18 -0
  53. package/templates/.claude/skills/feature-adr/references/agentic-qe/{qe-coverage-analysis.md → qe-ref-qe-coverage-analysis/REFERENCE.md} +42 -3
  54. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -0
  55. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/schemas/output.json +286 -0
  56. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/scripts/validate-config.json +42 -0
  57. package/templates/.claude/skills/feature-adr/references/agentic-qe/{qe-requirements-validation.md → qe-ref-qe-requirements-validation/REFERENCE.md} +13 -3
  58. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -0
  59. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/schemas/output.json +587 -0
  60. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/scripts/validate-config.json +37 -0
  61. package/templates/.claude/skills/feature-adr/references/agentic-qe/{regression-testing.md → qe-ref-regression-testing/REFERENCE.md} +30 -49
  62. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/evals/regression-testing.yaml +504 -0
  63. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/schemas/output.json +311 -0
  64. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/scripts/validate-config.json +50 -0
  65. package/templates/.claude/skills/feature-adr/references/agentic-qe/{risk-based-testing.md → qe-ref-risk-based-testing/REFERENCE.md} +23 -52
  66. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/evals/risk-based-testing.yaml +141 -0
  67. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/schemas/output.json +480 -0
  68. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/scripts/validate-config.json +25 -0
  69. package/templates/.claude/skills/feature-adr/references/agentic-qe/{shift-left-testing.md → qe-ref-shift-left-testing/REFERENCE.md} +33 -88
  70. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/evals/shift-left-testing.yaml +145 -0
  71. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/schemas/output.json +459 -0
  72. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/scripts/validate-config.json +25 -0
  73. package/templates/CLAUDE.md +3 -1
  74. package/templates/docs/feature-adr/04-admin-guide.md +1 -1
  75. package/templates/docs/improvement-directions.md +3 -3
  76. package/templates/docs/keysarium/02-admin-guide.md +2 -2
  77. package/templates/docs/keysarium/03-user-guide.md +3 -3
  78. package/templates/docs/keysarium/05-architecture.md +9 -8
  79. package/templates/docs/keysarium/06-user-flows.md +4 -4
  80. package/templates/lib/platform-templates/copilot.md +1 -1
  81. package/templates/lib/platform-templates/opencode.md +1 -1
  82. package/templates/.claude/skills/feature-adr/references/agentic-qe/enterprise-integration-testing.md +0 -111
  83. package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-ideation-swarm.md +0 -126
@@ -0,0 +1,447 @@
1
+ ---
2
+ name: code-goal-planner
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
+ color: blue
5
+ model: sonnet
6
+ ---
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.
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
@@ -195,7 +195,9 @@ researches/CASE_NAME/
195
195
  - Файлы создаются в момент фазы, не в Phase 6
196
196
  - ⭐ Phase 2.5 (CJM Prototype) — НИКОГДА НЕ ПРОПУСКАТЬ
197
197
  - ⭐ 08_executive_summary.md — ОБЯЗАТЕЛЕН
198
- - Research в paranoid mode — ноль непроверенных утверждений
198
+ - Research: `moderate` для обычных источников; `strict`/`paranoid` только после проверки
199
+ `issuer_keys_available` и `source_class_verified` по `.claude/rules/research-quality.md`.
200
+ Недостижимая цель исследования останавливает checkpoint и следующие фазы.
199
201
  - {CHOSEN_CJM} передаётся в Phase 3-5
200
202
  - Если банк: on-premise, ФЗ-152, ЦБ, GigaChat/YandexGPT
201
203
  - Если мало времени: Quick Mode
@@ -23,7 +23,7 @@ $ARGUMENTS
23
23
  4. **Step 2:** Определить 3 варианта CJM (A/B/C)
24
24
  5. **Step 2.5:** VARIANT D — Future-Ready CJM (Trend-Based)
25
25
  - Загрузи `.claude/skills/goap-research-ed25519/SKILL.md` для trend research
26
- - Исследуй 5 категорий трендов (PARANOID mode)
26
+ - Исследуй 5 категорий трендов в режиме, разрешённом `.claude/rules/research-quality.md`
27
27
  - Создай Trend Brief
28
28
  - Синтезируй Variant D
29
29
  6. **Step 3:** Сгенерируй React-прототип (.jsx) с 4 вариантами
@@ -38,5 +38,5 @@ $ARGUMENTS
38
38
  Запусти 3 агента параллельно:
39
39
  - Agent 1: CJM Variant A — один подход к точке входа
40
40
  - Agent 2: CJM Variant B + C — альтернативные подходы
41
- - Agent 3: Trend Research для Variant D (GOAP PARANOID)
41
+ - Agent 3: Trend Research для Variant D (GOAP `moderate` для обычных источников)
42
42
  Затем синтезируй в единый прототип с 4 вариантами.
@@ -12,7 +12,10 @@ $ARGUMENTS
12
12
 
13
13
  1. **Загрузи скилл:** Прочитай `.claude/skills/goap-research-ed25519/SKILL.md`
14
14
  2. **Прочитай Phase 0-1** для контекста
15
- 3. **Режим: PARANOID** — ноль непроверенных утверждений
15
+ 3. **Выбери режим по `.claude/rules/research-quality.md`:** `moderate` для обычных
16
+ источников; `strict`/`paranoid` только при подтверждённых ключах издателей и
17
+ подписанной выдаче. Если GOAP вернул `GOAL_UNREACHABLE`, покажи причину и не
18
+ отмечай фазу завершённой.
16
19
 
17
20
  4. **Исследуй по направлениям:**
18
21
  - Аналоги — кто решал похожую задачу
@@ -29,7 +29,7 @@ Promises are machine-readable markers that formalize phase gates.
29
29
  |-------|------------|---------|
30
30
  | Phase 0 | `<promise>DISCOVERY_COMPLETE</promise>` | JTBD + competitors + ROI analyzed |
31
31
  | Phase 1 | `<promise>CASE_EXPLORED</promise>` | Case fully understood, brief created |
32
- | Phase 2 | `<promise>RESEARCH_PARANOID_PASSED</promise>` | All claims verified, zero unverified |
32
+ | Phase 2 | `<promise>RESEARCH_PARANOID_PASSED</promise>` | Legacy tag: evidence gate passed in the selected GOAP mode; no issuer-signature claim unless independently confirmed |
33
33
  | Phase 2.5 | `<promise>CJM_VALIDATED</promise>` | CJM prototype created and variant chosen |
34
34
  | Phase 3 | `<promise>SOLUTION_DESIGNED</promise>` | Solution strategy formulated |
35
35
  | Phase 4 | `<promise>ARCHITECTURE_DEFINED</promise>` | C4 diagrams + sequence flows ready |
@@ -57,6 +57,7 @@ Files created: [list] ✅
57
57
  ### Promise Validation Rules
58
58
 
59
59
  - A promise tag MUST only be emitted AFTER its conditions are verifiably met
60
+ - GOAP `GOAL_UNREACHABLE` cannot satisfy the Phase 2 promise; report the missing capability and stop
60
61
  - If conditions are NOT met, emit `<promise>[TAG]_INCOMPLETE</promise>` instead
61
62
  - Downstream phases SHOULD check for upstream promises before starting
62
63
  - Promise tags serve as formal phase gates — they replace informal "phase done" signals
@@ -1,10 +1,15 @@
1
1
  # Research Quality Rules
2
2
 
3
- ## PARANOID Mode (Default for all research)
4
- - Every factual claim MUST have a verifiable source
5
- - Zero tolerance for hallucinated citations
6
- - Confidence threshold: 0.99 minimum
7
- - If source cannot be verified → mark as [UNVERIFIED] and flag
3
+ ## Research mode selection
4
+ - Use GOAP `moderate` for ordinary web and publication sources. Cite material factual claims,
5
+ identify uncertainty and do not turn an unverified claim into a decisive conclusion.
6
+ - Select GOAP `strict` or `paranoid` only after confirming both `issuer_keys_available` (real
7
+ pinned Ed25519 issuer keys) and `source_class_verified` (signed delivery for that source
8
+ class). A URL or citation alone establishes neither capability.
9
+ - If the requested mode returns `GOAL_UNREACHABLE`, record the missing capabilities and stop
10
+ the research checkpoint. Do not emit a success promise or advance to the next phase.
11
+ - Zero tolerance for invented citations applies in every mode. Source attribution and issuer
12
+ signature verification are different claims.
8
13
 
9
14
  ## Citation Requirements
10
15
  - Format: `[Claim] — Source: [URL or publication], [Date]`
@@ -14,7 +19,7 @@
14
19
  ## Verification Checklist
15
20
  Before completing any research phase:
16
21
  - [ ] All claims have sources
17
- - [ ] No unverified statistics or percentages
22
+ - [ ] No unverified statistics or percentages presented as established facts
18
23
  - [ ] Competitor names verified to exist
19
24
  - [ ] Technology recommendations are for real, available products
20
25
  - [ ] Regulatory references cite actual laws/standards
@@ -13,12 +13,14 @@ Load: `.claude/skills/goap-research-ed25519/SKILL.md`
13
13
  ## Mandatory Outputs
14
14
  - `02_research_findings.md`
15
15
 
16
- ## PARANOID Mode — ACTIVE
17
- - Every factual claim MUST have a verifiable source
18
- - Zero tolerance for hallucinated citations
19
- - Confidence threshold: 0.99 minimum
20
- - Unverifiable claims: mark as [UNVERIFIED] and flag
21
- - Citation format: `[Claim] — Source: [URL or publication], [Date]`
16
+ ## Research mode and evidence
17
+ - Follow `.claude/rules/research-quality.md`: default GOAP `moderate` for ordinary sources.
18
+ - Use `strict`/`paranoid` only if both issuer-key and signed-delivery capabilities are
19
+ confirmed for the selected source class. Do not infer signature verification from a URL.
20
+ - Cite material factual claims; label unsupported claims `[UNVERIFIED]` and keep them out of
21
+ decisive conclusions. Invented citations are never acceptable.
22
+ - Citation format: `[Claim] — Source: [URL or publication], [Date]`.
23
+ - A `GOAL_UNREACHABLE` result blocks the checkpoint and transition to Phase 2.5.
22
24
 
23
25
  ## Agent Swarm (3 parallel, model: sonnet)
24
26
  - Agent 1: Analogues + Benchmarks
@@ -28,13 +30,15 @@ Load: `.claude/skills/goap-research-ed25519/SKILL.md`
28
30
 
29
31
  ## Quality Gates
30
32
  - ALL claims have sources
31
- - No unverified statistics or percentages
33
+ - No unverified statistics or percentages presented as established facts
32
34
  - Competitor names verified to exist
33
35
  - Technology recommendations are for real, available products
34
36
  - Regulatory references cite actual laws/standards
35
37
 
36
38
  ## Promise
37
- On completion: `<promise>RESEARCH_PARANOID_PASSED</promise>`
39
+ On successful evidence review in the selected mode: `<promise>RESEARCH_PARANOID_PASSED</promise>`.
40
+ The tag name is retained for downstream compatibility; it does not assert GOAP paranoid mode or
41
+ cryptographic issuer verification. On failure, emit the incomplete marker and do not advance.
38
42
 
39
43
  ## Anti-Patterns to Check
40
44
  - Bare claims without attribution → BLOCK
@@ -21,14 +21,15 @@
21
21
  ## Process
22
22
  1. Extract: primary_user, segments, aha_moment, solution_concept from Phases 0-2
23
23
  2. Define 3 CJM variants (A/B/C) with different approaches
24
- 3. Research 5 trend categories for Variant D (PARANOID mode)
24
+ 3. Research 5 trend categories for Variant D in the GOAP mode allowed by
25
+ `.claude/rules/research-quality.md`; ordinary sources use `moderate`
25
26
  4. Generate React .jsx prototype with all 4 variants
26
27
  5. User selects winning variant → sets `{CHOSEN_CJM}`
27
28
 
28
29
  ## Agent Swarm (3 parallel)
29
30
  - Agent 1 (opus): CJM Variant A design
30
31
  - Agent 2 (opus): CJM Variants B + C design
31
- - Agent 3 (sonnet): Trend Research for Variant D (PARANOID mode, 5 categories)
32
+ - Agent 3 (sonnet): Trend Research for Variant D (selected GOAP mode, 5 categories)
32
33
 
33
34
  ## Critical Variable
34
35
  `{CHOSEN_CJM}` — MUST be set by user selection. Passed to Phases 3-5.
@@ -36,7 +37,8 @@
36
37
  ## Quality Gates
37
38
  - Minimum 3 CJM variants (A/B/C) + 1 trend variant (D)
38
39
  - Prototype must be valid React JSX
39
- - Trend research in PARANOID mode (verified sources)
40
+ - Trend research cites sources, labels uncertainty and does not claim issuer verification
41
+ without confirmed capabilities
40
42
  - User MUST explicitly select a variant
41
43
 
42
44
  ## Promise
@@ -60,17 +60,19 @@ 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/ ← Integrated agentic-qe skills (15 total)
63
+ │ └── agentic-qe/ ← 15 QE references (8 pinned protocols)
64
64
  │ ├── README.md ← Skill mapping, modes, install guide
65
- │ ├── shift-left-testing.md ← Step 3: ADR testability (Tier 3)
66
- │ ├── qcsd-ideation-swarm.md ← Step 3.5: Quality swarm (Tier 3)
65
+ │ ├── UPSTREAM-MANIFEST.json ← Pinned upstream paths and hashes
66
+ │ ├── LICENSE.agentic-qe ← Upstream MIT notice
67
+ │ ├── qe-ref-shift-left-testing/REFERENCE.md ← Step 3: ADR testability (Tier 3)
68
+ │ ├── qe-ref-qcsd-ideation-swarm/REFERENCE.md ← Step 3.5: Quality swarm (Tier 3)
67
69
  │ ├── code-goal-planner.md ← Step 6: SPARC-GOAP agent
68
- │ ├── brutal-honesty-review.md ← Step 8: Code review (Tier 2)
69
- │ ├── qe-requirements-validation.md ← Step 9: Traceability (Tier 3)
70
- │ ├── risk-based-testing.md ← Step 9: Risk scoring (Tier 3)
71
- │ ├── enterprise-integration-testing.md ← Step 9: Integration (Tier 3, condensed)
72
- │ ├── regression-testing.md ← Step 9: Regression (Tier 3)
73
- │ ├── qe-coverage-analysis.md ← Step 9: Coverage (Tier 3)
70
+ │ ├── qe-ref-brutal-honesty-review/REFERENCE.md ← Step 8: Code review (Tier 2)
71
+ │ ├── qe-ref-qe-requirements-validation/REFERENCE.md ← Step 9: Traceability (Tier 3)
72
+ │ ├── qe-ref-risk-based-testing/REFERENCE.md ← Step 9: Risk scoring (Tier 3)
73
+ │ ├── qe-ref-enterprise-integration-testing/REFERENCE.md ← Step 9: Integration
74
+ │ ├── qe-ref-regression-testing/REFERENCE.md ← Step 9: Regression (Tier 3)
75
+ │ ├── qe-ref-qe-coverage-analysis/REFERENCE.md ← Step 9: Coverage (Tier 3)
74
76
  │ ├── chaos-engineering-resilience.md ← Extended: Chaos (Tier 3)
75
77
  │ ├── security-testing.md ← Extended: OWASP (Tier 3)
76
78
  │ ├── performance-testing.md ← Extended: Load/stress (Tier 3)
@@ -649,17 +651,17 @@ statusline/JSON and its ETA keep their existing behavior. Do not start a termina
649
651
 
650
652
  ### What changes with `--full-qe`
651
653
 
652
- Full agentic-qe protocols for the same 9 core skills. No new agents, just deeper methodology.
654
+ The eight vendored core skills already provide pinned full protocols in Reference Mode. Direct Mode adds the installed aqe runtime, its MCP pattern memory, and the steps explicitly listed below; it does not make the bundled references more complete.
653
655
 
654
656
  | Step | Reference Mode (default) | Direct Mode (`--full-qe`) |
655
657
  |------|--------------------------|---------------------------|
656
658
  | Step 0 | Standard routing | + pattern recall → `{LEARNED_PATTERNS}` |
657
- | Step 3 | Condensed shift-left protocol | Full Level 1-4 shift-left with BDD generators |
658
- | Step 3.5 | 3 core + flag-based conditionals | Full QCSD swarm with all 9 agents + DDD mapping |
659
- | Step 6 | SPARC-GOAP goal state analysis | Full agent with milestone tracking + success metrics |
659
+ | Step 3 | Pinned shift-left protocol | Same protocol; installed aqe tooling when available |
660
+ | Step 3.5 | Bundled QCSD protocol and conditional perspectives | Installed aqe runtime can coordinate its full swarm |
661
+ | Step 6 | SPARC-GOAP goal state analysis | Installed planner agent when available |
660
662
  | Step 7 | Standard code generation | Standard code generation (no change) |
661
- | Step 8 | Brutal-honesty 3-mode review | Full calibration levels (1-3) + evidence protocol + QE pattern recall/store |
662
- | Step 9 | 4 agents with condensed protocols | 4 agents with full agentic-qe protocols + fleet pattern recall/store |
663
+ | Step 8 | Pinned brutal-honesty protocol | Same review plus aqe pattern recall/store |
664
+ | Step 9 | 4 agents with pinned full protocols | Same agents plus aqe fleet pattern recall/store |
663
665
 
664
666
  ### What `--full-qe-extended` adds on top
665
667
 
@@ -227,7 +227,7 @@ Fitness readiness:
227
227
 
228
228
  After all ADRs are drafted, apply **shift-left-testing** protocol (Level 4: Risk Analysis in Design).
229
229
 
230
- > Load: `references/agentic-qe/shift-left-testing.md`
230
+ > Load: `references/agentic-qe/qe-ref-shift-left-testing/REFERENCE.md`
231
231
 
232
232
  ### Testability Check per ADR
233
233