create-byan-agent 2.9.4 → 2.9.5

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 (92) hide show
  1. package/install/bin/byan-cleanup.js +156 -0
  2. package/install/bin/byan-kanban.js +159 -0
  3. package/install/bin/byan-ledger.js +45 -0
  4. package/install/lib/cleanup/detector.js +154 -0
  5. package/install/lib/cleanup/executor.js +72 -0
  6. package/install/lib/subagent-generator.js +208 -0
  7. package/install/lib/token-ledger.js +131 -0
  8. package/install/templates/.claude/agents/bmad-bmad-master.md +14 -0
  9. package/install/templates/.claude/agents/bmad-bmb-agent-builder.md +14 -0
  10. package/install/templates/.claude/agents/bmad-bmb-module-builder.md +14 -0
  11. package/install/templates/.claude/agents/bmad-bmb-workflow-builder.md +14 -0
  12. package/install/templates/.claude/agents/bmad-bmm-analyst.md +14 -0
  13. package/install/templates/.claude/agents/bmad-bmm-architect.md +14 -0
  14. package/install/templates/.claude/agents/bmad-bmm-dev.md +14 -0
  15. package/install/templates/.claude/agents/bmad-bmm-pm.md +14 -0
  16. package/install/templates/.claude/agents/bmad-bmm-quick-flow-solo-dev.md +14 -0
  17. package/install/templates/.claude/agents/bmad-bmm-quinn.md +14 -0
  18. package/install/templates/.claude/agents/bmad-bmm-sm.md +14 -0
  19. package/install/templates/.claude/agents/bmad-bmm-tech-writer.md +14 -0
  20. package/install/templates/.claude/agents/bmad-bmm-ux-designer.md +14 -0
  21. package/install/templates/.claude/agents/bmad-byan-v2.md +14 -0
  22. package/install/templates/.claude/agents/bmad-byan.md +152 -0
  23. package/install/templates/.claude/agents/bmad-carmack.md +14 -0
  24. package/install/templates/.claude/agents/bmad-cis-brainstorming-coach.md +14 -0
  25. package/install/templates/.claude/agents/bmad-cis-creative-problem-solver.md +14 -0
  26. package/install/templates/.claude/agents/bmad-cis-design-thinking-coach.md +14 -0
  27. package/install/templates/.claude/agents/bmad-cis-innovation-strategist.md +14 -0
  28. package/install/templates/.claude/agents/bmad-cis-presentation-master.md +14 -0
  29. package/install/templates/.claude/agents/bmad-cis-storyteller.md +14 -0
  30. package/install/templates/.claude/agents/bmad-claude.md +26 -0
  31. package/install/templates/.claude/agents/bmad-codex.md +26 -0
  32. package/install/templates/.claude/agents/bmad-compliance.md +68 -0
  33. package/install/templates/.claude/agents/bmad-drawio.md +25 -0
  34. package/install/templates/.claude/agents/bmad-expert-merise-agile.md +54 -0
  35. package/install/templates/.claude/agents/bmad-fact-checker.md +14 -0
  36. package/install/templates/.claude/agents/bmad-forgeron.md +14 -0
  37. package/install/templates/.claude/agents/bmad-hermes.md +59 -0
  38. package/install/templates/.claude/agents/bmad-marc.md +25 -0
  39. package/install/templates/.claude/agents/bmad-patnote.md +26 -0
  40. package/install/templates/.claude/agents/bmad-rachid.md +25 -0
  41. package/install/templates/.claude/agents/bmad-tao.md +14 -0
  42. package/install/templates/.claude/agents/bmad-tea-tea.md +14 -0
  43. package/install/templates/.claude/agents/bmad-yanstaller.md +47 -0
  44. package/install/templates/.claude/hooks/fact-check-absolutes.js +185 -0
  45. package/install/templates/.claude/hooks/fd-phase-guard.js +87 -0
  46. package/install/templates/.claude/hooks/fd-response-check.js +92 -0
  47. package/install/templates/.claude/hooks/lib/failure-detector.js +14 -0
  48. package/install/templates/.claude/hooks/pre-compact-save.js +148 -0
  49. package/install/templates/.claude/hooks/tool-failure-guard.js +6 -0
  50. package/install/templates/.claude/hooks/tool-transparency.js +4 -0
  51. package/install/templates/.claude/settings.json +23 -0
  52. package/install/templates/.claude/skills/byan-byan/SKILL.md +115 -163
  53. package/install/templates/.claude/skills/byan-orchestrate/SKILL.md +100 -0
  54. package/install/templates/.githooks/pre-commit +75 -0
  55. package/install/templates/_byan/mcp/byan-mcp-server/lib/copilot.js +148 -0
  56. package/install/templates/_byan/mcp/byan-mcp-server/lib/fd-state.js +163 -0
  57. package/install/templates/_byan/mcp/byan-mcp-server/lib/kanban.js +226 -0
  58. package/install/templates/_byan/mcp/byan-mcp-server/lib/peer-review.js +187 -0
  59. package/install/templates/_byan/mcp/byan-mcp-server/server.js +463 -0
  60. package/install/templates/detector.js +154 -0
  61. package/package.json +6 -7
  62. package/src/loadbalancer/capability-matrix.js +157 -0
  63. package/src/loadbalancer/config.js +141 -0
  64. package/src/loadbalancer/graceful-degradation.js +212 -0
  65. package/src/loadbalancer/health-probe.js +151 -0
  66. package/src/loadbalancer/hooks/claude-hooks.js +53 -0
  67. package/src/loadbalancer/hooks/copilot-hooks.js +74 -0
  68. package/src/loadbalancer/index.js +81 -0
  69. package/src/loadbalancer/loadbalancer.default.yaml +65 -0
  70. package/src/loadbalancer/loadbalancer.js +324 -0
  71. package/src/loadbalancer/mcp-server.js +304 -0
  72. package/src/loadbalancer/metrics.js +146 -0
  73. package/src/loadbalancer/native/claude-integration.js +64 -0
  74. package/src/loadbalancer/native/copilot-integration.js +59 -0
  75. package/src/loadbalancer/pressure-score.js +102 -0
  76. package/src/loadbalancer/providers/base-provider.js +80 -0
  77. package/src/loadbalancer/providers/byan-api-provider.js +132 -0
  78. package/src/loadbalancer/providers/claude-provider.js +113 -0
  79. package/src/loadbalancer/providers/copilot-provider.js +104 -0
  80. package/src/loadbalancer/rate-limit-tracker.js +216 -0
  81. package/src/loadbalancer/session-bridge.js +179 -0
  82. package/src/loadbalancer/state/db.js +211 -0
  83. package/src/loadbalancer/state/migrations/001-initial.sql +50 -0
  84. package/src/loadbalancer/tools/index.js +123 -0
  85. package/src/loadbalancer/velocity-estimator.js +147 -0
  86. package/update-byan-agent/bin/update-byan-agent.js +27 -2
  87. package/API-BYAN-V2.md +0 -741
  88. package/BMAD-QUICK-REFERENCE.md +0 -370
  89. package/CHANGELOG-v2.1.0.md +0 -371
  90. package/MIGRATION-v2.0-to-v2.1.md +0 -430
  91. package/README-BYAN-V2.md +0 -446
  92. package/TEST-GUIDE-v2.3.2.md +0 -161
@@ -1,430 +0,0 @@
1
- # Migration Guide: v2.0.0 → v2.1.0
2
-
3
- **Good News**: BYAN v2.1.0 is 100% backwards compatible with v2.0.0!
4
-
5
- ## 🎯 TL;DR
6
-
7
- **No changes required** - Your v2.0.0 code works unchanged in v2.1.0.
8
-
9
- If you want to use new BMAD features, they're opt-in.
10
-
11
- ---
12
-
13
- ## Option 1: No Changes (Recommended for Existing Projects)
14
-
15
- Your existing code continues to work:
16
-
17
- ```javascript
18
- // v2.0.0 code - works identically in v2.1.0
19
- const ByanV2 = require('create-byan-agent');
20
-
21
- const byan = new ByanV2();
22
- await byan.startSession();
23
-
24
- while (!byan.isComplete()) {
25
- const question = byan.getNextQuestion();
26
- const answer = await getUserInput(question);
27
- await byan.submitResponse(answer);
28
- }
29
-
30
- const profile = await byan.generateProfile();
31
- ```
32
-
33
- **Result**: Identical behavior to v2.0.0, zero breaking changes.
34
-
35
- ---
36
-
37
- ## Option 2: Enable All BMAD Features
38
-
39
- Get the full v2.1.0 experience:
40
-
41
- ```javascript
42
- const ByanV2 = require('create-byan-agent');
43
-
44
- const byan = new ByanV2({
45
- // Your existing config
46
- maxQuestions: 12,
47
- outputDir: './_bmad-output/bmb-creations',
48
-
49
- // NEW: Enable all BMAD features (optional)
50
- bmad_features: {
51
- glossary_builder: {
52
- enabled: true,
53
- auto_trigger_domains: ['ecommerce', 'finance', 'healthcare'],
54
- min_concepts: 5,
55
- clarity_threshold: 0.7
56
- },
57
- five_whys: {
58
- enabled: true,
59
- max_depth: 5,
60
- auto_trigger: true
61
- },
62
- active_listener: {
63
- enabled: true,
64
- reformulation_frequency: 3
65
- },
66
- mantras_validator: {
67
- enabled: true,
68
- min_compliance_score: 0.8
69
- }
70
- }
71
- });
72
-
73
- // Interview works the same, but now:
74
- // - Glossary auto-triggers for complex domains
75
- // - Pain points automatically analyzed with 5 Whys
76
- // - Responses reformulated every 3rd question
77
- // - Agent validated against 64 mantras at the end
78
- ```
79
-
80
- **New Methods Available**:
81
- ```javascript
82
- // Glossary
83
- const glossary = byan.startGlossary();
84
- const concept = byan.addConcept('Order', 'Customer purchase request');
85
- const concepts = byan.getConcepts();
86
-
87
- // Five Whys
88
- const painPoints = byan.detectPainPoints(response);
89
- const whyQuestion = byan.askWhy();
90
- const analysis = byan.processWhyAnswer(answer);
91
- const rootCause = byan.getRootCause();
92
-
93
- // Active Listener
94
- const result = byan.listen(userInput, context);
95
- const summary = byan.summarizeSession();
96
-
97
- // Mantras
98
- const validation = byan.validateAgent(agentDefinition);
99
- const report = byan.generateComplianceReport();
100
- ```
101
-
102
- ---
103
-
104
- ## Option 3: Selective Feature Enablement
105
-
106
- Enable only specific features:
107
-
108
- ```javascript
109
- const byan = new ByanV2({
110
- bmad_features: {
111
- glossary_builder: { enabled: true }, // ✅ Enable glossary
112
- five_whys: { enabled: false }, // ❌ Disable 5 Whys
113
- active_listener: { enabled: true }, // ✅ Enable active listening
114
- mantras_validator: { enabled: false } // ❌ Disable mantras
115
- }
116
- });
117
- ```
118
-
119
- **Use Cases**:
120
- - **Glossary only**: Perfect for domain-heavy projects
121
- - **Active Listener only**: Focus on interview quality
122
- - **Mantras only**: Post-generation validation
123
- - **Custom combo**: Mix and match as needed
124
-
125
- ---
126
-
127
- ## Configuration File Migration
128
-
129
- ### v2.0.0 `_byan/config.yaml`
130
- ```yaml
131
- user_name: Yan
132
- communication_language: Francais
133
- document_output_language: Francais
134
- output_folder: "{project-root}/_bmad-output"
135
- ```
136
-
137
- ### v2.1.0 `_byan/config.yaml` (Optional Additions)
138
- ```yaml
139
- # Existing config - unchanged
140
- user_name: Yan
141
- communication_language: Francais
142
- document_output_language: Francais
143
- output_folder: "{project-root}/_bmad-output"
144
-
145
- # NEW: Optional BMAD features
146
- bmad_features:
147
- glossary_builder:
148
- enabled: true
149
- auto_trigger_domains:
150
- - ecommerce
151
- - finance
152
- - healthcare
153
- min_concepts: 5
154
- clarity_threshold: 0.7
155
-
156
- five_whys:
157
- enabled: true
158
- max_depth: 5
159
- pain_keywords:
160
- - problem
161
- - issue
162
- - slow
163
- - error
164
- - bug
165
- auto_trigger: true
166
-
167
- active_listener:
168
- enabled: true
169
- reformulation_frequency: 3
170
-
171
- mantras_validator:
172
- enabled: true
173
- min_compliance_score: 0.8
174
- ```
175
-
176
- **If you don't add the `bmad_features` section**, default values are used (all enabled).
177
-
178
- ---
179
-
180
- ## State Machine Changes
181
-
182
- ### v2.0.0 Workflow
183
- ```
184
- INIT → INTERVIEW → ANALYSIS → GENERATION → COMPLETED
185
- ```
186
-
187
- ### v2.1.0 Workflow (with BMAD)
188
- ```
189
- INIT → INTERVIEW → [GLOSSARY] → ANALYSIS → GENERATION → [VALIDATION] → COMPLETED
190
- ```
191
-
192
- **Notes**:
193
- - `GLOSSARY` state: Optional, auto-triggers for complex domains
194
- - `VALIDATION` state: Optional, validates against mantras
195
- - If features disabled, workflow identical to v2.0.0
196
-
197
- ---
198
-
199
- ## New API Methods
200
-
201
- ### Glossary Builder
202
- ```javascript
203
- // Start glossary for a domain
204
- const glossary = byan.startGlossary('ecommerce', {
205
- minConcepts: 5,
206
- clarityThreshold: 0.7
207
- });
208
-
209
- // Add concept
210
- const result = byan.addConcept('Product', 'An item available for purchase');
211
- // Returns: { concept: {...}, validation: {...} }
212
-
213
- // Get all concepts
214
- const concepts = byan.getConcepts();
215
- // Returns: [{ term, definition, clarityScore, ... }]
216
-
217
- // Get full glossary
218
- const full = byan.getGlossary();
219
- // Returns: { domain, concepts, relatedTerms, ... }
220
- ```
221
-
222
- ### Five Whys Analyzer
223
- ```javascript
224
- // Detect pain points
225
- const detection = byan.detectPainPoints(response);
226
- // Returns: { needsWhys: true/false, painPoints: [...] }
227
-
228
- // Ask WHY question
229
- const question = byan.askWhy();
230
- // Returns: { depth: 1, question: "Why is this a problem?", prompt: "..." }
231
-
232
- // Process answer
233
- const result = byan.processWhyAnswer('Because the API is slow');
234
- // Returns: { valid: true, depth: 1, nextQuestion: {...} }
235
-
236
- // Get root cause
237
- const rootCause = byan.getRootCause();
238
- // Returns: {
239
- // statement: "Lack of API caching infrastructure",
240
- // category: "technical",
241
- // confidence: 0.85,
242
- // depth: 5,
243
- // actions: [...]
244
- // }
245
- ```
246
-
247
- ### Active Listener
248
- ```javascript
249
- // Listen to user input
250
- const result = byan.listen(userInput, context);
251
- // Returns: {
252
- // reformulation: "So you need...",
253
- // validation: { valid: true, issues: [] },
254
- // issues: [],
255
- // corrections: [],
256
- // confidence: 0.9
257
- // }
258
-
259
- // Reformulate explicitly
260
- const reformulated = byan.reformulate(userInput, 'formal');
261
- // Returns: { original, reformulation, improvements, style }
262
-
263
- // Validate response
264
- const validation = byan.validateResponse(userInput);
265
- // Returns: { valid: true/false, issues: [...] }
266
-
267
- // Summarize session
268
- const summary = byan.summarizeSession();
269
- // Returns: {
270
- // overview: "The user wants...",
271
- // keyPoints: [...],
272
- // insights: [...],
273
- // patterns: { clarityLevel: 'high', ... }
274
- // }
275
- ```
276
-
277
- ### Mantras Validator
278
- ```javascript
279
- // Validate agent
280
- const validation = byan.validateAgent(agentDefinition);
281
- // Returns: {
282
- // compliant: [{ id: '#37', name: 'Ockham\'s Razor', ... }],
283
- // nonCompliant: [{ id: 'IA-23', name: 'No Emoji Pollution', ... }],
284
- // score: 0.85
285
- // }
286
-
287
- // Generate report
288
- const report = byan.generateComplianceReport();
289
- // Returns: full compliance report with recommendations
290
-
291
- // Validate specific mantra
292
- const result = byan.validateMantra('IA-23', agentContent);
293
- // Returns: { compliant: true/false, violations: [...] }
294
-
295
- // Get mantras by category
296
- const mantras = byan.getMantras('Quality');
297
- // Returns: all Quality mantras
298
-
299
- // Get validation summary
300
- const summary = byan.getValidationSummary();
301
- // Returns: { score, compliant, nonCompliant, recommendations }
302
- ```
303
-
304
- ---
305
-
306
- ## Testing Updates
307
-
308
- ### v2.0.0
309
- ```bash
310
- npm test
311
- # 891 tests passing
312
- ```
313
-
314
- ### v2.1.0
315
- ```bash
316
- npm test
317
- # 1,308 tests passing (891 core + 417 BMAD)
318
- ```
319
-
320
- **No test changes needed** for your existing code.
321
-
322
- ---
323
-
324
- ## Performance Impact
325
-
326
- **v2.1.0 Performance**:
327
- - **Overhead**: < 10% vs v2.0.0 (measured)
328
- - **Glossary**: < 100ms per concept
329
- - **Five Whys**: < 50ms per question
330
- - **Active Listener**: < 100ms per response
331
- - **Mantras**: < 200ms per validation
332
-
333
- **Total Workflow**: < 10% slower than v2.0.0 with all features enabled.
334
-
335
- **Recommendation**: Negligible impact for typical workflows (< 1 second added to 10-second interview).
336
-
337
- ---
338
-
339
- ## Common Migration Scenarios
340
-
341
- ### Scenario 1: Existing Production Code
342
- **Recommendation**: No changes
343
- - v2.1.0 works identically to v2.0.0
344
- - Update `package.json` to `^2.1.0`
345
- - Test to confirm (zero changes expected)
346
- - Deploy with confidence
347
-
348
- ### Scenario 2: New Project
349
- **Recommendation**: Enable all BMAD features
350
- - Benefit from glossary, 5 Whys, active listening, mantras
351
- - Better agent quality out of the box
352
- - More structured interview process
353
-
354
- ### Scenario 3: Domain-Heavy Project (Finance, Healthcare, Legal)
355
- **Recommendation**: Enable glossary_builder + mantras_validator
356
- ```javascript
357
- bmad_features: {
358
- glossary_builder: { enabled: true },
359
- five_whys: { enabled: false },
360
- active_listener: { enabled: false },
361
- mantras_validator: { enabled: true }
362
- }
363
- ```
364
-
365
- ### Scenario 4: Problem-Focused Project (Troubleshooting Agents)
366
- **Recommendation**: Enable five_whys + active_listener
367
- ```javascript
368
- bmad_features: {
369
- glossary_builder: { enabled: false },
370
- five_whys: { enabled: true },
371
- active_listener: { enabled: true },
372
- mantras_validator: { enabled: false }
373
- }
374
- ```
375
-
376
- ---
377
-
378
- ## Breaking Changes
379
-
380
- **None** - v2.1.0 is 100% backwards compatible.
381
-
382
- ---
383
-
384
- ## Deprecations
385
-
386
- **None** - All v2.0.0 APIs remain fully supported.
387
-
388
- ---
389
-
390
- ## Rollback Plan
391
-
392
- If you encounter issues:
393
-
394
- ```bash
395
- # Downgrade to v2.0.0
396
- npm install byan-v2@2.0.0
397
- ```
398
-
399
- Or in `package.json`:
400
- ```json
401
- {
402
- "dependencies": {
403
- "byan-v2": "2.0.0"
404
- }
405
- }
406
- ```
407
-
408
- **Note**: No rollbacks reported in testing (100% compatibility maintained).
409
-
410
- ---
411
-
412
- ## Support
413
-
414
- - **Issues**: GitHub Issues
415
- - **Questions**: See [README-BYAN-V2.md](./README-BYAN-V2.md)
416
- - **API Docs**: See [API-BYAN-V2.md](./API-BYAN-V2.md)
417
- - **BMAD Guide**: See [BMAD-QUICK-REFERENCE.md](./BMAD-QUICK-REFERENCE.md)
418
-
419
- ---
420
-
421
- ## Checklist
422
-
423
- - [ ] Update `package.json` to `^2.1.0`
424
- - [ ] Run `npm install`
425
- - [ ] Run tests: `npm test`
426
- - [ ] (Optional) Add `bmad_features` to config
427
- - [ ] (Optional) Update code to use new methods
428
- - [ ] Deploy
429
-
430
- **Estimated Time**: 5 minutes (or less if no BMAD features needed)