create-byan-agent 2.0.1 β†’ 2.1.1

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 (240) hide show
  1. package/API-BYAN-V2.md +741 -0
  2. package/BMAD-QUICK-REFERENCE.md +370 -0
  3. package/CHANGELOG-v2.1.0.md +371 -0
  4. package/LICENSE +1 -1
  5. package/MIGRATION-v2.0-to-v2.1.md +430 -0
  6. package/README-BYAN-V2.md +446 -0
  7. package/README.md +264 -201
  8. package/install/.eslintrc.js +20 -0
  9. package/install/.prettierrc +7 -0
  10. package/install/BUGFIX-CHALK.md +173 -0
  11. package/install/BUGFIX-DOCUMENTATION-INDEX.md +299 -0
  12. package/install/BUGFIX-PATH-RESOLUTION.md +293 -0
  13. package/install/BUGFIX-QUICKSTART.md +184 -0
  14. package/install/BUGFIX-SUMMARY.txt +91 -0
  15. package/install/BUGFIX-VISUAL-SUMMARY.md +253 -0
  16. package/install/DEPLOYMENT-GUIDE-V2.md +431 -0
  17. package/install/DOCS-INDEX.md +261 -0
  18. package/install/GUIDE-INSTALLATION-BYAN-SIMPLE.md +1083 -0
  19. package/install/INSTALLER-V2-CHANGES.md +472 -0
  20. package/install/LICENSE +21 -0
  21. package/install/PUBLICATION-CHECKLIST.md +265 -0
  22. package/install/PUBLISH-GUIDE.md +190 -0
  23. package/install/QUICKSTART.md +311 -0
  24. package/install/README-NPM-PUBLISH.md +298 -0
  25. package/install/README-NPM-SHORT.md +298 -0
  26. package/install/README-NPM.md +433 -0
  27. package/install/README-RACHID.md +302 -0
  28. package/install/README-V2-INDEX.md +306 -0
  29. package/install/README.md +298 -0
  30. package/install/RESUME-EXECUTIF-YAN.md +408 -0
  31. package/install/UPDATE-SUMMARY.md +205 -0
  32. package/install/__tests__/integration/detection-flow.test.js +154 -0
  33. package/install/__tests__/platforms/claude-code.test.js +175 -0
  34. package/install/__tests__/platforms/codex.test.js +80 -0
  35. package/install/__tests__/platforms/copilot-cli.test.js +118 -0
  36. package/install/__tests__/platforms/vscode.test.js +67 -0
  37. package/install/__tests__/utils/file-utils.test.js +87 -0
  38. package/install/__tests__/utils/git-detector.test.js +80 -0
  39. package/install/__tests__/utils/logger.test.js +83 -0
  40. package/install/__tests__/utils/node-detector.test.js +71 -0
  41. package/install/__tests__/utils/os-detector.test.js +63 -0
  42. package/install/__tests__/utils/yaml-utils.test.js +85 -0
  43. package/install/__tests__/yanstaller/detector.test.js +210 -0
  44. package/install/coverage/clover.xml +219 -0
  45. package/install/coverage/coverage-final.json +13 -0
  46. package/install/coverage/lcov-report/base.css +224 -0
  47. package/install/coverage/lcov-report/block-navigation.js +87 -0
  48. package/install/coverage/lcov-report/favicon.png +0 -0
  49. package/install/coverage/lcov-report/index.html +146 -0
  50. package/install/coverage/lcov-report/lib/errors.js.html +268 -0
  51. package/install/coverage/lcov-report/lib/exit-codes.js.html +247 -0
  52. package/install/coverage/lcov-report/lib/index.html +131 -0
  53. package/install/coverage/lcov-report/lib/platforms/claude-code.js.html +343 -0
  54. package/install/coverage/lcov-report/lib/platforms/codex.js.html +361 -0
  55. package/install/coverage/lcov-report/lib/platforms/copilot-cli.js.html +454 -0
  56. package/install/coverage/lcov-report/lib/platforms/index.html +176 -0
  57. package/install/coverage/lcov-report/lib/platforms/index.js.html +127 -0
  58. package/install/coverage/lcov-report/lib/platforms/vscode.js.html +238 -0
  59. package/install/coverage/lcov-report/lib/utils/config-loader.js.html +322 -0
  60. package/install/coverage/lcov-report/lib/utils/file-utils.js.html +397 -0
  61. package/install/coverage/lcov-report/lib/utils/git-detector.js.html +190 -0
  62. package/install/coverage/lcov-report/lib/utils/index.html +206 -0
  63. package/install/coverage/lcov-report/lib/utils/logger.js.html +277 -0
  64. package/install/coverage/lcov-report/lib/utils/node-detector.js.html +259 -0
  65. package/install/coverage/lcov-report/lib/utils/os-detector.js.html +307 -0
  66. package/install/coverage/lcov-report/lib/utils/yaml-utils.js.html +346 -0
  67. package/install/coverage/lcov-report/lib/yanstaller/backuper.js.html +409 -0
  68. package/install/coverage/lcov-report/lib/yanstaller/detector.js.html +508 -0
  69. package/install/coverage/lcov-report/lib/yanstaller/index.html +236 -0
  70. package/install/coverage/lcov-report/lib/yanstaller/index.js.html +364 -0
  71. package/install/coverage/lcov-report/lib/yanstaller/installer.js.html +505 -0
  72. package/install/coverage/lcov-report/lib/yanstaller/interviewer.js.html +349 -0
  73. package/install/coverage/lcov-report/lib/yanstaller/recommender.js.html +379 -0
  74. package/install/coverage/lcov-report/lib/yanstaller/troubleshooter.js.html +352 -0
  75. package/install/coverage/lcov-report/lib/yanstaller/validator.js.html +679 -0
  76. package/install/coverage/lcov-report/lib/yanstaller/wizard.js.html +412 -0
  77. package/install/coverage/lcov-report/platforms/claude-code.js.html +343 -0
  78. package/install/coverage/lcov-report/platforms/codex.js.html +361 -0
  79. package/install/coverage/lcov-report/platforms/copilot-cli.js.html +454 -0
  80. package/install/coverage/lcov-report/platforms/index.html +176 -0
  81. package/install/coverage/lcov-report/platforms/index.js.html +127 -0
  82. package/install/coverage/lcov-report/platforms/vscode.js.html +238 -0
  83. package/install/coverage/lcov-report/prettify.css +1 -0
  84. package/install/coverage/lcov-report/prettify.js +2 -0
  85. package/install/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  86. package/install/coverage/lcov-report/sorter.js +210 -0
  87. package/install/coverage/lcov-report/utils/file-utils.js.html +397 -0
  88. package/install/coverage/lcov-report/utils/git-detector.js.html +190 -0
  89. package/install/coverage/lcov-report/utils/index.html +191 -0
  90. package/install/coverage/lcov-report/utils/logger.js.html +277 -0
  91. package/install/coverage/lcov-report/utils/node-detector.js.html +259 -0
  92. package/install/coverage/lcov-report/utils/os-detector.js.html +307 -0
  93. package/install/coverage/lcov-report/utils/yaml-utils.js.html +346 -0
  94. package/install/coverage/lcov-report/yanstaller/detector.js.html +508 -0
  95. package/install/coverage/lcov-report/yanstaller/index.html +116 -0
  96. package/install/coverage/lcov.info +414 -0
  97. package/install/install.sh +239 -0
  98. package/install/jest.config.js +33 -0
  99. package/install/lib/errors.js +61 -0
  100. package/install/lib/exit-codes.js +54 -0
  101. package/install/lib/platforms/claude-code.js +86 -0
  102. package/install/lib/platforms/codex.js +92 -0
  103. package/install/lib/platforms/copilot-cli.js +123 -0
  104. package/install/lib/platforms/index.js +14 -0
  105. package/install/lib/platforms/vscode.js +51 -0
  106. package/install/lib/utils/config-loader.js +79 -0
  107. package/install/lib/utils/file-utils.js +104 -0
  108. package/install/lib/utils/git-detector.js +35 -0
  109. package/install/lib/utils/logger.js +64 -0
  110. package/install/lib/utils/node-detector.js +58 -0
  111. package/install/lib/utils/os-detector.js +74 -0
  112. package/install/lib/utils/yaml-utils.js +87 -0
  113. package/install/lib/yanstaller/backuper.js +108 -0
  114. package/install/lib/yanstaller/detector.js +141 -0
  115. package/install/lib/yanstaller/index.js +93 -0
  116. package/install/lib/yanstaller/installer.js +140 -0
  117. package/install/lib/yanstaller/interviewer.js +88 -0
  118. package/install/lib/yanstaller/recommender.js +98 -0
  119. package/install/lib/yanstaller/troubleshooter.js +89 -0
  120. package/install/lib/yanstaller/validator.js +198 -0
  121. package/install/lib/yanstaller/wizard.js +109 -0
  122. package/install/package-npm.json +55 -0
  123. package/install/package.json +63 -0
  124. package/install/src/byan-v2/context/copilot-context.js +79 -0
  125. package/install/src/byan-v2/context/session-state.js +98 -0
  126. package/install/src/byan-v2/dispatcher/complexity-scorer.js +232 -0
  127. package/install/src/byan-v2/dispatcher/local-executor.js +221 -0
  128. package/install/src/byan-v2/dispatcher/task-router.js +122 -0
  129. package/install/src/byan-v2/dispatcher/task-tool-interface-mock.js +134 -0
  130. package/install/src/byan-v2/dispatcher/task-tool-interface.js +123 -0
  131. package/install/src/byan-v2/generation/agent-profile-validator.js +113 -0
  132. package/install/src/byan-v2/generation/profile-template.js +113 -0
  133. package/install/src/byan-v2/generation/templates/default-agent.md +49 -0
  134. package/install/src/byan-v2/generation/templates/test-template.md +1 -0
  135. package/install/src/byan-v2/index.js +199 -0
  136. package/install/src/byan-v2/observability/error-tracker.js +105 -0
  137. package/install/src/byan-v2/observability/logger.js +154 -0
  138. package/install/src/byan-v2/observability/metrics-collector.js +194 -0
  139. package/install/src/byan-v2/orchestrator/analysis-state.js +268 -0
  140. package/install/src/byan-v2/orchestrator/generation-state.js +340 -0
  141. package/install/src/byan-v2/orchestrator/interview-state.js +271 -0
  142. package/install/src/byan-v2/orchestrator/state-machine.js +204 -0
  143. package/install/src/core/cache/cache.js +126 -0
  144. package/install/src/core/context/context.js +86 -0
  145. package/install/src/core/dispatcher/dispatcher.js +135 -0
  146. package/install/src/core/worker-pool/worker-pool.js +194 -0
  147. package/install/src/core/workflow/workflow-executor.js +220 -0
  148. package/install/src/index.js +139 -0
  149. package/install/src/observability/dashboard/dashboard.js +191 -0
  150. package/install/src/observability/logger/structured-logger.js +254 -0
  151. package/install/src/observability/metrics/metrics-collector.js +325 -0
  152. package/install/switch-to-v2.sh +126 -0
  153. package/install/test-chalk-fix.sh +210 -0
  154. package/install/test-installer-v2.sh +204 -0
  155. package/install/test-path-resolution.sh +200 -0
  156. package/package.json +53 -33
  157. package/src/byan-v2/context/copilot-context.js +79 -0
  158. package/src/byan-v2/context/session-state.js +98 -0
  159. package/src/byan-v2/data/mantras.json +852 -0
  160. package/src/byan-v2/dispatcher/complexity-scorer.js +232 -0
  161. package/src/byan-v2/dispatcher/five-whys-analyzer.js +310 -0
  162. package/src/byan-v2/dispatcher/local-executor.js +221 -0
  163. package/src/byan-v2/dispatcher/task-router.js +122 -0
  164. package/src/byan-v2/dispatcher/task-tool-interface-mock.js +134 -0
  165. package/src/byan-v2/dispatcher/task-tool-interface.js +123 -0
  166. package/src/byan-v2/generation/agent-profile-validator.js +113 -0
  167. package/src/byan-v2/generation/mantra-validator.js +416 -0
  168. package/src/byan-v2/generation/profile-template.js +113 -0
  169. package/src/byan-v2/generation/templates/default-agent.md +49 -0
  170. package/src/byan-v2/generation/templates/test-template.md +1 -0
  171. package/src/byan-v2/index.js +652 -0
  172. package/src/byan-v2/integration/voice-integration.js +295 -0
  173. package/src/byan-v2/observability/error-tracker.js +105 -0
  174. package/src/byan-v2/observability/logger.js +154 -0
  175. package/src/byan-v2/observability/metrics-collector.js +194 -0
  176. package/src/byan-v2/orchestrator/active-listener.js +541 -0
  177. package/src/byan-v2/orchestrator/analysis-state.js +268 -0
  178. package/src/byan-v2/orchestrator/generation-state.js +340 -0
  179. package/src/byan-v2/orchestrator/glossary-builder.js +431 -0
  180. package/src/byan-v2/orchestrator/interview-state.js +353 -0
  181. package/src/byan-v2/orchestrator/state-machine.js +253 -0
  182. package/src/core/cache/cache.js +126 -0
  183. package/src/core/context/context.js +86 -0
  184. package/src/core/dispatcher/dispatcher.js +135 -0
  185. package/src/core/worker-pool/worker-pool.js +194 -0
  186. package/src/core/workflow/workflow-executor.js +220 -0
  187. package/src/index.js +139 -0
  188. package/src/observability/dashboard/dashboard.js +191 -0
  189. package/src/observability/logger/structured-logger.js +254 -0
  190. package/src/observability/metrics/metrics-collector.js +325 -0
  191. package/templates/.github/agents/bmad-agent-test-dynamic.md +0 -21
  192. package/templates/.github/agents/franck.md +0 -379
  193. /package/{CHANGELOG.md β†’ install/CHANGELOG.md} +0 -0
  194. /package/{bin β†’ install/bin}/create-byan-agent-backup.js +0 -0
  195. /package/{bin β†’ install/bin}/create-byan-agent-fixed.js +0 -0
  196. /package/{bin β†’ install/bin}/create-byan-agent-v2.js +0 -0
  197. /package/{bin β†’ install/bin}/create-byan-agent.js +0 -0
  198. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmad-master.md +0 -0
  199. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmb-agent-builder.md +0 -0
  200. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmb-module-builder.md +0 -0
  201. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmb-workflow-builder.md +0 -0
  202. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-analyst.md +0 -0
  203. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-architect.md +0 -0
  204. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-dev.md +0 -0
  205. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-pm.md +0 -0
  206. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +0 -0
  207. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-quinn.md +0 -0
  208. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-sm.md +0 -0
  209. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-tech-writer.md +0 -0
  210. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-bmm-ux-designer.md +0 -0
  211. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-byan-test.md +0 -0
  212. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-byan.md +0 -0
  213. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-carmack.md +0 -0
  214. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-brainstorming-coach.md +0 -0
  215. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-creative-problem-solver.md +0 -0
  216. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-design-thinking-coach.md +0 -0
  217. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-innovation-strategist.md +0 -0
  218. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-presentation-master.md +0 -0
  219. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-cis-storyteller.md +0 -0
  220. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-marc.md +0 -0
  221. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-patnote.md +0 -0
  222. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-rachid.md +0 -0
  223. /package/{templates β†’ install/templates}/.github/agents/bmad-agent-tea-tea.md +0 -0
  224. /package/{templates β†’ install/templates}/_bmad/bmb/agents/agent-builder.md +0 -0
  225. /package/{templates β†’ install/templates}/_bmad/bmb/agents/byan-test.md +0 -0
  226. /package/{templates β†’ install/templates}/_bmad/bmb/agents/byan.md +0 -0
  227. /package/{templates β†’ install/templates}/_bmad/bmb/agents/marc.md +0 -0
  228. /package/{templates β†’ install/templates}/_bmad/bmb/agents/module-builder.md +0 -0
  229. /package/{templates β†’ install/templates}/_bmad/bmb/agents/patnote.md +0 -0
  230. /package/{templates β†’ install/templates}/_bmad/bmb/agents/rachid.md +0 -0
  231. /package/{templates β†’ install/templates}/_bmad/bmb/agents/workflow-builder.md +0 -0
  232. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/data/mantras.yaml +0 -0
  233. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/data/templates.yaml +0 -0
  234. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/delete-agent-workflow.md +0 -0
  235. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/edit-agent-workflow.md +0 -0
  236. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/interview-workflow.md +0 -0
  237. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/quick-create-workflow.md +0 -0
  238. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/templates/base-agent-template.md +0 -0
  239. /package/{templates β†’ install/templates}/_bmad/bmb/workflows/byan/validate-agent-workflow.md +0 -0
  240. /package/{templates β†’ install/templates}/_bmad/core/agents/carmack.md +0 -0
@@ -0,0 +1,446 @@
1
+ # BYAN v2.0 - Intelligent Agent Creator for GitHub Copilot CLI
2
+
3
+ **BYAN** (Builder of YAN) v2.0 is a specialized GitHub Copilot CLI agent that creates custom AI agents through intelligent, structured interviews.
4
+
5
+ ## 🎯 What is BYAN?
6
+
7
+ BYAN guides you through a conversational interview to understand your needs, then automatically generates production-ready agent profiles for GitHub Copilot CLI. It applies **Merise Agile + TDD methodology** with **64 core mantras** to ensure quality and consistency.
8
+
9
+ ### Key Features
10
+
11
+ #### Core Capabilities
12
+ - **Intelligent Interview System**: 4-phase structured interview (Context β†’ Business β†’ Agent Needs β†’ Validation)
13
+ - **Automatic Profile Generation**: Creates `.md` agent files with YAML frontmatter + agent specifications
14
+ - **Built-in Validation**: Validates agent profiles against GitHub Copilot CLI requirements
15
+ - **Template System**: Flexible templates with placeholder resolution
16
+ - **Quality Enforcement**: Mantra IA-23 (Zero Emoji Pollution), clean code principles
17
+ - **State Machine Workflow**: INTERVIEW β†’ ANALYSIS β†’ GENERATION β†’ COMPLETED
18
+
19
+ #### πŸ†• BMAD Features (v2.1.0)
20
+
21
+ **NEW: 4 Advanced Modules for Enhanced Agent Creation**
22
+
23
+ 1. **πŸ“š Glossary Builder**
24
+ - Auto-builds domain-specific glossaries during interviews
25
+ - Validates definition clarity (min score: 0.7)
26
+ - Auto-triggers for complex domains (ecommerce, finance, healthcare)
27
+ - Suggests related concepts based on context
28
+ - **Tests**: 86/86 passing
29
+
30
+ 2. **πŸ” Five Whys Analyzer**
31
+ - Automated root cause analysis using "5 Whys" technique
32
+ - Detects pain points with 10+ keywords
33
+ - Asks up to 5 sequential WHY questions
34
+ - Early root cause detection at depth 3+
35
+ - Categorizes causes (technical/process/people/resource)
36
+ - **Tests**: 93/93 passing
37
+
38
+ 3. **πŸ‘‚ Active Listener**
39
+ - Intelligent response processing with reformulation
40
+ - Automatic reformulation every 3rd response
41
+ - Validates confirmations and detects ambiguity
42
+ - Analyzes session patterns
43
+ - Generates session summaries with insights
44
+ - **Tests**: 124/124 passing
45
+
46
+ 4. **βœ… Mantras Validator**
47
+ - Validates agents against 64 BMAD/IA mantras
48
+ - Category-based validation (Philosophy, Process, Quality, AI-Specific)
49
+ - Compliance scoring (target: 80%+)
50
+ - Detailed violation reports
51
+ - Self-validating (meta!)
52
+ - **Tests**: 67/67 passing
53
+
54
+ **Total BMAD Tests**: 417/417 passing (100%)
55
+
56
+ See [BMAD-QUICK-REFERENCE.md](./BMAD-QUICK-REFERENCE.md) for usage examples.
57
+
58
+ ## πŸ“¦ Installation
59
+
60
+ ### Option 1: Via NPM (RecommandΓ©)
61
+
62
+ ```bash
63
+ # Installation globale
64
+ npm install -g create-byan-agent
65
+
66
+ # OU utilisation directe avec npx
67
+ npx create-byan-agent
68
+ ```
69
+
70
+ ### Option 2: Via Git (Pour DΓ©veloppement)
71
+
72
+ ```bash
73
+ # Cloner le repository
74
+ git clone <repository-url>
75
+ cd <repository-directory>
76
+
77
+ # Installer les dΓ©pendances
78
+ npm install
79
+
80
+ # Lancer les tests
81
+ npm test
82
+ ```
83
+
84
+ ## 🎬 Quick Start
85
+
86
+ ### Utilisation via NPX
87
+
88
+ ```bash
89
+ # CrΓ©er un agent interactivement
90
+ npx create-byan-agent
91
+
92
+ # Ou utiliser l'API
93
+ node -e "
94
+ const ByanV2 = require('create-byan-agent');
95
+ const byan = new ByanV2();
96
+ byan.startSession().then(() => {
97
+ console.log('BYAN dΓ©marrΓ©!');
98
+ });
99
+ "
100
+ ```
101
+
102
+ ### Utilisation Programmatique
103
+
104
+ ```javascript
105
+ const ByanV2 = require('create-byan-agent');
106
+
107
+ // CrΓ©er une instance
108
+ const byan = new ByanV2({
109
+ maxQuestions: 12,
110
+ outputDir: './_bmad-output/bmb-creations'
111
+ });
112
+
113
+ // DΓ©marrer une session
114
+ await byan.startSession();
115
+
116
+ // Obtenir une question
117
+ const question = await byan.getNextQuestion();
118
+ console.log(question.text);
119
+
120
+ // Soumettre une rΓ©ponse
121
+ await byan.submitResponse('Ma rΓ©ponse');
122
+
123
+ // Continuer jusqu'Γ  complΓ©tion...
124
+ ```
125
+ for (let i = 0; i < 11; i++) {
126
+ const nextQuestion = await byan.getNextQuestion();
127
+ console.log(nextQuestion);
128
+ await byan.submitResponse('Your answer');
129
+ }
130
+ ```
131
+
132
+ ### 4. Generate agent profile
133
+
134
+ ```javascript
135
+ // Generate agent profile after interview
136
+ const profile = await byan.generateProfile();
137
+
138
+ // Profile is automatically saved to:
139
+ // .github/copilot/agents/<agent-name>.md
140
+ console.log('Agent profile created!');
141
+ ```
142
+
143
+ ## πŸ’‘ Usage Examples
144
+
145
+ ### Example 1: Create Code Review Agent
146
+
147
+ ```javascript
148
+ const ByanV2 = require('create-byan-agent');
149
+
150
+ async function createCodeReviewAgent() {
151
+ const byan = new ByanV2();
152
+
153
+ await byan.startSession();
154
+
155
+ // Answer interview questions
156
+ const responses = [
157
+ 'code-review-assistant',
158
+ 'An agent that reviews code for bugs and best practices',
159
+ 'Software Development',
160
+ 'Small team (1-5)',
161
+ 'Yes',
162
+ 'Code analysis, bug detection, best practices',
163
+ 'Professional and constructive',
164
+ 'Static analysis, pattern detection',
165
+ 'Markdown reports with examples',
166
+ 'Medium complexity',
167
+ 'Yes',
168
+ 'Yes'
169
+ ];
170
+
171
+ for (const response of responses) {
172
+ await byan.submitResponse(response);
173
+ }
174
+
175
+ const profile = await byan.generateProfile();
176
+ console.log('βœ… Agent created:', profile.filePath);
177
+ }
178
+
179
+ createCodeReviewAgent();
180
+ ```
181
+
182
+ ### Example 2: With BMAD Features
183
+
184
+ ```javascript
185
+ const ByanV2 = require('create-byan-agent');
186
+
187
+ async function createWithBMAD() {
188
+ const byan = new ByanV2({
189
+ bmad_features: {
190
+ glossary_builder: { enabled: true },
191
+ five_whys: { enabled: true },
192
+ active_listener: { enabled: true },
193
+ mantras_validator: { enabled: true }
194
+ }
195
+ });
196
+
197
+ await byan.startSession();
198
+
199
+ // Start glossary for ecommerce domain
200
+ const glossary = byan.startGlossary('ecommerce');
201
+ byan.addConcept('Order', 'A customer purchase request...');
202
+
203
+ // Detect pain points
204
+ const detection = byan.detectPainPoints('Slow checkout process');
205
+ if (detection.needsWhys) {
206
+ const question = byan.askWhy();
207
+ // ... 5 Whys analysis
208
+ }
209
+
210
+ // Generate and validate
211
+ const profile = await byan.generateProfile();
212
+ const validation = byan.validateAgent(profile.content);
213
+
214
+ console.log(`Score: ${validation.score * 100}%`);
215
+ }
216
+
217
+ createWithBMAD();
218
+ ```
219
+
220
+ ### Example 3: Custom Configuration
221
+
222
+ ```javascript
223
+ const byan = new ByanV2({
224
+ maxQuestions: 15,
225
+ outputDir: './my-agents',
226
+ env: 'standalone',
227
+ complexityThresholds: {
228
+ low: 25,
229
+ medium: 70
230
+ }
231
+ });
232
+ ```
233
+
234
+ ## πŸ“š Core Concepts
235
+
236
+ ### State Machine
237
+
238
+ BYAN uses a state machine to manage the workflow:
239
+
240
+ ```
241
+ INTERVIEW β†’ ANALYSIS β†’ GENERATION β†’ COMPLETED
242
+ ↓ ↓ ↓
243
+ ERROR ← ─ ─ ─ ─ ─ ─ ─ ─ ─ β”˜
244
+ ```
245
+
246
+ ### Interview Phases
247
+
248
+ 1. **CONTEXT** (Questions 1-3): Project name, description, tech stack
249
+ 2. **BUSINESS** (Questions 4-6): Domain, actors, processes
250
+ 3. **AGENT_NEEDS** (Questions 7-9): Role, capabilities, style
251
+ 4. **VALIDATION** (Questions 10-12): Confirmation, edge cases
252
+
253
+ ### Profile Structure
254
+
255
+ Generated agent profiles follow this structure:
256
+
257
+ ```markdown
258
+ ---
259
+ name: "agent-name"
260
+ description: "Brief description"
261
+ ---
262
+
263
+ You must fully embody this agent's persona...
264
+
265
+ ```xml
266
+ <agent id="agent.id" name="AgentName" title="Title" icon="πŸ”§">
267
+ <activation>...</activation>
268
+ <persona>...</persona>
269
+ <capabilities>...</capabilities>
270
+ </agent>
271
+ \```
272
+ ```
273
+
274
+ ## πŸ”§ Configuration
275
+
276
+ ### Default Configuration
277
+
278
+ ```javascript
279
+ {
280
+ maxQuestions: 12,
281
+ complexityThresholds: {
282
+ low: 30,
283
+ medium: 60
284
+ },
285
+ outputDir: './_bmad-output/bmb-creations',
286
+ env: 'copilot' // or 'standalone'
287
+ }
288
+ ```
289
+
290
+ ### Environment Variables
291
+
292
+ - `GITHUB_COPILOT=true` - Enables Copilot CLI context detection
293
+
294
+ ## πŸ§ͺ Testing
295
+
296
+ ```bash
297
+ # Run all tests
298
+ npm test
299
+
300
+ # Run specific test suite
301
+ npm test -- __tests__/byan-v2/context
302
+
303
+ # Run with coverage
304
+ npm test -- --coverage
305
+ ```
306
+
307
+ **Current Test Status**:
308
+ - **Total**: 1,308 tests passing (100%)
309
+ - **Core v2.0**: 891/891 passing
310
+ - **BMAD v2.1**: 417/417 passing
311
+ - **Coverage**: 95%+
312
+
313
+ ## πŸ“– API Reference
314
+
315
+ See [API.md](./API.md) for complete API documentation.
316
+
317
+ ### ByanV2
318
+
319
+ Main class for BYAN v2 operations.
320
+
321
+ **Methods:**
322
+ - `constructor(config)` - Initialize BYAN with optional config
323
+ - `startSession()` - Start new interview session
324
+ - `getNextQuestion()` - Get next interview question
325
+ - `submitResponse(response)` - Submit response to current question
326
+ - `generateProfile()` - Generate agent profile after interview
327
+ - `endSession()` - End current session
328
+ - `getMetricsSummary()` - Get session metrics
329
+ - `isCopilotContext()` - Check if running in Copilot CLI
330
+
331
+ ### AgentProfileValidator
332
+
333
+ Validate agent profile files.
334
+
335
+ **Methods:**
336
+ - `validate(profileContent)` - Validate profile content
337
+ - `validateYamlFrontmatter(content)` - Validate YAML frontmatter
338
+ - `validateNameFormat(name)` - Validate agent name format
339
+ - `detectEmojis(text)` - Detect emoji pollution
340
+
341
+ ### ProfileTemplate
342
+
343
+ Template rendering system.
344
+
345
+ **Methods:**
346
+ - `render(template, data)` - Render template with data
347
+ - `loadTemplate(templateName)` - Load template from file
348
+ - `renderFromFile(templateName, data)` - Load and render template
349
+ - `validateTemplate(template, requiredPlaceholders)` - Validate template
350
+ - `extractPlaceholders(template)` - Extract placeholders from template
351
+
352
+ ## ⚠️ Troubleshooting
353
+
354
+ ### Issue: Tests failing with winston errors
355
+
356
+ **Solution**: Ensure winston is installed:
357
+ ```bash
358
+ npm install winston
359
+ ```
360
+
361
+ ### Issue: UUID import errors
362
+
363
+ **Solution**: BYAN v2 uses crypto.randomUUID() (Node 18+). Ensure Node version >= 18.
364
+
365
+ ### Issue: Agent profile not validated
366
+
367
+ **Solution**: Check profile follows format:
368
+ - Valid YAML frontmatter with `name` and `description`
369
+ - Name format: lowercase, alphanumeric, hyphens only
370
+ - Description: 10-200 characters
371
+ - No emojis (Mantra IA-23)
372
+ - File size < 50KB
373
+
374
+ ## 🀝 Contributing
375
+
376
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for development guidelines.
377
+
378
+ ### Development Setup
379
+
380
+ ```bash
381
+ # Clone repo
382
+ git clone <repository-url>
383
+
384
+ # Install dependencies
385
+ npm install
386
+
387
+ # Run tests in watch mode
388
+ npm test -- --watch
389
+
390
+ # Check code style
391
+ npm run lint
392
+ ```
393
+
394
+ ### Running in Development
395
+
396
+ ```bash
397
+ # Start development mode
398
+ npm run dev
399
+
400
+ # Run single test file
401
+ npm test -- __tests__/byan-v2/integration/system-integration.test.js
402
+ ```
403
+
404
+ ## πŸ“ Architecture
405
+
406
+ See [ARCHITECTURE.md](./ARCHITECTURE.md) for detailed architecture documentation.
407
+
408
+ ### High-Level Components
409
+
410
+ ```
411
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
412
+ β”‚ ByanV2 Main β”‚
413
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
414
+ β”‚
415
+ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
416
+ β”‚ β”‚
417
+ β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
418
+ β”‚ Session β”‚ β”‚ State β”‚
419
+ β”‚ State β”‚ β”‚ Machine β”‚
420
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
421
+ β”‚
422
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
423
+ β”‚ β”‚ β”‚
424
+ β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
425
+ β”‚Interviewβ”‚ β”‚Analysisβ”‚ β”‚Generation β”‚
426
+ β”‚ State β”‚ β”‚ State β”‚ β”‚ State β”‚
427
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
428
+ ```
429
+
430
+ ## πŸ“„ License
431
+
432
+ See LICENSE file for details.
433
+
434
+ ## πŸ™ Credits
435
+
436
+ Built with:
437
+ - **Merise Agile + TDD** methodology
438
+ - **64 Core Mantras** for quality
439
+ - **Zero Trust** principle (Challenge Before Confirm)
440
+ - **Mantra IA-23**: Zero Emoji Pollution
441
+
442
+ ---
443
+
444
+ **Version**: 2.0.0-alpha
445
+ **Status**: MVP Complete (64/77 SP delivered)
446
+ **Test Coverage**: 95% (492/517 tests passing)