agents-templated 2.2.11 → 2.2.13

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 (85) hide show
  1. package/README.md +34 -8
  2. package/bin/cli.js +49 -0
  3. package/lib/orchestrator.js +562 -0
  4. package/lib/workflow.js +478 -22
  5. package/package.json +1 -1
  6. package/templates/.claude/agents/README.md +15 -1
  7. package/templates/.claude/agents/architect.md +79 -106
  8. package/templates/.claude/agents/backend-specialist.md +79 -0
  9. package/templates/.claude/agents/build-error-resolver.md +78 -119
  10. package/templates/.claude/agents/code-reviewer.md +79 -116
  11. package/templates/.claude/agents/compatibility-checker.md +79 -79
  12. package/templates/.claude/agents/configuration-validator.md +79 -85
  13. package/templates/.claude/agents/database-migrator.md +79 -83
  14. package/templates/.claude/agents/dependency-auditor.md +79 -92
  15. package/templates/.claude/agents/deployment-specialist.md +91 -0
  16. package/templates/.claude/agents/doc-updater.md +78 -130
  17. package/templates/.claude/agents/e2e-runner.md +78 -122
  18. package/templates/.claude/agents/frontend-specialist.md +79 -0
  19. package/templates/.claude/agents/load-tester.md +79 -80
  20. package/templates/.claude/agents/performance-profiler.md +79 -103
  21. package/templates/.claude/agents/performance-specialist.md +91 -0
  22. package/templates/.claude/agents/planner.md +81 -87
  23. package/templates/.claude/agents/qa-specialist.md +92 -0
  24. package/templates/.claude/agents/refactor-cleaner.md +79 -137
  25. package/templates/.claude/agents/release-ops-specialist.md +80 -0
  26. package/templates/.claude/agents/security-reviewer.md +80 -138
  27. package/templates/.claude/agents/tdd-guide.md +79 -98
  28. package/templates/.claude/agents/test-data-builder.md +79 -0
  29. package/templates/CLAUDE.md +10 -0
  30. package/templates/README.md +36 -8
  31. package/templates/agent-docs/ARCHITECTURE.md +6 -0
  32. package/templates/agents/commands/README.md +81 -8
  33. package/templates/agents/commands/SCHEMA.md +21 -1
  34. package/templates/agents/commands/arch-check.md +58 -33
  35. package/templates/agents/commands/audit.md +58 -38
  36. package/templates/agents/commands/debug-track.md +58 -33
  37. package/templates/agents/commands/docs.md +58 -34
  38. package/templates/agents/commands/fix.md +58 -34
  39. package/templates/agents/commands/learn-loop.md +58 -33
  40. package/templates/agents/commands/perf.md +58 -34
  41. package/templates/agents/commands/plan.md +58 -34
  42. package/templates/agents/commands/pr.md +58 -35
  43. package/templates/agents/commands/problem-map.md +58 -33
  44. package/templates/agents/commands/release-ready.md +58 -33
  45. package/templates/agents/commands/release.md +58 -39
  46. package/templates/agents/commands/risk-review.md +58 -33
  47. package/templates/agents/commands/scope-shape.md +58 -33
  48. package/templates/agents/commands/task.md +58 -35
  49. package/templates/agents/commands/test-data.md +56 -0
  50. package/templates/agents/commands/test.md +58 -34
  51. package/templates/agents/commands/ux-bar.md +58 -33
  52. package/templates/agents/skills/README.md +9 -0
  53. package/templates/agents/skills/debug-skill/SKILL.md +39 -0
  54. package/templates/agents/skills/feature-forge/SKILL.md +39 -0
  55. package/templates/agents/skills/secure-code-guardian/SKILL.md +39 -0
  56. package/agents/commands/README.md +0 -70
  57. package/agents/commands/SCHEMA.md +0 -22
  58. package/agents/commands/arch-check.md +0 -33
  59. package/agents/commands/audit.md +0 -38
  60. package/agents/commands/debug-track.md +0 -33
  61. package/agents/commands/docs-sync.md +0 -33
  62. package/agents/commands/docs.md +0 -34
  63. package/agents/commands/fix.md +0 -34
  64. package/agents/commands/learn-loop.md +0 -33
  65. package/agents/commands/perf-scan.md +0 -33
  66. package/agents/commands/perf.md +0 -34
  67. package/agents/commands/plan.md +0 -34
  68. package/agents/commands/pr.md +0 -35
  69. package/agents/commands/problem-map.md +0 -33
  70. package/agents/commands/quality-gate.md +0 -33
  71. package/agents/commands/refactor.md +0 -34
  72. package/agents/commands/release-ready.md +0 -33
  73. package/agents/commands/release.md +0 -39
  74. package/agents/commands/risk-review.md +0 -33
  75. package/agents/commands/scaffold.md +0 -34
  76. package/agents/commands/scope-shape.md +0 -33
  77. package/agents/commands/task.md +0 -35
  78. package/agents/commands/test.md +0 -34
  79. package/agents/commands/ux-bar.md +0 -33
  80. package/agents/rules/planning.mdc +0 -69
  81. package/templates/agents/commands/docs-sync.md +0 -33
  82. package/templates/agents/commands/perf-scan.md +0 -33
  83. package/templates/agents/commands/quality-gate.md +0 -33
  84. package/templates/agents/commands/refactor.md +0 -34
  85. package/templates/agents/commands/scaffold.md +0 -34
package/lib/workflow.js CHANGED
@@ -3,6 +3,7 @@ const WORKFLOW_COMMANDS = [
3
3
  cli: 'problem-map',
4
4
  slash: '/problem-map',
5
5
  purpose: 'problem-framing',
6
+ track: 'planning',
6
7
  specialist: 'Problem Strategist',
7
8
  contract: 'plan.md',
8
9
  description: 'Clarify user pain and define the real problem before implementation.'
@@ -11,6 +12,7 @@ const WORKFLOW_COMMANDS = [
11
12
  cli: 'scope-shape',
12
13
  slash: '/scope-shape',
13
14
  purpose: 'scope-decision',
15
+ track: 'planning',
14
16
  specialist: 'Scope Director',
15
17
  contract: 'plan.md',
16
18
  description: 'Challenge scope and lock the highest-leverage direction.'
@@ -19,6 +21,7 @@ const WORKFLOW_COMMANDS = [
19
21
  cli: 'arch-check',
20
22
  slash: '/arch-check',
21
23
  purpose: 'architecture-readiness',
24
+ track: 'backend',
22
25
  specialist: 'Architecture Reviewer',
23
26
  contract: 'plan.md',
24
27
  description: 'Lock architecture, edge cases, and test strategy before build.'
@@ -27,6 +30,7 @@ const WORKFLOW_COMMANDS = [
27
30
  cli: 'ux-bar',
28
31
  slash: '/ux-bar',
29
32
  purpose: 'ux-quality-readiness',
33
+ track: 'frontend',
30
34
  specialist: 'Design Quality Lead',
31
35
  contract: 'plan.md',
32
36
  description: 'Assess UX quality and close design gaps before implementation.'
@@ -35,6 +39,7 @@ const WORKFLOW_COMMANDS = [
35
39
  cli: 'debug-track',
36
40
  slash: '/debug-track',
37
41
  purpose: 'root-cause-investigation',
42
+ track: 'qa',
38
43
  specialist: 'Root-Cause Investigator',
39
44
  contract: 'fix.md',
40
45
  description: 'Reproduce issues and isolate root cause before applying fixes.'
@@ -43,60 +48,332 @@ const WORKFLOW_COMMANDS = [
43
48
  cli: 'risk-review',
44
49
  slash: '/risk-review',
45
50
  purpose: 'release-risk-assessment',
51
+ track: 'release-ops',
46
52
  specialist: 'Release Risk Reviewer',
47
53
  contract: 'audit.md',
48
54
  description: 'Run a production-risk review on active changes.'
49
55
  },
50
56
  {
51
- cli: 'quality-gate',
52
- slash: '/quality-gate',
53
- purpose: 'quality-gating',
54
- specialist: 'Quality Gatekeeper',
55
- contract: 'test.md',
56
- description: 'Validate behavior, capture regressions, and enforce quality gates.'
57
- },
58
- {
59
- cli: 'perf-scan',
60
- slash: '/perf-scan',
61
- purpose: 'performance-regression-check',
57
+ cli: 'perf',
58
+ slash: '/perf',
59
+ purpose: 'performance-optimization-and-regression-check',
60
+ track: 'performance',
62
61
  specialist: 'Performance Analyst',
63
62
  contract: 'perf.md',
64
- description: 'Record baseline performance and compare before/after changes.'
63
+ description: 'Optimize performance and validate baseline-vs-candidate regression safety.'
64
+ },
65
+ {
66
+ cli: 'test-data',
67
+ slash: '/test-data',
68
+ purpose: 'test-data-asset-preparation',
69
+ track: 'test-data',
70
+ specialist: 'Test Data Builder',
71
+ contract: 'test.md',
72
+ description: 'Prepare deterministic fixtures, seeds, and synthetic datasets for downstream validation.'
65
73
  },
66
74
  {
67
75
  cli: 'release-ready',
68
76
  slash: '/release-ready',
69
77
  purpose: 'release-readiness',
78
+ track: 'deployment',
70
79
  specialist: 'Release Coordinator',
71
80
  contract: 'release.md',
72
81
  description: 'Prepare release branch, tests, and release checklist artifacts.'
73
82
  },
74
83
  {
75
- cli: 'docs-sync',
76
- slash: '/docs-sync',
77
- purpose: 'documentation-synchronization',
84
+ cli: 'docs',
85
+ slash: '/docs',
86
+ purpose: 'documentation-update-and-synchronization',
87
+ track: 'release-ops',
78
88
  specialist: 'Documentation Engineer',
79
89
  contract: 'docs.md',
80
- description: 'Update README and architecture docs to match shipped behavior.'
90
+ description: 'Update and synchronize README and architecture docs to match shipped behavior.'
81
91
  },
82
92
  {
83
93
  cli: 'learn-loop',
84
94
  slash: '/learn-loop',
85
95
  purpose: 'retrospective-action-loop',
96
+ track: 'release-ops',
86
97
  specialist: 'Iteration Lead',
87
98
  contract: 'task.md',
88
99
  description: 'Capture wins, misses, and next-cycle improvements.'
89
100
  }
90
101
  ];
91
102
 
103
+ const ORCHESTRATION_TRACKS = {
104
+ planning: {
105
+ subagent: 'planner',
106
+ skills: ['feature-delivery', 'feature-forge'],
107
+ goal: 'Clarify objective and lock scope before implementation.'
108
+ },
109
+ backend: {
110
+ subagent: 'backend-specialist',
111
+ skills: ['secure-code-guardian', 'feature-delivery', 'bug-triage'],
112
+ goal: 'Design and implement API/data/server-side logic.'
113
+ },
114
+ frontend: {
115
+ subagent: 'frontend-specialist',
116
+ skills: ['ui-ux-pro-max', 'emilkowalski-skill', 'raphaelsalaja-userinterface-wiki'],
117
+ goal: 'Design and implement UI, accessibility, and interactions.'
118
+ },
119
+ qa: {
120
+ subagent: 'qa-specialist',
121
+ skills: ['debug-skill', 'bug-triage'],
122
+ goal: 'Verify quality gates, regression checks, and issue triage.'
123
+ },
124
+ 'qa-design': {
125
+ subagent: 'qa-specialist',
126
+ skills: ['debug-skill', 'bug-triage'],
127
+ goal: 'Design test strategy before implementation starts.'
128
+ },
129
+ performance: {
130
+ subagent: 'performance-specialist',
131
+ skills: ['debug-skill', 'bug-triage'],
132
+ goal: 'Diagnose bottlenecks and validate load thresholds.'
133
+ },
134
+ 'test-data': {
135
+ subagent: 'test-data-builder',
136
+ skills: ['bug-triage', 'feature-delivery'],
137
+ goal: 'Build deterministic data assets for downstream validation and load checks.'
138
+ },
139
+ 'release-ops': {
140
+ subagent: 'release-ops-specialist',
141
+ skills: ['app-hardening', 'secure-code-guardian'],
142
+ goal: 'Harden release, validate risk posture, and synchronize docs.'
143
+ },
144
+ deployment: {
145
+ subagent: 'deployment-specialist',
146
+ skills: ['app-hardening', 'secure-code-guardian'],
147
+ goal: 'Prepare and validate deployment execution plans.'
148
+ }
149
+ };
150
+
151
+ const ORCHESTRATION_SCENARIOS = [
152
+ {
153
+ id: 'feature-delivery',
154
+ description: 'End-to-end feature lifecycle from framing to release.',
155
+ keywords: ['feature', 'build', 'implement', 'add', 'create'],
156
+ phases: [
157
+ { command: 'problem-map', track: 'planning' },
158
+ { command: 'scope-shape', track: 'planning' },
159
+ { command: 'scope-shape', track: 'qa-design' },
160
+ { command: 'test-data', track: 'test-data' },
161
+ { command: 'arch-check', track: 'backend' },
162
+ { command: 'ux-bar', track: 'frontend' },
163
+ { command: 'debug-track', track: 'qa' },
164
+ { command: 'perf', track: 'performance' },
165
+ { command: 'risk-review', track: 'release-ops' },
166
+ { command: 'release-ready', track: 'deployment' },
167
+ { command: 'docs', track: 'release-ops' }
168
+ ]
169
+ },
170
+ {
171
+ id: 'backend-api',
172
+ description: 'API and backend-focused changes with risk checks.',
173
+ keywords: ['api', 'backend', 'service', 'database', 'endpoint'],
174
+ phases: [
175
+ { command: 'problem-map', track: 'planning' },
176
+ { command: 'problem-map', track: 'qa-design' },
177
+ { command: 'arch-check', track: 'backend' },
178
+ { command: 'test-data', track: 'test-data' },
179
+ { command: 'debug-track', track: 'qa' },
180
+ { command: 'perf', track: 'performance' },
181
+ { command: 'risk-review', track: 'release-ops' },
182
+ { command: 'release-ready', track: 'deployment' }
183
+ ]
184
+ },
185
+ {
186
+ id: 'frontend-feature',
187
+ description: 'UI-focused delivery with quality and release gates.',
188
+ keywords: ['frontend', 'ui', 'ux', 'design', 'component'],
189
+ phases: [
190
+ { command: 'problem-map', track: 'planning' },
191
+ { command: 'scope-shape', track: 'planning' },
192
+ { command: 'scope-shape', track: 'qa-design' },
193
+ { command: 'test-data', track: 'test-data' },
194
+ { command: 'ux-bar', track: 'frontend' },
195
+ { command: 'debug-track', track: 'qa' },
196
+ { command: 'perf', track: 'performance' },
197
+ { command: 'risk-review', track: 'release-ops' },
198
+ { command: 'release-ready', track: 'deployment' }
199
+ ]
200
+ },
201
+ {
202
+ id: 'bug-fix',
203
+ description: 'Defect-focused sequence with regression protection.',
204
+ keywords: ['bug', 'fix', 'issue', 'error', 'regression'],
205
+ phases: [
206
+ { command: 'debug-track', track: 'qa' },
207
+ { command: 'perf', track: 'performance' },
208
+ { command: 'arch-check', track: 'backend' },
209
+ { command: 'risk-review', track: 'release-ops' },
210
+ { command: 'release-ready', track: 'deployment' }
211
+ ]
212
+ },
213
+ {
214
+ id: 'deployment',
215
+ description: 'Deployment-focused path with risk and release checks.',
216
+ keywords: ['deploy', 'deployment', 'ship', 'release', 'production'],
217
+ phases: [
218
+ { command: 'risk-review', track: 'release-ops' },
219
+ { command: 'perf', track: 'performance' },
220
+ { command: 'release-ready', track: 'deployment' },
221
+ { command: 'docs', track: 'release-ops' },
222
+ { command: 'learn-loop', track: 'release-ops' }
223
+ ]
224
+ }
225
+ ];
226
+
227
+ const OPTIONAL_SUBAGENT_RULES = [
228
+ {
229
+ subagent: 'architect',
230
+ required: false,
231
+ reason: 'Deep architecture trade-off analysis support.',
232
+ when: {
233
+ commands: ['arch-check'],
234
+ keywords: ['architecture', 'design', 'scalability', 'adr']
235
+ }
236
+ },
237
+ {
238
+ subagent: 'tdd-guide',
239
+ required: false,
240
+ reason: 'Test-first guidance when explicit test strategy is requested.',
241
+ deprecatedAliasFor: 'qa-specialist',
242
+ mode: 'design',
243
+ when: {
244
+ tracks: ['backend', 'frontend', 'qa'],
245
+ keywords: ['test', 'tdd', 'coverage', 'unit test']
246
+ }
247
+ },
248
+ {
249
+ subagent: 'test-data-builder',
250
+ required: false,
251
+ reason: 'Prepare deterministic fixtures and seed data for downstream validation phases.',
252
+ when: {
253
+ tracks: ['qa-design', 'backend', 'test-data'],
254
+ keywords: ['test data', 'fixture', 'seed', 'mock', 'dataset', 'migration', 'database']
255
+ }
256
+ },
257
+ {
258
+ subagent: 'code-reviewer',
259
+ required: false,
260
+ reason: 'Static quality review before release risk checkpoints.',
261
+ when: {
262
+ commands: ['risk-review'],
263
+ scenarios: ['feature-delivery', 'bug-fix', 'deployment']
264
+ }
265
+ },
266
+ {
267
+ subagent: 'security-reviewer',
268
+ required: false,
269
+ reason: 'Security audit for auth, secrets, and sensitive data paths.',
270
+ when: {
271
+ tracks: ['backend', 'release-ops', 'deployment'],
272
+ keywords: ['auth', 'token', 'secret', 'security', 'permission', 'pii']
273
+ }
274
+ },
275
+ {
276
+ subagent: 'build-error-resolver',
277
+ required: false,
278
+ reason: 'Targeted build/type/lint failure remediation.',
279
+ when: {
280
+ scenarios: ['bug-fix'],
281
+ keywords: ['build', 'type', 'compile', 'lint', 'error']
282
+ }
283
+ },
284
+ {
285
+ subagent: 'e2e-runner',
286
+ required: false,
287
+ reason: 'E2E execution for journey-level validation after test data handoff.',
288
+ dependsOnSubagents: ['test-data-builder'],
289
+ when: {
290
+ tracks: ['qa', 'frontend'],
291
+ keywords: ['e2e', 'playwright', 'journey', 'end-to-end', 'validation']
292
+ }
293
+ },
294
+ {
295
+ subagent: 'refactor-cleaner',
296
+ required: false,
297
+ reason: 'Safe dead-code cleanup and refactor hygiene pass.',
298
+ when: {
299
+ keywords: ['refactor', 'cleanup', 'dead code', 'unused']
300
+ }
301
+ },
302
+ {
303
+ subagent: 'doc-updater',
304
+ required: false,
305
+ reason: 'Documentation synchronization for release and handoff.',
306
+ when: {
307
+ commands: ['docs']
308
+ }
309
+ },
310
+ {
311
+ subagent: 'performance-specialist',
312
+ required: false,
313
+ reason: 'Performance bottleneck profiling for latency/resource risks.',
314
+ mode: 'profile',
315
+ when: {
316
+ tracks: ['performance'],
317
+ keywords: ['performance', 'latency', 'memory', 'cpu', 'slow', 'profile']
318
+ }
319
+ },
320
+ {
321
+ subagent: 'dependency-auditor',
322
+ required: false,
323
+ reason: 'Dependency and CVE hygiene audit.',
324
+ when: {
325
+ tracks: ['backend', 'release-ops', 'deployment'],
326
+ keywords: ['dependency', 'package', 'cve', 'vulnerability', 'upgrade']
327
+ }
328
+ },
329
+ {
330
+ subagent: 'configuration-validator',
331
+ required: false,
332
+ reason: 'Configuration and environment safety validation.',
333
+ deprecatedAliasFor: 'deployment-specialist',
334
+ mode: 'config-validation',
335
+ when: {
336
+ scenarios: ['deployment'],
337
+ keywords: ['config', 'environment', 'env', 'settings']
338
+ }
339
+ },
340
+ {
341
+ subagent: 'database-migrator',
342
+ required: false,
343
+ reason: 'Schema/data migration planning and rollback checks.',
344
+ when: {
345
+ tracks: ['backend'],
346
+ keywords: ['database', 'schema', 'migration', 'sql']
347
+ }
348
+ },
349
+ {
350
+ subagent: 'performance-specialist',
351
+ required: false,
352
+ reason: 'Load and stress validation near release/deployment phases after test data handoff.',
353
+ mode: 'load',
354
+ dependsOnSubagents: ['test-data-builder'],
355
+ when: {
356
+ tracks: ['performance', 'deployment'],
357
+ keywords: ['load', 'throughput', 'stress', 'traffic']
358
+ }
359
+ },
360
+ {
361
+ subagent: 'compatibility-checker',
362
+ required: false,
363
+ reason: 'Contract and version compatibility checks for API changes.',
364
+ when: {
365
+ tracks: ['backend', 'release-ops'],
366
+ keywords: ['compatibility', 'breaking', 'contract', 'api version']
367
+ }
368
+ }
369
+ ];
370
+
92
371
  const CONTRACT_FILES = [
93
372
  'SCHEMA.md',
94
373
  'README.md',
95
374
  'plan.md',
96
375
  'task.md',
97
- 'scaffold.md',
98
376
  'fix.md',
99
- 'refactor.md',
100
377
  'audit.md',
101
378
  'perf.md',
102
379
  'test.md',
@@ -111,15 +388,146 @@ const SPECIALIST_CONTRACT_FILES = [
111
388
  'arch-check.md',
112
389
  'ux-bar.md',
113
390
  'debug-track.md',
391
+ 'test-data.md',
114
392
  'risk-review.md',
115
- 'quality-gate.md',
116
- 'perf-scan.md',
117
393
  'release-ready.md',
118
- 'docs-sync.md',
119
394
  'learn-loop.md'
120
395
  ];
121
396
 
122
- const DEPRECATED_COMMAND_ALIASES = [];
397
+ const DEPRECATED_COMMAND_ALIASES = [
398
+ {
399
+ from: 'quality-gate',
400
+ to: 'risk-review',
401
+ status: 'deprecated',
402
+ notice: 'quality-gate is deprecated; redirecting to risk-review.'
403
+ },
404
+ {
405
+ from: 'perf-scan',
406
+ to: 'perf',
407
+ status: 'deprecated',
408
+ notice: 'perf-scan is deprecated; redirecting to perf.'
409
+ },
410
+ {
411
+ from: 'docs-sync',
412
+ to: 'docs',
413
+ status: 'deprecated',
414
+ notice: 'docs-sync is deprecated; redirecting to docs.'
415
+ }
416
+ ];
417
+
418
+ const DEPRECATED_SUBAGENT_ALIASES = {
419
+ 'tdd-guide': {
420
+ to: 'qa-specialist',
421
+ mode: 'design',
422
+ notice: 'tdd-guide is deprecated; redirecting to qa-specialist(mode=design).'
423
+ },
424
+ 'performance-profiler': {
425
+ to: 'performance-specialist',
426
+ mode: 'profile',
427
+ notice: 'performance-profiler is deprecated; redirecting to performance-specialist(mode=profile).'
428
+ },
429
+ 'load-tester': {
430
+ to: 'performance-specialist',
431
+ mode: 'load',
432
+ notice: 'load-tester is deprecated; redirecting to performance-specialist(mode=load).'
433
+ },
434
+ 'configuration-validator': {
435
+ to: 'deployment-specialist',
436
+ mode: 'config-validation',
437
+ notice: 'configuration-validator is deprecated; redirecting to deployment-specialist(mode=config-validation).'
438
+ }
439
+ };
440
+
441
+ const NON_OVERLAP_ROUTE_BOUNDARIES = {
442
+ backendResolutionSubagents: ['build-error-resolver', 'compatibility-checker', 'database-migrator'],
443
+ reviewSequence: ['code-reviewer', 'dependency-auditor', 'doc-updater'],
444
+ commandAllowlist: {
445
+ 'arch-check': [
446
+ 'architect',
447
+ 'security-reviewer',
448
+ 'build-error-resolver',
449
+ 'compatibility-checker',
450
+ 'database-migrator',
451
+ 'test-data-builder'
452
+ ],
453
+ 'risk-review': ['code-reviewer', 'dependency-auditor', 'security-reviewer', 'compatibility-checker'],
454
+ docs: ['doc-updater', 'security-reviewer']
455
+ }
456
+ };
457
+
458
+ const MODE_LOCKED_SPECIALISTS = {
459
+ 'qa-specialist': ['design', 'validation'],
460
+ 'performance-specialist': ['profile', 'load']
461
+ };
462
+
463
+ const SECURITY_REVIEW_POLICY = {
464
+ mandatoryKeywords: [
465
+ 'auth',
466
+ 'authorization',
467
+ 'session',
468
+ 'token',
469
+ 'permission',
470
+ 'public endpoint',
471
+ 'parser',
472
+ 'secret',
473
+ 'credential',
474
+ 'cve',
475
+ 'vulnerability',
476
+ 'breaking',
477
+ 'api contract',
478
+ 'production',
479
+ 'threat surface',
480
+ 'pii'
481
+ ],
482
+ mediumKeywords: [
483
+ 'input',
484
+ 'transform',
485
+ 'middleware',
486
+ 'integration',
487
+ 'upload',
488
+ 'request',
489
+ 'external'
490
+ ],
491
+ mediumThreshold: 3
492
+ };
493
+
494
+ const REFACTOR_BUILD_RETRY_CAP = 2;
495
+ const REFACTOR_BUILD_HALT_AFTER = REFACTOR_BUILD_RETRY_CAP + 1;
496
+
497
+ function findScenarioById(id) {
498
+ if (!id) {
499
+ return null;
500
+ }
501
+
502
+ return ORCHESTRATION_SCENARIOS.find((scenario) => scenario.id === id) || null;
503
+ }
504
+
505
+ function resolveScenarioFromObjective(objective) {
506
+ const normalizedObjective = (objective || '').toLowerCase();
507
+ let bestScenario = ORCHESTRATION_SCENARIOS[0];
508
+ let bestScore = -1;
509
+
510
+ for (const scenario of ORCHESTRATION_SCENARIOS) {
511
+ let score = 0;
512
+ for (const keyword of scenario.keywords) {
513
+ if (normalizedObjective.includes(keyword)) {
514
+ score += 1;
515
+ }
516
+ }
517
+
518
+ if (score > bestScore) {
519
+ bestScenario = scenario;
520
+ bestScore = score;
521
+ }
522
+ }
523
+
524
+ return {
525
+ scenario: bestScenario,
526
+ reason: bestScore > 0
527
+ ? `matched ${bestScore} scenario keyword(s)`
528
+ : 'defaulted to feature-delivery because no scenario keywords matched'
529
+ };
530
+ }
123
531
 
124
532
  function formatWorkflowOutput(workflow, objective) {
125
533
  const trimmedObjective = (objective || '').trim();
@@ -150,6 +558,8 @@ function validateWorkflowDefinitions() {
150
558
  const seenCli = new Set();
151
559
  const seenSlash = new Set();
152
560
  const seenPurpose = new Set();
561
+ const seenScenarioIds = new Set();
562
+ const seenOptionalSubagentRule = new Set();
153
563
  const issues = [];
154
564
 
155
565
  for (const workflow of WORKFLOW_COMMANDS) {
@@ -177,14 +587,60 @@ function validateWorkflowDefinitions() {
177
587
  }
178
588
  }
179
589
 
590
+ for (const scenario of ORCHESTRATION_SCENARIOS) {
591
+ if (seenScenarioIds.has(scenario.id)) {
592
+ issues.push(`Duplicate orchestration scenario id: ${scenario.id}`);
593
+ }
594
+ seenScenarioIds.add(scenario.id);
595
+
596
+ for (const phase of scenario.phases) {
597
+ if (!seenCli.has(phase.command)) {
598
+ issues.push(`Scenario ${scenario.id} references unknown command: ${phase.command}`);
599
+ }
600
+
601
+ if (!ORCHESTRATION_TRACKS[phase.track]) {
602
+ issues.push(`Scenario ${scenario.id} references unknown track: ${phase.track}`);
603
+ }
604
+ }
605
+ }
606
+
607
+ for (const rule of OPTIONAL_SUBAGENT_RULES) {
608
+ const key = JSON.stringify({
609
+ subagent: rule.subagent,
610
+ when: rule.when || {},
611
+ mode: rule.mode || null,
612
+ deprecatedAliasFor: rule.deprecatedAliasFor || null,
613
+ dependsOnSubagents: rule.dependsOnSubagents || []
614
+ });
615
+ if (seenOptionalSubagentRule.has(key)) {
616
+ issues.push(`Duplicate optional subagent rule: ${rule.subagent}`);
617
+ }
618
+ seenOptionalSubagentRule.add(key);
619
+
620
+ if (rule.required !== false) {
621
+ issues.push(`Optional subagent rule must remain non-required: ${rule.subagent}`);
622
+ }
623
+ }
624
+
180
625
  return issues;
181
626
  }
182
627
 
183
628
  module.exports = {
184
629
  WORKFLOW_COMMANDS,
630
+ ORCHESTRATION_TRACKS,
631
+ ORCHESTRATION_SCENARIOS,
632
+ OPTIONAL_SUBAGENT_RULES,
633
+ DEPRECATED_SUBAGENT_ALIASES,
634
+ NON_OVERLAP_ROUTE_BOUNDARIES,
635
+ MODE_LOCKED_SPECIALISTS,
636
+ SECURITY_REVIEW_POLICY,
637
+ REFACTOR_BUILD_RETRY_CAP,
638
+ REFACTOR_BUILD_HALT_AFTER,
185
639
  CONTRACT_FILES,
186
640
  SPECIALIST_CONTRACT_FILES,
187
641
  DEPRECATED_COMMAND_ALIASES,
642
+ findScenarioById,
643
+ resolveScenarioFromObjective,
188
644
  formatWorkflowOutput,
189
645
  validateWorkflowDefinitions
190
646
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-templated",
3
- "version": "2.2.11",
3
+ "version": "2.2.13",
4
4
  "description": "Technology-agnostic development template with multi-AI agent support (Cursor, Copilot, VSCode, Gemini), security-first patterns, and comprehensive testing guidelines",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -23,11 +23,18 @@ Subagents are bounded agent processes that your orchestrator (main AI) can deleg
23
23
  | `refactor-cleaner` | sonnet | Remove dead code, unused deps, orphaned exports |
24
24
  | `doc-updater` | haiku | Sync README, API docs, and codemaps after code changes |
25
25
  | `performance-profiler` | sonnet | Diagnose latency and resource bottlenecks with measurable optimization plans |
26
+ | `performance-specialist` | sonnet | Execute explicit profile/load performance phases with mode-locked invocation |
27
+ | `test-data-builder` | sonnet | Build deterministic fixtures/seeds and handoff data for validation/e2e/load |
26
28
  | `dependency-auditor` | sonnet | Audit dependency risk, CVEs, and upgrade hygiene |
27
29
  | `configuration-validator` | sonnet | Validate environment config, safety defaults, and deploy readiness |
28
30
  | `database-migrator` | sonnet | Plan and review schema/data migrations with rollback and validation gates |
29
31
  | `load-tester` | sonnet | Define load scenarios, thresholds, and release-quality performance gates |
30
32
  | `compatibility-checker` | sonnet | Detect contract-breaking API changes and enforce versioning discipline |
33
+ | `backend-specialist` | sonnet | Execute backend-oriented implementation phases in orchestrated runs |
34
+ | `frontend-specialist` | sonnet | Execute frontend-oriented implementation phases in orchestrated runs |
35
+ | `qa-specialist` | sonnet | Run validation and regression-focused orchestration phases |
36
+ | `release-ops-specialist` | sonnet | Perform release hardening, risk checks, and operational readiness steps |
37
+ | `deployment-specialist` | sonnet | Prepare deployment rollout plans and rollback-safe execution guidance |
31
38
 
32
39
  ## Model Selection Guide
33
40
 
@@ -64,11 +71,18 @@ Reference the subagent file directly in your prompt or instruct your AI to follo
64
71
  ├── refactor-cleaner.md
65
72
  ├── doc-updater.md
66
73
  ├── performance-profiler.md
74
+ ├── performance-specialist.md
75
+ ├── test-data-builder.md
67
76
  ├── dependency-auditor.md
68
77
  ├── configuration-validator.md
69
78
  ├── database-migrator.md
70
79
  ├── load-tester.md
71
- └── compatibility-checker.md
80
+ ├── compatibility-checker.md
81
+ ├── backend-specialist.md
82
+ ├── frontend-specialist.md
83
+ ├── qa-specialist.md
84
+ ├── release-ops-specialist.md
85
+ └── deployment-specialist.md
72
86
  ```
73
87
 
74
88
  ## Adding a New Subagent