mirror of
https://github.com/harivansh-afk/claude-code-vertical.git
synced 2026-04-16 18:03:53 +00:00
prompts iteration
This commit is contained in:
parent
593bdb8208
commit
bc2b015fff
11 changed files with 2245 additions and 933 deletions
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
description: Execute a plan by launching orchestrator and weavers in tmux. Creates PRs for each spec.
|
||||
description: Execute a plan by launching orchestrator in tmux. Creates PRs for each spec.
|
||||
argument-hint: <plan-id> [spec-names...]
|
||||
---
|
||||
|
||||
|
|
@ -14,75 +14,129 @@ Execute a plan. Launches orchestrator in tmux, which spawns weavers for each spe
|
|||
/build plan-20260119-1430 01-schema 02-backend
|
||||
```
|
||||
|
||||
## What Happens
|
||||
## What You Do
|
||||
|
||||
1. Read plan from `.claude/vertical/plans/<plan-id>/`
|
||||
2. Launch orchestrator in tmux: `vertical-<plan-id>-orch`
|
||||
3. Orchestrator reads specs, selects skills, spawns weavers
|
||||
4. Each weaver runs in tmux: `vertical-<plan-id>-w-01`, etc.
|
||||
5. Weavers build, verify, create PRs
|
||||
6. Results written to `.claude/vertical/plans/<plan-id>/run/`
|
||||
When `/build <plan-id>` is invoked:
|
||||
|
||||
## Execution Flow
|
||||
|
||||
```
|
||||
/build plan-20260119-1430
|
||||
|
|
||||
+-> Orchestrator (tmux: vertical-plan-20260119-1430-orch)
|
||||
|
|
||||
+-> Weaver 01 (tmux: vertical-plan-20260119-1430-w-01)
|
||||
| |
|
||||
| +-> Verifier (subagent)
|
||||
| +-> PR #42
|
||||
|
|
||||
+-> Weaver 02 (tmux: vertical-plan-20260119-1430-w-02)
|
||||
| |
|
||||
| +-> Verifier (subagent)
|
||||
| +-> PR #43
|
||||
|
|
||||
+-> Summary written to run/summary.md
|
||||
```
|
||||
|
||||
## Parallelization
|
||||
|
||||
- Independent specs (all with `pr.base: main`) run in parallel
|
||||
- Dependent specs (with `pr.base: <other-branch>`) wait for dependencies
|
||||
|
||||
## Monitoring
|
||||
|
||||
Check status while running:
|
||||
|
||||
```
|
||||
/status plan-20260119-1430
|
||||
```
|
||||
|
||||
Or directly:
|
||||
### Step 1: Validate Plan Exists
|
||||
|
||||
```bash
|
||||
# List tmux sessions
|
||||
tmux list-sessions | grep vertical
|
||||
if [ ! -f ".claude/vertical/plans/<plan-id>/meta.json" ]; then
|
||||
echo "Error: Plan not found: <plan-id>"
|
||||
echo "Run /status to see available plans"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
# Attach to orchestrator
|
||||
tmux attach -t vertical-plan-20260119-1430-orch
|
||||
### Step 2: Generate Orchestrator Prompt
|
||||
|
||||
# Attach to a weaver
|
||||
tmux attach -t vertical-plan-20260119-1430-w-01
|
||||
```bash
|
||||
cat > /tmp/orch-prompt-<plan-id>.md << 'PROMPT_EOF'
|
||||
<orchestrator-skill>
|
||||
$(cat skills/orchestrator/SKILL.md)
|
||||
</orchestrator-skill>
|
||||
|
||||
# Capture weaver output
|
||||
tmux capture-pane -t vertical-plan-20260119-1430-w-01 -p
|
||||
<plan-id><plan-id></plan-id>
|
||||
<repo-path>$(pwd)</repo-path>
|
||||
|
||||
Execute the plan. Spawn weavers. Track progress. Write summary.
|
||||
|
||||
Begin now.
|
||||
PROMPT_EOF
|
||||
```
|
||||
|
||||
### Step 3: Launch Orchestrator in Tmux
|
||||
|
||||
```bash
|
||||
tmux new-session -d -s "vertical-<plan-id>-orch" -c "$(pwd)" \
|
||||
"claude -p \"\$(cat /tmp/orch-prompt-<plan-id>.md)\" --dangerously-skip-permissions --model claude-opus-4-5-20250514; echo '[Orchestrator complete. Press any key to close.]'; read"
|
||||
```
|
||||
|
||||
### Step 4: Confirm Launch
|
||||
|
||||
Output to human:
|
||||
|
||||
```
|
||||
════════════════════════════════════════════════════════════════
|
||||
BUILD LAUNCHED: <plan-id>
|
||||
════════════════════════════════════════════════════════════════
|
||||
|
||||
Orchestrator: vertical-<plan-id>-orch
|
||||
|
||||
The orchestrator will:
|
||||
1. Read specs from .claude/vertical/plans/<plan-id>/specs/
|
||||
2. Spawn weavers in parallel tmux sessions
|
||||
3. Track progress and handle dependencies
|
||||
4. Write summary when complete
|
||||
|
||||
Monitor commands:
|
||||
/status <plan-id> # Check status
|
||||
tmux attach -t vertical-<plan-id>-orch # Watch orchestrator
|
||||
tmux list-sessions | grep vertical # List all sessions
|
||||
|
||||
Results will be at:
|
||||
.claude/vertical/plans/<plan-id>/run/summary.md
|
||||
|
||||
════════════════════════════════════════════════════════════════
|
||||
```
|
||||
|
||||
## Partial Execution
|
||||
|
||||
To execute specific specs only:
|
||||
|
||||
```
|
||||
/build plan-20260119-1430 01-schema 02-backend
|
||||
```
|
||||
|
||||
Modify the orchestrator prompt:
|
||||
|
||||
```
|
||||
<specs-to-execute>01-schema, 02-backend</specs-to-execute>
|
||||
```
|
||||
|
||||
The orchestrator will only process those specs.
|
||||
|
||||
## Monitoring While Running
|
||||
|
||||
### Check Status
|
||||
|
||||
```bash
|
||||
/status <plan-id>
|
||||
```
|
||||
|
||||
### Attach to Orchestrator
|
||||
|
||||
```bash
|
||||
tmux attach -t vertical-<plan-id>-orch
|
||||
# Detach: Ctrl+B then D
|
||||
```
|
||||
|
||||
### Attach to a Weaver
|
||||
|
||||
```bash
|
||||
tmux attach -t vertical-<plan-id>-w-01
|
||||
# Detach: Ctrl+B then D
|
||||
```
|
||||
|
||||
### Capture Weaver Output
|
||||
|
||||
```bash
|
||||
tmux capture-pane -t vertical-<plan-id>-w-01 -p -S -100
|
||||
```
|
||||
|
||||
## Results
|
||||
|
||||
When complete, find results at:
|
||||
|
||||
- `.claude/vertical/plans/<plan-id>/run/state.json` - Overall status
|
||||
- `.claude/vertical/plans/<plan-id>/run/summary.md` - Human-readable summary
|
||||
- `.claude/vertical/plans/<plan-id>/run/weavers/w-*.json` - Per-weaver status
|
||||
| File | Contents |
|
||||
|------|----------|
|
||||
| `run/state.json` | Overall status and weaver states |
|
||||
| `run/summary.md` | Human-readable summary with PR links |
|
||||
| `run/weavers/w-*.json` | Per-weaver status |
|
||||
|
||||
## Debugging Failures
|
||||
|
||||
If a weaver fails, you can resume its session:
|
||||
### Resume a Failed Weaver
|
||||
|
||||
```bash
|
||||
# Get session ID from weaver status
|
||||
|
|
@ -92,7 +146,7 @@ cat .claude/vertical/plans/<plan-id>/run/weavers/w-01.json | jq -r .session_id
|
|||
claude --resume <session-id>
|
||||
```
|
||||
|
||||
Or attach to the tmux session if still running:
|
||||
### Attach to Running Weaver
|
||||
|
||||
```bash
|
||||
tmux attach -t vertical-<plan-id>-w-01
|
||||
|
|
@ -101,20 +155,40 @@ tmux attach -t vertical-<plan-id>-w-01
|
|||
## Killing a Build
|
||||
|
||||
```bash
|
||||
# Kill all sessions for a plan
|
||||
# Source helpers
|
||||
source lib/tmux.sh
|
||||
vertical_kill_plan plan-20260119-1430
|
||||
|
||||
# Kill all sessions for this plan
|
||||
vertical_kill_plan <plan-id>
|
||||
|
||||
# Or kill everything
|
||||
vertical_kill_all
|
||||
```
|
||||
|
||||
## Implementation Notes
|
||||
## What Happens Behind the Scenes
|
||||
|
||||
This command:
|
||||
1. Loads orchestrator skill
|
||||
2. Generates orchestrator prompt with plan context
|
||||
3. Spawns tmux session with `claude -p "<prompt>" --dangerously-skip-permissions --model opus`
|
||||
4. Returns immediately (orchestrator runs in background)
|
||||
|
||||
The orchestrator handles everything from there.
|
||||
```
|
||||
/build plan-20260119-1430
|
||||
│
|
||||
├─→ Create orchestrator prompt
|
||||
│
|
||||
├─→ Launch tmux: vertical-plan-20260119-1430-orch
|
||||
│ │
|
||||
│ ├─→ Read specs
|
||||
│ ├─→ Analyze dependencies
|
||||
│ ├─→ Launch weavers in parallel
|
||||
│ │ │
|
||||
│ │ ├─→ vertical-plan-20260119-1430-w-01
|
||||
│ │ │ └─→ Build → Verify → PR #42
|
||||
│ │ │
|
||||
│ │ ├─→ vertical-plan-20260119-1430-w-02
|
||||
│ │ │ └─→ Build → Verify → PR #43
|
||||
│ │ │
|
||||
│ │ └─→ (waits for dependencies...)
|
||||
│ │
|
||||
│ ├─→ Poll weaver status
|
||||
│ ├─→ Launch dependent specs when ready
|
||||
│ └─→ Write summary.md
|
||||
│
|
||||
└─→ Human runs /status to check progress
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue