diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 2c38727e6..ec9a0d56a 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ "plugins": [ { "name": "genie", - "version": "3.260317.3", + "version": "3.260317.6", "source": "./plugins/genie", "description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, wish them into plans, make with parallel agents, ship as one team. A coding genie that grows with your project." } diff --git a/openclaw.plugin.json b/openclaw.plugin.json index 3fe11d00f..3aa6a857f 100644 --- a/openclaw.plugin.json +++ b/openclaw.plugin.json @@ -2,7 +2,7 @@ "id": "genie", "name": "Genie", "description": "Skills, agents, and hooks for the Genie CLI terminal orchestration toolkit", - "version": "3.260317.3", + "version": "3.260317.6", "configSchema": { "type": "object", "additionalProperties": false, diff --git a/package.json b/package.json index 88a28f2a8..fc05ca861 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@automagik/genie", - "version": "3.260317.3", + "version": "3.260317.6", "description": "Collaborative terminal toolkit for human + AI workflows", "type": "module", "bin": { diff --git a/plugins/genie/.claude-plugin/plugin.json b/plugins/genie/.claude-plugin/plugin.json index a7c231f10..9f61bc307 100644 --- a/plugins/genie/.claude-plugin/plugin.json +++ b/plugins/genie/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "genie", - "version": "3.260317.3", + "version": "3.260317.6", "description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, turn them into wishes, execute with /work, validate with /review, and ship as one team.", "author": { "name": "Namastex Labs" diff --git a/plugins/genie/agents/team-lead.md b/plugins/genie/agents/team-lead.md index 4b23b620e..7b23e3ee5 100644 --- a/plugins/genie/agents/team-lead.md +++ b/plugins/genie/agents/team-lead.md @@ -48,17 +48,32 @@ Read the WISH.md at the path provided in your initial prompt. Parse execution gr **Gate:** All groups parsed, dependency DAG understood. If wish is unparseable or missing groups, report to PM and stop. -## Phase 2 — Execute Groups -Dispatch groups whose dependencies are satisfied. `genie work` auto-initializes state on first call — do NOT run `genie status` before your first dispatch. Just dispatch immediately. +## Phase 2 — Execute Waves +Read the **Execution Strategy** section from WISH.md. It defines waves — each wave lists groups that can run in parallel. `genie work` auto-initializes state on first call — do NOT run `genie status` before your first dispatch. Just dispatch immediately. -```bash -genie work engineer # # Auto-inits state, sets in_progress, spawns engineer -genie read -engineer # Monitor progress -genie done # # Mark group complete -genie status # Check progress (only AFTER first dispatch) -``` +For each wave, in order: + +1. **Dispatch all groups in the wave simultaneously:** + ```bash + genie work engineer # # For EACH group in the wave + ``` + The auto-suffix feature (`engineer` → `engineer-1`, `engineer-2`, etc.) prevents role collisions, so all groups in a wave launch at once. + +2. **Monitor all workers in the wave:** + ```bash + genie read -engineer- # Check individual worker progress + genie inbox # Read worker messages + genie status # Check overall progress (only AFTER first dispatch) + ``` + +3. **As each group completes, mark it done:** + ```bash + genie done # + ``` + +4. **When ALL groups in the current wave are done, advance to the next wave.** -One group per engineer dispatch. Wait for completion before marking done. +Independent groups within a wave run in parallel — dispatch them all, then monitor. Do not wait for one group to finish before dispatching the next group in the same wave. **Gate:** All groups show `done` in `genie status`. If any group is stuck after 2 fix attempts, mark team blocked and stop. @@ -166,8 +181,8 @@ gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments - **NEVER merge PRs to main or master.** Only humans do that. - **NEVER create tasks for yourself or speculative tasks for others.** - **NEVER modify files in `~/.claude/rules/` or `~/.claude/hooks/`.** -- Respect group dependency order strictly — no group starts before its dependencies complete. -- One group per engineer dispatch — do not batch multiple groups to one worker. +- Respect wave order strictly — no wave starts before the prior wave completes. +- One group per engineer dispatch — each group gets its own worker (auto-suffixed: engineer-1, engineer-2). Dispatch all groups in a wave simultaneously. - If blocked after 2 fix rounds, run `genie team blocked ` and stop. - Always push all work before exiting: `git pull --rebase && git push`. diff --git a/plugins/genie/agents/team-lead/AGENTS.md b/plugins/genie/agents/team-lead/AGENTS.md index 4b23b620e..7b23e3ee5 100644 --- a/plugins/genie/agents/team-lead/AGENTS.md +++ b/plugins/genie/agents/team-lead/AGENTS.md @@ -48,17 +48,32 @@ Read the WISH.md at the path provided in your initial prompt. Parse execution gr **Gate:** All groups parsed, dependency DAG understood. If wish is unparseable or missing groups, report to PM and stop. -## Phase 2 — Execute Groups -Dispatch groups whose dependencies are satisfied. `genie work` auto-initializes state on first call — do NOT run `genie status` before your first dispatch. Just dispatch immediately. +## Phase 2 — Execute Waves +Read the **Execution Strategy** section from WISH.md. It defines waves — each wave lists groups that can run in parallel. `genie work` auto-initializes state on first call — do NOT run `genie status` before your first dispatch. Just dispatch immediately. -```bash -genie work engineer # # Auto-inits state, sets in_progress, spawns engineer -genie read -engineer # Monitor progress -genie done # # Mark group complete -genie status # Check progress (only AFTER first dispatch) -``` +For each wave, in order: + +1. **Dispatch all groups in the wave simultaneously:** + ```bash + genie work engineer # # For EACH group in the wave + ``` + The auto-suffix feature (`engineer` → `engineer-1`, `engineer-2`, etc.) prevents role collisions, so all groups in a wave launch at once. + +2. **Monitor all workers in the wave:** + ```bash + genie read -engineer- # Check individual worker progress + genie inbox # Read worker messages + genie status # Check overall progress (only AFTER first dispatch) + ``` + +3. **As each group completes, mark it done:** + ```bash + genie done # + ``` + +4. **When ALL groups in the current wave are done, advance to the next wave.** -One group per engineer dispatch. Wait for completion before marking done. +Independent groups within a wave run in parallel — dispatch them all, then monitor. Do not wait for one group to finish before dispatching the next group in the same wave. **Gate:** All groups show `done` in `genie status`. If any group is stuck after 2 fix attempts, mark team blocked and stop. @@ -166,8 +181,8 @@ gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments - **NEVER merge PRs to main or master.** Only humans do that. - **NEVER create tasks for yourself or speculative tasks for others.** - **NEVER modify files in `~/.claude/rules/` or `~/.claude/hooks/`.** -- Respect group dependency order strictly — no group starts before its dependencies complete. -- One group per engineer dispatch — do not batch multiple groups to one worker. +- Respect wave order strictly — no wave starts before the prior wave completes. +- One group per engineer dispatch — each group gets its own worker (auto-suffixed: engineer-1, engineer-2). Dispatch all groups in a wave simultaneously. - If blocked after 2 fix rounds, run `genie team blocked ` and stop. - Always push all work before exiting: `git pull --rebase && git push`. diff --git a/plugins/genie/package.json b/plugins/genie/package.json index 9bf87c5c6..337fe0b25 100644 --- a/plugins/genie/package.json +++ b/plugins/genie/package.json @@ -1,6 +1,6 @@ { "name": "genie-plugin", - "version": "3.260317.3", + "version": "3.260317.6", "private": true, "description": "Runtime dependencies for genie bundled CLIs", "type": "module", diff --git a/plugins/genie/references/wish-template.md b/plugins/genie/references/wish-template.md deleted file mode 100644 index 3cd2987a9..000000000 --- a/plugins/genie/references/wish-template.md +++ /dev/null @@ -1,102 +0,0 @@ -# Wish: - -**Status:** DRAFT | IN_PROGRESS | REVIEW | DONE -**Slug:** `<slug>` -**Created:** YYYY-MM-DD - ---- - -## Summary - -<2-3 sentences: what we're building and why> - ---- - -## Scope - -### IN -- <what we're doing> -- <specific deliverables> - -### OUT -- <what we're explicitly not doing> -- <boundaries to prevent scope creep> - ---- - -## Decisions - -- **DEC-1:** <key decision with brief rationale> - ---- - -## Success Criteria - -- [ ] <overall testable criterion 1> -- [ ] <overall testable criterion 2> - ---- - -## Assumptions - -- **ASM-1:** <assumption that if wrong, changes the plan> - -## Risks - -- **RISK-1:** <risk description> — Mitigation: <how we handle it> - ---- - -## Execution Groups - -### Group A: <Name> - -**Goal:** <one sentence> - -**Deliverables:** -- <concrete output 1> -- <concrete output 2> - -**Acceptance Criteria:** -- [ ] <testable criterion> -- [ ] <testable criterion> - -**Validation:** `<command to verify completion>` - ---- - -### Group B: <Name> - -**Goal:** <one sentence> - -**Deliverables:** -- <concrete output> - -**Acceptance Criteria:** -- [ ] <testable criterion> - -**Validation:** `<command to verify completion>` - ---- - -## QA Criteria - -_What must be verified on dev after merge. The QA agent tests each criterion._ - -- [ ] <functional criterion — user-facing behavior works> -- [ ] <integration criterion — system works end-to-end> -- [ ] <regression criterion — existing behavior not broken> - ---- - -## Review Results - -_Populated by `/review` after execution completes._ - ---- - -## Files to Create/Modify - -``` -<list of files this wish will touch> -``` diff --git a/plugins/genie/scripts/smart-install.js b/plugins/genie/scripts/smart-install.js index 1e4641f58..ebf1a7a19 100644 --- a/plugins/genie/scripts/smart-install.js +++ b/plugins/genie/scripts/smart-install.js @@ -252,8 +252,6 @@ function getUpdateChannel() { function genieCliNeedsInstall() { const installed = getGenieVersion(); if (!installed) return true; - // Never overwrite dev builds — dev users update manually via genie update --next - if (getUpdateChannel() === 'next') return false; const pluginVersion = getPluginVersion(); if (!pluginVersion) return false; return installed !== pluginVersion; @@ -376,18 +374,18 @@ function installGenieCli() { throw new Error('Bun executable not found — cannot install genie CLI'); } - const pluginVersion = getPluginVersion(); + const updateChannel = getUpdateChannel(); + const tag = updateChannel === 'next' ? 'next' : 'latest'; const installed = getGenieVersion(); if (installed) { - console.error(`Upgrading genie CLI: ${installed} → ${pluginVersion}...`); + console.error(`Upgrading genie CLI: ${installed} → @${tag}...`); } else { console.error('Installing genie CLI globally via bun...'); } const bunCmd = IS_WINDOWS && bunPath.includes(' ') ? `"${bunPath}"` : bunPath; - const versionSuffix = pluginVersion ? `@${pluginVersion}` : ''; - execSync(`${bunCmd} install -g @automagik/genie${versionSuffix}`, { stdio: ['pipe', 'pipe', 'inherit'], shell: IS_WINDOWS }); + execSync(`${bunCmd} install -g @automagik/genie@${tag}`, { stdio: ['pipe', 'pipe', 'inherit'], shell: IS_WINDOWS }); const newVersion = getGenieVersion(); if (!newVersion) { diff --git a/skills/wish/SKILL.md b/skills/wish/SKILL.md index b37106b10..a9d0e3a7a 100644 --- a/skills/wish/SKILL.md +++ b/skills/wish/SKILL.md @@ -38,8 +38,10 @@ This skill is collaborative and operates on the shared worktree: | Scope IN / OUT | Yes | OUT cannot be empty | | Decisions | Yes | Key choices with rationale | | Success Criteria | Yes | Checkboxes, each testable | +| Execution Strategy | Yes | Wave-based parallel/sequential execution plan | | Execution Groups | Yes | Goal, deliverables, acceptance criteria, validation command | | Dependencies | No | `depends-on` / `blocks` using slug or `repo/slug` | +| QA Criteria | No | What must be verified on dev after merge | | Assumptions / Risks | No | Flag what could invalidate the plan | ## Wish Template @@ -76,6 +78,20 @@ Use this structure when writing `WISH.md`: - [ ] Testable criterion 1 - [ ] Testable criterion 2 +## Execution Strategy + +### Wave 1 (parallel) +| Group | Agent | Description | +|-------|-------|-------------| +| 1 | engineer | <task description> | +| 2 | engineer | <task description> | + +### Wave 2 (after Wave 1) +| Group | Agent | Description | +|-------|-------|-------------| +| 3 | engineer | <task description> | +| review | reviewer | Review Groups 1+2 | + ## Execution Groups ### Group 1: <Name> @@ -84,8 +100,8 @@ Use this structure when writing `WISH.md`: 1. Deliverable with acceptance criteria 2. Deliverable with acceptance criteria -**Acceptance criteria:** -- Criterion with validation command +**Acceptance Criteria:** +- [ ] Testable criterion **Validation:** ```bash @@ -96,10 +112,34 @@ Use this structure when writing `WISH.md`: --- +## QA Criteria + +_What must be verified on dev after merge. The QA agent tests each criterion._ + +- [ ] <functional criterion — user-facing behavior works> +- [ ] <integration criterion — system works end-to-end> +- [ ] <regression criterion — existing behavior not broken> + +--- + ## Assumptions / Risks | Risk | Severity | Mitigation | |------|----------|------------| | Risk 1 | Low/Medium/High | How to handle | + +--- + +## Review Results + +_Populated by `/review` after execution completes._ + +--- + +## Files to Create/Modify + +``` +<list of files this wish will touch> +``` ``` ## Rules @@ -108,3 +148,4 @@ Use this structure when writing `WISH.md`: - Keep tasks bite-sized and independently shippable. - Declare cross-wish dependencies early with `depends-on` / `blocks`. - OUT scope must contain at least one concrete exclusion. +- Execution Strategy is mandatory — every wish must define waves, even if sequential (single wave). This forces the planner to think about ordering, parallelism, and dependencies upfront. diff --git a/src/term-commands/agents.ts b/src/term-commands/agents.ts index 8727ae3b3..c569a3a3b 100644 --- a/src/term-commands/agents.ts +++ b/src/term-commands/agents.ts @@ -682,6 +682,8 @@ export interface SpawnOptions { cwd?: string; /** Initial prompt to send as the first user message (Claude Code positional [prompt] arg). */ initialPrompt?: string; + /** Override the role name for registration and duplicate-check (agent directory still resolves by `name`). */ + role?: string; } /** Resolve agent from directory, returning entry + derived CWD/identity/model/systemPromptFile. */ @@ -761,7 +763,10 @@ async function buildSpawnParams( } export async function handleWorkerSpawn(name: string, options: SpawnOptions): Promise<void> { - // 1. Resolve agent from directory or built-ins + // Effective role: suffixed name for registration/duplicate-check, original name for directory lookup + const effectiveRole = options.role ?? name; + + // 1. Resolve agent from directory or built-ins (uses original name) let agent = await resolveAgentForSpawn(name, options); // 2. Resolve team (track whether it was explicitly provided via --team) @@ -771,7 +776,7 @@ export async function handleWorkerSpawn(name: string, options: SpawnOptions): Pr console.error('Error: --team is required (or set GENIE_TEAM, or run inside a genie session)'); process.exit(1); } - await rejectDuplicateRole(team, name); + await rejectDuplicateRole(team, effectiveRole); // 2b. Override CWD with team worktree path if available const teamConfig = await teamManager.getTeam(team); @@ -780,17 +785,17 @@ export async function handleWorkerSpawn(name: string, options: SpawnOptions): Pr } // 3. Build params - const { params, parentSessionId, spawnColor } = await buildSpawnParams(name, team, options, agent); + const { params, parentSessionId, spawnColor } = await buildSpawnParams(effectiveRole, team, options, agent); const validated = validateSpawnParams(params); const launch = buildLaunchCommand(validated); const layoutMode = resolveLayoutMode(options.layout); - const workerId = await generateWorkerId(validated.team, name); + const workerId = await generateWorkerId(validated.team, effectiveRole); const insideTmux = Boolean(process.env.TMUX); const nt = validated.nativeTeam; const now = new Date().toISOString(); - const agentName = nt?.agentName ?? name; + const agentName = nt?.agentName ?? effectiveRole; // OTel relay for non-native workers (Codex) let otelRelayActive = false; diff --git a/src/term-commands/dispatch.ts b/src/term-commands/dispatch.ts index abb03311c..1038801d5 100644 --- a/src/term-commands/dispatch.ts +++ b/src/term-commands/dispatch.ts @@ -318,6 +318,7 @@ export async function workDispatchCommand(agentName: string, ref: string): Promi await handleWorkerSpawn(agentName, { provider: 'claude', team: process.env.GENIE_TEAM ?? 'genie', + role: `${agentName}-${group}`, extraArgs: ['--append-system-prompt-file', contextFile], initialPrompt: `Execute Group ${group} of wish "${slug}". Your full context is in the system prompt. Read the wish at ${wishPath} if needed. Implement all deliverables, run validation, and report completion.`, });