create-byan-agent 2.41.0 → 2.42.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.
- package/CHANGELOG.md +51 -0
- package/install/bin/byan-handoff.js +139 -0
- package/install/bin/create-byan-agent-v2.js +30 -9
- package/install/lib/codex-native-setup.js +94 -2
- package/install/lib/project-handoff.js +300 -0
- package/install/lib/rtk-integration.js +81 -14
- package/install/templates/.claude/CLAUDE.md +16 -0
- package/install/templates/.claude/settings.json +24 -24
- package/install/templates/.claude/skills/byan-byan/SKILL.md +14 -0
- package/install/templates/.claude/skills/byan-codex/SKILL.md +7 -0
- package/install/templates/.codex/skills/byan/SKILL.md +77 -0
- package/install/templates/_byan/INDEX.md +6 -2
- package/install/templates/_byan/_config/workflow-manifest.csv +1 -1
- package/install/templates/_byan/mcp/byan-mcp-server/skill-bundles-manifest.json +2 -2
- package/install/templates/_byan/workflow/simple/byan/project-handoff-workflow.md +90 -0
- package/install/templates/dist/skill-bundles/byan-byan.zip +0 -0
- package/install/templates/dist/skill-bundles/byan-codex.zip +0 -0
- package/install/templates/docs/codex-auto-delegation.md +140 -0
- package/package.json +2 -1
|
@@ -5,16 +5,20 @@
|
|
|
5
5
|
*
|
|
6
6
|
* RTK ("Rust Token Killer", Apache-2.0) is a single zero-dependency binary that
|
|
7
7
|
* filters/compresses dev-command output before it reaches the LLM context
|
|
8
|
-
* (-60/90% tokens). It wires into Claude Code through its OWN hook installer
|
|
8
|
+
* (-60/90% tokens). It wires into Claude Code through its OWN hook installer;
|
|
9
|
+
* for Codex installs BYAN can make the native binary available, but does not
|
|
10
|
+
* claim a transparent hook layer where Codex has no BYAN hook adapter.
|
|
9
11
|
*
|
|
10
12
|
* MAINTAINABILITY by design (the whole point of choosing this shape):
|
|
11
13
|
* - We do NOT reimplement per-OS download / checksum / version pinning. We
|
|
12
14
|
* DELEGATE the install to rtk's own canonical installer (brew / the official
|
|
13
15
|
* install.sh / cargo), and DELEGATE the Claude Code hook wiring to rtk's own
|
|
14
16
|
* `rtk init -g --auto-patch` (the `--auto-patch` is what makes it non-
|
|
15
|
-
* interactive — see wireHook). BYAN
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* interactive — see wireHook). For Codex, BYAN stops at verified native
|
|
18
|
+
* binary availability and reports that honestly. BYAN maintains only "pick
|
|
19
|
+
* the available installer, run it bounded + visible, locate the binary, ask
|
|
20
|
+
* rtk to wire its hook when Claude is targeted" — a tiny surface, bumped via
|
|
21
|
+
* one constant.
|
|
18
22
|
* - SUPPLY-CHAIN: we pin to a TAG, never a moving branch. cargo builds the
|
|
19
23
|
* tagged source (`--tag`), and install.sh is fetched from the IMMUTABLE tag ref.
|
|
20
24
|
* That script verifies a SHA-256 of the downloaded binary against a published
|
|
@@ -39,8 +43,8 @@
|
|
|
39
43
|
*
|
|
40
44
|
* Mirrors the ENTRY-POINT shape of byan-web-integration.js / byan-leantime-
|
|
41
45
|
* integration.js (one `setup*Integration`); the return contract is { ok, synced,
|
|
42
|
-
* reason, ... } because persistence is owned by rtk's own `rtk init -g
|
|
43
|
-
* byan-platform-config.
|
|
46
|
+
* reason, ... } because persistence is owned by rtk's own `rtk init -g
|
|
47
|
+
* --auto-patch`, not by byan-platform-config.
|
|
44
48
|
*/
|
|
45
49
|
|
|
46
50
|
const { execSync } = require('child_process');
|
|
@@ -128,6 +132,48 @@ function pathHintFor(bin, { env = process.env, platform = process.platform } = {
|
|
|
128
132
|
return `export PATH="${dir}:$PATH"`;
|
|
129
133
|
}
|
|
130
134
|
|
|
135
|
+
function normalizeTargetPlatforms(targetPlatforms = ['claude']) {
|
|
136
|
+
const raw = Array.isArray(targetPlatforms) ? targetPlatforms : [targetPlatforms];
|
|
137
|
+
const set = new Set();
|
|
138
|
+
for (const p of raw) {
|
|
139
|
+
const key = String(p || '').trim().toLowerCase();
|
|
140
|
+
if (key === 'claude' || key === 'claude-code') set.add('claude');
|
|
141
|
+
if (key === 'codex') set.add('codex');
|
|
142
|
+
}
|
|
143
|
+
if (!set.size) set.add('claude');
|
|
144
|
+
return set;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function codexReady({
|
|
148
|
+
log,
|
|
149
|
+
installedVia,
|
|
150
|
+
version,
|
|
151
|
+
bin = 'rtk',
|
|
152
|
+
env = process.env,
|
|
153
|
+
platform = process.platform,
|
|
154
|
+
claudeHook = false,
|
|
155
|
+
} = {}) {
|
|
156
|
+
const offPath = bin !== 'rtk';
|
|
157
|
+
log(`rtk: ready for Codex (${installedVia}, v${version || '?'}) — native binary available; no transparent Codex hook is wired.`);
|
|
158
|
+
const r = {
|
|
159
|
+
ok: true,
|
|
160
|
+
synced: true,
|
|
161
|
+
reason: 'codex-binary-ready',
|
|
162
|
+
installed: true,
|
|
163
|
+
installedVia,
|
|
164
|
+
version,
|
|
165
|
+
hook: Boolean(claudeHook),
|
|
166
|
+
claudeHook: Boolean(claudeHook),
|
|
167
|
+
codexReady: true,
|
|
168
|
+
bin,
|
|
169
|
+
};
|
|
170
|
+
if (offPath) {
|
|
171
|
+
r.pathHint = pathHintFor(bin, { env, platform });
|
|
172
|
+
log(`rtk: note — installed at ${bin}, not on your PATH. Add it: ${r.pathHint}`);
|
|
173
|
+
}
|
|
174
|
+
return r;
|
|
175
|
+
}
|
|
176
|
+
|
|
131
177
|
/**
|
|
132
178
|
* rtkStatus() -> { installed, version, bin }. Never throws. Probes `<bin>
|
|
133
179
|
* --version` ("rtk 0.42.4"), default bin "rtk" (on PATH). An installed-but-
|
|
@@ -209,7 +255,7 @@ function wireHook({ run, log, installedVia, version, bin = 'rtk', env = process.
|
|
|
209
255
|
try {
|
|
210
256
|
run(initCmd, { stdio: 'pipe' });
|
|
211
257
|
log(`rtk: ready (${installedVia}, v${version || '?'}) — hook wired via '${initCmd}'. Restart Claude Code to activate.`);
|
|
212
|
-
const r = { ok: true, synced: true, reason: 'wired', installed: true, installedVia, version, hook: true, bin };
|
|
258
|
+
const r = { ok: true, synced: true, reason: 'wired', installed: true, installedVia, version, hook: true, claudeHook: true, bin };
|
|
213
259
|
if (offPath) {
|
|
214
260
|
r.pathHint = pathHintFor(bin, { env, platform });
|
|
215
261
|
log(`rtk: note — installed at ${bin}, not on your PATH. Add it: ${r.pathHint}`);
|
|
@@ -217,7 +263,7 @@ function wireHook({ run, log, installedVia, version, bin = 'rtk', env = process.
|
|
|
217
263
|
return r;
|
|
218
264
|
} catch (err) {
|
|
219
265
|
log(`rtk: installed (${installedVia}) but '${initCmd}' failed (${oneLine(err)}) — run it manually, BYAN unaffected.`);
|
|
220
|
-
const r = { ok: true, synced: false, reason: 'hook-failed', installed: true, installedVia, version, hook: false, bin };
|
|
266
|
+
const r = { ok: true, synced: false, reason: 'hook-failed', installed: true, installedVia, version, hook: false, claudeHook: false, bin };
|
|
221
267
|
if (offPath) r.pathHint = pathHintFor(bin, { env, platform });
|
|
222
268
|
return r;
|
|
223
269
|
}
|
|
@@ -240,6 +286,9 @@ function wireHook({ run, log, installedVia, version, bin = 'rtk', env = process.
|
|
|
240
286
|
* @param {Function} [o.resolve] binary resolver (default resolveBinary) — injected in tests
|
|
241
287
|
* @param {Function} [o.log] one-line breadcrumb sink (default no-op)
|
|
242
288
|
* @param {object} [o.env] environment (default process.env) — for the timeout override
|
|
289
|
+
* @param {string[]|string} [o.targetPlatforms] platforms to prepare:
|
|
290
|
+
* claude wires RTK's Claude Code hook; codex verifies the
|
|
291
|
+
* native binary and reports no transparent hook.
|
|
243
292
|
*/
|
|
244
293
|
function setupRtkIntegration({
|
|
245
294
|
run = execSync,
|
|
@@ -248,16 +297,33 @@ function setupRtkIntegration({
|
|
|
248
297
|
log = () => {},
|
|
249
298
|
env = process.env,
|
|
250
299
|
platform = process.platform,
|
|
300
|
+
targetPlatforms = ['claude'],
|
|
251
301
|
} = {}) {
|
|
302
|
+
const targets = normalizeTargetPlatforms(targetPlatforms);
|
|
303
|
+
const wantsClaude = targets.has('claude');
|
|
304
|
+
const wantsCodex = targets.has('codex');
|
|
305
|
+
const finishReady = ({ installedVia, version, bin }) => {
|
|
306
|
+
if (!wantsClaude && wantsCodex) {
|
|
307
|
+
return codexReady({ log, installedVia, version, bin, env, platform });
|
|
308
|
+
}
|
|
309
|
+
const r = wireHook({ run, log, installedVia, version, bin, env, platform });
|
|
310
|
+
if (wantsCodex && r.installed) {
|
|
311
|
+
r.codexReady = true;
|
|
312
|
+
if (r.reason === 'wired') r.reason = 'wired+codex-binary-ready';
|
|
313
|
+
log('rtk: also ready for Codex — native binary available; no transparent Codex hook is wired.');
|
|
314
|
+
}
|
|
315
|
+
return r;
|
|
316
|
+
};
|
|
317
|
+
|
|
252
318
|
const before = locateRtk({ run, has, resolve, env });
|
|
253
319
|
if (before.installed) {
|
|
254
|
-
return
|
|
320
|
+
return finishReady({ installedVia: 'already-present', version: before.version, bin: before.bin });
|
|
255
321
|
}
|
|
256
322
|
|
|
257
323
|
const strat = pickStrategy({ has });
|
|
258
324
|
if (!strat) {
|
|
259
325
|
log('rtk: no installer found (brew / curl / cargo) — skipped. BYAN install unaffected.');
|
|
260
|
-
return { ok: true, synced: false, reason: 'no-installer', installed: false, hook: false };
|
|
326
|
+
return { ok: true, synced: false, reason: 'no-installer', installed: false, hook: false, claudeHook: false, codexReady: false };
|
|
261
327
|
}
|
|
262
328
|
|
|
263
329
|
// Breadcrumb BEFORE the delegated install. stdio is INHERITED so the installer's
|
|
@@ -269,10 +335,10 @@ function setupRtkIntegration({
|
|
|
269
335
|
} catch (err) {
|
|
270
336
|
if (isTimeout(err)) {
|
|
271
337
|
log(`rtk: install via ${strat.id} exceeded ${Math.round(timeoutMs / MIN)}min — stopped (a background build may still continue). Retry with 'npm run setup-rtk' (or widen BYAN_RTK_TIMEOUT_MS). BYAN unaffected.`);
|
|
272
|
-
return { ok: true, synced: false, reason: `install-timeout:${strat.id}`, installed: false, hook: false };
|
|
338
|
+
return { ok: true, synced: false, reason: `install-timeout:${strat.id}`, installed: false, hook: false, claudeHook: false, codexReady: false };
|
|
273
339
|
}
|
|
274
340
|
log(`rtk: install via ${strat.id} failed (${oneLine(err)}) — skipped gracefully.`);
|
|
275
|
-
return { ok: true, synced: false, reason: `install-failed:${strat.id}`, installed: false, hook: false };
|
|
341
|
+
return { ok: true, synced: false, reason: `install-failed:${strat.id}`, installed: false, hook: false, claudeHook: false, codexReady: false };
|
|
276
342
|
}
|
|
277
343
|
|
|
278
344
|
// The binary may be installed but OFF PATH (cargo -> ~/.cargo/bin). Resolve it
|
|
@@ -280,10 +346,10 @@ function setupRtkIntegration({
|
|
|
280
346
|
const after = locateRtk({ run, has, resolve, env });
|
|
281
347
|
if (!after.installed) {
|
|
282
348
|
log(`rtk: install via ${strat.id} ran but 'rtk --version' did not confirm — skipped.`);
|
|
283
|
-
return { ok: true, synced: false, reason: 'install-unverified', installed: false, hook: false };
|
|
349
|
+
return { ok: true, synced: false, reason: 'install-unverified', installed: false, hook: false, claudeHook: false, codexReady: false };
|
|
284
350
|
}
|
|
285
351
|
|
|
286
|
-
return
|
|
352
|
+
return finishReady({ installedVia: strat.id, version: after.version, bin: after.bin });
|
|
287
353
|
}
|
|
288
354
|
|
|
289
355
|
/**
|
|
@@ -307,6 +373,7 @@ module.exports = {
|
|
|
307
373
|
timeoutFor,
|
|
308
374
|
isTimeout,
|
|
309
375
|
pathHintFor,
|
|
376
|
+
normalizeTargetPlatforms,
|
|
310
377
|
doctor,
|
|
311
378
|
shouldOfferRtk,
|
|
312
379
|
RTK_VERSION,
|
|
@@ -67,6 +67,22 @@ Doctrine d'equipe complete (template role-in-team, analogie orchestre, principes
|
|
|
67
67
|
- Architecture portable (noyau portable, projection native): voir .claude/rules/portable-core.md (charge a la demande)
|
|
68
68
|
- Systeme API byan_web: voir @.claude/rules/byan-api.md
|
|
69
69
|
|
|
70
|
+
## Handoff Claude/Codex
|
|
71
|
+
|
|
72
|
+
Quand l'utilisateur demande `importe depuis claude` ou `importe depuis codex`,
|
|
73
|
+
ne demande pas de precision si un handoff depuis cette source existe. Lance:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
byan-handoff latest --from <source demandee> --prompt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Utilise le prompt produit comme contexte de reprise, inspecte les fichiers listes,
|
|
80
|
+
puis continue le travail. Si aucun fichier ne correspond, signale simplement
|
|
81
|
+
qu'aucun handoff depuis cette source n'a ete trouve et propose
|
|
82
|
+
`byan-handoff latest --prompt` comme fallback seulement si l'utilisateur accepte
|
|
83
|
+
de reprendre depuis le dernier handoff toutes sources confondues. Ne t'appuie
|
|
84
|
+
pas sur les memoires natives Claude/Codex comme source de verite.
|
|
85
|
+
|
|
70
86
|
## API byan_web
|
|
71
87
|
|
|
72
88
|
BYAN expose une API REST via `$BYAN_API_URL` avec authentification par token (`ApiKey` ou `Bearer`).
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "
|
|
9
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-soul.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "
|
|
13
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-tao.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "command",
|
|
17
|
-
"command": "
|
|
17
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/soul-memory-check.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
@@ -25,27 +25,27 @@
|
|
|
25
25
|
"hooks": [
|
|
26
26
|
{
|
|
27
27
|
"type": "command",
|
|
28
|
-
"command": "
|
|
28
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-voice-anchor.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"command": "
|
|
32
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-delivery-default.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"type": "command",
|
|
36
|
-
"command": "
|
|
36
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/soul-memory-triggers.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"type": "command",
|
|
40
|
-
"command": "
|
|
40
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/fd-phase-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"type": "command",
|
|
44
|
-
"command": "
|
|
44
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/strict-context-inject.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"type": "command",
|
|
48
|
-
"command": "
|
|
48
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/codex-autodelegate.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
}
|
|
@@ -56,35 +56,35 @@
|
|
|
56
56
|
"hooks": [
|
|
57
57
|
{
|
|
58
58
|
"type": "command",
|
|
59
|
-
"command": "
|
|
59
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/mantra-validate.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"type": "command",
|
|
63
|
-
"command": "
|
|
63
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/fact-check-claims.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"type": "command",
|
|
67
|
-
"command": "
|
|
67
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/fd-response-check.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"type": "command",
|
|
71
|
-
"command": "
|
|
71
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/stage-to-byan.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"type": "command",
|
|
75
|
-
"command": "
|
|
75
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/strict-stop-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"type": "command",
|
|
79
|
-
"command": "
|
|
79
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/autobench-stop-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"type": "command",
|
|
83
|
-
"command": "
|
|
83
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/punt-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"type": "command",
|
|
87
|
-
"command": "
|
|
87
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/drain-advisory.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
88
88
|
}
|
|
89
89
|
]
|
|
90
90
|
}
|
|
@@ -95,15 +95,15 @@
|
|
|
95
95
|
"hooks": [
|
|
96
96
|
{
|
|
97
97
|
"type": "command",
|
|
98
|
-
"command": "
|
|
98
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/tool-transparency.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"type": "command",
|
|
102
|
-
"command": "
|
|
102
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/fact-check-absolutes.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"type": "command",
|
|
106
|
-
"command": "
|
|
106
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/strict-scope-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
107
107
|
}
|
|
108
108
|
]
|
|
109
109
|
},
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"hooks": [
|
|
113
113
|
{
|
|
114
114
|
"type": "command",
|
|
115
|
-
"command": "
|
|
115
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/tier-script-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
118
|
}
|
|
@@ -123,11 +123,11 @@
|
|
|
123
123
|
"hooks": [
|
|
124
124
|
{
|
|
125
125
|
"type": "command",
|
|
126
|
-
"command": "
|
|
126
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/tool-failure-guard.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"type": "command",
|
|
130
|
-
"command": "
|
|
130
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/leantime-fd-sync.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
131
131
|
}
|
|
132
132
|
]
|
|
133
133
|
}
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"hooks": [
|
|
139
139
|
{
|
|
140
140
|
"type": "command",
|
|
141
|
-
"command": "
|
|
141
|
+
"command": "p=\"$CLAUDE_PROJECT_DIR/.claude/hooks/pre-compact-save.js\"; [ -f \"$p\" ] || exit 0; exec node \"$p\""
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -18,6 +18,20 @@ Invoke this protocol when the user :
|
|
|
18
18
|
|
|
19
19
|
If the user request is a simple question or chat, stay out of FD — respond normally.
|
|
20
20
|
|
|
21
|
+
## 1.25. Claude/Codex handoff import trigger
|
|
22
|
+
|
|
23
|
+
When the user says `importe depuis claude` or `importe depuis codex`, handle it
|
|
24
|
+
before starting a new FD cycle:
|
|
25
|
+
|
|
26
|
+
1. Run `byan-handoff latest --from <requested source> --prompt`.
|
|
27
|
+
2. Use the generated prompt as resume context, inspect the listed files, then
|
|
28
|
+
continue the current work.
|
|
29
|
+
|
|
30
|
+
If no matching handoff exists, say that no handoff from that source was found and
|
|
31
|
+
offer `byan-handoff latest --prompt` as the fallback only if the user accepts
|
|
32
|
+
resuming from the newest handoff across all sources. Do not rely on native
|
|
33
|
+
Claude/Codex memory as the source of truth.
|
|
34
|
+
|
|
21
35
|
## 1.5. Freshness check (silent, once per session)
|
|
22
36
|
|
|
23
37
|
Before responding to the user's first activation message in a session, call the MCP tool `byan_update_check` once. It is read-only and cheap (single npm registry lookup, 5s timeout, no side effects).
|
|
@@ -19,3 +19,10 @@ description: "OpenCode/Codex integration specialist for BYAN skills Role: OpenCo
|
|
|
19
19
|
- Validate .codex/prompts/ structure
|
|
20
20
|
- Test skill detection before deployment
|
|
21
21
|
- Handle Codex-specific terminology (skills not agents)
|
|
22
|
+
- When the user says `importe depuis claude` or `importe depuis codex`, run
|
|
23
|
+
`byan-handoff latest --from <requested source> --prompt`, then resume from
|
|
24
|
+
the generated prompt after inspecting the listed files. If none matches,
|
|
25
|
+
report that no handoff from that source exists and offer
|
|
26
|
+
`byan-handoff latest --prompt` as fallback only if the user accepts resuming
|
|
27
|
+
from the newest handoff across all sources. Native Claude/Codex memory is not
|
|
28
|
+
the source of truth.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byan
|
|
3
|
+
description: BYAN local project skill. Use when working in the BYAN repo, invoking BYAN agents/workflows/commands, enforcing BYAN Strict Mode, or needing the portable BYAN filesystem map.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BYAN Local Skill
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks for BYAN behavior, mentions BYAN/BMAD, asks to
|
|
9
|
+
run an agent or workflow from this repo, or works on the BYAN platform itself.
|
|
10
|
+
|
|
11
|
+
## Source Of Truth
|
|
12
|
+
|
|
13
|
+
BYAN's portable core lives in this repository. Do not treat native assistant
|
|
14
|
+
memory, generated caches, or platform-specific projections as authoritative.
|
|
15
|
+
|
|
16
|
+
Read `_byan/INDEX.md` first to find agents, workflows, commands, and project
|
|
17
|
+
artefacts. Avoid broad filesystem scans unless the index is missing, stale, or
|
|
18
|
+
insufficient for the requested task.
|
|
19
|
+
|
|
20
|
+
Core references:
|
|
21
|
+
|
|
22
|
+
- `_byan/INDEX.md` — filesystem map for BYAN agents, workflows, commands, and projects.
|
|
23
|
+
- `AGENTS.md` — Codex adapter for BYAN Strict Mode and delivery defaults.
|
|
24
|
+
- `.claude/rules/portable-core.md` — portable-core doctrine: `_byan/` and
|
|
25
|
+
`_byan-output/` are the source of truth; native platform features are
|
|
26
|
+
write-through accelerators.
|
|
27
|
+
- `_byan/agent/byan/byan.md` — BYAN core meta-agent when the task requires the
|
|
28
|
+
full BYAN persona and FD workflow.
|
|
29
|
+
|
|
30
|
+
## Strict Mode
|
|
31
|
+
|
|
32
|
+
When BYAN Strict Mode is active, follow the audit protocol before delivery:
|
|
33
|
+
|
|
34
|
+
1. Lock scope with `byan_strict_lock_scope` before building.
|
|
35
|
+
2. Build the locked scope without silent downgrade.
|
|
36
|
+
3. Run at least three `byan_strict_self_verify` passes against the original
|
|
37
|
+
request and acceptance criteria.
|
|
38
|
+
4. Call `byan_strict_complete` only after the final pass is `ok`.
|
|
39
|
+
|
|
40
|
+
Surface gaps explicitly. Do not round skipped tests, blocked tools, or partial
|
|
41
|
+
work up to done.
|
|
42
|
+
|
|
43
|
+
## Working Rules
|
|
44
|
+
|
|
45
|
+
- Prefer BYAN's local manifests and `_byan/INDEX.md` over filesystem wandering.
|
|
46
|
+
- Keep Codex-specific material under `.codex/` or installed Codex skills under
|
|
47
|
+
`$CODEX_HOME/skills` / `~/.codex/skills`.
|
|
48
|
+
- Use existing BYAN agents and workflows instead of inventing parallel
|
|
49
|
+
conventions.
|
|
50
|
+
- If a public surface changes, update the matching doc, manifest, template, or
|
|
51
|
+
generated projection when applicable.
|
|
52
|
+
- Preserve BYAN's no-emoji convention in code, commits, docs, and prompts.
|
|
53
|
+
|
|
54
|
+
## Claude/Codex Handoff Import
|
|
55
|
+
|
|
56
|
+
When the user says `importe depuis claude` or `importe depuis codex`, handle it
|
|
57
|
+
without asking for more context if a matching handoff exists:
|
|
58
|
+
|
|
59
|
+
1. Run `byan-handoff latest --from <requested source> --prompt`.
|
|
60
|
+
2. Treat the generated prompt as the resume context, inspect the listed files,
|
|
61
|
+
then continue the work.
|
|
62
|
+
|
|
63
|
+
If no matching handoff exists, say that no handoff from that source was found and
|
|
64
|
+
offer `byan-handoff latest --prompt` as the fallback only if the user accepts
|
|
65
|
+
resuming from the newest handoff across all sources. Do not rely on native
|
|
66
|
+
Claude/Codex memory as the source of truth.
|
|
67
|
+
|
|
68
|
+
## Installed Bundles In This Repo
|
|
69
|
+
|
|
70
|
+
Prebuilt Codex skill bundles are available under `dist/skill-bundles/`, including:
|
|
71
|
+
|
|
72
|
+
- `byan-byan.zip` — full BYAN FD/meta-agent skill.
|
|
73
|
+
- `byan-strict.zip` — strict scope-lock and audit protocol.
|
|
74
|
+
- `byan-codex.zip` — Codex/OpenCode integration specialist.
|
|
75
|
+
|
|
76
|
+
Use those bundles when the user asks for a specific packaged BYAN skill. Use this
|
|
77
|
+
local `byan` skill as the general repo-aware entrypoint.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> Carte du systeme de fichiers BYAN. Genere automatiquement — ne pas editer a la main.
|
|
4
4
|
> Source : `_byan/_config/*-manifest.csv` + scan `_byan/projet/`. Regenerer : `byan-build-index`.
|
|
5
5
|
|
|
6
|
-
## Agents (
|
|
6
|
+
## Agents (28)
|
|
7
7
|
|
|
8
8
|
### bmb
|
|
9
9
|
- `agent-builder` — Agent Building Expert — `_byan/agent/agent-builder/agent-builder.md`
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
- `architect` — Architect — `_byan/agent/architect/architect.md`
|
|
19
19
|
- `dev` — Developer Agent — `_byan/agent/dev/dev.md`
|
|
20
20
|
- `expert-merise-agile` — Expert Merise Agile - Assistant de Conception & Rédaction — `_byan/agent/expert-merise-agile/expert-merise-agile.md`
|
|
21
|
+
- `jimmy` — Spécialiste Documentation Technique & Processus Internes — `_byan/agent/jimmy/jimmy.md`
|
|
22
|
+
- `mike` — Gestionnaire de Projet — Spécialiste Leantime — `_byan/agent/mike/mike.md`
|
|
21
23
|
- `pm` — Product Manager — `_byan/agent/pm/pm.md`
|
|
22
24
|
- `quick-flow-solo-dev` — Quick Flow Solo Dev — `_byan/agent/quick-flow-solo-dev/quick-flow-solo-dev.md`
|
|
23
25
|
- `quinn` — QA Engineer — `_byan/agent/quinn/quinn.md`
|
|
@@ -41,10 +43,11 @@
|
|
|
41
43
|
### tea
|
|
42
44
|
- `tea` — Master Test Architect and Quality Advisor — `_byan/agent/tea/tea.md`
|
|
43
45
|
|
|
44
|
-
## Workflows (
|
|
46
|
+
## Workflows (47)
|
|
45
47
|
|
|
46
48
|
### bmb
|
|
47
49
|
- `agent` — Tri-modal workflow for creating, editing, and validating BMAD Core compliant agents — `_byan/workflow/simple/agent/workflow.md`
|
|
50
|
+
- `byan-benchmark` — DATA-only benchmark engine for any decision fork: options x weighted-criteria matrix + best-first reco + dissent — `_byan/workflow/simple/bmb/byan-benchmark/workflow.md`
|
|
48
51
|
- `module` — Quad-modal workflow for creating BMAD modules (Brief + Create + Edit + Validate) — `_byan/workflow/simple/module/workflow.md`
|
|
49
52
|
- `turbo-whisper-configure` — Configure Turbo Whisper API, hotkeys, and preferences — `_byan/workflow/simple/turbo-whisper/configure-workflow.md`
|
|
50
53
|
- `turbo-whisper-docker-setup` — Setup self-hosted faster-whisper-server with Docker for privacy and cost-free transcription — `_byan/workflow/simple/turbo-whisper/docker-setup-workflow.md`
|
|
@@ -86,6 +89,7 @@
|
|
|
86
89
|
### core
|
|
87
90
|
- `brainstorming` — Facilitate interactive brainstorming sessions using diverse creative techniques and ideation methods — `_byan/workflow/simple/brainstorming/workflow.md`
|
|
88
91
|
- `party-mode` — Orchestrates group discussions between all installed BMAD agents, enabling natural multi-agent conversations — `_byan/workflow/simple/party-mode/workflow.md`
|
|
92
|
+
- `project-handoff` — Export/import portable Markdown project state between Claude Code and Codex — `_byan/workflow/simple/byan/project-handoff-workflow.md`
|
|
89
93
|
|
|
90
94
|
### tea
|
|
91
95
|
- `teach-me-testing` — Multi-session learning companion that teaches testing progressively through 7 structured sessions with state persistence — `_byan/workflow/simple/testarch/teach-me-testing/workflow.md`
|
|
@@ -45,4 +45,4 @@ name,description,module,path
|
|
|
45
45
|
"turbo-whisper-docker-setup","Setup self-hosted faster-whisper-server with Docker for privacy and cost-free transcription","bmb","_byan/workflow/simple/turbo-whisper/docker-setup-workflow.md"
|
|
46
46
|
"turbo-whisper-integrate","Integrate Turbo Whisper with GitHub Copilot CLI, Claude Code, and Codex platforms","bmb","_byan/workflow/simple/turbo-whisper/integrate-workflow.md"
|
|
47
47
|
"byan-benchmark","DATA-only benchmark engine for any decision fork: options x weighted-criteria matrix + best-first reco + dissent","bmb","_byan/workflow/simple/bmb/byan-benchmark/workflow.md"
|
|
48
|
-
|
|
48
|
+
"project-handoff","Export/import portable Markdown project state between Claude Code and Codex","core","_byan/workflow/simple/byan/project-handoff-workflow.md"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"name": "byan-byan",
|
|
95
95
|
"module": "core",
|
|
96
96
|
"tier": "connector-bound",
|
|
97
|
-
"sourceHash": "
|
|
97
|
+
"sourceHash": "6798beb68df9831e0b9bf3ca17100174316c51b2671d96b2ef5bff6def4eabc7"
|
|
98
98
|
},
|
|
99
99
|
"byan-byan-v2": {
|
|
100
100
|
"name": "byan-byan-v2",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"name": "byan-codex",
|
|
155
155
|
"module": "core",
|
|
156
156
|
"tier": "standalone",
|
|
157
|
-
"sourceHash": "
|
|
157
|
+
"sourceHash": "32f2ae4a9bfe7a0f90f2ca9787e472c57b847bc36ac9bc6fa0050af70c0af27c"
|
|
158
158
|
},
|
|
159
159
|
"byan-drawio": {
|
|
160
160
|
"name": "byan-drawio",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-handoff
|
|
3
|
+
description: "Export/import portable Markdown project state between Claude Code and Codex"
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
module: byan
|
|
6
|
+
phases: 4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# BYAN Project Handoff Workflow
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Use this workflow when a BYAN session must move between Claude Code and Codex,
|
|
14
|
+
usually because one assistant is close to a usage limit. The handoff artifact is
|
|
15
|
+
a Markdown file under `_byan-output/handoffs/`; it is portable repo state, not
|
|
16
|
+
native assistant memory.
|
|
17
|
+
|
|
18
|
+
## Contract
|
|
19
|
+
|
|
20
|
+
- Source of truth: repository files plus `_byan/` and `_byan-output/`.
|
|
21
|
+
- Artifact: `_byan-output/handoffs/<timestamp>-<from>-to-<to>-<task>.md`.
|
|
22
|
+
- Format: human-readable Markdown with a parseable `json byan-handoff` block.
|
|
23
|
+
- Direction: Claude -> Codex and Codex -> Claude use the same format.
|
|
24
|
+
- Native memories (`~/.claude`, `~/.codex`) may help locally but are not needed
|
|
25
|
+
to resume.
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
Export from the current assistant:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
byan-handoff export --from claude --to codex \
|
|
33
|
+
--task "current feature" \
|
|
34
|
+
--summary "what happened so far" \
|
|
35
|
+
--next "first action for the next assistant"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Import on the next assistant:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
byan-handoff latest --from claude --prompt
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or import a specific file:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
byan-handoff import _byan-output/handoffs/<file>.md --prompt
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Phase 1: Export
|
|
51
|
+
|
|
52
|
+
1. Re-read the active request and any locked BYAN strict scope.
|
|
53
|
+
2. Run `byan-handoff export` with explicit `--from`, `--to`, `--task`,
|
|
54
|
+
`--summary`, and at least one `--next`.
|
|
55
|
+
3. Add useful optional details:
|
|
56
|
+
- `--decision "..."` for architectural or product decisions.
|
|
57
|
+
- `--command "..."` for tests or checks already run.
|
|
58
|
+
- `--blocker "..."` for gaps, failures, or risks.
|
|
59
|
+
- `--note "..."` for context the next assistant should not rediscover.
|
|
60
|
+
4. Report the generated file path to the user.
|
|
61
|
+
|
|
62
|
+
## Phase 2: Transfer
|
|
63
|
+
|
|
64
|
+
The user opens the same repository with the other assistant. No hidden copy step
|
|
65
|
+
is required when both assistants share the same working tree. If the handoff is
|
|
66
|
+
moving to another machine, copy the Markdown file with the repo or paste its
|
|
67
|
+
`Resume Prompt` section.
|
|
68
|
+
|
|
69
|
+
## Phase 3: Import
|
|
70
|
+
|
|
71
|
+
1. Run `byan-handoff latest --from <source> --prompt` or
|
|
72
|
+
`byan-handoff import <file> --prompt`.
|
|
73
|
+
2. Treat the printed prompt as the starting context.
|
|
74
|
+
3. Inspect the listed files before editing.
|
|
75
|
+
4. Check `_byan-output/fd-state.json` and strict status if the handoff names an
|
|
76
|
+
active FD.
|
|
77
|
+
|
|
78
|
+
## Phase 4: Continue
|
|
79
|
+
|
|
80
|
+
1. Continue from the `Next Actions` section.
|
|
81
|
+
2. Update the same FD rather than starting a parallel one unless the handoff says
|
|
82
|
+
the old FD is complete or aborted.
|
|
83
|
+
3. Before switching back, create a new handoff in the opposite direction.
|
|
84
|
+
|
|
85
|
+
## Validation Checklist
|
|
86
|
+
|
|
87
|
+
- [ ] Handoff file exists under `_byan-output/handoffs/`.
|
|
88
|
+
- [ ] `byan-handoff latest --from <source> --prompt` prints a usable resume prompt.
|
|
89
|
+
- [ ] The next assistant inspected files listed in `Files Touched`.
|
|
90
|
+
- [ ] Any strict-mode gaps are surfaced, not hidden.
|
|
Binary file
|
|
Binary file
|