| name | dream |
| description | Batch-execute SHIP-ready wishes overnight — pick wishes, orchestrate workers, review PRs, wake up to results. |
/dream — Overnight Batch Execution
Pick SHIP-ready wishes, build a dependency-ordered execution plan, spawn parallel workers, review PRs, merge to dev, run QA loop, produce a wake-up report.
When to Use
- Human wants to queue multiple wishes for autonomous overnight execution
- Multiple SHIP-ready wishes exist in
.genie/brainstorm.md under Poured
Flow
- Pick wishes from
.genie/brainstorm.md in the shared worktree.
- Generate DREAM.md with dependency-ordered execution plan.
- Human confirms DREAM.md (may edit before run).
- Create dream task (v4): register the dream run in PG:
genie task create "Dream run <date>" --type software --tags chore
- Create child tasks (v4): one per wish in the dream:
genie task create "<wish title>" --parent
- Phase 1 — Execute: dispatch workers per wish via
genie work, collect outcomes.
- Phase 2 — Review + PR: review each group, create PRs, fix valid issues, CI green.
- Phase 3 — Merge + QA: merge to dev, spawn qa, QA loop until criteria proven.
- Phase 4 — Report: write DREAM-REPORT.md as the wake-up artifact, log to parent task.
Picker
- Read
.genie/brainstorm.md, locate the Poured section.
- Parse each SHIP-ready entry in listed order, extracting
slug and one-line description.
- If no entries found, print
No SHIP-ready wishes found in .genie/brainstorm.md and exit.
- Display numbered list preserving original order:
1. <slug> — <one-line description>
- Prompt human to choose by number(s) (
1 3 5) or all. Accept whitespace-separated numbers.
- Emit selected set in order:
- <slug>: .genie/wishes/<slug>/WISH.md
DREAM.md Generation
- For each selected wish, read
depends_on from its WISH.md.
- Compute topological sort across selected wishes. Assign
merge_order as integer layers 1..N:
- Layer 1: wishes with no selected dependencies.
- Increment layer when a wish depends on a lower layer.
- Same-layer wishes are parallel.
- Generate per-wish entry:
| Field | Value |
|---|
slug | wish identifier |
branch | feat/<slug> |
wish_path | .genie/wishes/<slug>/WISH.md |
depends_on | upstream slugs from WISH.md |
merge_order | integer from topological layering |
- Write to
.genie/DREAM.md in the shared worktree.
- Present for human confirmation before execution.
Team Lifecycle
create dream team → hire agents → execute groups → review → PR to dev → merge → QA loop → disband
genie team create dream-<date>
genie team hire engineer
genie team hire reviewer
genie team hire fixer
genie team hire qa
Phase 1: Execute
- Create team:
genie team create dream-<date>.
- For each wish in DREAM.md, ordered by
merge_order layer:
- Same-layer wishes dispatch in parallel.
- Dispatch workers via
genie work <agent> <slug>#<group> — gets state tracking for free.
- Parallel groups within a wish dispatched simultaneously.
- Monitor via
genie wish status <slug>. Mark groups done via genie wish done <slug>#<group> (and, when PG tasks exist, genie task done #<seq>).
- Track progress (v4): as each wish starts execution, move its child task:
genie task move
- Workers signal completion via
genie agent send.
- If a group gets stuck, use
genie wish reset <ref> to retry.
Worker Contract
Each worker executes independently:
- Read WISH.md from
wish_path.
- Self-refine task prompt via
/refine (text mode).
- Checkout branch:
git checkout -b <branch>.
- Implement execution groups from WISH.md.
- Run local
/review per group against acceptance criteria.
- CI check: run CI. If fail → fix and retry (max 3 retries). Poll CI status — do not sleep.
- After 3 failures: mark BLOCKED.
- Only after CI green:
gh pr create --base dev.
- Report to lead via
genie agent send:
- Success:
DONE: PR at <url>. CI: green. Groups: N/N.
- Failure:
BLOCKED: <reason>. Groups: N/N.
Phase 2: Review + PR
Trigger: all execute workers have reported DONE or BLOCKED.
- Leader creates PR to dev after all groups done for each wish.
- Read bot comments critically — do not blindly accept automated suggestions.
- Dispatch
/review against wish acceptance criteria per PR.
- On
FIX-FIRST: dispatch /fix for valid issues (max 2 loops per PR).
- On architectural issue: escalate immediately (no fix attempt), record in report.
- CI must be green before proceeding. Poll CI status, do not sleep.
- On
SHIP: mark review-complete.
Phase 3: Merge + QA
Trigger: all PRs reviewed and marked SHIP.
- Merge PRs to dev in
merge_order.
- Spawn qa on dev branch:
genie agent spawn qa.
- QA loop: test against wish acceptance criteria → failures get
/report → /trace → /fix → retest.
- Each fix creates a new PR to dev, goes through review, merge, retest.
- Continue until all wish criteria are proven or blocked.
Phase 4: Report
Log report to parent task (v4):
genie task comment
genie task done
Write to .genie/DREAM-REPORT.md in the shared worktree:
# Dream Report — <date>
## Per-Wish Status
| merge_order | slug | PR link | CI | Review | Merged | QA |
|-------------|------|---------|----|--------|--------|----|
| 1 | slug-1 | #123 | green | SHIP | yes | verified |
| 2 | slug-2 | #124 | green | SHIP | yes | 2/3 criteria |
## Blocked Wishes
- `<slug>`: blocking reason.
## QA Findings
- `<slug>`: criteria X failed — traced to <root cause>, fix PR #125.
## Follow-ups
- Action items requiring human intervention.
After report is written:
genie team disband dream-<date>
Task Lifecycle Integration (v4)
When PG is available, the dream run is fully tracked in the task system:
| Event | Command |
|---|
| Dream run starts | genie task create "Dream run <date>" --type software --tags chore |
| Per-wish tracking | genie task create "<wish title>" --parent #<dream-seq> --type software |
| Wish execution starts | genie task move #<wish-seq> --to build --comment "Execution started" |
| Wish completes | genie task move #<wish-seq> --to done --comment "Shipped — PR #<num>" |
| Wish blocked | genie task block #<wish-seq> --reason "<reason>" |
| Dream report written | genie task comment #<dream-seq> "Dream report: X shipped, Y blocked" |
| Dream run complete | genie task done #<dream-seq> --comment "Dream run complete" |
Graceful degradation: If PG is unavailable or genie task commands fail, skip task tracking and fall back to current behavior. Task integration is optional — the dream flow must never break due to missing tasks. Log a warning and continue.
Rules
- Never early-stop: if a wish returns BLOCKED, record reason and continue with remaining wishes.
- Never skip Phase 2 — every DONE PR must be reviewed.
- Never skip Phase 3 — every merged PR must be QA-tested against wish criteria.
- Orchestrator never executes wish work directly — dispatch via
genie work.
- Do not expand scope beyond what WISH.md defines.
- Always write DREAM-REPORT.md, even if all wishes BLOCKED.
- Poll CI status instead of sleeping — never use
sleep in CI retry loops.
- Use
genie wish done, genie wish status, and genie wish reset for wish-group state; use genie task … subcommands for PG task tracking. The two namespaces are distinct — do not substitute one for the other.