create-byan-agent 1.0.1 → 1.0.3

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 (43) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +54 -6
  3. package/bin/create-byan-agent-backup.js +220 -0
  4. package/bin/create-byan-agent-fixed.js +301 -0
  5. package/bin/create-byan-agent.js +111 -30
  6. package/package.json +12 -5
  7. package/templates/.github/agents/bmad-agent-bmad-master.md +15 -0
  8. package/templates/.github/agents/bmad-agent-bmb-agent-builder.md +15 -0
  9. package/templates/.github/agents/bmad-agent-bmb-module-builder.md +15 -0
  10. package/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +15 -0
  11. package/templates/.github/agents/bmad-agent-bmm-analyst.md +15 -0
  12. package/templates/.github/agents/bmad-agent-bmm-architect.md +15 -0
  13. package/templates/.github/agents/bmad-agent-bmm-dev.md +15 -0
  14. package/templates/.github/agents/bmad-agent-bmm-pm.md +15 -0
  15. package/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +15 -0
  16. package/templates/.github/agents/bmad-agent-bmm-quinn.md +15 -0
  17. package/templates/.github/agents/bmad-agent-bmm-sm.md +15 -0
  18. package/templates/.github/agents/bmad-agent-bmm-tech-writer.md +15 -0
  19. package/templates/.github/agents/bmad-agent-bmm-ux-designer.md +15 -0
  20. package/templates/.github/agents/bmad-agent-byan.md +224 -0
  21. package/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +15 -0
  22. package/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +15 -0
  23. package/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +15 -0
  24. package/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +15 -0
  25. package/templates/.github/agents/bmad-agent-cis-presentation-master.md +15 -0
  26. package/templates/.github/agents/bmad-agent-cis-storyteller.md +15 -0
  27. package/templates/.github/agents/bmad-agent-marc.md +48 -0
  28. package/templates/.github/agents/bmad-agent-rachid.md +47 -0
  29. package/templates/.github/agents/bmad-agent-tea-tea.md +15 -0
  30. package/templates/_bmad/bmb/agents/agent-builder.md +59 -0
  31. package/templates/_bmad/bmb/agents/byan.md +215 -0
  32. package/templates/_bmad/bmb/agents/marc.md +303 -0
  33. package/templates/_bmad/bmb/agents/module-builder.md +60 -0
  34. package/templates/_bmad/bmb/agents/rachid.md +184 -0
  35. package/templates/_bmad/bmb/agents/workflow-builder.md +61 -0
  36. package/templates/_bmad/bmb/workflows/byan/data/mantras.yaml +272 -0
  37. package/templates/_bmad/bmb/workflows/byan/data/templates.yaml +59 -0
  38. package/templates/_bmad/bmb/workflows/byan/delete-agent-workflow.md +657 -0
  39. package/templates/_bmad/bmb/workflows/byan/edit-agent-workflow.md +688 -0
  40. package/templates/_bmad/bmb/workflows/byan/interview-workflow.md +753 -0
  41. package/templates/_bmad/bmb/workflows/byan/quick-create-workflow.md +450 -0
  42. package/templates/_bmad/bmb/workflows/byan/templates/base-agent-template.md +79 -0
  43. package/templates/_bmad/bmb/workflows/byan/validate-agent-workflow.md +676 -0
@@ -0,0 +1,753 @@
1
+ # BYAN Interview Workflow
2
+
3
+ **Workflow:** Intelligent Agent Creation Interview
4
+ **Duration:** 30-45 minutes
5
+ **Phases:** 4 (Contexte → Métier → Agent → Validation)
6
+ **Methodology:** Merise Agile + TDD + 64 Mantras
7
+
8
+ ---
9
+
10
+ ## WORKFLOW OVERVIEW
11
+
12
+ This workflow conducts a structured interview to create high-quality specialized agents with complete project context and business documentation.
13
+
14
+ **Mantras Applied:**
15
+ - Mantra IA-1: Trust But Verify
16
+ - Mantra IA-16: Challenge Before Confirm
17
+ - Mantra #37: Rasoir d'Ockham (start simple)
18
+ - Mantra #39: Évaluation des Conséquences
19
+ - Mantra #33: Data Dictionary First
20
+
21
+ **Output:**
22
+ 1. ProjectContext with business documentation
23
+ 2. AgentSpec validated against 64 mantras
24
+ 3. AgentFile(s) for target platform(s)
25
+
26
+ ---
27
+
28
+ ## PHASE 1: PROJECT CONTEXT (15-30 min)
29
+
30
+ ### Objectives
31
+ - Understand project landscape
32
+ - Identify technical stack and constraints
33
+ - Map team capabilities
34
+ - Discover main pain points
35
+
36
+ ### Questions to Ask
37
+
38
+ **1. Project Basics:**
39
+ ```
40
+ "Tell me about your project:
41
+ - What's the project name?
42
+ - What problem does it solve?
43
+ - What's the current maturity level? (idea / MVP / development / production)
44
+ "
45
+ ```
46
+
47
+ **2. Technical Stack:**
48
+ ```
49
+ "What technologies are you using?
50
+ - Backend: (languages, frameworks, databases)
51
+ - Frontend: (frameworks, libraries)
52
+ - Infrastructure: (cloud, containers, CI/CD)
53
+ - Any constraints or mandatory technologies?
54
+ "
55
+ ```
56
+
57
+ **3. Team Context:**
58
+ ```
59
+ "Tell me about your team:
60
+ - How many developers?
61
+ - What are their skill levels and specializations?
62
+ - Are you solo or working in a team?
63
+ - What development methodology do you use? (Agile, Scrum, etc.)
64
+ "
65
+ ```
66
+
67
+ **4. Pain Points (Apply 5 Whys here!):**
68
+ ```
69
+ "What are the main challenges or pain points you're facing?
70
+ - What slows down development?
71
+ - What causes the most bugs or issues?
72
+ - What repetitive tasks frustrate the team?
73
+
74
+ [For the most critical pain point, apply 5 Whys:]
75
+ - WHY is this a problem?
76
+ - WHY does that happen?
77
+ - WHY is that the case?
78
+ - WHY hasn't it been fixed?
79
+ - WHY is that the root cause?
80
+ "
81
+ ```
82
+
83
+ **5. Goals & Success Criteria:**
84
+ ```
85
+ "What would success look like?
86
+ - What should this agent help you accomplish?
87
+ - How will you know it's working well?
88
+ - Any specific metrics or outcomes you're tracking?
89
+ "
90
+ ```
91
+
92
+ ### Active Listening Techniques
93
+
94
+ **ALWAYS reformulate user answers:**
95
+ ```
96
+ "So if I understand correctly, you're working on a [PROJECT] that [DESCRIPTION],
97
+ using [STACK], with a team of [SIZE] developers who are [SKILLS LEVEL].
98
+ Your main challenge is [PAIN POINT] because [ROOT CAUSE].
99
+ Did I get that right?"
100
+ ```
101
+
102
+ **Use YES AND to build on ideas:**
103
+ ```
104
+ User: "We need help with API documentation"
105
+ BYAN: "YES, API documentation is crucial, AND would it also help to have
106
+ automated tests for those APIs to keep docs in sync?"
107
+ ```
108
+
109
+ **Challenge Before Confirm:**
110
+ ```
111
+ If user says: "We need an agent that does everything"
112
+ BYAN: "I'm hearing you want comprehensive coverage, but let me challenge that
113
+ - wouldn't a specialized agent that does ONE thing exceptionally well be more
114
+ valuable than a generalist that does many things poorly? What's the ONE most
115
+ critical capability you need?"
116
+ ```
117
+
118
+ ### Output of Phase 1
119
+
120
+ Store in session:
121
+ ```json
122
+ {
123
+ "project_name": "string",
124
+ "project_description": "string",
125
+ "domain": "string",
126
+ "subdomain": "string | null",
127
+ "stack_tech": {
128
+ "backend": [],
129
+ "frontend": [],
130
+ "infrastructure": [],
131
+ "databases": [],
132
+ "constraints": []
133
+ },
134
+ "team_size": number,
135
+ "team_skills": [],
136
+ "maturity_level": "idea|mvp|dev|prod",
137
+ "pain_points": [],
138
+ "root_cause": "string (from 5 Whys)",
139
+ "goals": [],
140
+ "success_criteria": []
141
+ }
142
+ ```
143
+
144
+ ---
145
+
146
+ ## PHASE 2: BUSINESS/DOMAIN (15-20 min)
147
+
148
+ ### Objectives
149
+ - Deep dive into business domain
150
+ - Create business glossary (minimum 5 concepts)
151
+ - Identify actors, processes, business rules
152
+ - Document edge cases
153
+
154
+ ### Questions to Ask
155
+
156
+ **1. Business Domain:**
157
+ ```
158
+ "Let's dive into your business domain:
159
+ - What industry or sector is this? (e-commerce, fintech, healthcare, etc.)
160
+ - What are the core business activities?
161
+ - Who are your users/customers?
162
+ - What value do you provide them?
163
+ "
164
+ ```
165
+
166
+ **2. Interactive Glossary Creation (CRITICAL!):**
167
+ ```
168
+ "I'm going to help you build a business glossary - a shared vocabulary
169
+ that the agent will understand. This is Mantra #33: Data Dictionary First.
170
+
171
+ Let's identify the key concepts in your domain. I need at least 5, but
172
+ more is better. For each concept, tell me:
173
+ - The name (as you call it in your team)
174
+ - A clear definition
175
+ - Any synonyms or related terms
176
+ - Examples if helpful
177
+
178
+ Example concepts might be:
179
+ - In e-commerce: Product, Cart, Order, Customer, Inventory
180
+ - In fintech: Account, Transaction, Balance, Transfer, Reconciliation
181
+ - In healthcare: Patient, Appointment, Prescription, Diagnosis, Treatment
182
+
183
+ What are YOUR domain's core concepts?"
184
+ ```
185
+
186
+ **Interactive process:**
187
+ ```
188
+ For each concept:
189
+ 1. User provides name + definition
190
+ 2. BYAN reformulates to ensure understanding
191
+ 3. BYAN challenges if definition is vague
192
+ 4. BYAN suggests related concepts user might have missed
193
+
194
+ Example:
195
+ User: "We have Orders"
196
+ BYAN: "What exactly is an Order in your system? When does something
197
+ become an Order vs a Cart or a Quote?"
198
+ User: "An Order is created when a customer completes checkout"
199
+ BYAN: "Got it. So Order = finalized purchase with payment confirmed.
200
+ Do you also have concepts like OrderLine (items in order), OrderStatus,
201
+ or Fulfillment?"
202
+ ```
203
+
204
+ **Validate glossary completeness:**
205
+ ```
206
+ After 5+ concepts:
207
+ "Let's validate our glossary. I have:
208
+ 1. [Concept 1]: [Definition]
209
+ 2. [Concept 2]: [Definition]
210
+ ...
211
+
212
+ Are these definitions accurate? Any concepts missing? Could someone
213
+ new to your project understand your domain with these definitions?"
214
+ ```
215
+
216
+ **3. Actors & Roles:**
217
+ ```
218
+ "Who interacts with your system?
219
+ - External actors (users, customers, admins, systems)
220
+ - Internal actors (team roles)
221
+ - What permissions/capabilities does each actor have?
222
+ "
223
+ ```
224
+
225
+ **4. Business Processes:**
226
+ ```
227
+ "What are the main business processes or workflows?
228
+ - What's the happy path?
229
+ - What are the critical user journeys?
230
+ - Any complex or error-prone processes?
231
+ "
232
+ ```
233
+
234
+ **5. Business Rules:**
235
+ ```
236
+ "What are the non-negotiable business rules?
237
+ - Validation rules (e.g., 'email must be unique')
238
+ - Business logic (e.g., 'discount max 20%')
239
+ - Regulatory requirements (GDPR, HIPAA, etc.)
240
+ "
241
+ ```
242
+
243
+ **6. Edge Cases & Constraints:**
244
+ ```
245
+ "What are the tricky edge cases or constraints?
246
+ - What breaks the system?
247
+ - What scenarios cause the most bugs?
248
+ - Any known limitations?
249
+ "
250
+ ```
251
+
252
+ ### Output of Phase 2
253
+
254
+ Store in ProjectContext:
255
+ ```json
256
+ {
257
+ "glossaire": {
258
+ "concept1": {
259
+ "definition": "string",
260
+ "synonyms": [],
261
+ "examples": []
262
+ },
263
+ "concept2": {...},
264
+ // minimum 5 concepts
265
+ },
266
+ "acteurs": [
267
+ {
268
+ "name": "string",
269
+ "type": "external|internal|system",
270
+ "permissions": [],
271
+ "description": "string"
272
+ }
273
+ ],
274
+ "processus_metier": [
275
+ {
276
+ "name": "string",
277
+ "description": "string",
278
+ "steps": [],
279
+ "criticity": "low|medium|high|critical"
280
+ }
281
+ ],
282
+ "regles_gestion": [
283
+ {
284
+ "id": "RG-001",
285
+ "description": "string",
286
+ "priority": "low|medium|high|critical",
287
+ "regulatory": boolean
288
+ }
289
+ ],
290
+ "edge_cases": []
291
+ }
292
+ ```
293
+
294
+ **Validate RG-PRJ-002:** Glossaire must have >= 5 concepts
295
+
296
+ ---
297
+
298
+ ## PHASE 3: AGENT NEEDS (10-15 min)
299
+
300
+ ### Objectives
301
+ - Define agent role and responsibilities
302
+ - Identify required knowledge and capabilities
303
+ - Select mantras to prioritize
304
+ - Specify communication style
305
+ - Define use cases
306
+
307
+ ### Questions to Ask
308
+
309
+ **1. Agent Role:**
310
+ ```
311
+ "What role should this agent play?
312
+ - Think of it as hiring a team member - what's their job title?
313
+ - What are they responsible for?
314
+ - What decisions can they make autonomously?
315
+ - When should they ask for human input?
316
+
317
+ Examples:
318
+ - 'Backend API Expert' - responsible for API design, validation, error handling
319
+ - 'Database Architect' - responsible for schema design, migrations, optimization
320
+ - 'Testing Specialist' - responsible for test strategy, coverage, quality
321
+ "
322
+ ```
323
+
324
+ **2. Required Knowledge:**
325
+ ```
326
+ "What must this agent know to be effective?
327
+
328
+ Business Knowledge:
329
+ - Which concepts from our glossary are critical?
330
+ - Which business rules must they enforce?
331
+ - Which processes must they understand deeply?
332
+
333
+ Technical Knowledge:
334
+ - Languages, frameworks, tools they'll work with
335
+ - Architectures, patterns, best practices
336
+ - Specific APIs, libraries, or systems
337
+ "
338
+ ```
339
+
340
+ **3. Capabilities (Minimum 3!):**
341
+ ```
342
+ "What capabilities should this agent have? I need at least 3 specific capabilities.
343
+
344
+ Think in terms of:
345
+ - What can they CREATE? (code, tests, docs, configs)
346
+ - What can they ANALYZE? (code quality, performance, security)
347
+ - What can they REVIEW? (PRs, designs, architectures)
348
+ - What can they OPTIMIZE? (queries, algorithms, workflows)
349
+ - What can they TEACH? (patterns, best practices, conventions)
350
+
351
+ Example capabilities:
352
+ - 'Generate RESTful API endpoints with validation'
353
+ - 'Review database migrations for performance impacts'
354
+ - 'Create comprehensive test suites with edge cases'
355
+ - 'Analyze code for security vulnerabilities'
356
+ "
357
+ ```
358
+
359
+ **Validate RG-AGT-002:** At least 3 capabilities defined
360
+
361
+ **4. Mantras to Prioritize (Minimum 5!):**
362
+ ```
363
+ "From our 64 mantras, which ones should this agent prioritize?
364
+
365
+ I'll suggest some based on your needs, and you tell me if they fit:
366
+
367
+ For Backend work:
368
+ - Mantra #4: Fail Fast, Fail Visible (error handling)
369
+ - Mantra #7: Keep It Simple, Stupid (KISS)
370
+ - Mantra #20: Performance is a Feature (from Sprint 0)
371
+ - Mantra #37: Rasoir d'Ockham (simplicity first)
372
+ - Mantra IA-3: Explain Reasoning (transparent decisions)
373
+
374
+ For Testing work:
375
+ - Mantra #18: TDD is Not Optional
376
+ - Mantra #19: Test the Behavior, Not Implementation
377
+ - Mantra #39: Évaluation des Conséquences
378
+ - Mantra IA-16: Challenge Before Confirm
379
+
380
+ Which of these resonate? Any others you want to add?
381
+ "
382
+ ```
383
+
384
+ **Validate RG-AGT-003:** At least 5 mantras selected
385
+
386
+ **5. Communication Style:**
387
+ ```
388
+ "How should this agent communicate?
389
+ - Formal and technical, or friendly and conversational?
390
+ - Verbose explanations, or concise and direct?
391
+ - Should it use analogies and examples?
392
+ - Any communication preferences or styles to avoid?
393
+ "
394
+ ```
395
+
396
+ **6. Use Cases (Minimum 3!):**
397
+ ```
398
+ "Give me 3+ concrete examples of when you'd use this agent:
399
+
400
+ Example format:
401
+ - 'As a developer, I want the agent to review my API design and suggest improvements'
402
+ - 'As a team lead, I want the agent to generate test cases for a new feature'
403
+ - 'As a junior dev, I want the agent to explain why my query is slow'
404
+
405
+ What are YOUR use cases?"
406
+ ```
407
+
408
+ **Validate RG-AGT-004:** At least 3 use cases defined
409
+
410
+ ### Output of Phase 3
411
+
412
+ Store in AgentSpec (draft):
413
+ ```json
414
+ {
415
+ "agent_name": "string (kebab-case)",
416
+ "role": "string",
417
+ "responsibilities": [],
418
+ "knowledge_business": [],
419
+ "knowledge_technical": [],
420
+ "capabilities": [
421
+ {
422
+ "id": "string",
423
+ "description": "string",
424
+ "category": "create|analyze|review|optimize|teach"
425
+ }
426
+ // minimum 3
427
+ ],
428
+ "mantras_applied": [
429
+ {
430
+ "mantra_id": number,
431
+ "mantra_name": "string",
432
+ "priority": "critical|high|medium|low"
433
+ }
434
+ // minimum 5
435
+ ],
436
+ "communication_style": "string",
437
+ "use_cases": [
438
+ {
439
+ "scenario": "string",
440
+ "expected_behavior": "string"
441
+ }
442
+ // minimum 3
443
+ ],
444
+ "status": "draft"
445
+ }
446
+ ```
447
+
448
+ ---
449
+
450
+ ## PHASE 4: VALIDATION & CO-CREATION (10 min)
451
+
452
+ ### Objectives
453
+ - Synthesize all information collected
454
+ - Challenge inconsistencies (Zero Trust!)
455
+ - Validate with user
456
+ - Create final ProjectContext
457
+ - Finalize AgentSpec
458
+
459
+ ### Process
460
+
461
+ **1. Complete Synthesis:**
462
+ ```
463
+ "Let me synthesize everything we've discussed:
464
+
465
+ PROJECT CONTEXT:
466
+ - Project: [NAME] - [DESCRIPTION]
467
+ - Domain: [DOMAIN]
468
+ - Stack: [TECH STACK]
469
+ - Team: [SIZE] developers, [SKILLS]
470
+ - Maturity: [LEVEL]
471
+ - Main Pain Point: [PAIN] caused by [ROOT CAUSE]
472
+
473
+ BUSINESS DOCUMENTATION:
474
+ - Glossary: [N] concepts defined
475
+ - [List key concepts]
476
+ - Actors: [N] actors identified
477
+ - Processes: [N] business processes documented
478
+ - Rules: [N] business rules captured
479
+
480
+ AGENT SPECIFICATION:
481
+ - Role: [ROLE]
482
+ - Capabilities: [N] capabilities
483
+ - [List capabilities]
484
+ - Knowledge: [BUSINESS + TECHNICAL]
485
+ - Mantras: [N] mantras prioritized
486
+ - [List key mantras]
487
+ - Use Cases: [N] use cases
488
+ - [List use cases]
489
+
490
+ Does this accurately capture everything?"
491
+ ```
492
+
493
+ **2. Challenge Before Confirm (Mantra IA-16):**
494
+
495
+ Actively look for:
496
+ - **Inconsistencies:**
497
+ ```
498
+ "You said the team is junior, but want an agent that assumes advanced knowledge.
499
+ Should we adjust the agent's communication style to be more educational?"
500
+ ```
501
+
502
+ - **Over-scoping:**
503
+ ```
504
+ "I'm seeing 8 capabilities, which might make this agent unfocused.
505
+ Following Mantra #37 (Ockham's Razor), should we start with the 3 most
506
+ critical capabilities and iterate?"
507
+ ```
508
+
509
+ - **Under-scoping:**
510
+ ```
511
+ "You want this agent to handle API design, but didn't mention validation
512
+ or error handling. Are those implicit, or should we add them explicitly?"
513
+ ```
514
+
515
+ - **Vague definitions:**
516
+ ```
517
+ "The capability 'improve code quality' is too vague. Do you mean:
518
+ - Static analysis for bugs?
519
+ - Refactoring suggestions?
520
+ - Performance optimization?
521
+ Let's be more specific."
522
+ ```
523
+
524
+ - **Missing context:**
525
+ ```
526
+ "You mentioned GDPR compliance is critical, but the agent has no capability
527
+ related to privacy or data protection. Should we add that?"
528
+ ```
529
+
530
+ **3. Consequences Evaluation (Mantra #39):**
531
+ ```
532
+ "Before I create this agent, let me evaluate potential consequences:
533
+
534
+ POSITIVE IMPACTS:
535
+ - [List expected benefits]
536
+
537
+ POTENTIAL RISKS:
538
+ - [List potential issues, e.g., 'Agent might generate overly complex code']
539
+ - [List limitations, e.g., 'Agent won't understand legacy codebase initially']
540
+
541
+ MITIGATION:
542
+ - [Suggest ways to address risks]
543
+
544
+ Are you comfortable with these trade-offs?"
545
+ ```
546
+
547
+ **4. Final Validation:**
548
+ ```
549
+ "I'm ready to create your agent with these specifications.
550
+
551
+ Last chance to make changes:
552
+ - Anything to add?
553
+ - Anything to remove?
554
+ - Anything to clarify?
555
+
556
+ Should I proceed? (yes/no)"
557
+ ```
558
+
559
+ **5. Create ProjectContext:**
560
+
561
+ Execute:
562
+ ```python
563
+ context = ProjectContext.create(
564
+ session_id=session.id,
565
+ project_name=session.project_name,
566
+ project_description=session.answers['project_description'],
567
+ domain=session.answers['domain'],
568
+ # ... all Phase 1 & 2 data
569
+ )
570
+
571
+ # Validate RG-PRJ-001: Unique project name
572
+ # Validate RG-PRJ-002: Glossaire >= 5 concepts
573
+
574
+ context.save()
575
+ ```
576
+
577
+ **6. Finalize AgentSpec:**
578
+
579
+ Execute:
580
+ ```python
581
+ agent_spec = AgentSpec.create(
582
+ context_id=context.id,
583
+ agent_name=session.answers['agent_name'],
584
+ # ... all Phase 3 data
585
+ )
586
+
587
+ # Validate RG-AGT-001: Unique agent name
588
+ # Validate RG-AGT-002: >= 3 capabilities
589
+ # Validate RG-AGT-003: >= 5 mantras
590
+ # Validate RG-AGT-004: >= 3 use cases
591
+
592
+ agent_spec.validate() # Status: draft → validated
593
+ agent_spec.save()
594
+ ```
595
+
596
+ **7. Next Steps Presentation:**
597
+ ```
598
+ "Agent specification created successfully!
599
+
600
+ WHAT'S BEEN CREATED:
601
+ - ProjectContext with business documentation saved
602
+ - AgentSpec validated against all rules
603
+ - Ready for file generation
604
+
605
+ NEXT STEPS:
606
+ 1. Generate agent file(s) for your platform(s)
607
+ - GitHub Copilot CLI
608
+ - VSCode
609
+ - Claude Code
610
+ - Codex
611
+
612
+ 2. Review and test the generated agent
613
+
614
+ 3. Iterate and improve based on usage
615
+
616
+ Which platform(s) should I generate files for? (or type 'all')"
617
+ ```
618
+
619
+ ### Output of Phase 4
620
+
621
+ Final validated:
622
+ - ProjectContext (saved to DB + exported to YAML/JSON)
623
+ - AgentSpec (saved to DB, status: validated)
624
+ - Ready for file generation
625
+
626
+ ---
627
+
628
+ ## ERROR HANDLING
629
+
630
+ **If validation fails:**
631
+ ```
632
+ "I found issues with the specifications:
633
+
634
+ CRITICAL ISSUES:
635
+ - [List critical issues, e.g., 'Glossary has only 3 concepts, need at least 5']
636
+
637
+ WARNINGS:
638
+ - [List warnings, e.g., 'Agent has no security-related mantra']
639
+
640
+ MANTRA VIOLATED:
641
+ - [Which mantra was violated and why it matters]
642
+
643
+ We need to fix the critical issues before proceeding. Let's address them:
644
+ [Go back to relevant phase]
645
+ "
646
+ ```
647
+
648
+ **If user is uncertain:**
649
+ ```
650
+ "I'm sensing some uncertainty. That's totally fine - better to get it right
651
+ than rush.
652
+
653
+ Would you like to:
654
+ 1. Take a break and come back later (I'll save our progress)
655
+ 2. Focus on a smaller scope for V1
656
+ 3. Discuss the unclear parts more
657
+ 4. Start over with a clearer vision
658
+
659
+ What would help?"
660
+ ```
661
+
662
+ **If scope is too large:**
663
+ ```
664
+ "STOP! Red flag here. 🚩
665
+
666
+ Following Mantra #37 (Ockham's Razor), I'm concerned this agent is trying
667
+ to do too much. Large scope = high complexity = harder to maintain =
668
+ lower quality.
669
+
670
+ Let me challenge you: What's the ONE most valuable capability?
671
+
672
+ Let's create an MVP agent that does ONE thing exceptionally well, then
673
+ iterate. We can always add capabilities later.
674
+
675
+ Which ONE capability is most critical?"
676
+ ```
677
+
678
+ ---
679
+
680
+ ## DELIVERABLES
681
+
682
+ After completing all 4 phases:
683
+
684
+ **1. ProjectContext File:** `{output_folder}/project-context-{project_name}.yaml`
685
+ ```yaml
686
+ project_name: "ecommerce-b2b"
687
+ domain: "E-commerce B2B"
688
+ glossaire:
689
+ product: "Physical or digital item sold"
690
+ # ... minimum 5 concepts
691
+ acteurs:
692
+ - name: "buyer"
693
+ type: "external"
694
+ # ... all business documentation
695
+ ```
696
+
697
+ **2. AgentSpec File:** `{output_folder}/agent-spec-{agent_name}.yaml`
698
+ ```yaml
699
+ agent_name: "backend-api-expert"
700
+ role: "Backend API Specialist"
701
+ capabilities:
702
+ - id: "generate-api"
703
+ description: "Generate RESTful API endpoints"
704
+ # ... minimum 3 capabilities
705
+ mantras_applied:
706
+ - mantra_id: 37
707
+ mantra_name: "Rasoir d'Ockham"
708
+ # ... minimum 5 mantras
709
+ status: "validated"
710
+ ```
711
+
712
+ **3. Interview Summary:** `{output_folder}/interview-summary-{timestamp}.md`
713
+ - Full transcript
714
+ - Decisions made
715
+ - Validations performed
716
+ - Next steps
717
+
718
+ ---
719
+
720
+ ## SUCCESS CRITERIA
721
+
722
+ ✅ All 4 phases completed
723
+ ✅ RG-PRJ-002: Glossaire >= 5 concepts
724
+ ✅ RG-AGT-002: >= 3 capabilities
725
+ ✅ RG-AGT-003: >= 5 mantras
726
+ ✅ RG-AGT-004: >= 3 use cases
727
+ ✅ All validations passed
728
+ ✅ User confirmed final specs
729
+ ✅ ProjectContext created
730
+ ✅ AgentSpec created and validated
731
+
732
+ ---
733
+
734
+ ## WORKFLOW COMPLETION
735
+
736
+ After Phase 4 validation, BYAN should:
737
+
738
+ 1. Save all artifacts to `{output_folder}`
739
+ 2. Update session status to "completed"
740
+ 3. Present user with next steps (file generation)
741
+ 4. Offer to proceed immediately or exit
742
+
743
+ ```
744
+ "Interview complete! 🎉
745
+
746
+ All specifications validated and saved.
747
+
748
+ Ready to generate agent files?
749
+ - Type the platform name (copilot / vscode / claude / codex)
750
+ - Or type 'all' for all platforms
751
+ - Or type 'later' to exit and generate files later
752
+ "
753
+ ```