mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-04 06:21:59 +09:00
`ruflo init --dual` (and `@claude-flow/codex init --dual`) wrote two divergent instruction files. Now AGENTS.md carries the shared sections once plus the Codex-only ones, and CLAUDE.md is Claude Code's `@AGENTS.md` import plus only the Claude-specific sections. - codex/src/generators/shared-instructions.ts: the shared sections (rules, swarm routing, memory & learning, agents, build & test, CLI reference). The CLI keeps a byte-identical mirror (a test compares the files) because it resolves @claude-flow/codex from the registry at the pinned version. - claudemd-generator.ts builds its shared sections from that module; single-host output is byte-identical (snapshot recorded on origin/main). New generateDualClaudeMd keeps only Claude-only sections + template extras. - Existing CLAUDE.md is only replaced when missing, generated by init and unedited, or under --force (backed up); otherwise kept with migration steps. - After the Codex pass, finalizeDualInstructions keeps the import only if AGENTS.md carries every shared section verbatim; else the full CLAUDE.md is written back, so an older codex adapter cannot lose content. - commands/init.ts (outside the lane's file list): pass instructionsSource and dual to the two passes, run the finalize step, never pass --dual to a fetched adapter of unknown version. Fixes #2638 Co-Authored-By: RuFlo <ruv@ruv.net>