Skip to content

Commit eac9831

Browse files
authored
refactor(dev): separate start-agent from agent selection (#463)
* fix(dev): align dev new agent flags * Update auto-generated docs * refactor(dev): separate start-agent from agent selection * Update auto-generated docs
1 parent ba56b5b commit eac9831

12 files changed

Lines changed: 378 additions & 130 deletions

File tree

.claude-plugin/skills/agent-cli-dev/SKILL.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If `agent-cli` is not available, install it first:
2020
uv tool install agent-cli -p 3.13
2121

2222
# Or run directly without installing
23-
uvx --python 3.13 agent-cli dev new <branch-name> --agent --prompt "..."
23+
uvx --python 3.13 agent-cli dev new <branch-name> --prompt "..."
2424
```
2525

2626
## When to spawn parallel agents
@@ -40,17 +40,17 @@ Do NOT spawn when:
4040

4141
For new features (starts from origin/main):
4242
```bash
43-
agent-cli dev new <branch-name> --agent --prompt "Implement the new feature..."
43+
agent-cli dev new <branch-name> --prompt "Implement the new feature..."
4444
```
4545

4646
For work on current branch (review, test, fix) - use `--from HEAD`:
4747
```bash
48-
agent-cli dev new <branch-name> --from HEAD --agent --prompt "Review/test/fix..."
48+
agent-cli dev new <branch-name> --from HEAD --prompt "Review/test/fix..."
4949
```
5050

5151
For longer prompts (recommended for multi-line or complex instructions):
5252
```bash
53-
agent-cli dev new <branch-name> --from HEAD --agent --prompt-file path/to/prompt.md
53+
agent-cli dev new <branch-name> --from HEAD --prompt-file path/to/prompt.md
5454
```
5555

5656
This creates:
@@ -67,10 +67,10 @@ This creates:
6767
When an assistant is executing this workflow on the user's behalf, the spawn is not complete unless the agent receives a prompt at launch time.
6868

6969
- Prefer `--prompt-file`; create the prompt file first, then launch the agent
70-
- Use `dev new ... --agent --prompt-file ...` for a new delegated task
70+
- Use `dev new ... --prompt-file ...` for a new delegated task
7171
- Use `dev agent ... --prompt-file ...` for another agent in an existing worktree
7272
- Do not stop after `dev new ...` alone if the user's intent was to delegate work immediately
73-
- Do not run `dev new ... --agent` or `dev agent ... -m tmux` without `--prompt` or `--prompt-file` unless the user explicitly wants an interactive session that they will drive manually
73+
- Do not run `dev new ... --start-agent`, `dev new ... --agent <name>`, or `dev agent ... -m tmux` without `--prompt` or `--prompt-file` unless the user explicitly wants an interactive session that they will drive manually
7474

7575
## Writing effective prompts for spawned agents
7676

@@ -92,7 +92,7 @@ Example workflow:
9292
```bash
9393
# 1. Write prompt to file
9494
# 2. Spawn agent with the file
95-
agent-cli dev new my-feature --agent --prompt-file .claude/spawn-prompt.md
95+
agent-cli dev new my-feature --prompt-file .claude/spawn-prompt.md
9696
# 3. Optionally clean up
9797
rm .claude/spawn-prompt.md
9898
```
@@ -144,7 +144,7 @@ agent-cli dev agent review-auth -m tmux --prompt-file .claude/review-tests.md
144144

145145
Key rules for same-worktree launches:
146146
- Use `dev agent`, not `dev new`, after the worktree already exists
147-
- Use `dev agent -a <agent>` to select a specific agent for an existing worktree; `--with-agent` remains a deprecated alias on this subcommand
147+
- Use `dev agent --agent <agent>` to select a specific agent for an existing worktree; `--with-agent` remains a deprecated alias on this subcommand
148148
- Use `-m tmux` for headless or scripted launching; it works even when not already inside tmux
149149
- Each launch joins the same deterministic repo-scoped tmux session, so related agents stay grouped together
150150
- Ask each agent to write to a unique report path such as `.claude/REPORT-security-<run-id>.md` or `.claude/REPORT-tests-<run-id>.md`
@@ -171,7 +171,7 @@ When complete, write findings to .claude/REPORT-security-20260319-153045-123.md
171171
For non-interactive contexts (scripts, cron jobs, other assistants), combine `--prompt-file` with `-m tmux`:
172172

173173
```bash
174-
agent-cli dev new validation-a --from HEAD --agent --with-agent codex -m tmux \
174+
agent-cli dev new validation-a --from HEAD --agent codex -m tmux \
175175
--prompt-file .claude/validation-a.md
176176
```
177177

@@ -183,9 +183,9 @@ If asked to implement auth, payments, and notifications:
183183

184184
```bash
185185
# Spawn three parallel agents
186-
agent-cli dev new auth-feature --agent --prompt "Implement JWT authentication..."
187-
agent-cli dev new payment-integration --agent --prompt "Add Stripe payment processing..."
188-
agent-cli dev new email-notifications --agent --prompt "Implement email notification system..."
186+
agent-cli dev new auth-feature --prompt "Implement JWT authentication..."
187+
agent-cli dev new payment-integration --prompt "Add Stripe payment processing..."
188+
agent-cli dev new email-notifications --prompt "Implement email notification system..."
189189
```
190190

191191
Each agent works independently in its own branch. Results can be reviewed and merged separately.
@@ -194,11 +194,11 @@ Each agent works independently in its own branch. Results can be reviewed and me
194194

195195
| Option | Description |
196196
|--------|-------------|
197-
| `--agent` / `-a` | Start AI coding agent after creation |
197+
| `--start-agent` | Start the default/auto-detected agent without an initial prompt |
198198
| `--prompt` / `-p` | Initial prompt for the agent (short prompts only) |
199199
| `--prompt-file` / `-P` | Read prompt from file (recommended for longer prompts) |
200200
| `--from` / `-f` | Base ref (default: origin/main). **Use `--from HEAD` when reviewing/testing current branch!** |
201-
| `--with-agent` | Specific agent: claude, aider, codex, gemini |
201+
| `--agent` | Specific agent (or `auto`): claude, aider, codex, gemini |
202202
| `--agent-args` | Extra arguments for the agent |
203203

204204
@examples.md

.claude-plugin/skills/agent-cli-dev/examples.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Real-world scenarios for spawning parallel AI coding agents, optimized for Claud
66
>
77
> ```bash
88
> # Write prompt to file, then spawn
9-
> agent-cli dev new my-feature --agent --prompt-file .claude/spawn-prompt.md
9+
> agent-cli dev new my-feature --prompt-file .claude/spawn-prompt.md
1010
> ```
1111
>
1212
> When an assistant is executing these commands, do not launch `dev new` or `dev agent` without `--prompt` or `--prompt-file` unless the user explicitly wants a manual interactive session.
@@ -31,7 +31,7 @@ Each prompt for a spawned agent should follow this structure:
3131
3232
```bash
3333
# Review the current branch - MUST use --from HEAD
34-
agent-cli dev new review-changes --from HEAD --agent --prompt "Review the code changes on this branch.
34+
agent-cli dev new review-changes --from HEAD --prompt "Review the code changes on this branch.
3535
3636
<workflow>
3737
- Run git diff origin/main...HEAD to identify all changes
@@ -91,7 +91,7 @@ Write your review to .claude/REPORT.md:
9191
**Strategy**: Three independent features → spawn three agents.
9292
9393
```bash
94-
agent-cli dev new auth-feature --agent --prompt "Implement JWT-based user authentication.
94+
agent-cli dev new auth-feature --prompt "Implement JWT-based user authentication.
9595
9696
<workflow>
9797
- Read multiple files in parallel when exploring the codebase
@@ -144,7 +144,7 @@ How to verify the implementation works
144144
Any items needing review
145145
</report>"
146146
147-
agent-cli dev new payment-integration --agent --prompt "Integrate Stripe payment processing.
147+
agent-cli dev new payment-integration --prompt "Integrate Stripe payment processing.
148148
149149
<workflow>
150150
- Read multiple files in parallel when exploring the codebase
@@ -195,7 +195,7 @@ After verifying tests pass, write to .claude/REPORT.md:
195195
[Any items for review]
196196
</report>"
197197
198-
agent-cli dev new email-notifications --agent --prompt "Implement email notification system.
198+
agent-cli dev new email-notifications --prompt "Implement email notification system.
199199
200200
<workflow>
201201
- Read multiple files in parallel when exploring the codebase
@@ -240,7 +240,7 @@ After verifying tests pass, write to .claude/REPORT.md with summary, files chang
240240
**Strategy**: One agent writes tests first, another implements.
241241
242242
```bash
243-
agent-cli dev new cache-tests --agent --prompt "Write comprehensive tests for a caching layer.
243+
agent-cli dev new cache-tests --prompt "Write comprehensive tests for a caching layer.
244244
245245
<task>
246246
Create a complete test suite that drives the implementation of a caching system. The tests define the interface - write them as if the implementation already exists.
@@ -306,7 +306,7 @@ When complete, write to .claude/REPORT.md:
306306
After reviewing the tests:
307307
308308
```bash
309-
agent-cli dev new cache-impl --from cache-tests --agent --prompt "Implement the caching layer to pass existing tests.
309+
agent-cli dev new cache-impl --from cache-tests --prompt "Implement the caching layer to pass existing tests.
310310
311311
<workflow>
312312
- Read all test files first to understand the complete interface
@@ -360,7 +360,7 @@ After ALL tests pass, write to .claude/REPORT.md:
360360
**Strategy**: Split by module, each agent handles one area.
361361
362362
```bash
363-
agent-cli dev new refactor-users-errors --agent --prompt "Refactor error handling in the users module.
363+
agent-cli dev new refactor-users-errors --prompt "Refactor error handling in the users module.
364364
365365
<workflow>
366366
- Read all relevant files in parallel before making any changes
@@ -428,7 +428,7 @@ After tests pass and linting is clean, write to .claude/REPORT.md:
428428
**Strategy**: One agent implements, another writes docs simultaneously.
429429
430430
```bash
431-
agent-cli dev new plugin-system --agent --prompt "Implement a plugin system.
431+
agent-cli dev new plugin-system --prompt "Implement a plugin system.
432432
433433
<workflow>
434434
- Read existing codebase structure in parallel before designing
@@ -483,7 +483,7 @@ class Plugin:
483483
[How to create and register a plugin]
484484
</report>"
485485
486-
agent-cli dev new plugin-docs --agent --prompt "Write documentation for the plugin system.
486+
agent-cli dev new plugin-docs --prompt "Write documentation for the plugin system.
487487
488488
<context>
489489
Implementation is happening in parallel in another branch. Write documentation based on a standard plugin system design. The implementation agent will adapt if needed, or you can update docs after reviewing their work.
@@ -595,7 +595,7 @@ Write findings to .claude/REPORT-tests-$run_id.md:
595595
596596
```bash
597597
for section in 1 2 3 4 5 6 7 8; do
598-
agent-cli dev new "test-section-$section" --from HEAD --agent --with-agent codex -m tmux \
598+
agent-cli dev new "test-section-$section" --from HEAD --agent codex -m tmux \
599599
--prompt-file ".claude/test-section-$section.md"
600600
done
601601
```

.claude/skills/agent-cli-dev/SKILL.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If `agent-cli` is not available, install it first:
2020
uv tool install agent-cli -p 3.13
2121

2222
# Or run directly without installing
23-
uvx --python 3.13 agent-cli dev new <branch-name> --agent --prompt "..."
23+
uvx --python 3.13 agent-cli dev new <branch-name> --prompt "..."
2424
```
2525

2626
## When to spawn parallel agents
@@ -40,17 +40,17 @@ Do NOT spawn when:
4040

4141
For new features (starts from origin/main):
4242
```bash
43-
agent-cli dev new <branch-name> --agent --prompt "Implement the new feature..."
43+
agent-cli dev new <branch-name> --prompt "Implement the new feature..."
4444
```
4545

4646
For work on current branch (review, test, fix) - use `--from HEAD`:
4747
```bash
48-
agent-cli dev new <branch-name> --from HEAD --agent --prompt "Review/test/fix..."
48+
agent-cli dev new <branch-name> --from HEAD --prompt "Review/test/fix..."
4949
```
5050

5151
For longer prompts (recommended for multi-line or complex instructions):
5252
```bash
53-
agent-cli dev new <branch-name> --from HEAD --agent --prompt-file path/to/prompt.md
53+
agent-cli dev new <branch-name> --from HEAD --prompt-file path/to/prompt.md
5454
```
5555

5656
This creates:
@@ -67,10 +67,10 @@ This creates:
6767
When an assistant is executing this workflow on the user's behalf, the spawn is not complete unless the agent receives a prompt at launch time.
6868

6969
- Prefer `--prompt-file`; create the prompt file first, then launch the agent
70-
- Use `dev new ... --agent --prompt-file ...` for a new delegated task
70+
- Use `dev new ... --prompt-file ...` for a new delegated task
7171
- Use `dev agent ... --prompt-file ...` for another agent in an existing worktree
7272
- Do not stop after `dev new ...` alone if the user's intent was to delegate work immediately
73-
- Do not run `dev new ... --agent` or `dev agent ... -m tmux` without `--prompt` or `--prompt-file` unless the user explicitly wants an interactive session that they will drive manually
73+
- Do not run `dev new ... --start-agent`, `dev new ... --agent <name>`, or `dev agent ... -m tmux` without `--prompt` or `--prompt-file` unless the user explicitly wants an interactive session that they will drive manually
7474

7575
## Writing effective prompts for spawned agents
7676

@@ -92,7 +92,7 @@ Example workflow:
9292
```bash
9393
# 1. Write prompt to file
9494
# 2. Spawn agent with the file
95-
agent-cli dev new my-feature --agent --prompt-file .claude/spawn-prompt.md
95+
agent-cli dev new my-feature --prompt-file .claude/spawn-prompt.md
9696
# 3. Optionally clean up
9797
rm .claude/spawn-prompt.md
9898
```
@@ -144,7 +144,7 @@ agent-cli dev agent review-auth -m tmux --prompt-file .claude/review-tests.md
144144

145145
Key rules for same-worktree launches:
146146
- Use `dev agent`, not `dev new`, after the worktree already exists
147-
- Use `dev agent -a <agent>` to select a specific agent for an existing worktree; `--with-agent` remains a deprecated alias on this subcommand
147+
- Use `dev agent --agent <agent>` to select a specific agent for an existing worktree; `--with-agent` remains a deprecated alias on this subcommand
148148
- Use `-m tmux` for headless or scripted launching; it works even when not already inside tmux
149149
- Each launch joins the same deterministic repo-scoped tmux session, so related agents stay grouped together
150150
- Ask each agent to write to a unique report path such as `.claude/REPORT-security-<run-id>.md` or `.claude/REPORT-tests-<run-id>.md`
@@ -171,7 +171,7 @@ When complete, write findings to .claude/REPORT-security-20260319-153045-123.md
171171
For non-interactive contexts (scripts, cron jobs, other assistants), combine `--prompt-file` with `-m tmux`:
172172

173173
```bash
174-
agent-cli dev new validation-a --from HEAD --agent --with-agent codex -m tmux \
174+
agent-cli dev new validation-a --from HEAD --agent codex -m tmux \
175175
--prompt-file .claude/validation-a.md
176176
```
177177

@@ -183,9 +183,9 @@ If asked to implement auth, payments, and notifications:
183183

184184
```bash
185185
# Spawn three parallel agents
186-
agent-cli dev new auth-feature --agent --prompt "Implement JWT authentication..."
187-
agent-cli dev new payment-integration --agent --prompt "Add Stripe payment processing..."
188-
agent-cli dev new email-notifications --agent --prompt "Implement email notification system..."
186+
agent-cli dev new auth-feature --prompt "Implement JWT authentication..."
187+
agent-cli dev new payment-integration --prompt "Add Stripe payment processing..."
188+
agent-cli dev new email-notifications --prompt "Implement email notification system..."
189189
```
190190

191191
Each agent works independently in its own branch. Results can be reviewed and merged separately.
@@ -194,11 +194,11 @@ Each agent works independently in its own branch. Results can be reviewed and me
194194

195195
| Option | Description |
196196
|--------|-------------|
197-
| `--agent` / `-a` | Start AI coding agent after creation |
197+
| `--start-agent` | Start the default/auto-detected agent without an initial prompt |
198198
| `--prompt` / `-p` | Initial prompt for the agent (short prompts only) |
199199
| `--prompt-file` / `-P` | Read prompt from file (recommended for longer prompts) |
200200
| `--from` / `-f` | Base ref (default: origin/main). **Use `--from HEAD` when reviewing/testing current branch!** |
201-
| `--with-agent` | Specific agent: claude, aider, codex, gemini |
201+
| `--agent` | Specific agent (or `auto`): claude, aider, codex, gemini |
202202
| `--agent-args` | Extra arguments for the agent |
203203

204204
@examples.md

.claude/skills/agent-cli-dev/examples.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Real-world scenarios for spawning parallel AI coding agents, optimized for Claud
66
>
77
> ```bash
88
> # Write prompt to file, then spawn
9-
> agent-cli dev new my-feature --agent --prompt-file .claude/spawn-prompt.md
9+
> agent-cli dev new my-feature --prompt-file .claude/spawn-prompt.md
1010
> ```
1111
>
1212
> When an assistant is executing these commands, do not launch `dev new` or `dev agent` without `--prompt` or `--prompt-file` unless the user explicitly wants a manual interactive session.
@@ -31,7 +31,7 @@ Each prompt for a spawned agent should follow this structure:
3131
3232
```bash
3333
# Review the current branch - MUST use --from HEAD
34-
agent-cli dev new review-changes --from HEAD --agent --prompt "Review the code changes on this branch.
34+
agent-cli dev new review-changes --from HEAD --prompt "Review the code changes on this branch.
3535
3636
<workflow>
3737
- Run git diff origin/main...HEAD to identify all changes
@@ -91,7 +91,7 @@ Write your review to .claude/REPORT.md:
9191
**Strategy**: Three independent features → spawn three agents.
9292
9393
```bash
94-
agent-cli dev new auth-feature --agent --prompt "Implement JWT-based user authentication.
94+
agent-cli dev new auth-feature --prompt "Implement JWT-based user authentication.
9595
9696
<workflow>
9797
- Read multiple files in parallel when exploring the codebase
@@ -144,7 +144,7 @@ How to verify the implementation works
144144
Any items needing review
145145
</report>"
146146
147-
agent-cli dev new payment-integration --agent --prompt "Integrate Stripe payment processing.
147+
agent-cli dev new payment-integration --prompt "Integrate Stripe payment processing.
148148
149149
<workflow>
150150
- Read multiple files in parallel when exploring the codebase
@@ -195,7 +195,7 @@ After verifying tests pass, write to .claude/REPORT.md:
195195
[Any items for review]
196196
</report>"
197197
198-
agent-cli dev new email-notifications --agent --prompt "Implement email notification system.
198+
agent-cli dev new email-notifications --prompt "Implement email notification system.
199199
200200
<workflow>
201201
- Read multiple files in parallel when exploring the codebase
@@ -240,7 +240,7 @@ After verifying tests pass, write to .claude/REPORT.md with summary, files chang
240240
**Strategy**: One agent writes tests first, another implements.
241241
242242
```bash
243-
agent-cli dev new cache-tests --agent --prompt "Write comprehensive tests for a caching layer.
243+
agent-cli dev new cache-tests --prompt "Write comprehensive tests for a caching layer.
244244
245245
<task>
246246
Create a complete test suite that drives the implementation of a caching system. The tests define the interface - write them as if the implementation already exists.
@@ -306,7 +306,7 @@ When complete, write to .claude/REPORT.md:
306306
After reviewing the tests:
307307
308308
```bash
309-
agent-cli dev new cache-impl --from cache-tests --agent --prompt "Implement the caching layer to pass existing tests.
309+
agent-cli dev new cache-impl --from cache-tests --prompt "Implement the caching layer to pass existing tests.
310310
311311
<workflow>
312312
- Read all test files first to understand the complete interface
@@ -360,7 +360,7 @@ After ALL tests pass, write to .claude/REPORT.md:
360360
**Strategy**: Split by module, each agent handles one area.
361361
362362
```bash
363-
agent-cli dev new refactor-users-errors --agent --prompt "Refactor error handling in the users module.
363+
agent-cli dev new refactor-users-errors --prompt "Refactor error handling in the users module.
364364
365365
<workflow>
366366
- Read all relevant files in parallel before making any changes
@@ -428,7 +428,7 @@ After tests pass and linting is clean, write to .claude/REPORT.md:
428428
**Strategy**: One agent implements, another writes docs simultaneously.
429429
430430
```bash
431-
agent-cli dev new plugin-system --agent --prompt "Implement a plugin system.
431+
agent-cli dev new plugin-system --prompt "Implement a plugin system.
432432
433433
<workflow>
434434
- Read existing codebase structure in parallel before designing
@@ -483,7 +483,7 @@ class Plugin:
483483
[How to create and register a plugin]
484484
</report>"
485485
486-
agent-cli dev new plugin-docs --agent --prompt "Write documentation for the plugin system.
486+
agent-cli dev new plugin-docs --prompt "Write documentation for the plugin system.
487487
488488
<context>
489489
Implementation is happening in parallel in another branch. Write documentation based on a standard plugin system design. The implementation agent will adapt if needed, or you can update docs after reviewing their work.
@@ -595,7 +595,7 @@ Write findings to .claude/REPORT-tests-$run_id.md:
595595
596596
```bash
597597
for section in 1 2 3 4 5 6 7 8; do
598-
agent-cli dev new "test-section-$section" --from HEAD --agent --with-agent codex -m tmux \
598+
agent-cli dev new "test-section-$section" --from HEAD --agent codex -m tmux \
599599
--prompt-file ".claude/test-section-$section.md"
600600
done
601601
```

0 commit comments

Comments
 (0)