Skip to content

Cross-tool adapter pass: Codex / Gemini / OpenCode #1

Description

@sawy3r

Goal

baton today ships slash commands for Claude Code only. Extend support to three additional CLI tools so a single ./install.sh provisions the harness into whichever directives ecosystem the adopter uses.

Target tools (in priority order):

Tool Rules file User-level commands dir Format
Claude Code ~/.claude/CLAUDE.md ~/.claude/commands/*.md markdown + frontmatter
OpenAI Codex CLI AGENTS.md (canonical) ~/.codex/prompts/*.md markdown
Gemini CLI GEMINI.md or AGENTS.md ~/.gemini/commands/*.toml TOML
OpenCode (SST) AGENTS.md ~/.config/opencode/command/ markdown

Cursor (no user-level commands) and Aider (no slash-command surface) are explicitly out of scope.

Why

The seven rules and three role contracts are tool-agnostic prose — they describe a protocol, not a tool. Restricting the install path to Claude Code is a packaging artefact, not a design constraint. Cross-tool support multiplies the adoption surface for zero rule-content rework.

Proposed architecture — two layers

Layer 1 — universal core (tool-agnostic, single source of truth):

~/.baton/
├── role-prompts/{planner,implementer,verifier}.md
├── release-mode-template/*
├── bin/release-verify.sh
└── AGENTS-fragment.md

Role-prompt content lives here once. Every tool's slash command reads the same file.

Layer 2 — per-tool adapter shims:

adapters/
├── claude-code/   # *.md slash commands → ~/.claude/commands/
├── codex/         # *.md prompts        → ~/.codex/prompts/
├── gemini/        # *.toml commands     → ~/.gemini/commands/
└── opencode/      # *.md commands       → ~/.config/opencode/command/

Each adapter command is a thin wrapper whose only behaviour is "read ~/.baton/role-prompts/<role>.md and follow it as your governing instructions." No role-content duplication.

install.sh evolution

Multi-tool installer:

./install.sh                              # auto-detect tools, install all matching adapters
./install.sh --tools=claude-code,codex    # explicit subset
./install.sh --core-only                  # Layer 1 only, skip all adapters
./install.sh --list-detected-tools        # probe + report, no install

Detection probes:

  • Claude Code: [[ -d ~/.claude ]]
  • Codex: command -v codex OR [[ -d ~/.codex ]]
  • Gemini: command -v gemini OR [[ -d ~/.gemini ]]
  • OpenCode: command -v opencode OR [[ -d ~/.config/opencode ]]

Migration path from v0.1.x users

Anyone who installed v0.1.x onto a machine should be able to either:

  • (a) Clean and re-install: rm -rf ~/.claude/baton ~/.claude/bin ~/.claude/commands/{plan,implement,verify,merge}-* then re-run the new install.sh.
  • (b) Re-run install.sh directly — it should be idempotent enough to overwrite the v0.1.x Claude-Code shims in place and additionally drop Layer 1 at its new ~/.baton/ home. Adapters point at $HOME/.baton/... instead of $HOME/.claude/baton/....

Rule content does not change across this transition.

Acceptance criteria

  • Layer 1 directory structure exists in the repo at core/ (or equivalent)
  • adapters/claude-code/ reproduces existing v0.1.x behaviour (regression-pinned)
  • adapters/codex/ lands four prompts at ~/.codex/prompts/ that successfully load ~/.baton/role-prompts/<role>.md
  • adapters/gemini/ lands four .toml commands at ~/.gemini/commands/ that load the same role prompts
  • adapters/opencode/ lands four .md commands at ~/.config/opencode/command/ that load the same role prompts
  • install.sh auto-detects each tool and installs its adapter when present; explicit --tools= override works
  • install.sh --dry-run prints all four adapters' would-be paths without copying
  • At least one slice has been driven through /plan-release/implement-slice/verify-slice end-to-end on a non-Claude-Code tool to validate the adapter path (smoke test, not exhaustive)
  • README's "Caveats" section drops the "Claude Code only" bullet
  • ROADMAP.md's "Now (shipped)" section updated to reflect cross-tool support

Out of scope for this issue

  • Claude Code plugin packaging (.claude-plugin/plugin.json + marketplace install). Separate issue when this lands.
  • IDE-only integrations (VS Code Copilot, JetBrains AI Assistant).
  • Cursor adapter (no user-level command surface; project-level only — covered if/when someone needs it).
  • Aider adapter (no slash-command surface at all; documented manual paste-role-prompts workflow only).

Reference

Full design is in ROADMAP.md. This issue tracks execution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions