@automagik/genie 4.260324.9 → 4.260324.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "genie",
13
- "version": "4.260324.9",
13
+ "version": "4.260324.11",
14
14
  "source": "./plugins/genie",
15
15
  "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."
16
16
  }
package/README.md CHANGED
@@ -13,275 +13,50 @@
13
13
 
14
14
  <h2 align="center">Wishes in, PRs out.</h2>
15
15
 
16
- <p align="center">Describe the problem. Genie interviews you, plans the work, dispatches agents, and reviews the code.<br/>You approve and ship.</p>
17
-
18
- <p align="center">
19
- <a href="#install"><strong>Install</strong></a> &middot;
20
- <a href="#quick-start"><strong>Quick Start</strong></a> &middot;
21
- <a href="#features"><strong>Features</strong></a> &middot;
22
- <a href="https://discord.gg/xcW8c7fF3R"><strong>Discord</strong></a>
23
- </p>
24
-
25
- <br/>
26
-
27
16
  ## What is Genie?
28
17
 
29
- Genie is a CLI that turns vague ideas into shipped PRs through a structured pipeline. Describe what you want — Genie interviews you to capture the full context, builds a plan with acceptance criteria, dispatches specialized agents to execute in parallel, and runs automated review before anything reaches your eyes. You make decisions. Genie does everything else.
30
-
31
- ## Genie is right for you if
32
-
33
- - ✅ You've re-explained your codebase architecture to Claude Code for the third time this week
34
- - ✅ You have 5+ AI coding tabs open and can't remember which one is doing what
35
- - ✅ You've watched an AI agent spiral for 20 minutes because it lost the original context
36
- - ✅ You want AI to ask *you* the right questions before writing code, not the other way around
37
- - ✅ You want to go to lunch and come back to reviewed PRs, not a stuck terminal
38
- - ✅ You want a repeatable process that works the same whether you're focused or half-asleep
39
- <br/>
18
+ Genie is an AI orchestration CLI that turns vague ideas into shipped PRs. You describe the problem — Genie interviews you, plans the work, dispatches parallel agents, and reviews the code. You approve and ship.
40
19
 
41
- ## Install
20
+ ## Get Started
42
21
 
43
- ```bash
44
- curl -fsSL https://raw.githubusercontent.com/automagik-dev/genie/main/install.sh | bash
45
- ```
46
-
47
- Sets up everything: Bun, tmux, Claude Code plugin, orchestration config. Update anytime with `genie update`.
48
-
49
- <details>
50
- <summary>Alternative: npm install</summary>
22
+ Paste this into your AI coding agent (Claude Code, Codex, etc.):
51
23
 
52
- ```bash
53
- npm install -g @automagik/genie
54
24
  ```
25
+ Install Genie, then run /wizard to set up this project:
55
26
 
56
- > Installs the CLI only. You'll need Bun 1.3.10+, tmux, and `genie setup` for full plugin integration.
57
-
58
- </details>
59
-
60
- > **Requirements:** macOS or Linux, [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
61
-
62
- ## Quick Start
63
-
64
- **Interactive (you drive):**
65
-
66
- | Step | Command |
67
- |------|---------|
68
- | **01. Launch** | `genie` |
69
- | **02. Wish** | `/wish fix the authentication bug in the login flow` |
70
- | **03. Ship** | Genie asks questions, builds a plan, executes it. You approve the PR. |
71
-
72
- **Autonomous (team-lead drives):**
73
-
74
- | Step | Command |
75
- |------|---------|
76
- | **01. Plan** | `/wish` — define scope, acceptance criteria, execution groups |
77
- | **02. Launch** | `genie team create auth-fix --repo . --wish auth-bug` |
78
- | **03. Ship** | Team-lead hires agents, dispatches work, runs review loops. You approve the PR. |
79
- <br/>
80
-
81
- ## Features
82
-
83
- <table>
84
- <tr>
85
- <td align="center" width="33%"><h3>🧞 Wish Pipeline</h3>
86
- Brainstorm, plan, execute, review, ship — consistent results every time.
87
- </td>
88
- <td align="center" width="33%"><h3>🤖 Autonomous Team-Lead</h3>
89
- <code>genie team create --wish</code> — team-lead hires agents, dispatches work, runs fix loops, and opens the PR. You approve.
90
- </td>
91
- <td align="center" width="33%"><h3>🧠 Context Preservation</h3>
92
- Scoped specialists instead of one bloated window. No context rot.
93
- </td>
94
- </tr>
95
- <tr>
96
- <td align="center"><h3>💾 Persistent Memory</h3>
97
- Knowledge vault that agents search before answering. Compounds daily.
98
- </td>
99
- <td align="center"><h3>🔍 Automated Review</h3>
100
- Severity-tagged review. Nothing ships with CRITICAL or HIGH issues.
101
- </td>
102
- <td align="center"><h3>🌙 Overnight Execution</h3>
103
- Queue wishes before bed. Wake up to reviewed PRs.
104
- </td>
105
- </tr>
106
- <tr>
107
- <td align="center"><h3>👥 10-Critic Council</h3>
108
- 10 specialists critique your design before you commit to anything.
109
- </td>
110
- <td align="center"><h3>🎯 Behavioral Learning</h3>
111
- Genie adapts to your codebase conventions and preferences.
112
- </td>
113
- <td align="center"><h3>📦 Portable Context</h3>
114
- Identity, skills, memory — markdown files you own. Git-versioned.
115
- </td>
116
- </tr>
117
- </table>
118
- <br/>
119
-
120
- ## Without Genie vs. With Genie
121
-
122
- | ❌ Without Genie | ✅ With Genie |
123
- |---|---|
124
- | Re-explain your codebase to Claude every session | Genie interviews you once. Context flows to every agent. |
125
- | Copy-paste requirements, hope it understood | `/wish` captures scope and acceptance criteria upfront |
126
- | One Claude tab per task, alt-tab between 5 of them | Parallel agents in live terminal sessions |
127
- | Eyeball generated code, miss a bug, fix at 2am | Automated `/review` with severity-tagged gaps |
128
- | 45 min in, Claude forgets your instructions | Scoped specialists — no context window accumulates junk |
129
- | 10 min of setup before any work starts | `genie team create auth-fix --repo . --wish auth-bug` — team-lead handles the rest |
130
- <br/>
131
-
132
- ## The Wish Pipeline
133
-
134
- 💭 `/brainstorm` → 🧞 `/wish` → ⚙️ `/work` → 🔍 `/review` → 🚀 **ship**
135
-
136
- | Stage | What happens |
137
- |-------|-------------|
138
- | **Brainstorm** | Think out loud. Genie asks clarifying questions until the idea is concrete. |
139
- | **Wish** | Crystallize intent into a plan with scope and acceptance criteria. |
140
- | **Work** | Agents spawn in isolated worktrees, execute in parallel. |
141
- | **Review** | Automated review with severity gates. Nothing merges without passing. |
142
- | **Ship** | PR created, checks pass, you merge. |
143
- <br/>
144
-
145
- <details id="cli-reference">
146
- <summary><strong>CLI Reference</strong></summary>
147
-
148
- **Entry point:**
149
-
150
- | Command | Description |
151
- |---------|-------------|
152
- | `genie` | Persistent session in current directory |
153
- | `genie --session <name>` | Named/resumed leader session |
154
-
155
- **Team (autonomous execution):**
156
-
157
- | Command | Description |
158
- |---------|-------------|
159
- | `genie team create <name> --repo <path>` | Form team + git worktree |
160
- | `genie team create <name> --repo <path> --wish <slug>` | Form team and auto-spawn team-lead with wish context |
161
- | `genie team hire <agent>` | Add agent to team |
162
- | `genie team hire council` | Hire all 10 council members |
163
- | `genie team fire <agent>` | Remove agent from team |
164
- | `genie team ls [<name>]` | List teams or team members |
165
- | `genie team done <name>` | Mark team done, kill all members |
166
- | `genie team blocked <name>` | Mark team blocked, kill all members |
167
- | `genie team disband <name>` | Kill members, remove worktree, delete config |
168
-
169
- **Dispatch (lifecycle orchestration):**
170
-
171
- | Command | Description |
172
- |---------|-------------|
173
- | `genie brainstorm <agent> <slug>` | Spawn agent with brainstorm context |
174
- | `genie wish <agent> <slug>` | Spawn agent with design for wish creation |
175
- | `genie work <agent> <slug>#<group>` | Check deps, set in\_progress, spawn with context |
176
- | `genie review <agent> <slug>#<group>` | Spawn agent with review scope |
177
- | `genie done <slug>#<group>` | Mark group done, unblock dependents |
178
- | `genie reset <slug>#<group>` | Reset in-progress group back to ready |
179
- | `genie status <slug>` | Show wish group states |
180
-
181
- **Agent lifecycle:**
182
-
183
- | Command | Description |
184
- |---------|-------------|
185
- | `genie spawn <name>` | Spawn registered agent or built-in role |
186
- | `genie kill <name>` | Force kill agent |
187
- | `genie stop <name>` | Stop current run, keep pane alive |
188
- | `genie ls` | List agents, teams, state |
189
- | `genie history <name>` | Compressed session timeline |
190
- | `genie read <name>` | Tail agent pane output |
191
- | `genie answer <name> <choice>` | Answer agent prompt |
192
-
193
- **Messaging:**
194
-
195
- | Command | Description |
196
- |---------|-------------|
197
- | `genie send '<msg>' --to <name>` | Direct message (scoped to own team) |
198
- | `genie broadcast '<msg>'` | Leader to all team members |
199
- | `genie chat '<msg>'` | Team group channel |
200
- | `genie chat read` | Read team channel history |
201
- | `genie inbox [<name>]` | View inbox |
202
-
203
- **Directory (agent registry):**
204
-
205
- | Command | Description |
206
- |---------|-------------|
207
- | `genie dir add <name>` | Register agent (`--dir`, `--prompt-mode`, `--model`, `--roles`) |
208
- | `genie dir rm <name>` | Remove agent from directory |
209
- | `genie dir ls [<name>]` | List all or show single entry |
210
- | `genie dir edit <name>` | Update entry fields |
211
-
212
- **Infrastructure:**
213
-
214
- | Command | Description |
215
- |---------|-------------|
216
- | `genie setup` | Interactive setup wizard |
217
- | `genie doctor` | Diagnose configuration issues |
218
- | `genie update` | Update to latest version (`--next` for dev builds, `--stable` for releases) |
219
- | `genie shortcuts show\|install\|uninstall` | tmux keyboard shortcuts |
220
-
221
- </details>
222
-
223
- <details id="configuration">
224
- <summary><strong>Configuration</strong></summary>
225
-
226
- ### Agent Directory
227
-
228
- Register custom agents with a directory path, prompt mode, and optional model. Built-in roles (engineer, reviewer, qa, fix, refactor, trace, docs, learn, council) are available out of the box.
229
-
230
- ```bash
231
- genie dir add my-agent --dir /path/to/agent --prompt-mode append
232
- genie dir ls # List all registered agents
233
- genie dir ls --builtins # Include built-in roles
234
- genie dir edit my-agent --model opus # Update config
235
- genie dir rm my-agent # Remove registration
27
+ curl -fsSL https://raw.githubusercontent.com/automagik-dev/genie/main/install.sh | bash
28
+ genie
29
+ /wizard
236
30
  ```
237
31
 
238
- ### Worktrees
32
+ That's it. The wizard handles everything: project scaffold, identity, first wish, execution, and review.
239
33
 
240
- Teams work in isolated git worktrees so agents never conflict with your working tree.
34
+ ## What Happens Next
241
35
 
242
36
  ```
243
- ~/.genie/worktrees/<project>/<team>/
244
- ```
245
-
246
- Configurable via `genie setup --terminal` `worktreeBase`. Worktrees are created on `genie team create` and cleaned up on `genie team disband`.
247
-
248
- ### Setup
249
-
250
- ```bash
251
- genie setup # Interactive wizard (hooks, terminal, shortcuts, sessions)
252
- genie setup --quick # Recommended defaults
253
- genie setup --show # Show current configuration
254
- genie setup --reset # Reset to defaults
37
+ You describe an idea
38
+ └─ /brainstorm ─── Genie asks clarifying questions until the idea is concrete
39
+ └─ /wish ───── Crystallizes intent into a plan with scope + acceptance criteria
40
+ └─ /work ── Agents spawn in isolated worktrees, execute in parallel
41
+ └─ /review ── Automated severity-gated review. You approve the PR.
255
42
  ```
256
43
 
257
- ### Config Files
258
-
259
- | File | Purpose |
260
- |------|---------|
261
- | `~/.genie/config.json` | Terminal settings, session config, worker profiles |
262
- | `~/.claude/settings.json` | Claude Code settings (hooks registered here) |
263
-
264
- </details>
265
-
266
- <br/>
267
-
268
- ## Development
269
-
270
- ```bash
271
- bun run build # Build CLI
272
- bun run check # Typecheck + lint + dead-code + test
273
- bun test # Run tests
274
- genie doctor # Diagnose issues
275
- ```
44
+ ## Why Genie?
276
45
 
277
- Uninstall: `curl -fsSL https://raw.githubusercontent.com/automagik-dev/genie/main/install.sh | bash -s -- uninstall`
46
+ - **No re-explaining** — Genie captures context once. Every agent inherits it.
47
+ - **Parallel execution** — Multiple agents work simultaneously in isolated worktrees.
48
+ - **Automated review** — Severity-tagged gaps. Nothing ships with CRITICAL issues.
49
+ - **Overnight mode** — Queue wishes before bed. Wake up to reviewed PRs.
50
+ - **10-critic council** — 10 specialists critique your design before you commit.
51
+ - **Portable context** — Identity, skills, memory — markdown files you own, git-versioned.
278
52
 
279
53
  ---
280
54
 
281
55
  <p align="center">
282
- <a href="https://github.com/automagik-dev/genie">GitHub</a> &middot;
283
- <a href="https://discord.gg/xcW8c7fF3R">Discord</a> &middot;
284
- <a href="LICENSE">MIT License</a>
56
+ <a href="https://docs.automagik.dev/genie"><strong>Documentation</strong></a> &middot;
57
+ <a href="https://github.com/automagik-dev/genie"><strong>GitHub</strong></a> &middot;
58
+ <a href="https://discord.gg/xcW8c7fF3R"><strong>Discord</strong></a> &middot;
59
+ <a href="LICENSE"><strong>MIT License</strong></a>
285
60
  </p>
286
61
 
287
62
  <p align="center">
package/dist/genie.js CHANGED
@@ -839,7 +839,7 @@ ${gitLog}`:"","","Pick up where you left off. Read the wish file for full contex
839
839
  WHERE actor_type = ${actor.actorType}
840
840
  AND actor_id = ${actor.actorId}
841
841
  AND channel = ${channel}
842
- `).count>0}async function listTasksForActor(actor,filters={}){let sql=await getConnection(),repo=filters.repoPath??getRepoPath(),conditions=["t.repo_path = $1"],values2=[repo],paramIdx=2;if(conditions.push(`ta.actor_type = $${paramIdx++}`),values2.push(actor.actorType),conditions.push(`ta.actor_id = $${paramIdx++}`),values2.push(actor.actorId),filters.stage)conditions.push(`t.stage = $${paramIdx++}`),values2.push(filters.stage);if(filters.status)conditions.push(`t.status = $${paramIdx++}`),values2.push(filters.status);if(filters.priority)conditions.push(`t.priority = $${paramIdx++}`),values2.push(filters.priority);let limit=filters.limit??100,offset=filters.offset??0;values2.push(limit,offset);let query=`SELECT DISTINCT t.* FROM tasks t JOIN task_actors ta ON ta.task_id = t.id WHERE ${conditions.join(" AND ")} ORDER BY t.created_at DESC LIMIT $${paramIdx++} OFFSET $${paramIdx++}`;return(await sql.unsafe(query,values2)).map(mapTask)}var init_task_service=__esm(()=>{init_db()});import{writeFileSync as writeFileSync7}from"fs";import{join as join33}from"path";function scaffoldAgentFiles(targetDir){writeFileSync7(join33(targetDir,"SOUL.md"),SOUL_TEMPLATE),writeFileSync7(join33(targetDir,"HEARTBEAT.md"),HEARTBEAT_TEMPLATE),writeFileSync7(join33(targetDir,"AGENTS.md"),AGENTS_TEMPLATE)}var SOUL_TEMPLATE=`# Soul
842
+ `).count>0}async function listTasksForActor(actor,filters={}){let sql=await getConnection(),conditions=[],values2=[],paramIdx=1;if(filters.allProjects);else if(filters.projectName)conditions.push(`t.project_id = (SELECT id FROM projects WHERE name = $${paramIdx++})`),values2.push(filters.projectName);else conditions.push(`t.repo_path = $${paramIdx++}`),values2.push(filters.repoPath??getRepoPath());if(conditions.push(`ta.actor_type = $${paramIdx++}`),values2.push(actor.actorType),conditions.push(`ta.actor_id = $${paramIdx++}`),values2.push(actor.actorId),filters.stage)conditions.push(`t.stage = $${paramIdx++}`),values2.push(filters.stage);if(filters.status)conditions.push(`t.status = $${paramIdx++}`),values2.push(filters.status);if(filters.priority)conditions.push(`t.priority = $${paramIdx++}`),values2.push(filters.priority);let limit=filters.limit??100,offset=filters.offset??0;values2.push(limit,offset);let query=`SELECT DISTINCT t.* FROM tasks t JOIN task_actors ta ON ta.task_id = t.id WHERE ${conditions.join(" AND ")} ORDER BY t.created_at DESC LIMIT $${paramIdx++} OFFSET $${paramIdx++}`;return(await sql.unsafe(query,values2)).map(mapTask)}var init_task_service=__esm(()=>{init_db()});import{writeFileSync as writeFileSync7}from"fs";import{join as join33}from"path";function scaffoldAgentFiles(targetDir){writeFileSync7(join33(targetDir,"SOUL.md"),SOUL_TEMPLATE),writeFileSync7(join33(targetDir,"HEARTBEAT.md"),HEARTBEAT_TEMPLATE),writeFileSync7(join33(targetDir,"AGENTS.md"),AGENTS_TEMPLATE)}var SOUL_TEMPLATE=`# Soul
843
843
 
844
844
  You are an AI assistant. Define your role, personality, and approach here.
845
845
 
package/install.sh CHANGED
@@ -792,17 +792,23 @@ output_agent_prompt() {
792
792
 
793
793
  Genie has been installed successfully.
794
794
 
795
- Next steps for the user:
795
+ ## Agent Instructions
796
796
 
797
- genie Launch genie
797
+ Run `/wizard` now to complete onboarding. The wizard will:
798
798
 
799
- First time? Genie will suggest /onboarding to set up your workspace.
799
+ 1. **Check environment** verify genie CLI, git repo, and project structure
800
+ 2. **Shape identity** — define agent roles via `/brainstorm`
801
+ 3. **Create first wish** — scope work via `/brainstorm` then `/wish`
802
+ 4. **Execute** — build it via `/work`
803
+ 5. **Celebrate** — review results and learn next steps
800
804
 
801
- Integrations installed automatically:
805
+ To start: paste `/wizard` in your Claude Code session.
806
+
807
+ Integrations installed:
802
808
  - Claude Code plugin (if claude was found in PATH)
803
- - Orchestration prompt written to ~/.claude/rules/genie-orchestration.md
804
- - Default config created at ~/.genie/config.json
805
- - tmux defaults configured in ~/.tmux.conf
809
+ - Orchestration rules at ~/.claude/rules/genie-orchestration.md
810
+ - Default config at ~/.genie/config.json
811
+ - tmux defaults at ~/.tmux.conf
806
812
  AGENT_EOF
807
813
  }
808
814
 
@@ -855,6 +861,11 @@ run_install() {
855
861
 
856
862
  offer_codex_skills
857
863
 
864
+ # Agent mode: structured output for piped installs
865
+ if [[ "$INTERACTIVE" == "false" ]]; then
866
+ output_agent_prompt
867
+ fi
868
+
858
869
  print_success
859
870
  }
860
871
 
@@ -1065,7 +1076,7 @@ print_success() {
1065
1076
  echo -e " Get started:"
1066
1077
  echo -e " ${BOLD}genie${NC} Launch genie"
1067
1078
  echo
1068
- echo -e " First time? Genie will suggest ${DIM}/onboarding${NC} to set up your workspace."
1079
+ echo -e " First time? Run ${DIM}/wizard${NC} to set up your workspace."
1069
1080
  echo
1070
1081
  }
1071
1082
 
@@ -2,7 +2,7 @@
2
2
  "id": "genie",
3
3
  "name": "Genie",
4
4
  "description": "Skills, agents, and hooks for the Genie CLI terminal orchestration toolkit",
5
- "version": "4.260324.9",
5
+ "version": "4.260324.11",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/genie",
3
- "version": "4.260324.9",
3
+ "version": "4.260324.11",
4
4
  "description": "Collaborative terminal toolkit for human + AI workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genie",
3
- "version": "4.260324.9",
3
+ "version": "4.260324.11",
4
4
  "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.",
5
5
  "author": {
6
6
  "name": "Namastex Labs"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genie-plugin",
3
- "version": "4.260324.9",
3
+ "version": "4.260324.11",
4
4
  "private": true,
5
5
  "description": "Runtime dependencies for genie bundled CLIs",
6
6
  "type": "module",
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: wizard
3
+ description: "Guided onboarding — scaffold workspace, shape agent identity, create first wish, execute, and celebrate."
4
+ ---
5
+
6
+ # /wizard — First-Run Onboarding
7
+
8
+ Walk a new user (or their agent) through the complete Genie setup in five phases. Each phase has clear entry/exit criteria so the wizard can be interrupted and resumed.
9
+
10
+ ## When to Use
11
+ - First time running Genie in a new project
12
+ - User explicitly invokes `/wizard`
13
+ - Bootstrap script directed the agent here after install
14
+ - No `.genie/` directory or `AGENTS.md` exists in the current repo
15
+
16
+ ## Flow
17
+
18
+ ### Phase 1: Environment Check
19
+
20
+ **Entry:** User invokes `/wizard` or agent is directed here after install.
21
+
22
+ **Steps:**
23
+ 1. Verify `genie` CLI is installed and accessible in PATH:
24
+ ```bash
25
+ command -v genie && genie --version
26
+ ```
27
+ 2. Check if the current directory is a git repository (`git rev-parse --git-dir`).
28
+ 3. Check if `.genie/` directory exists (has Genie been scaffolded?).
29
+ 4. Check if `AGENTS.md` exists (has identity been shaped?).
30
+ 5. Check if `CLAUDE.md` exists (project instructions present?).
31
+
32
+ **Exit criteria:** All checks pass, or we know exactly what to set up.
33
+
34
+ **Display status:**
35
+ ```
36
+ Wizard Phase 1/5: Environment Check
37
+ genie CLI ✅ v4.x.x
38
+ git repo ✅
39
+ .genie/ ⬜ not found — will scaffold
40
+ AGENTS.md ⬜ not found — will create
41
+ CLAUDE.md ✅ found
42
+ ```
43
+
44
+ If `genie` is not installed, stop and direct the user to install it first:
45
+ ```
46
+ genie is not installed. Run:
47
+ curl -fsSL https://raw.githubusercontent.com/automagik-dev/genie/main/install.sh | bash
48
+ ```
49
+
50
+ If not in a git repo, stop and ask the user to initialize one or navigate to one.
51
+
52
+ ### Phase 2: Agent Identity
53
+
54
+ **Entry:** Phase 1 complete. Workspace needs scaffolding or identity shaping.
55
+
56
+ **Steps:**
57
+ 1. If `.genie/` does not exist, run `genie` to trigger scaffolding (creates `.genie/` directory structure, default configs).
58
+ 2. Delegate to `/brainstorm` with this seed context:
59
+
60
+ > We're shaping the agent identity for this project. The goal is to create an AGENTS.md that defines who the agents are in this workspace — their roles, responsibilities, communication style, and domain expertise. Look at the codebase to understand the project, then help define the agent team.
61
+
62
+ 3. Let `/brainstorm` run its interactive flow. It will:
63
+ - Explore the codebase to understand the project
64
+ - Ask clarifying questions about the team's needs
65
+ - Track WRS (Wish Readiness Score) for the identity definition
66
+ - Crystallize into a design when ready
67
+
68
+ **Exit criteria:** `/brainstorm` completes with a design, or user skips identity shaping.
69
+
70
+ **Skip option:** If user wants to skip, create a minimal `AGENTS.md`:
71
+ ```markdown
72
+ # Agents
73
+
74
+ This project uses Automagik Genie for orchestration.
75
+ Agent identity will be shaped over time through usage.
76
+ ```
77
+
78
+ ### Phase 3: First Wish
79
+
80
+ **Entry:** Phase 2 complete. Agent identity exists or was skipped.
81
+
82
+ **Steps:**
83
+ 1. Ask the user: "What's the first thing you'd like to build or fix in this project?"
84
+ 2. If the idea is fuzzy, delegate to `/brainstorm` to explore it.
85
+ 3. Once the idea is concrete, delegate to `/wish` to create a structured wish plan:
86
+ - `/wish` will create `.genie/wishes/<slug>/WISH.md`
87
+ - It defines scope, acceptance criteria, and execution groups
88
+ 4. Run `/review` on the wish to validate the plan before execution.
89
+
90
+ **Exit criteria:** A wish exists with status APPROVED (or SHIP from review).
91
+
92
+ **Display progress:**
93
+ ```
94
+ Wizard Phase 3/5: First Wish
95
+ Idea ✅ "Add dark mode to the settings page"
96
+ Brainstorm ✅ design crystallized
97
+ Wish plan ✅ .genie/wishes/add-dark-mode/WISH.md
98
+ Review ✅ SHIP — plan approved
99
+ ```
100
+
101
+ ### Phase 4: Execute
102
+
103
+ **Entry:** Phase 3 complete. An approved wish exists.
104
+
105
+ **Steps:**
106
+ 1. Show the user what's about to happen:
107
+ ```
108
+ Ready to execute wish: add-dark-mode
109
+ Groups: 3 execution groups, estimated 2 agents
110
+ ```
111
+ 2. Run `/work` on the wish to begin execution:
112
+ - `/work` will orchestrate subagents per execution group
113
+ - Each group runs its fix/review loop
114
+ - Progress is tracked via genie task system
115
+ 3. Monitor progress and report status to the user.
116
+ 4. When `/work` completes, run `/review` for final verification.
117
+
118
+ **Exit criteria:** All work groups complete and pass review.
119
+
120
+ ### Phase 5: Celebrate
121
+
122
+ **Entry:** Phase 4 complete. Work is done and reviewed.
123
+
124
+ **Steps:**
125
+ 1. Summarize what was accomplished:
126
+ ```
127
+ Your first wish has been granted!
128
+
129
+ Wish: add-dark-mode
130
+ Status: COMPLETE
131
+ Files: 12 files changed, 340 insertions
132
+ Review: SHIP — all criteria met
133
+ ```
134
+ 2. Show next steps:
135
+ - **Create a PR:** `genie` can help create a pull request for the changes
136
+ - **Run another wish:** Use `/brainstorm` or `/wish` to plan the next piece of work
137
+ - **Set up a team:** For larger work, use `genie team create` for autonomous multi-agent execution
138
+ - **Explore skills:** Run `/genie` to see all available skills and the wish lifecycle
139
+ 3. Close with:
140
+ ```
141
+ You're all set! From here, the flow is:
142
+ /brainstorm → /wish → /work → /review → ship
143
+
144
+ Run /genie anytime to see where you are in the lifecycle.
145
+ ```
146
+
147
+ ## Resumption
148
+
149
+ If the wizard is interrupted and re-invoked, detect the current state:
150
+ - `.genie/` exists → skip scaffolding in Phase 2
151
+ - `AGENTS.md` exists → skip identity in Phase 2
152
+ - `.genie/wishes/` has an approved wish → skip to Phase 4
153
+ - `.genie/wishes/` has a completed wish → skip to Phase 5
154
+
155
+ ## Error Handling
156
+
157
+ - If any phase fails, show the error clearly and offer to retry or skip.
158
+ - If `/brainstorm` or `/wish` fails, the wizard can still continue — these are delegated skills.
159
+ - If `/work` fails on a group, show the failure and ask the user how to proceed (retry, skip, or abort).
160
+ - Never leave the user stuck — always offer a path forward.
@@ -1020,4 +1020,82 @@ describe('Projects', () => {
1020
1020
  expect(t.projectId).toBe(proj!.id);
1021
1021
  }
1022
1022
  });
1023
+
1024
+ it('should round-trip: create virtual project → create task with explicit projectId → list by projectName', async () => {
1025
+ const projName = `test-virtual-roundtrip-${Date.now()}`;
1026
+ const taskRepo = `${REPO}-roundtrip`;
1027
+
1028
+ // 1. Create virtual project (no repoPath) — mimics handleTaskCreate --project flow
1029
+ const project = await createProject({ name: projName });
1030
+ expect(project.id).toMatch(/^proj-/);
1031
+ expect(project.repoPath).toBeNull();
1032
+
1033
+ // 2. Create task with explicit projectId — mimics createTask(input, repoPath, projectId)
1034
+ const task = await createTask({ title: 'Round-trip test task' }, taskRepo, project.id);
1035
+ expect(task.projectId).toBe(project.id);
1036
+ expect(task.repoPath).toBe(taskRepo);
1037
+
1038
+ // 3. List by projectName — mimics genie task list --project <name>
1039
+ const tasks = await listTasks({ projectName: projName });
1040
+ expect(tasks.length).toBeGreaterThanOrEqual(1);
1041
+ const found = tasks.find((t) => t.id === task.id);
1042
+ expect(found).not.toBeUndefined();
1043
+ expect(found!.projectId).toBe(project.id);
1044
+
1045
+ // 4. Verify getProjectByName returns same project
1046
+ const lookedUp = await getProjectByName(projName);
1047
+ expect(lookedUp).not.toBeNull();
1048
+ expect(lookedUp!.id).toBe(project.id);
1049
+
1050
+ // Cleanup
1051
+ await sql`DELETE FROM tasks WHERE repo_path = ${taskRepo}`;
1052
+ await sql`DELETE FROM projects WHERE name = ${projName}`;
1053
+ });
1054
+
1055
+ it('should round-trip with listTasksForActor and --project filter', async () => {
1056
+ const projName = `test-virtual-actor-${Date.now()}`;
1057
+ const taskRepo = `${REPO}-actor-proj`;
1058
+
1059
+ // Create virtual project and task
1060
+ const project = await createProject({ name: projName });
1061
+ const task = await createTask({ title: 'Actor project task' }, taskRepo, project.id);
1062
+ await assignTask(task.id, actor, 'assignee', {}, taskRepo);
1063
+
1064
+ // List via listTasksForActor with projectName filter
1065
+ const tasks = await listTasksForActor(actor, { projectName: projName });
1066
+ expect(tasks.length).toBeGreaterThanOrEqual(1);
1067
+ const found = tasks.find((t) => t.id === task.id);
1068
+ expect(found).not.toBeUndefined();
1069
+ expect(found!.projectId).toBe(project.id);
1070
+
1071
+ // Cleanup
1072
+ await sql`DELETE FROM task_actors WHERE task_id = ${task.id}`;
1073
+ await sql`DELETE FROM tasks WHERE repo_path = ${taskRepo}`;
1074
+ await sql`DELETE FROM projects WHERE name = ${projName}`;
1075
+ });
1076
+
1077
+ it('should find auto-created projects by name in subsequent commands', async () => {
1078
+ const autoRepo = `${REPO}-auto-find`;
1079
+
1080
+ // ensureProject auto-creates with basename
1081
+ const projId = await ensureProject(autoRepo);
1082
+
1083
+ // The auto-created project should be findable by its name (basename of path)
1084
+ const parts = autoRepo.split('/');
1085
+ const expectedName = parts[parts.length - 1];
1086
+ const found = await getProjectByName(expectedName);
1087
+ expect(found).not.toBeNull();
1088
+ expect(found!.id).toBe(projId);
1089
+
1090
+ // Create task and list by project name
1091
+ const task = await createTask({ title: 'Auto-find task' }, autoRepo);
1092
+ expect(task.projectId).toBe(projId);
1093
+
1094
+ const tasks = await listTasks({ projectName: expectedName });
1095
+ expect(tasks.some((t) => t.id === task.id)).toBe(true);
1096
+
1097
+ // Cleanup
1098
+ await sql`DELETE FROM tasks WHERE repo_path = ${autoRepo}`;
1099
+ await sql`DELETE FROM projects WHERE repo_path = ${autoRepo}`;
1100
+ });
1023
1101
  });
@@ -1489,11 +1489,21 @@ export async function deletePreference(actor: Actor, channel: string): Promise<b
1489
1489
  /** List tasks assigned to a specific actor. */
1490
1490
  export async function listTasksForActor(actor: Actor, filters: TaskFilters = {}): Promise<TaskRow[]> {
1491
1491
  const sql = await getConnection();
1492
- const repo = filters.repoPath ?? getRepoPath();
1493
1492
 
1494
- const conditions: string[] = ['t.repo_path = $1'];
1495
- const values: unknown[] = [repo];
1496
- let paramIdx = 2;
1493
+ const conditions: string[] = [];
1494
+ const values: unknown[] = [];
1495
+ let paramIdx = 1;
1496
+
1497
+ // Scope conditions (project/repo/all) — mirrors buildScopeConditions with t. prefix
1498
+ if (filters.allProjects) {
1499
+ // No repo scoping — show all projects
1500
+ } else if (filters.projectName) {
1501
+ conditions.push(`t.project_id = (SELECT id FROM projects WHERE name = $${paramIdx++})`);
1502
+ values.push(filters.projectName);
1503
+ } else {
1504
+ conditions.push(`t.repo_path = $${paramIdx++}`);
1505
+ values.push(filters.repoPath ?? getRepoPath());
1506
+ }
1497
1507
 
1498
1508
  conditions.push(`ta.actor_type = $${paramIdx++}`);
1499
1509
  values.push(actor.actorType);