-
Notifications
You must be signed in to change notification settings - Fork 56
chore: promote dev → main (genie mcp registration + rules-ghost fix, v5.260705.5) #2527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "genie": { | ||
| "command": "genie", | ||
| "args": ["mcp"] | ||
|
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Use the absolute executable path here. Hard-coding Suggested fix- "command": "genie",
+ "command": "<absolute genie path>",As per path instructions, verify plugin manifest updates are consistent. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,20 @@ | ||
| # Genie CLI — Agent Orchestration | ||
| # Genie — Agent Orchestration (v5) | ||
| Genie is zero-daemon: docs live in git, task state in SQLite. Load `/genie` for full guidance. | ||
|
|
||
| Automagik Genie is installed. Load `/genie` to activate full orchestration guidance. | ||
|
|
||
| ## Essential Commands | ||
|
|
||
| ```bash | ||
| genie team create <name> --repo <path> --wish <slug> # Launch autonomous team | ||
| genie spawn <role> # Spawn agent (engineer, reviewer, qa, fix) | ||
| genie send '<msg>' --to <agent> # Message cross-session agent | ||
| genie wish status <slug> # Check wish progress | ||
| genie events list --since 5m # Recent structured events | ||
| genie events timeline <entity-id> # Full entity event history | ||
| genie ls --json # Agent state from PG | ||
| ``` | ||
|
|
||
| ## Tool Restrictions | ||
|
|
||
| NEVER use `Agent` to spawn agents — use `genie spawn` instead. | ||
| NEVER use `TeamCreate` or `TeamDelete` — use `genie team create` / `genie team disband` instead. | ||
|
|
||
| ## Spawn Session Rule | ||
|
|
||
| NEVER pass `--session <team-name>` to `genie spawn`. The team config already stores the correct `tmuxSessionName` (resolved at team creation from the parent session). Passing `--session` overrides this and creates a separate tmux session, breaking the topology. | ||
| ## Dispatch — native teams | ||
| - Spawn workers with the **Agent tool**: one call per execution group, all groups in a single message for parallel waves; workers run in the background and notify on completion. | ||
| - Follow-ups via **SendMessage**; each worker's final report returns as its Agent tool result. Push, not poll. | ||
| - Multi-session cockpit: `genie launch <slug> [--groups <csv>]` — one pane per ready group. | ||
|
|
||
| ## Task DB — the shared truth | ||
| ```bash | ||
| # WRONG — creates separate session | ||
| genie spawn reviewer --team my-team --session my-team | ||
|
|
||
| # CORRECT — uses team's configured session | ||
| genie spawn reviewer --team my-team | ||
| genie task checkout <id> --worker <name> # worker atomically claims its task | ||
| genie task status <id> # task detail + stage log | ||
| genie task list --json # all task state | ||
| genie board --wish <slug> --json # wish progress | ||
| genie task done <id> # ORCHESTRATOR marks done, after review + validation | ||
| ``` | ||
|
|
||
| The `--session` flag is for rare manual overrides only. When `--team` is set, let genie resolve the session from the team config. | ||
|
|
||
| ## Post-Dispatch Monitoring | ||
|
|
||
| After `genie team create` or `genie spawn`, use ONLY structured primitives. A hook enforces this automatically. | ||
|
|
||
| ### DO — Structured monitoring | ||
| | Need | Command | | ||
| |------|---------| | ||
| | Wish progress | `genie wish status <slug>` | | ||
| | Worker state | `genie ls --json` | | ||
| | Send instructions | `genie send '<msg>' --to <agent>` | | ||
| | Event timeline | `genie events timeline <id>` | | ||
| | Error patterns | `genie events errors` | | ||
|
|
||
| ### NEVER — Terminal scraping | ||
| - `tmux capture-pane` to check worker progress (BLOCKED by hook) | ||
| - `sleep` + poll loops to watch terminal output (BLOCKED by hook) | ||
| - Raw terminal text parsing for workflow decisions | ||
|
|
||
| ### Post-dispatch flow | ||
| 1. **Dispatch** — `genie team create` or `genie spawn` | ||
| 2. **Trust** — workers execute autonomously, report via PG events | ||
| 3. **Check** — `genie wish status <slug>` for progress | ||
| 4. **Communicate** — `genie send` for instructions | ||
| 5. **Review** — when workers report done, review output | ||
| ## Never | ||
| - Terminal-scrape (`tmux capture-pane`) or sleep-poll workers — use the primitives above; a hook nudges this. | ||
| - Workers marking their own tasks done — `done` is the orchestrator's verb, post-review. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,60 +239,10 @@ function genieCliNeedsInstall() { | |
| } | ||
|
|
||
|
|
||
| /** | ||
| * Read the current marker version (before installDeps overwrites it). | ||
| * Returns the version string or null if not found. | ||
| */ | ||
| function getMarkerVersion() { | ||
| try { | ||
| if (existsSync(MARKER)) { | ||
| const marker = JSON.parse(readFileSync(MARKER, 'utf-8')); | ||
| return marker.version || null; | ||
| } | ||
| } catch { | ||
| // Ignore | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Inject the orchestration prompt into ~/.claude/rules/genie-orchestration.md | ||
| * Reads from the rules file in the plugin directory. | ||
| * Only writes/rewrites if the plugin version changed. | ||
| * @param {string|null} oldVersion - marker version captured before installDeps ran | ||
| */ | ||
| function injectOrchestrationPrompt(oldVersion) { | ||
| const rulesDir = join(homedir(), '.claude', 'rules'); | ||
| const destFile = join(rulesDir, 'genie-orchestration.md'); | ||
|
|
||
| if (!existsSync(rulesDir)) { | ||
| mkdirSync(rulesDir, { recursive: true }); | ||
| } | ||
|
|
||
| let pluginVersion = null; | ||
| try { | ||
| const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8')); | ||
| pluginVersion = pkg.version || null; | ||
| } catch { | ||
| // Ignore | ||
| } | ||
|
|
||
| const fileExists = existsSync(destFile); | ||
| const versionChanged = !fileExists || oldVersion !== pluginVersion; | ||
|
|
||
| if (versionChanged) { | ||
| const sourceFile = join(ROOT, 'rules', 'genie-orchestration.md'); | ||
| if (existsSync(sourceFile)) { | ||
| const content = readFileSync(sourceFile, 'utf-8'); | ||
| writeFileSync(destFile, content, 'utf-8'); | ||
| console.error(`Orchestration rules installed: ${destFile}`); | ||
| } else { | ||
| // Fallback: write minimal inline message | ||
| writeFileSync(destFile, '# Genie CLI\n\nUse `genie` CLI for all agent operations. Never use native Agent/SendMessage tools.\n', 'utf-8'); | ||
| console.error(`Orchestration rules installed (fallback): ${destFile}`); | ||
| } | ||
| } | ||
| } | ||
| // NOTE: this script used to copy rules/genie-orchestration.md into | ||
| // ~/.claude/rules/ on version change. That injection is gone: the rules file | ||
| // is plugin-native (loaded from the plugin itself), and the copy kept | ||
| // resurrecting a file that `genie install`'s v4 cleanup deletes. | ||
|
Comment on lines
+242
to
+245
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user upgrades the plugin from the previous release without re-running Useful? React with 👍 / 👎. |
||
|
|
||
| /** | ||
| * Create default ~/.genie/config.json with schema v2 defaults if missing. | ||
|
|
@@ -456,7 +406,7 @@ try { | |
| if (!isTmuxInstalled()) { | ||
| console.error(''); | ||
| console.error('WARNING: tmux is not installed.'); | ||
| console.error('tmux is required for agent orchestration (genie spawn, teams, etc.).'); | ||
| console.error('tmux is required for the genie launch cockpit and TUI integration.'); | ||
| console.error('Non-interactive features still work without it.'); | ||
| console.error(''); | ||
| console.error('Install tmux:'); | ||
|
|
@@ -474,30 +424,20 @@ try { | |
| // Don't exit — let the rest of the chain run | ||
| } | ||
|
|
||
| // Capture marker version BEFORE installDeps overwrites it | ||
| const oldVersion = getMarkerVersion(); | ||
|
|
||
| // 3. Install plugin dependencies if needed | ||
| if (needsInstall()) { | ||
| installDeps(); | ||
| console.error('Dependencies installed'); | ||
| } | ||
|
|
||
| // 3a. Inject orchestration prompt (idempotent — checks version marker) | ||
| try { | ||
| injectOrchestrationPrompt(oldVersion); | ||
| } catch (e) { | ||
| console.error(`Warning: Could not write orchestration prompt: ${e.message}`); | ||
| } | ||
|
|
||
| // 3b. Create default config if missing (idempotent — never overwrites) | ||
| // 3a. Create default config if missing (idempotent — never overwrites) | ||
| try { | ||
| createDefaultConfig(); | ||
| } catch (e) { | ||
| console.error(`Warning: Could not create default config: ${e.message}`); | ||
| } | ||
|
|
||
| // 3c. Configure tmux TUI (scripts + config on first run) | ||
| // 3b. Configure tmux TUI (scripts + config on first run) | ||
| try { | ||
| configureTmux(); | ||
| } catch (e) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On installs where
genieis not on the non-interactive PATH, this static plugin MCP config registers a server that Claude cannot spawn. The existing project registration path explicitly avoids baregenieand writesprocess.execPathbecause the binary may only live under~/.genie/bin(src/term-commands/init.tslines 156-165, README lines 115-120), so users can have a valid install while this plugin-level server still fails. Use an absolute or shell-resolved command here, or rely on thegenie init/launchgenerated MCP configs.Useful? React with 👍 / 👎.