Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The full gate runs type checking, Biome, dead-code analysis, skill/wish/council
- `src/genie.ts` is the Commander CLI entry point.
- `src/lib/v5/` owns SQLite state. Per-repo `.genie/genie.db` stores task state; global `~/.genie/genie.db` stores Omni state. Never mix their path/schema modules.
- `src/hooks/` owns provider-neutral lifecycle policy plus Claude/Codex wire adapters.
- `src/term-commands/` owns `init`, `launch`, MCP, Omni, task, and board commands.
- `src/term-commands/` owns `init`, `context`, MCP, Omni, task, and board commands.
- `plugins/genie/` is one shared plugin payload with sibling Claude and Codex manifests.
- `skills/` is shared runtime-neutral workflow guidance. Runtime mapping lives in `plugins/genie/references/native-surfaces.md`.
- `.genie/` contains git-tracked wishes/brainstorms/index plus gitignored operational SQLite files.
Expand All @@ -32,7 +32,7 @@ Genie v5 is zero-daemon except for the explicitly launched `genie omni serve` br
- Config migrations are narrow, backup-first, idempotent, and covered by fixtures.
- Every new CLI surface tests success, error exit code, stderr, and idempotency.
- Shared skills use roles and native delegation language, never a hardcoded client tool name.
- Subagents share a workspace unless the client explicitly guarantees otherwise. Parallel writers must have disjoint file ownership or dedicated worktrees; otherwise sequence them. Shared-workspace subagents never mutate repo-level git state (no `checkout`/`switch`/`reset`/`stash`/`rebase`) — **only the orchestrator moves HEAD**; work needing repo-level mutation gets a worktree via `genie launch` or gets sequenced. `git worktree add/remove/prune` on snapshot/lane paths is orchestrator-side plumbing and permitted. Genie task claims own shared-workspace scope; `genie launch` owns worktree isolation.
- Subagents share a workspace unless the client explicitly guarantees otherwise. Parallel writers must have disjoint file ownership or dedicated worktrees; otherwise sequence them. Shared-workspace subagents never mutate repo-level git state (no `checkout`/`switch`/`reset`/`stash`/`rebase`) — **only the orchestrator moves HEAD**; work needing repo-level mutation gets an isolated worktree arranged by the orchestrator (client-provided worktrees or explicit `git worktree add` plumbing) or gets sequenced. `git worktree add/remove/prune` on snapshot/lane paths is orchestrator-side plumbing and permitted. Genie task claims own shared-workspace scope; the orchestrator arranges worktree isolation.
- Reviewer and engineer are different roles. Never accept self-review as independent evidence.
- Codex agents inherit the active model; do not hardcode unstable model identifiers.
- Hook trust and workspace trust remain explicit user decisions.
Expand Down
14 changes: 8 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,34 +59,36 @@ src/lib/v5/ v5 state engine — SQLite, zero-daemon ("lightw
sqlite-open.ts Shared bun:sqlite open primitive (WAL, busy_timeout, typed errors)
task-state.ts Task / dependency / ready-set state machine
omni-queue.ts Approval-queue + inbox persistence for the Omni runner
warp-launch.ts Warp cockpit planner — one worktree per ready group
base-state.ts Integration-branch resolution + recorded wish-base state (context verb)
TAXONOMY.md The docs-in-git / state-in-SQLite contract
src/hooks/ Provider-neutral Claude/Codex hook dispatch and wire adapters
index.ts Handler chain + fail-closed envelope (buildFailClosedResponse)
dispatch-command.ts CLI entry: genie hook dispatch
handlers/ branch-guard, freshness, identity-inject, omni-approval, git-freeze-guard, audit-context
src/term-commands/ CLI command handlers (board, init, launch, omni, shortcuts, task, ...)
src/term-commands/ CLI command handlers (board, context, init, omni, shortcuts, task, ...)
skills/ Skill prompt files (brainstorm, wish, work, review, etc.)
.genie/ Per-repo state: git-tracked wishes/brainstorms/INDEX.md + genie.db (gitignored)
```

## CLI Commands

Fourteen top-level commands (run `genie <command> --help` for detail):
Sixteen top-level commands (run `genie <command> --help` for detail):

| Command | Purpose |
|---------|---------|
| `board` | Kanban view derived by query (no stored view state); `--board`, `--wish`, `--json` |
| `idea <text...>` | Capture an idea into the roadmap board Idea lane (creates the board if absent) |
| `doctor` | Diagnostic checks on the genie installation |
| `hook` | Hook middleware for Claude Code (`genie hook dispatch` runs in-process) |
| `init` | Scaffold per-repo state and reconcile `.mcp.json`, `.warp/.mcp.json`, plus the marker-owned `.codex/config.toml` stable-facade route |
| `init` | Scaffold per-repo state and reconcile `.mcp.json` plus the marker-owned `.codex/config.toml` stable-facade route |
| `install` | Post-install finisher — authenticated delivery, v4 cleanup (`--skip-v4-cleanup`), and non-Codex convergence |
| `launch <slug>` | Open a Warp cockpit for a wish: one pane per ready group, each in its own worktree |
| `context` | Resolve spawn context: wish/group branch + base SHA, or the integration branch (versioned JSON); `--plan` previews |
| `mcp` | Stdio MCP server exposing genie.db task/board state (read + write tools) |
| `omni` | Omni integration — `serve`, `status`, `inbox`, `handshake` |
| `setup` | Configure Genie; authenticated `setup --codex` owns Codex activation and managed convergence |
| `shortcuts` | Manage tmux keyboard shortcuts |
| `task` | Task state (SQLite, zero-daemon) |
| `ui-bridge` | UI-owned stdio MCP bridge into genie.db (reads + roster writes + change-push) |
| `uninstall` | Remove Genie CLI and clean up hooks |
| `update` | Update Genie CLI to the latest GitHub Release |
| `help` | `genie help [command]` |
Expand Down Expand Up @@ -141,7 +143,7 @@ Worktrees share the main repo's `.genie/genie.db` via `git rev-parse --git-commo
| `GENIE_AGENT_NAME` | Agent identity for hook dispatch |
| `GENIE_AGENT_ID` | Agent id used by hook identity injection |
| `GENIE_TEAM` | Default team when `--team` not provided |
| `GENIE_WORKTREES_DIR` | Override where `launch` creates per-group worktrees (default `<GENIE_HOME>/worktrees`) |
| `GENIE_WORKTREES_DIR` | Override the worktrees base the doctor launch-residue check and review snapshots use (default `<GENIE_HOME>/worktrees`) |
| `GENIE_CONFIG_FILE` | Override the resolved genie config path |
| `OMNI_*` | Omni runner config — `OMNI_APPROVALS_ENABLED`, `OMNI_API_URL`, `OMNI_API_KEY`, `OMNI_NATS_URL`, `OMNI_APPROVAL_CHAT`, `OMNI_INSTANCE`, `OMNI_APPROVE_TOKENS`/`OMNI_DENY_TOKENS` |

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Re-run `genie board` any time for a current snapshot of task state on the kanban
- **Skills** carry the methodology — `brainstorm → design review → wish → plan review → work → implementation review`, authored once for native Claude and Codex surfaces.
- **Documents in git.** Wishes, designs, and brainstorms are plain markdown under `.genie/wishes/<slug>/` and `.genie/brainstorms/<slug>/`; you diff, review, and version them like any other code.
- **One file of state.** Tasks, boards, dependency edges, and wish-group execution state live in a single per-repo SQLite file (`.genie/genie.db`), on Bun's built-in engine.
- **Small.** 14 CLI commands, 4 runtime dependencies (`@inquirer/prompts`, `commander`, `zod`, `nats`) — `nats` initializes only when the omni runner starts. A ~0.9 MB single-file bundle. Bun-powered.
- **Warp cockpit (optional).** `genie launch <slug>` turns a wish's ready groups into a Warp window — one pane per group, each in its own git worktree running that group's agent on a kickoff prompt. Emitting the launch config works on any platform; opening it needs Warp (macOS/Linux). Everywhere else the config is still written for you to open by hand.
- **Small.** 16 CLI commands, 4 runtime dependencies (`@inquirer/prompts`, `commander`, `zod`, `nats`) — `nats` initializes only when the omni runner starts. A ~0.9 MB single-file bundle. Bun-powered.
- **Spawn-context contract.** `genie context --wish <slug> [--group g] [--plan]` emits one line of versioned JSON — composed branch + resolved base SHA + ready tasks — that a spawn consumes. `--plan` previews the same payload without side effects; the wishless form resolves the repo's integration branch for plain spawns.
- **Zero daemons, no Postgres.** Nothing runs in the background between invocations.

## Commands
Expand All @@ -66,10 +66,12 @@ genie --help

| Command | What it does |
|---------|-------------|
| `genie init` | Scaffold per-repo state and reconcile project MCP files (`.mcp.json`, `.warp/.mcp.json`, and the marker-owned `.codex/config.toml` stable-facade route) |
| `genie launch` | Open a Warp cockpit for a wish — one pane per ready group, each in its own worktree |
| `genie init` | Scaffold per-repo state and reconcile project MCP files (`.mcp.json` and the marker-owned `.codex/config.toml` stable-facade route) |
| `genie context` | Resolve spawn context — wish/group branch + base SHA, or the integration branch (versioned JSON; `--plan` previews) |
| `genie board` | Kanban view of task state, derived live by query |
| `genie idea` | Capture an idea into the roadmap board Idea lane (creates the board if absent) |
| `genie task` | Inspect and drive task state (SQLite, zero-daemon) |
| `genie ui-bridge` | Run the UI-owned stdio MCP bridge into genie.db (reads + roster writes + change-push) |
| `genie install` | Finish a verified install and deliver selected integrations; Codex activation is deferred to setup |
| `genie mcp` | Serve Genie task/board state over stdio MCP (read + write tools) |
| `genie omni` | Bridge agents to WhatsApp via Omni — remote approvals + inbound one-shots (`serve`, `status`, `inbox`, `handshake`) |
Expand All @@ -93,7 +95,7 @@ Skills are the product. Invoke them as `/name` in Claude, `$genie:name` from the
| `review` | Severity-gated verdict — SHIP, FIX-FIRST, or BLOCKED |
| `council` | Independent architecture, delivery, product, security, and dissent assessment |

Shared skill bodies use a runtime-neutral delegation contract. Codex maps it to the optional `genie_*` custom-agent profiles installed by the CLI; a plugin-only install still has skills but no custom agents. Codex subagents share a workspace, so task claims own scope; use `genie launch` when worktree isolation is required. The engineer reports completion, an independent reviewer returns a verdict, and only the orchestrator runs `genie task done`. `/level-up` remains Claude-only because it evaluates Claude Code mastery.
Shared skill bodies use a runtime-neutral delegation contract. Codex maps it to the optional `genie_*` custom-agent profiles installed by the CLI; a plugin-only install still has skills but no custom agents. Codex subagents share a workspace, so task claims own scope; worktree isolation, when required, is orchestrator-arranged per the dispatch contract. The engineer reports completion, an independent reviewer returns a verdict, and only the orchestrator runs `genie task done`. `/level-up` remains Claude-only because it evaluates Claude Code mastery.

### Codex surface boundaries

Expand Down Expand Up @@ -179,17 +181,16 @@ All linked worktrees of a repository share one `genie.db`, resolved from the git
- Approval-gated agents launched with `--permission-mode default`. Under `auto` mode a passthrough `ask` can auto-resolve to allow, which defeats the timeout→ask fail-safe.
- `genie omni serve` running as the one resident process. It is the *only* NATS client — `--help`, `task`, `board`, and every other command stay transport-free (`nats` never initializes on those paths).

## MCP server (Warp + Claude Code + Codex)
## MCP server (Claude Code + Codex)

`genie mcp` is a zero-dependency [MCP](https://modelcontextprotocol.io) server over stdio exposing the operative task/board state: five read tools plus twelve `genie_task_*` write tools mirroring `genie task`. Codex does not launch it from the versioned plugin cache. Instead, every trusted initialized repository owns one marker-managed `.codex/config.toml` route pointing at the stable absolute `$GENIE_HOME/bin/genie mcp` facade, with no `cwd` override. Missing, symlinked, or path-escaped executables fail closed.

**How it gets picked up.** `genie init` reconciles Claude, Warp, and Codex project configs and may change the three project files named below; review those project-scoped commands before trusting the workspace. The Codex route is plugin-independent and is created or repaired only when its marker proves Genie ownership. Unowned same-key routes, damaged markers, nested shadowing, and untrusted repositories are preserved and reported rather than overwritten. `genie launch` applies the same marker-owned policy to its worktrees:
**How it gets picked up.** `genie init` reconciles Claude Code and Codex project configs and may change the two project files named below; review those project-scoped commands before trusting the workspace. The Codex route is plugin-independent and is created or repaired only when its marker proves Genie ownership. Unowned same-key routes, damaged markers, nested shadowing, and untrusted repositories are preserved and reported rather than overwritten.

- `.mcp.json` — Claude Code's project MCP config. Project-scope servers are *pending approval* until you trust the workspace (accept the trust dialog in an interactive `claude` session) — expected, not a bug.
- `.warp/.mcp.json` — Warp auto-detects this on save (no restart) and lists `genie` under Settings → AI/Agents → MCP servers.
- `.codex/config.toml` — marker-owned absolute stable-facade route with no effective `cwd` override.

The Claude and Warp JSON files use the identical `mcpServers` shape and are merged idempotently; the Codex TOML route uses marker-owned root-level dotted assignments so it cannot capture following keys. Re-running `genie init` preserves every other server and top-level key and rewrites byte-identical. A compiled Genie records the absolute executable plus `mcp`; an interpreted `bun src/genie.ts` or `bun dist/genie.js` run records the absolute Bun executable plus the absolute script and `mcp`. No route relies on bare `genie`, which is not reliably on PATH. Because `genie init`/`launch` run on the box that owns the repo, the recorded paths are correct even under Warp's SSH-remote feature, where Warp spawns the server on that same box.
The Claude JSON config uses the `mcpServers` shape and is merged idempotently; the Codex TOML route uses marker-owned root-level dotted assignments so it cannot capture following keys. Re-running `genie init` preserves every other server and top-level key and rewrites byte-identical. A compiled Genie records the absolute executable plus `mcp`; an interpreted `bun src/genie.ts` or `bun dist/genie.js` run records the absolute Bun executable plus the absolute script and `mcp`. No route relies on bare `genie`, which is not reliably on PATH. Because `genie init` runs on the box that owns the repo, the recorded paths are correct there.

**What it exposes** — five read tools backed by the per-repo `.genie/genie.db`, plus twelve operative write tools (`genie_task_create`, `genie_task_checkout`, `genie_task_done`, `genie_task_move`, `genie_task_block`, `genie_task_unblock`, `genie_task_release`, `genie_task_comment`, `genie_task_report`, `genie_task_heartbeat`, `genie_task_set_wish`, `genie_task_add_dependency`) that mirror the `genie task` CLI:

Expand All @@ -199,17 +200,16 @@ The Claude and Warp JSON files use the identical `mcpServers` shape and are merg
- `genie_task` — full task detail by id
- `genie_active` — every in-progress task and who claimed it

**Honest limitation — genie does not push into your tabs.** Warp exposes no external tab-push API, so genie cannot inject state into a pane. The flow is pull, not push: the pane's agent *asks* genie over MCP (`genie_worktree_context`, `genie_board`, …) when it wants to know the board state. `genie launch` still seeds each pane with a kickoff prompt at open time, but ongoing awareness is the agent querying the MCP server, not genie writing into the tab.
**Pull, not push.** Genie never injects state into a client session. The flow is pull: the agent *asks* genie over MCP (`genie_worktree_context`, `genie_board`, …) when it wants board state.

## Hermes-native surface

Genie also ships a Hermes-native plugin under `plugins/hermes-genie/` — seven read-only tools (doctor, board, wish/task queries, `launch --dry-run` plans), `/genie` slash commands, advisory hooks, and workflow skills, all wrapping the genie CLI through an argv-only subprocess bridge that marks every payload `mutation: "none"`. The boundary is deliberate: Hermes is the chat/reasoning cockpit; Genie remains the execution system and the source of task truth. Install and smoke-test instructions: [`plugins/hermes-genie/README.md`](plugins/hermes-genie/README.md).
Genie also ships a Hermes-native plugin under `plugins/hermes-genie/` — seven read-only tools (doctor, board, wish/task queries, `context --plan` spawn previews), `/genie` slash commands, advisory hooks, and workflow skills, all wrapping the genie CLI through an argv-only subprocess bridge that marks every payload `mutation: "none"`. The boundary is deliberate: Hermes is the chat/reasoning cockpit; Genie remains the execution system and the source of task truth. Install and smoke-test instructions: [`plugins/hermes-genie/README.md`](plugins/hermes-genie/README.md).

## Roadmap

No dates — direction, not promises:

- **Deeper Warp integration.** A Tab Config upgrade and richer pane orchestration on top of today's `genie launch`.
- **More emit targets.** Continue expanding native clients beyond Claude, Codex, and Hermes.
- **CDN distribution.** Serve signed releases from a CDN for faster, wider installs.

Expand Down
5 changes: 3 additions & 2 deletions plugins/genie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ invokes the plugin copies as `$genie:brainstorm`, `$genie:wish`, `$genie:review`
intentionally select the user tier, which now only ever holds a separately installed personal copy. Claude Code uses the
equivalent slash skills. Native subagents do not imply separate worktrees. Every engineer first claims its assigned task
with `genie task checkout <id> --worker <name>`, reports completion without mutating task state, and is reviewed by a
different agent. Only the orchestrator calls `genie task done <id>` after a SHIP verdict and passing validation. Use
`genie launch` when separate worktrees or a human-supervised Warp cockpit are required.
different agent. Only the orchestrator calls `genie task done <id>` after a SHIP verdict and passing validation. Separate
worktrees, when required, are orchestrator-arranged (client-provided worktrees or explicit `git worktree add`
plumbing per the dispatch contract).

Those selectors are for manual invocation. Each physical skill's `agents/openai.yaml` starter card is selector-free, so selecting a plugin-tier or user-tier card executes that already-selected physical skill instead of naming and potentially redirecting to the other tier.

Expand Down
Loading
Loading