create-byan-agent 2.4.6 → 2.5.0

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * LevelScorer - Scores a fact's confidence based on its proof level
3
+ *
4
+ * LEVEL-1 : Official spec / RFC / Primary documentation → 95
5
+ * LEVEL-2 : Reproducible benchmark / Executable code → 80
6
+ * LEVEL-3 : Peer-reviewed article / Independent source → 65
7
+ * LEVEL-4 : Community consensus (> 1000 votes) → 50
8
+ * LEVEL-5 : Opinion / Personal experience → 20
9
+ */
10
+
11
+ const LEVEL_SCORES = { 1: 95, 2: 80, 3: 65, 4: 50, 5: 20 };
12
+
13
+ const STRICT_DOMAIN_MIN_LEVEL = {
14
+ security: 2,
15
+ performance: 2,
16
+ compliance: 1
17
+ };
18
+
19
+ class LevelScorer {
20
+ score(level) {
21
+ if (!Number.isInteger(level) || level < 1 || level > 5) {
22
+ throw new Error('Level must be an integer between 1 and 5');
23
+ }
24
+ return LEVEL_SCORES[level];
25
+ }
26
+
27
+ isBlockedInDomain(level, domain) {
28
+ const minLevel = STRICT_DOMAIN_MIN_LEVEL[domain];
29
+ if (!minLevel) return false;
30
+ return level > minLevel;
31
+ }
32
+
33
+ describeLevel(level) {
34
+ const descriptions = {
35
+ 1: 'Official spec / RFC / Primary documentation',
36
+ 2: 'Reproducible benchmark / Executable proof',
37
+ 3: 'Peer-reviewed / Independent source',
38
+ 4: 'Community consensus',
39
+ 5: 'Opinion / Personal experience'
40
+ };
41
+ return descriptions[level] || 'Unknown level';
42
+ }
43
+ }
44
+
45
+ module.exports = LevelScorer;
@@ -6,11 +6,13 @@
6
6
  */
7
7
 
8
8
  const Logger = require('../observability/logger');
9
+ const FactChecker = require('../fact-check/index');
9
10
 
10
11
  class GlossaryBuilder {
11
- constructor(sessionState, logger = null) {
12
+ constructor(sessionState, logger = null, factChecker = null) {
12
13
  this.sessionState = sessionState;
13
14
  this.logger = logger || new Logger('glossary-builder');
15
+ this.factChecker = factChecker || new FactChecker({ output_fact_sheet: false }, sessionState);
14
16
  this.concepts = [];
15
17
  this.minConcepts = 5;
16
18
  this.minDefinitionLength = 20;
@@ -65,6 +67,11 @@ class GlossaryBuilder {
65
67
  this.concepts.push(concept);
66
68
  this.logger.info('Concept added', { name: concept.name, clarityScore: concept.clarityScore });
67
69
 
70
+ const factCheck = this.factChecker.parse(definition);
71
+ if (factCheck.length > 0) {
72
+ this.logger.info('Fact-check triggered on definition', { name, patterns: factCheck.map(f => f.matched) });
73
+ }
74
+
68
75
  const suggestions = this.suggestRelatedConcepts(this.concepts);
69
76
 
70
77
  return {
@@ -1,441 +0,0 @@
1
- # 🧪 MARC - Quick Test Guide for Copilot CLI Integration
2
-
3
- **Package:** create-byan-agent v1.0.4
4
- **Test Duration:** 10 minutes
5
- **Tester:** Rachid (ou tout utilisateur)
6
-
7
- ---
8
-
9
- ## 🎯 OBJECTIF
10
-
11
- Valider que les agents BYAN, RACHID et MARC sont correctement détectés et activables dans GitHub Copilot CLI.
12
-
13
- ---
14
-
15
- ## 📋 PRÉREQUIS
16
-
17
- - ✅ GitHub Copilot CLI installé
18
- - ✅ Package `create-byan-agent` installé dans un projet test
19
- - ✅ Projet Git initialisé (recommandé)
20
-
21
- **Installation:**
22
- ```bash
23
- mkdir /tmp/test-copilot-integration
24
- cd /tmp/test-copilot-integration
25
- git init
26
- npx create-byan-agent
27
- # Suivre l'installation interactive
28
- ```
29
-
30
- ---
31
-
32
- ## 🧪 TEST 1: Détection Agents (3 min)
33
-
34
- ### Commande
35
-
36
- ```bash
37
- copilot
38
- ```
39
-
40
- **Dans le prompt Copilot, taper:**
41
- ```
42
- /agent
43
- ```
44
-
45
- ### Résultat Attendu
46
-
47
- Une liste d'agents devrait s'afficher incluant :
48
-
49
- ```
50
- Available agents:
51
- - bmad-agent-byan - byan agent
52
- - bmad-agent-rachid - NPM/NPX deployment specialist for BYAN installation
53
- - bmad-agent-marc - GitHub Copilot CLI integration specialist for BMAD agents
54
- [... autres agents si présents ...]
55
- ```
56
-
57
- ### ✅ PASS SI:
58
- - [ ] Les 3 agents (byan, rachid, marc) apparaissent dans la liste
59
- - [ ] Les noms commencent par `bmad-agent-`
60
- - [ ] Les descriptions sont affichées
61
-
62
- ### ❌ FAIL SI:
63
- - [ ] Aucun agent n'apparaît
64
- - [ ] Un ou plusieurs agents manquent
65
- - [ ] Erreur de parsing YAML
66
-
67
- **Diagnostic si FAIL:**
68
- ```bash
69
- # Vérifier présence des fichiers
70
- ls -la .github/agents/bmad-agent-*.md
71
-
72
- # Vérifier YAML frontmatter
73
- head -n 5 .github/agents/bmad-agent-byan.md
74
- # Doit commencer par:
75
- # ---
76
- # name: 'bmad-agent-byan'
77
- # description: '...'
78
- # ---
79
- ```
80
-
81
- ---
82
-
83
- ## 🧪 TEST 2: Activation BYAN (2 min)
84
-
85
- ### Commande
86
-
87
- **Dans le prompt Copilot, taper:**
88
- ```
89
- @byan
90
- ```
91
-
92
- OU sélectionner dans le menu `/agent` puis choisir `bmad-agent-byan`.
93
-
94
- ### Résultat Attendu
95
-
96
- ```
97
- 🏗️ BYAN - Builder of YAN - Agent Creator Specialist
98
-
99
- Bonjour [VotreNom] ! Je suis BYAN, votre assistant pour créer des agents IA personnalisés...
100
-
101
- MENU PRINCIPAL:
102
- 1. [MH] Redisplay Menu Help
103
- 2. [CH] Chat with BYAN
104
- 3. [INT] Start Intelligent Interview
105
- 4. [QC] Quick Create agent
106
- 5. [LA] List all agents
107
- 6. [EA] Edit existing agent
108
- 7. [VA] Validate agent
109
- 8. [DA] Delete agent
110
- 9. [PC] Show Project Context
111
- 10. [MAN] Display 64 Mantras
112
- 11. [PM] Start Party Mode
113
- 12. [EXIT] Dismiss BYAN Agent
114
-
115
- Tapez /bmad-help à tout moment pour obtenir de l'aide.
116
-
117
- Que voulez-vous faire ?
118
- ```
119
-
120
- ### ✅ PASS SI:
121
- - [ ] Greeting BYAN s'affiche avec nom utilisateur (depuis config.yaml)
122
- - [ ] Menu complet avec 12 items visible
123
- - [ ] `/bmad-help` mentionné
124
- - [ ] Agent attend input
125
-
126
- ### ❌ FAIL SI:
127
- - [ ] Erreur "agent not found"
128
- - [ ] Erreur de chargement du fichier source
129
- - [ ] Greeting incomplet ou manquant
130
- - [ ] Menu non affiché
131
-
132
- **Diagnostic si FAIL:**
133
- ```bash
134
- # Vérifier agent source
135
- cat _byan/bmb/agents/byan.md | head -30
136
-
137
- # Vérifier stub
138
- cat .github/agents/bmad-agent-byan.md | head -20
139
-
140
- # Vérifier config
141
- cat _byan/bmb/config.yaml
142
- ```
143
-
144
- **Tester une commande:**
145
- ```
146
- LA
147
- ```
148
-
149
- **Résultat attendu:** Liste des agents dans `_byan/bmb/agents/`
150
-
151
- ---
152
-
153
- ## 🧪 TEST 3: Activation RACHID (2 min)
154
-
155
- ### Commande
156
-
157
- **Dans Copilot prompt:**
158
- ```
159
- @rachid
160
- ```
161
-
162
- ### Résultat Attendu
163
-
164
- ```
165
- 📦 RACHID - NPM/NPX Deployment Specialist
166
-
167
- Salut [VotreNom] ! Je suis RACHID, expert en déploiement npm/npx...
168
-
169
- MENU PRINCIPAL:
170
- 1. [INSTALL] Install BYAN via npx
171
- 2. [VALIDATE] Validate _byan structure
172
- 3. [FIX-DEPS] Fix npm dependencies
173
- 4. [UPDATE-PKG] Update package.json
174
- 5. [PUBLISH] Publish to npm
175
- 6. [TEST-NPX] Test npx installation
176
- 7. [AUDIT] Security audit
177
- 8. [HELP] NPM Help
178
- 9. [EXIT] Exit RACHID
179
-
180
- Que puis-je faire pour toi ?
181
- ```
182
-
183
- ### ✅ PASS SI:
184
- - [ ] Greeting RACHID s'affiche
185
- - [ ] Menu NPM/NPX visible (9 items)
186
- - [ ] Agent répond en français (si configuré)
187
-
188
- ### ❌ FAIL SI:
189
- - [ ] Agent non trouvé
190
- - [ ] Menu incomplet
191
- - [ ] Erreur de chargement
192
-
193
- ---
194
-
195
- ## 🧪 TEST 4: Activation MARC (2 min)
196
-
197
- ### Commande
198
-
199
- **Dans Copilot prompt:**
200
- ```
201
- @marc
202
- ```
203
-
204
- ### Résultat Attendu
205
-
206
- ```
207
- 🤖 MARC - GitHub Copilot CLI Integration Specialist
208
-
209
- Hello [VotreNom]! I'm MARC, your GitHub Copilot CLI integration expert...
210
-
211
- MAIN MENU:
212
- 1. [VALIDATE] Validate .github/agents/
213
- 2. [TEST] Test /agent detection
214
- 3. [CREATE-STUB] Create agent stub
215
- 4. [FIX-YAML] Fix YAML frontmatter
216
- 5. [MCP] Configure MCP server
217
- 6. [TEST-INVOKE] Test agent invocation
218
- 7. [OPTIMIZE] Optimize context
219
- 8. [HELP] Copilot CLI Help
220
- 9. [EXIT] Exit Marc
221
-
222
- What can I help you with?
223
- ```
224
-
225
- ### ✅ PASS SI:
226
- - [ ] Greeting MARC s'affiche
227
- - [ ] Menu Copilot CLI visible (9 items)
228
- - [ ] Agent répond correctement
229
-
230
- ### ❌ FAIL SI:
231
- - [ ] Agent non détecté
232
- - [ ] Menu manquant
233
- - [ ] Erreur activation
234
-
235
- ---
236
-
237
- ## 🧪 TEST 5: Invocation Directe (1 min)
238
-
239
- ### Test @byan avec Prompt
240
-
241
- **Commande:**
242
- ```bash
243
- copilot --agent=bmad-agent-byan --prompt "List all agents in this project"
244
- ```
245
-
246
- ### Résultat Attendu
247
-
248
- Agent BYAN s'active et répond avec la liste des agents dans `_byan/bmb/agents/`.
249
-
250
- ### ✅ PASS SI:
251
- - [ ] Agent BYAN activé directement
252
- - [ ] Prompt traité
253
- - [ ] Réponse pertinente
254
-
255
- ### ❌ FAIL SI:
256
- - [ ] Erreur "agent not found"
257
- - [ ] Nom agent non reconnu
258
-
259
- **Note:** Si erreur, essayer avec le nom exact du fichier:
260
- ```bash
261
- copilot --agent=bmad-agent-byan
262
- ```
263
-
264
- ---
265
-
266
- ## 📊 RÉSULTATS TESTS
267
-
268
- ### Score Global
269
-
270
- | Test | Status | Notes |
271
- |------|--------|-------|
272
- | 1. Détection Agents | ☐ PASS / ☐ FAIL | ___ agents détectés |
273
- | 2. Activation BYAN | ☐ PASS / ☐ FAIL | Menu complet: Oui/Non |
274
- | 3. Activation RACHID | ☐ PASS / ☐ FAIL | Menu complet: Oui/Non |
275
- | 4. Activation MARC | ☐ PASS / ☐ FAIL | Menu complet: Oui/Non |
276
- | 5. Invocation Directe | ☐ PASS / ☐ FAIL | Prompt traité: Oui/Non |
277
-
278
- ### Verdict Final
279
-
280
- - [ ] ✅ **TOUS LES TESTS PASSÉS** → Prêt pour publication
281
- - [ ] ⚠️ **1-2 TESTS ÉCHOUÉS** → Corrections mineures nécessaires
282
- - [ ] ❌ **3+ TESTS ÉCHOUÉS** → Révision majeure requise
283
-
284
- ---
285
-
286
- ## 🐛 TROUBLESHOOTING
287
-
288
- ### Problème: Aucun agent détecté
289
-
290
- **Causes possibles:**
291
- 1. `.github/agents/` directory manquant
292
- 2. YAML frontmatter invalide
293
- 3. Permissions fichiers incorrectes
294
- 4. Copilot CLI cache obsolète
295
-
296
- **Solutions:**
297
- ```bash
298
- # Vérifier structure
299
- ls -la .github/agents/
300
-
301
- # Vérifier YAML
302
- cat .github/agents/bmad-agent-byan.md | head -5
303
-
304
- # Clear Copilot cache (si nécessaire)
305
- rm -rf ~/.copilot/cache/
306
-
307
- # Relancer Copilot
308
- copilot
309
- ```
310
-
311
- ---
312
-
313
- ### Problème: Agent détecté mais ne charge pas
314
-
315
- **Causes possibles:**
316
- 1. Fichier source `_byan/bmb/agents/*.md` manquant
317
- 2. Erreur dans `<agent-activation>` block
318
- 3. Chemin `{project-root}` mal résolu
319
- 4. Config.yaml manquant
320
-
321
- **Solutions:**
322
- ```bash
323
- # Vérifier agents sources
324
- ls -la _byan/bmb/agents/
325
-
326
- # Vérifier config
327
- cat _byan/bmb/config.yaml
328
-
329
- # Tester résolution path
330
- pwd
331
- # Doit correspondre au {project-root}
332
- ```
333
-
334
- ---
335
-
336
- ### Problème: Menu incomplet ou manquant
337
-
338
- **Causes possibles:**
339
- 1. Agent source corrompu
340
- 2. Section `<menu>` mal formatée
341
- 3. Erreur parsing XML
342
-
343
- **Solutions:**
344
- ```bash
345
- # Réinstaller l'agent
346
- npx create-byan-agent
347
- # Répondre "Yes" pour overwrite
348
-
349
- # Ou restaurer depuis template
350
- cp templates/_byan/bmb/agents/byan.md _byan/bmb/agents/
351
- ```
352
-
353
- ---
354
-
355
- ### Problème: Langue incorrecte
356
-
357
- **Cause:** `communication_language` dans config.yaml
358
-
359
- **Solution:**
360
- ```bash
361
- # Éditer config
362
- nano _byan/bmb/config.yaml
363
-
364
- # Changer:
365
- communication_language: Francais # ou English
366
-
367
- # Sauvegarder et relancer agent
368
- ```
369
-
370
- ---
371
-
372
- ## 🎯 VALIDATION FINALE
373
-
374
- ### Checklist de Clôture
375
-
376
- - [ ] Tous les tests passés (5/5)
377
- - [ ] Les 3 agents (BYAN, RACHID, MARC) fonctionnels
378
- - [ ] Menu complet sur chaque agent
379
- - [ ] Greeting personnalisé avec nom utilisateur
380
- - [ ] Commandes de menu répondent correctement
381
-
382
- ### Si TOUS LES TESTS PASSENT:
383
-
384
- **✅ VALIDATION COMPLÈTE**
385
-
386
- L'intégration GitHub Copilot CLI est **FONCTIONNELLE** et **PRÊTE POUR PUBLICATION**.
387
-
388
- **Prochaines étapes:**
389
- 1. Publier sur npm : `npm publish --access public`
390
- 2. Tester installation publique
391
- 3. Documenter et partager
392
-
393
- ---
394
-
395
- ### Si DES TESTS ÉCHOUENT:
396
-
397
- **⚠️ CORRECTIONS NÉCESSAIRES**
398
-
399
- Avant publication npm:
400
- 1. Identifier causes des échecs (voir Troubleshooting)
401
- 2. Corriger les problèmes
402
- 3. Re-tester complètement
403
- 4. Valider avec MARC
404
-
405
- **Ne pas publier tant que Score < 4/5**
406
-
407
- ---
408
-
409
- ## 📝 RAPPORT DE TEST
410
-
411
- **Testeur:** _______________
412
- **Date:** _______________
413
- **Environnement:**
414
- - OS: _______________
415
- - Node.js version: _______________
416
- - Copilot CLI version: _______________
417
- - Package version: 1.0.4
418
-
419
- **Tests Effectués:**
420
- - [ ] Test 1: Détection Agents
421
- - [ ] Test 2: Activation BYAN
422
- - [ ] Test 3: Activation RACHID
423
- - [ ] Test 4: Activation MARC
424
- - [ ] Test 5: Invocation Directe
425
-
426
- **Score:** ___/5
427
-
428
- **Verdict:** ☐ PASS / ☐ FAIL
429
-
430
- **Notes supplémentaires:**
431
- _________________________________
432
- _________________________________
433
- _________________________________
434
-
435
- **Signature Validation:** _______________
436
-
437
- ---
438
-
439
- **Guide créé par:** MARC - GitHub Copilot CLI Integration Specialist
440
- **Méthodologie:** Test-Driven Validation
441
- **Contact:** Via agents BYAN/RACHID/MARC