create-byan-agent 2.3.6 → 2.4.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.
- package/CHANGELOG.md +174 -0
- package/install/bin/create-byan-agent-v2.js +75 -22
- package/install/lib/phase2-chat.js +58 -32
- package/install/templates/.claude/CLAUDE.md +44 -0
- package/install/templates/.claude/rules/byan-agents.md +72 -0
- package/install/templates/.claude/rules/hermes-dispatcher.md +53 -0
- package/install/templates/.claude/rules/merise-agile.md +48 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,180 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [2.4.0] - 2026-02-11
|
|
11
|
+
|
|
12
|
+
### ✨ Added - Claude Code Native Agent Integration
|
|
13
|
+
|
|
14
|
+
**New Feature: BYAN agents natively integrated with Claude Code**
|
|
15
|
+
|
|
16
|
+
Claude Code uses `.claude/CLAUDE.md` and `.claude/rules/*.md` for project memory.
|
|
17
|
+
Yanstaller now creates this structure automatically when Claude is detected.
|
|
18
|
+
|
|
19
|
+
**Files Created in User Project:**
|
|
20
|
+
```
|
|
21
|
+
.claude/
|
|
22
|
+
CLAUDE.md # Main project memory with Hermes entry point
|
|
23
|
+
rules/
|
|
24
|
+
hermes-dispatcher.md # Hermes commands, routing rules, pipelines
|
|
25
|
+
byan-agents.md # 35+ agents across 5 modules (tables)
|
|
26
|
+
merise-agile.md # Methodology, mantras, dev cycle, test levels
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Hermes Always Included:**
|
|
30
|
+
- Hermes dispatcher is the universal entry point on ALL Claude Code projects
|
|
31
|
+
- `CLAUDE.md` references Hermes and links to rules via `@.claude/rules/` imports
|
|
32
|
+
- Claude Code auto-loads all `.claude/rules/*.md` at session start
|
|
33
|
+
|
|
34
|
+
**How It Works:**
|
|
35
|
+
- User runs `npx create-byan-agent` and selects Claude Code platform
|
|
36
|
+
- Yanstaller detects Claude and installs `.claude/` structure
|
|
37
|
+
- Claude Code reads `CLAUDE.md` + all `rules/*.md` at every session start
|
|
38
|
+
- User asks "quel agent pour mon projet?" → Claude knows Hermes and all agents
|
|
39
|
+
- No MCP server needed for agent knowledge (native Claude Code memory)
|
|
40
|
+
|
|
41
|
+
**Verification:**
|
|
42
|
+
- Installation checks: CLAUDE.md, rules/ directory, hermes-dispatcher.md
|
|
43
|
+
- Updated success message with Claude-specific activation instructions
|
|
44
|
+
|
|
45
|
+
**Based on Claude Code SDK:**
|
|
46
|
+
- Uses official `.claude/rules/*.md` modular rules system
|
|
47
|
+
- Uses `@path` import syntax for cross-referencing
|
|
48
|
+
- Rules auto-loaded per session (no manual configuration)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## [2.3.8] - 2026-02-11
|
|
53
|
+
|
|
54
|
+
### 🐛 Fixed - Windows 11 + Claude Code Compatibility
|
|
55
|
+
|
|
56
|
+
**Cross-Platform CLI Execution:**
|
|
57
|
+
- Replaced `execSync` with `spawnSync` in Phase 2 chat (no shell = no character interpretation)
|
|
58
|
+
- On Unix: args passed directly (no `@`, `$`, `%` interpretation)
|
|
59
|
+
- On Windows: `shell: true` for `.cmd` file support, stdin for long prompts
|
|
60
|
+
- Removed all bash-only syntax: `$(cat ...)`, `2>/dev/null`, single-quote escaping
|
|
61
|
+
|
|
62
|
+
**Version Display Fix:**
|
|
63
|
+
- `BYAN_VERSION` now reads from `package.json` (was hardcoded as `2.3.0`)
|
|
64
|
+
- Banner now shows correct installed version
|
|
65
|
+
|
|
66
|
+
**Claude-Aware Model Selection:**
|
|
67
|
+
- When Claude platform selected, model switches from `gpt-5-mini` to `claude-haiku-4.5`
|
|
68
|
+
- `generateDefaultConfig()` now accepts `selectedPlatform` parameter
|
|
69
|
+
- Display: "Model adapte: claude-haiku-4.5 (plateforme: Claude)"
|
|
70
|
+
|
|
71
|
+
**Claude Auth Improvements:**
|
|
72
|
+
- Login command fixed: `claude login` (was `claude auth`)
|
|
73
|
+
- Shows 3 connection methods on failure:
|
|
74
|
+
1. `claude login` (OAuth)
|
|
75
|
+
2. `export ANTHROPIC_API_KEY=sk-ant-...`
|
|
76
|
+
3. `/login` dans Claude Code
|
|
77
|
+
- Auth error detection in Phase 2 chat with specific guidance
|
|
78
|
+
|
|
79
|
+
**Files Modified:**
|
|
80
|
+
- `install/lib/phase2-chat.js`: New `runCliCommand()` helper, cross-platform `sendChatMessage()`
|
|
81
|
+
- `install/bin/create-byan-agent-v2.js`: `spawnSync` imports, dynamic version, platform-aware model
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## [2.3.7] - 2026-02-11
|
|
86
|
+
|
|
87
|
+
### 🐛 Fixed - Codex Prompt Escaping
|
|
88
|
+
|
|
89
|
+
**Issue:** Bash interpreted `@hermes` as shell command in Codex prompts
|
|
90
|
+
- Phase 2 chat with Codex failed with `/bin/bash: ligne 1: @hermes : commande introuvable`
|
|
91
|
+
- Root cause: `echo "${prompt}"` with double quotes allowed bash to interpret special characters
|
|
92
|
+
- The Hermes documentation contains `@hermes` examples, which bash tried to execute
|
|
93
|
+
|
|
94
|
+
**Fix:**
|
|
95
|
+
- Changed `install/lib/phase2-chat.js`: Use single quotes for Codex echo command
|
|
96
|
+
- Escape single quotes within content: `replace(/'/g, "'\\''")`
|
|
97
|
+
- Prevents bash from interpreting `@`, `$`, backticks, and other special chars
|
|
98
|
+
- Copilot and Claude already working (direct arguments, not shell expansion)
|
|
99
|
+
|
|
100
|
+
**Impact:** Yanstaller Phase 2 now works correctly with Codex platform
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## [2.3.6] - 2026-02-11
|
|
105
|
+
|
|
106
|
+
### ✨ Enhanced - Hermes in Yanstaller Knowledge Base
|
|
107
|
+
|
|
108
|
+
**Feature:** Yanstaller Phase 2 now knows complete BYAN ecosystem
|
|
109
|
+
- Added full Hermes documentation to Phase 2 system prompt (~1500 tokens)
|
|
110
|
+
- Documents all 35+ agents across 5 modules (Core, BMM, BMB, CIS, TEA)
|
|
111
|
+
- Includes 7 predefined workflows with agent chains
|
|
112
|
+
- Explains smart routing capabilities and pipelines
|
|
113
|
+
- Yanstaller recommends Hermes as universal entry point
|
|
114
|
+
|
|
115
|
+
**Knowledge Expansion:**
|
|
116
|
+
- Before: ~300 tokens (basic user profile)
|
|
117
|
+
- After: ~1500 tokens (complete ecosystem)
|
|
118
|
+
- 5x increase in contextual intelligence
|
|
119
|
+
|
|
120
|
+
**Impact:** Users asking about Hermes or agents get intelligent, informed responses
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## [2.3.5] - 2026-02-11
|
|
125
|
+
|
|
126
|
+
### 🐛 Fixed - Multi-Platform CLI Commands
|
|
127
|
+
|
|
128
|
+
**Issue:** Codex and Claude commands were incorrect
|
|
129
|
+
- Codex: `codex -p "prompt"` doesn't exist (wrong flag)
|
|
130
|
+
- Claude: `claude -p "prompt" --no-input` used wrong flags
|
|
131
|
+
- Both failed during Phase 2 chat in Yanstaller
|
|
132
|
+
|
|
133
|
+
**Fix:**
|
|
134
|
+
- `install/lib/phase2-chat.js`:
|
|
135
|
+
- Codex: Changed to `codex exec` with stdin (line 175)
|
|
136
|
+
- Claude: Changed to `claude -p` print mode (line 184)
|
|
137
|
+
- Copilot: Already correct with `-p` flag
|
|
138
|
+
|
|
139
|
+
**Verified:**
|
|
140
|
+
- Copilot: `copilot -p "prompt" -s` ✓
|
|
141
|
+
- Codex: `echo "prompt" | codex exec` ✓
|
|
142
|
+
- Claude: `claude -p "prompt"` ✓
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## [2.3.4] - 2026-02-11
|
|
147
|
+
|
|
148
|
+
### 🐛 Fixed - Yanstaller Phase 2 Config Bug
|
|
149
|
+
|
|
150
|
+
**Issue:** ReferenceError during Phase 2 chat initialization
|
|
151
|
+
- Error: `Cannot access 'config' before initialization`
|
|
152
|
+
- Root cause: `config` variable used at line 737 but defined at line 817
|
|
153
|
+
- Phase 2 chat failed to start
|
|
154
|
+
|
|
155
|
+
**Fix:**
|
|
156
|
+
- `install/bin/create-byan-agent-v2.js`: Moved config prompt to Phase 1.5 (before Phase 2 chat)
|
|
157
|
+
- Config now collected at lines 714-729 (userName, language)
|
|
158
|
+
- Passed to `launchPhase2Chat()` as parameters
|
|
159
|
+
- Removed duplicate config definition
|
|
160
|
+
|
|
161
|
+
**Impact:** Yanstaller Phase 2 now starts correctly with all platforms
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## [2.3.3] - 2026-02-10
|
|
166
|
+
|
|
167
|
+
### 🐛 Fixed - GitHub Repository URLs
|
|
168
|
+
|
|
169
|
+
**Issue:** README and package.json pointed to wrong GitHub repository
|
|
170
|
+
- Old URL: `github.com/yannsix/byan-v2` (incorrect)
|
|
171
|
+
- Correct URL: `github.com/Yan-Acadenice/BYAN`
|
|
172
|
+
|
|
173
|
+
**Changes:**
|
|
174
|
+
- `README.md`: Updated 10 GitHub link occurrences
|
|
175
|
+
- `package.json`: Updated repository URLs (3 occurrences)
|
|
176
|
+
- repository.url
|
|
177
|
+
- bugs.url
|
|
178
|
+
- homepage
|
|
179
|
+
|
|
180
|
+
**Impact:** Users can now find correct repository and report issues properly
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
10
184
|
## [2.3.2] - 2026-02-10
|
|
11
185
|
|
|
12
186
|
### 🏛️ Added - Hermes Universal Dispatcher
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const fs = require('fs-extra');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
|
-
const { execSync } = require('child_process');
|
|
6
|
+
const { execSync, spawnSync } = require('child_process');
|
|
7
7
|
const { program } = require('commander');
|
|
8
8
|
const inquirer = require('inquirer');
|
|
9
9
|
const chalk = require('chalk');
|
|
@@ -15,7 +15,7 @@ const { getDomainQuestions, buildPhase2Prompt } = require('../lib/domain-questio
|
|
|
15
15
|
const { generateProjectAgentsDoc } = require('../lib/project-agents-generator');
|
|
16
16
|
const { launchPhase2Chat, generateDefaultConfig } = require('../lib/phase2-chat');
|
|
17
17
|
|
|
18
|
-
const BYAN_VERSION = '
|
|
18
|
+
const BYAN_VERSION = require('../../package.json').version;
|
|
19
19
|
|
|
20
20
|
// ASCII Art Banner
|
|
21
21
|
const banner = `
|
|
@@ -470,29 +470,41 @@ async function install() {
|
|
|
470
470
|
const promptFile = path.join(projectRoot, '.yanstaller-prompt.tmp');
|
|
471
471
|
await fs.writeFile(promptFile, interviewPrompt, 'utf8');
|
|
472
472
|
|
|
473
|
-
//
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
let agentCommand = null;
|
|
478
|
-
if (detectedPlatforms.copilot) {
|
|
479
|
-
agentCommand = `copilot --agent=bmad-agent-yanstaller-interview -p "$(cat '${promptFile}')" --model ${interviewComplexity} -s`;
|
|
480
|
-
} else if (detectedPlatforms.codex) {
|
|
481
|
-
agentCommand = `codex exec "$(cat '${promptFile}')"`;
|
|
482
|
-
} else if (detectedPlatforms.claude) {
|
|
483
|
-
agentCommand = `claude -p "$(cat '${promptFile}')"`;
|
|
484
|
-
}
|
|
473
|
+
// Cross-platform CLI execution using spawnSync (no shell = no escaping issues)
|
|
474
|
+
const isWindows = process.platform === 'win32';
|
|
475
|
+
const promptContent = await fs.readFile(promptFile, 'utf8');
|
|
476
|
+
let hasAgent = false;
|
|
485
477
|
|
|
486
|
-
if (
|
|
478
|
+
if (detectedPlatforms.copilot || detectedPlatforms.codex || detectedPlatforms.claude) {
|
|
479
|
+
hasAgent = true;
|
|
487
480
|
const agentSpinner = ora(`Analysing with yanstaller agent (${interviewComplexity})...`).start();
|
|
488
481
|
|
|
489
482
|
try {
|
|
490
|
-
const
|
|
483
|
+
const spawnOpts = {
|
|
491
484
|
encoding: 'utf8',
|
|
492
485
|
cwd: projectRoot,
|
|
493
486
|
timeout: 120000,
|
|
487
|
+
maxBuffer: 1024 * 1024,
|
|
494
488
|
stdio: ['pipe', 'pipe', 'pipe']
|
|
495
|
-
}
|
|
489
|
+
};
|
|
490
|
+
if (isWindows) spawnOpts.shell = true;
|
|
491
|
+
|
|
492
|
+
let res;
|
|
493
|
+
if (detectedPlatforms.copilot) {
|
|
494
|
+
res = spawnSync('copilot', [
|
|
495
|
+
'--agent=bmad-agent-yanstaller-interview',
|
|
496
|
+
'-p', promptContent,
|
|
497
|
+
'--model', interviewComplexity,
|
|
498
|
+
'-s'
|
|
499
|
+
], spawnOpts);
|
|
500
|
+
} else if (detectedPlatforms.codex) {
|
|
501
|
+
res = spawnSync('codex', ['exec', promptContent], spawnOpts);
|
|
502
|
+
} else if (detectedPlatforms.claude) {
|
|
503
|
+
res = spawnSync('claude', ['-p', promptContent], spawnOpts);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (res.error) throw res.error;
|
|
507
|
+
const result = (res.stdout || '').toString();
|
|
496
508
|
|
|
497
509
|
agentSpinner.succeed(`Analysis complete (model: ${interviewComplexity})`);
|
|
498
510
|
|
|
@@ -568,7 +580,7 @@ async function install() {
|
|
|
568
580
|
console.log(chalk.green(` Essential agents: ${interviewResults.agents.essential.join(', ')}`));
|
|
569
581
|
console.log(chalk.green(` Model: ${interviewResults.recommended_model}`));
|
|
570
582
|
}
|
|
571
|
-
} else {
|
|
583
|
+
} else if (!hasAgent) {
|
|
572
584
|
// No AI platform detected - build from interview data
|
|
573
585
|
interviewResults = {
|
|
574
586
|
platforms: ['copilot'],
|
|
@@ -663,6 +675,15 @@ async function install() {
|
|
|
663
675
|
installMode = 'auto';
|
|
664
676
|
}
|
|
665
677
|
|
|
678
|
+
// Update recommended model based on selected platform
|
|
679
|
+
if (selectedPlatform === 'claude' && interviewResults) {
|
|
680
|
+
const oldModel = interviewResults.recommended_model || '';
|
|
681
|
+
if (oldModel.includes('gpt')) {
|
|
682
|
+
interviewResults.recommended_model = 'claude-haiku-4.5';
|
|
683
|
+
console.log(chalk.cyan(` 🧠 Model adapté: claude-haiku-4.5 (plateforme: Claude)`));
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
666
687
|
// NEW: Verify authentication for selected platform
|
|
667
688
|
if (selectedPlatform && installMode === 'custom') {
|
|
668
689
|
console.log('');
|
|
@@ -680,7 +701,7 @@ async function install() {
|
|
|
680
701
|
loginCmd = 'codex login';
|
|
681
702
|
} else if (selectedPlatform === 'claude') {
|
|
682
703
|
checkCmd = 'claude --version';
|
|
683
|
-
loginCmd = 'claude
|
|
704
|
+
loginCmd = 'claude login';
|
|
684
705
|
}
|
|
685
706
|
|
|
686
707
|
const result = execSync(checkCmd, { encoding: 'utf8', timeout: 5000, stdio: 'pipe' });
|
|
@@ -689,6 +710,10 @@ async function install() {
|
|
|
689
710
|
console.log('');
|
|
690
711
|
console.log(chalk.yellow(`⚠️ ${selectedPlatform} n'est pas authentifié ou non disponible`));
|
|
691
712
|
console.log(chalk.gray(` Pour vous connecter, exécutez: ${chalk.cyan(loginCmd)}`));
|
|
713
|
+
if (selectedPlatform === 'claude') {
|
|
714
|
+
console.log(chalk.gray(` Alternative: ${chalk.cyan('export ANTHROPIC_API_KEY=sk-ant-...')}`));
|
|
715
|
+
console.log(chalk.gray(` Ou dans Claude Code: ${chalk.cyan('/login')}`));
|
|
716
|
+
}
|
|
692
717
|
console.log('');
|
|
693
718
|
|
|
694
719
|
const { continueAnyway } = await inquirer.prompt([{
|
|
@@ -766,13 +791,13 @@ async function install() {
|
|
|
766
791
|
}]);
|
|
767
792
|
|
|
768
793
|
if (useFallback) {
|
|
769
|
-
phase2Results = generateDefaultConfig(interviewAnswers, detectedPlatforms);
|
|
794
|
+
phase2Results = generateDefaultConfig(interviewAnswers, detectedPlatforms, selectedPlatform);
|
|
770
795
|
}
|
|
771
796
|
}
|
|
772
797
|
} else if (enterPhase2 === 'auto') {
|
|
773
798
|
// Use default configuration
|
|
774
799
|
const autoSpinner = ora('Generating default configuration...').start();
|
|
775
|
-
phase2Results = generateDefaultConfig(interviewAnswers, detectedPlatforms);
|
|
800
|
+
phase2Results = generateDefaultConfig(interviewAnswers, detectedPlatforms, selectedPlatform);
|
|
776
801
|
autoSpinner.succeed('Configuration generated');
|
|
777
802
|
}
|
|
778
803
|
|
|
@@ -918,6 +943,9 @@ async function install() {
|
|
|
918
943
|
await fs.ensureDir(path.join(byanDir, '_memory'));
|
|
919
944
|
await fs.ensureDir(path.join(byanDir, '_output'));
|
|
920
945
|
await fs.ensureDir(githubAgentsDir);
|
|
946
|
+
if (detectedPlatforms.claude || platform === 'claude' || platform === 'all') {
|
|
947
|
+
await fs.ensureDir(path.join(projectRoot, '.claude', 'rules'));
|
|
948
|
+
}
|
|
921
949
|
|
|
922
950
|
installSpinner.succeed('Directory structure created');
|
|
923
951
|
|
|
@@ -978,6 +1006,19 @@ async function install() {
|
|
|
978
1006
|
copySpinner.warn(`⚠ GitHub agents source not found: ${githubAgentsSource}`);
|
|
979
1007
|
}
|
|
980
1008
|
|
|
1009
|
+
// Copy .claude/ files for Claude Code integration (always includes Hermes)
|
|
1010
|
+
if (detectedPlatforms.claude || platform === 'claude' || platform === 'all') {
|
|
1011
|
+
const claudeSource = path.join(templateDir, '.claude');
|
|
1012
|
+
const claudeDest = path.join(projectRoot, '.claude');
|
|
1013
|
+
|
|
1014
|
+
if (await fs.pathExists(claudeSource)) {
|
|
1015
|
+
await fs.ensureDir(path.join(claudeDest, 'rules'));
|
|
1016
|
+
await fs.copy(claudeSource, claudeDest, { overwrite: true });
|
|
1017
|
+
copySpinner.text = 'Copied Claude Code rules + Hermes dispatcher...';
|
|
1018
|
+
console.log(chalk.green(` ✓ Claude Code: CLAUDE.md + rules/ (Hermes, agents, methodology)`));
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
981
1022
|
copySpinner.succeed('BYAN platform files installed');
|
|
982
1023
|
} catch (error) {
|
|
983
1024
|
copySpinner.fail('Error copying files');
|
|
@@ -1033,6 +1074,15 @@ async function install() {
|
|
|
1033
1074
|
{ name: 'GitHub agents dir', path: githubAgentsDir }
|
|
1034
1075
|
];
|
|
1035
1076
|
|
|
1077
|
+
// Add Claude Code checks if installed
|
|
1078
|
+
if (detectedPlatforms.claude || platform === 'claude' || platform === 'all') {
|
|
1079
|
+
checks.push(
|
|
1080
|
+
{ name: 'Claude CLAUDE.md', path: path.join(projectRoot, '.claude', 'CLAUDE.md') },
|
|
1081
|
+
{ name: 'Claude rules/', path: path.join(projectRoot, '.claude', 'rules') },
|
|
1082
|
+
{ name: 'Hermes dispatcher rule', path: path.join(projectRoot, '.claude', 'rules', 'hermes-dispatcher.md') }
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1036
1086
|
// Add v2.0 checks if installed
|
|
1037
1087
|
if (v2Installed) {
|
|
1038
1088
|
checks.push(
|
|
@@ -1122,7 +1172,10 @@ async function install() {
|
|
|
1122
1172
|
console.log(' Open VSCode Command Palette (Ctrl+Shift+P)');
|
|
1123
1173
|
console.log(' Type: \'Activate BYAN Agent\'');
|
|
1124
1174
|
} else if (platform === 'claude') {
|
|
1125
|
-
console.log(` ${chalk.blue('claude
|
|
1175
|
+
console.log(` ${chalk.blue('claude')}`);
|
|
1176
|
+
console.log(` Hermes est integre via ${chalk.cyan('.claude/CLAUDE.md')}`);
|
|
1177
|
+
console.log(` Demande: ${chalk.cyan('"quel agent pour mon projet?"')} → Hermes repond`);
|
|
1178
|
+
console.log(` Regles: ${chalk.cyan('.claude/rules/')} (hermes, agents, methodologie)`);
|
|
1126
1179
|
} else {
|
|
1127
1180
|
console.log(' Follow your platform\'s agent activation procedure');
|
|
1128
1181
|
}
|
|
@@ -5,13 +5,43 @@
|
|
|
5
5
|
* using copilot/codex CLI for AI responses.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const {
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const fs = require('fs-extra');
|
|
11
11
|
const inquirer = require('inquirer');
|
|
12
12
|
const chalk = require('chalk');
|
|
13
13
|
const ora = require('ora');
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Cross-platform CLI command execution
|
|
17
|
+
* Uses spawnSync without shell on Unix (no character interpretation)
|
|
18
|
+
* Uses shell on Windows for .cmd file support
|
|
19
|
+
*/
|
|
20
|
+
function runCliCommand(cmd, args, cwd, stdinInput) {
|
|
21
|
+
const isWindows = process.platform === 'win32';
|
|
22
|
+
const opts = {
|
|
23
|
+
encoding: 'utf8',
|
|
24
|
+
cwd: cwd,
|
|
25
|
+
timeout: 60000,
|
|
26
|
+
maxBuffer: 1024 * 1024,
|
|
27
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
if (stdinInput) opts.input = stdinInput;
|
|
31
|
+
if (isWindows) opts.shell = true;
|
|
32
|
+
|
|
33
|
+
const res = spawnSync(cmd, args, opts);
|
|
34
|
+
if (res.error) throw res.error;
|
|
35
|
+
|
|
36
|
+
// Check for non-zero exit code with stderr
|
|
37
|
+
if (res.status !== 0 && res.stderr) {
|
|
38
|
+
const stderr = res.stderr.toString().trim();
|
|
39
|
+
if (stderr) throw new Error(stderr);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (res.stdout || '').toString();
|
|
43
|
+
}
|
|
44
|
+
|
|
15
45
|
/**
|
|
16
46
|
* Build the initial context prompt from Phase 1 answers
|
|
17
47
|
*/
|
|
@@ -144,7 +174,6 @@ Quand l'utilisateur dit "finaliser", "terminer" ou "c'est bon", génère la conf
|
|
|
144
174
|
* @returns {Promise<string>} AI response
|
|
145
175
|
*/
|
|
146
176
|
async function sendChatMessage(message, systemContext, conversationHistory, selectedPlatform, projectRoot) {
|
|
147
|
-
// Build the full prompt with context and history
|
|
148
177
|
const fullPrompt = `${systemContext}
|
|
149
178
|
|
|
150
179
|
## Historique de conversation:
|
|
@@ -160,44 +189,37 @@ Continue la conversation pour comprendre le projet et personnaliser les agents.`
|
|
|
160
189
|
let result = '';
|
|
161
190
|
|
|
162
191
|
try {
|
|
163
|
-
const escaped = fullPrompt.replace(/"/g, '\\"').replace(/\n/g, '\\n');
|
|
164
|
-
|
|
165
192
|
if (selectedPlatform === 'copilot') {
|
|
166
|
-
|
|
167
|
-
result = execSync(`copilot -p "${escaped}" -s 2>/dev/null`, {
|
|
168
|
-
encoding: 'utf8',
|
|
169
|
-
cwd: projectRoot,
|
|
170
|
-
timeout: 60000,
|
|
171
|
-
maxBuffer: 1024 * 1024
|
|
172
|
-
});
|
|
193
|
+
result = runCliCommand('copilot', ['-p', fullPrompt, '-s'], projectRoot);
|
|
173
194
|
} else if (selectedPlatform === 'codex') {
|
|
174
|
-
//
|
|
175
|
-
result =
|
|
176
|
-
encoding: 'utf8',
|
|
177
|
-
cwd: projectRoot,
|
|
178
|
-
timeout: 60000,
|
|
179
|
-
maxBuffer: 1024 * 1024,
|
|
180
|
-
shell: '/bin/bash'
|
|
181
|
-
});
|
|
195
|
+
// Codex takes prompt as argument to exec command
|
|
196
|
+
result = runCliCommand('codex', ['exec', fullPrompt], projectRoot);
|
|
182
197
|
} else if (selectedPlatform === 'claude') {
|
|
183
|
-
|
|
184
|
-
result = execSync(`claude -p "${escaped}" 2>/dev/null`, {
|
|
185
|
-
encoding: 'utf8',
|
|
186
|
-
cwd: projectRoot,
|
|
187
|
-
timeout: 60000,
|
|
188
|
-
maxBuffer: 1024 * 1024
|
|
189
|
-
});
|
|
198
|
+
result = runCliCommand('claude', ['-p', fullPrompt], projectRoot);
|
|
190
199
|
} else {
|
|
191
200
|
throw new Error(`Platform not supported: ${selectedPlatform}`);
|
|
192
201
|
}
|
|
193
202
|
} catch (error) {
|
|
203
|
+
const errMsg = (error.message || '').toLowerCase();
|
|
194
204
|
console.error(chalk.red(`\n❌ Erreur ${selectedPlatform}: ${error.message}`));
|
|
205
|
+
|
|
206
|
+
// Platform-specific login guidance
|
|
207
|
+
if (selectedPlatform === 'claude' && (errMsg.includes('auth') || errMsg.includes('api') || errMsg.includes('key') || errMsg.includes('login') || errMsg.includes('401'))) {
|
|
208
|
+
console.log('');
|
|
209
|
+
console.log(chalk.yellow(' 💡 Pour se connecter à Claude Code:'));
|
|
210
|
+
console.log(chalk.cyan(' 1. claude login'));
|
|
211
|
+
console.log(chalk.gray(' 2. ou: export ANTHROPIC_API_KEY=sk-ant-...'));
|
|
212
|
+
console.log(chalk.gray(' 3. ou dans Claude Code: /login'));
|
|
213
|
+
} else if (selectedPlatform === 'copilot') {
|
|
214
|
+
console.log(chalk.gray(' → gh auth login'));
|
|
215
|
+
} else if (selectedPlatform === 'codex') {
|
|
216
|
+
console.log(chalk.gray(' → codex login'));
|
|
217
|
+
}
|
|
218
|
+
|
|
195
219
|
result = `Désolé, erreur de communication avec ${selectedPlatform}. Réessayez ou tapez "skip".`;
|
|
196
220
|
}
|
|
197
221
|
|
|
198
|
-
// Clean up the response (remove ANSI codes, extra whitespace)
|
|
199
222
|
result = result.replace(/\x1b\[[0-9;]*m/g, '').trim();
|
|
200
|
-
|
|
201
223
|
return result;
|
|
202
224
|
}
|
|
203
225
|
|
|
@@ -373,7 +395,7 @@ IMPORTANT: L'utilisateur veut finaliser. Génère maintenant la configuration JS
|
|
|
373
395
|
/**
|
|
374
396
|
* Fallback: Generate default config based on Phase 1 answers only
|
|
375
397
|
*/
|
|
376
|
-
function generateDefaultConfig(interviewAnswers, detectedPlatforms) {
|
|
398
|
+
function generateDefaultConfig(interviewAnswers, detectedPlatforms, selectedPlatform) {
|
|
377
399
|
const domain = interviewAnswers.domain;
|
|
378
400
|
const quality = interviewAnswers.quality;
|
|
379
401
|
|
|
@@ -477,9 +499,13 @@ function generateDefaultConfig(interviewAnswers, detectedPlatforms) {
|
|
|
477
499
|
{ from: 'architect', to: 'dev', type: 'triggers', description: 'Architecture triggers implementation' }
|
|
478
500
|
];
|
|
479
501
|
|
|
480
|
-
// Set model based on quality
|
|
481
|
-
|
|
482
|
-
|
|
502
|
+
// Set model based on quality and selected platform
|
|
503
|
+
if (selectedPlatform === 'claude') {
|
|
504
|
+
config.recommendedModel = quality === 'critical' ? 'claude-sonnet-4' : 'claude-haiku-4.5';
|
|
505
|
+
} else {
|
|
506
|
+
config.recommendedModel = quality === 'critical' ? 'claude-sonnet-4' :
|
|
507
|
+
quality === 'production' ? 'gpt-5.1-codex' : 'gpt-5-mini';
|
|
508
|
+
}
|
|
483
509
|
|
|
484
510
|
config.rationale = `Configuration par défaut pour projet ${domain}. Personnalisez via la conversation Phase 2 pour plus de précision.`;
|
|
485
511
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# BYAN - Builder of YAN
|
|
2
|
+
|
|
3
|
+
> Projet propulse par BYAN (Merise Agile + TDD + 64 Mantras)
|
|
4
|
+
> Installer: `npx create-byan-agent`
|
|
5
|
+
> GitHub: https://github.com/Yan-Acadenice/BYAN
|
|
6
|
+
|
|
7
|
+
## Hermes - Dispatcher Universel
|
|
8
|
+
|
|
9
|
+
**Hermes est le point d'entree universel de ton ecosysteme BYAN.**
|
|
10
|
+
Avant de chercher un agent specifique, demande a Hermes. Il connait tous les agents,
|
|
11
|
+
workflows et contextes, et te route vers le bon specialiste.
|
|
12
|
+
|
|
13
|
+
Pour invoquer Hermes, tape: `@hermes` ou demande simplement "quel agent pour [ta tache]?"
|
|
14
|
+
|
|
15
|
+
Voir @.claude/rules/hermes-dispatcher.md pour les commandes Hermes.
|
|
16
|
+
|
|
17
|
+
## Architecture BYAN
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
{project-root}/
|
|
21
|
+
_byan/ # Plateforme BYAN
|
|
22
|
+
_config/ # Manifestes (agents, workflows, tasks)
|
|
23
|
+
bmb/ # Module Builder (BYAN, agents, workflows)
|
|
24
|
+
_memory/ # Memoire persistante des agents
|
|
25
|
+
_output/ # Artefacts generes
|
|
26
|
+
.claude/ # Integration Claude Code
|
|
27
|
+
CLAUDE.md # Ce fichier (instructions projet)
|
|
28
|
+
rules/ # Regles modulaires par domaine
|
|
29
|
+
.github/agents/ # Agents Copilot CLI (si installe)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Regles de Code
|
|
33
|
+
|
|
34
|
+
- Pas d'emojis dans le code, commits, ou specs techniques (Mantra IA-23)
|
|
35
|
+
- Code auto-documente, commentaires uniquement pour le POURQUOI (Mantra IA-24)
|
|
36
|
+
- Format commits: `type: description` (feat, fix, docs, refactor, test, chore)
|
|
37
|
+
- Simplicite d'abord - Rasoir d'Ockham (Mantra #37)
|
|
38
|
+
- Challenge Before Confirm - Valider avant d'accepter (Mantra IA-16)
|
|
39
|
+
|
|
40
|
+
## Commandes Utiles
|
|
41
|
+
|
|
42
|
+
- `@hermes` → Dispatcher universel (recommandations, routage, pipelines)
|
|
43
|
+
- Agent disponibles: voir @.claude/rules/byan-agents.md
|
|
44
|
+
- Methodologie: voir @.claude/rules/merise-agile.md
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Agents BYAN - Ecosysteme Complet
|
|
2
|
+
|
|
3
|
+
## Core Module (Foundation)
|
|
4
|
+
|
|
5
|
+
| Agent | Persona | Role |
|
|
6
|
+
|-------|---------|------|
|
|
7
|
+
| **hermes** | Dispatcher | Routeur universel, point d'entree |
|
|
8
|
+
| **bmad-master** | Orchestrateur | Execute workflows et tasks |
|
|
9
|
+
| **yanstaller** | Installeur | Installation intelligente BYAN |
|
|
10
|
+
| **expert-merise-agile** | Expert | Conception Merise Agile + MCD/MCT |
|
|
11
|
+
|
|
12
|
+
## BMB Module (Builders)
|
|
13
|
+
|
|
14
|
+
| Agent | Persona | Role |
|
|
15
|
+
|-------|---------|------|
|
|
16
|
+
| **byan** | Builder | Createur d'agents via interview (12 questions, 64 mantras) |
|
|
17
|
+
| **agent-builder** | Constructeur | Expert en construction d'agents |
|
|
18
|
+
| **marc** | Specialiste | Integration GitHub Copilot |
|
|
19
|
+
| **rachid** | Specialiste | Deploiement NPM/NPX |
|
|
20
|
+
| **carmack** | Optimiseur | Optimisation tokens |
|
|
21
|
+
| **patnote** | Gestionnaire | Mises a jour et conflits |
|
|
22
|
+
|
|
23
|
+
## BMM Module (SDLC - Software Development Lifecycle)
|
|
24
|
+
|
|
25
|
+
| Agent | Persona | Role |
|
|
26
|
+
|-------|---------|------|
|
|
27
|
+
| **analyst** | Mary | Analyse business, etude de marche, brief |
|
|
28
|
+
| **architect** | Winston | Design systeme, tech stack, architecture |
|
|
29
|
+
| **dev** | Amelia | Implementation, coding, ultra-succincte |
|
|
30
|
+
| **pm** | John | Product management, PRD, roadmap |
|
|
31
|
+
| **sm** | Bob | Scrum master, sprint planning, backlog |
|
|
32
|
+
| **quinn** | Quinn | QA engineer, tests, couverture |
|
|
33
|
+
| **tech-writer** | Paige | Documentation, guides, clarity |
|
|
34
|
+
| **ux-designer** | Sally | UX/UI design, empathie utilisateur |
|
|
35
|
+
| **quick-flow-solo-dev** | Barry | Dev rapide brownfield |
|
|
36
|
+
|
|
37
|
+
## CIS Module (Creative Innovation & Strategy)
|
|
38
|
+
|
|
39
|
+
| Agent | Persona | Role |
|
|
40
|
+
|-------|---------|------|
|
|
41
|
+
| **brainstorming-coach** | Carson | Ideation, "YES AND" energy |
|
|
42
|
+
| **creative-problem-solver** | Dr. Quinn | Resolution de problemes |
|
|
43
|
+
| **design-thinking-coach** | Maya | Design thinking |
|
|
44
|
+
| **innovation-strategist** | Victor | Strategie innovation |
|
|
45
|
+
| **presentation-master** | Caravaggio | Presentations, slides |
|
|
46
|
+
| **storyteller** | Sophia | Storytelling, narratives |
|
|
47
|
+
|
|
48
|
+
## TEA Module (Test Engineering & Architecture)
|
|
49
|
+
|
|
50
|
+
| Agent | Persona | Role |
|
|
51
|
+
|-------|---------|------|
|
|
52
|
+
| **tea** | Murat | Master test architect (ATDD, NFR, CI/CD) |
|
|
53
|
+
|
|
54
|
+
## Workflows Cles
|
|
55
|
+
|
|
56
|
+
| Workflow | Description |
|
|
57
|
+
|----------|-------------|
|
|
58
|
+
| `create-prd` | Creer un Product Requirements Document |
|
|
59
|
+
| `create-architecture` | Concevoir l'architecture technique |
|
|
60
|
+
| `create-epics-and-stories` | Decouper en epics et user stories |
|
|
61
|
+
| `sprint-planning` | Planifier un sprint |
|
|
62
|
+
| `dev-story` | Developper une story |
|
|
63
|
+
| `code-review` | Revoir du code |
|
|
64
|
+
| `quick-spec` | Spec rapide conversationnelle |
|
|
65
|
+
| `quick-dev` | Dev rapide (brownfield) |
|
|
66
|
+
|
|
67
|
+
## Comment Invoquer un Agent
|
|
68
|
+
|
|
69
|
+
Dans Claude Code, demande simplement:
|
|
70
|
+
- "Je veux creer une architecture" → Hermes recommande `architect`
|
|
71
|
+
- "Analyse ce projet" → Hermes recommande `analyst`
|
|
72
|
+
- "Cree un nouvel agent" → Hermes recommande `byan`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Hermes - Dispatcher Universel BYAN
|
|
2
|
+
|
|
3
|
+
Hermes est le routeur intelligent de l'ecosysteme BYAN. Il ne fait pas le travail
|
|
4
|
+
lui-meme, il invoque le bon specialiste.
|
|
5
|
+
|
|
6
|
+
## Commandes Hermes
|
|
7
|
+
|
|
8
|
+
| Commande | Action |
|
|
9
|
+
|----------|--------|
|
|
10
|
+
| `[LA]` | Lister tous les agents par module |
|
|
11
|
+
| `[LW]` | Lister les workflows disponibles |
|
|
12
|
+
| `[LC]` | Lister les contextes projet |
|
|
13
|
+
| `[REC]` | Recommandation: decris ta tache, Hermes trouve le bon agent |
|
|
14
|
+
| `[PIPE]` | Pipelines multi-agents pour taches complexes |
|
|
15
|
+
| `[?agent]` | Quick help sur un agent sans le charger |
|
|
16
|
+
| `[@agent]` | Invoquer directement un agent |
|
|
17
|
+
| `[HELP]` | Reafficher le menu |
|
|
18
|
+
| `[EXIT]` | Quitter Hermes |
|
|
19
|
+
|
|
20
|
+
## Routage Intelligent
|
|
21
|
+
|
|
22
|
+
Quand un utilisateur decrit une tache, Hermes recommande le bon agent:
|
|
23
|
+
|
|
24
|
+
| Mots-cles | Agent recommande |
|
|
25
|
+
|-----------|------------------|
|
|
26
|
+
| analyser, requirements, brief, etude | analyst (Mary) |
|
|
27
|
+
| architecture, design, tech stack | architect (Winston) |
|
|
28
|
+
| coder, implementer, dev, feature | dev (Amelia) |
|
|
29
|
+
| tester, QA, coverage, bugs | quinn (QA) / tea (Murat) |
|
|
30
|
+
| planifier, sprint, backlog, scrum | sm (Bob) |
|
|
31
|
+
| documenter, guide, readme | tech-writer (Paige) |
|
|
32
|
+
| UX, design, mockup, interface | ux-designer (Sally) |
|
|
33
|
+
| PRD, produit, roadmap, specs | pm (John) |
|
|
34
|
+
| creer agent, workflow, module | byan (Builder) |
|
|
35
|
+
| brainstorm, idees, innovation | brainstorming-coach (Carson) |
|
|
36
|
+
| optimiser, tokens, performance | carmack (Optimizer) |
|
|
37
|
+
|
|
38
|
+
## Pipelines Predefinies
|
|
39
|
+
|
|
40
|
+
1. **Feature Complete**: PM → Architect → UX → SM → Dev → Tea
|
|
41
|
+
2. **Idea to Code**: PM → Architect → SM → Quick Flow
|
|
42
|
+
3. **New Agent**: BYAN (handles entire flow)
|
|
43
|
+
4. **Refactoring**: Architect → Dev → Tea
|
|
44
|
+
5. **Bug Fix**: Dev → Quinn
|
|
45
|
+
6. **Documentation**: Analyst → Tech Writer
|
|
46
|
+
7. **Quality Complete**: Tea → Quinn → code-review
|
|
47
|
+
|
|
48
|
+
## Manifestes
|
|
49
|
+
|
|
50
|
+
Hermes lit les manifestes CSV a l'execution:
|
|
51
|
+
- `_byan/_config/agent-manifest.csv` - Tous les agents installes
|
|
52
|
+
- `_byan/_config/workflow-manifest.csv` - Tous les workflows
|
|
53
|
+
- `_byan/_config/task-manifest.csv` - Toutes les tasks standalone
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Methodologie Merise Agile + TDD
|
|
2
|
+
|
|
3
|
+
BYAN utilise la methodologie Merise Agile enrichie de 64 mantras.
|
|
4
|
+
|
|
5
|
+
## Principes Fondamentaux
|
|
6
|
+
|
|
7
|
+
1. **Data Dictionary First** (Mantra #33): Definir les entites de donnees avant toute modelisation
|
|
8
|
+
2. **MCD-MCT Cross-Validation** (Mantra #34): Coherence entre modeles de donnees et traitements
|
|
9
|
+
3. **Bottom-Up from User Stories**: Les entites emergent des user stories
|
|
10
|
+
4. **Incremental Design**: Sprint 0 = MCD squelettique, enrichi sprint par sprint
|
|
11
|
+
5. **Test-Driven at All Levels**: Tests conceptuels avant implementation
|
|
12
|
+
|
|
13
|
+
## Mantras Cles
|
|
14
|
+
|
|
15
|
+
| ID | Mantra | Application |
|
|
16
|
+
|----|--------|-------------|
|
|
17
|
+
| #37 | Rasoir d'Ockham | Simplicite d'abord, approche MVP |
|
|
18
|
+
| #39 | Consequences | Evaluer avant d'executer |
|
|
19
|
+
| IA-1 | Trust But Verify | Challenger toutes les exigences |
|
|
20
|
+
| IA-16 | Challenge Before Confirm | Jouer l'avocat du diable |
|
|
21
|
+
| IA-23 | No Emoji Pollution | Zero emoji dans code, commits, specs |
|
|
22
|
+
| IA-24 | Clean Code | Auto-documente, commentaires minimaux |
|
|
23
|
+
|
|
24
|
+
## Cycle de Developpement BYAN
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Phase 0: Document Project (brownfield)
|
|
28
|
+
Phase 1: Analyse (Brief → PRD)
|
|
29
|
+
Phase 2: Planning (Architecture → Epics/Stories)
|
|
30
|
+
Phase 3: Solutioning (Sprint Planning)
|
|
31
|
+
Phase 4: Implementation (Dev → Test → Review)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Niveaux de Test
|
|
35
|
+
|
|
36
|
+
Priorite (preferer les niveaux bas):
|
|
37
|
+
1. **Unit** > **Integration** > **E2E**
|
|
38
|
+
2. Les tests API sont first-class citizens
|
|
39
|
+
3. Tout nouveau code necessite des tests unitaires
|
|
40
|
+
4. Chemins critiques: tests d'integration
|
|
41
|
+
5. Parcours utilisateur: tests E2E
|
|
42
|
+
|
|
43
|
+
## Convention Commits
|
|
44
|
+
|
|
45
|
+
Format: `type: description`
|
|
46
|
+
- Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
|
|
47
|
+
- PAS d'emojis dans les commits
|
|
48
|
+
- Description claire et concise en anglais
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-byan-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "BYAN v2.3.2 - Intelligent AI agent ecosystem with Hermes universal dispatcher + Multi-platform support (Copilot CLI, Claude, Codex) + Automatic LLM cost optimization (87.5% savings) + Node 12+ compatible",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|