Skip to content

/wbNext — Exhaustive Simulation () ​

/wbNext is the DAG navigator. It reads the active plan, evaluates which tasks are unblocked, and returns the single highest-priority next task. The key design choice: /wbNext returns one answer, not a menu. If you want a menu, use /wbStandup. If you want the answer and immediate execution, use /wbNext --act.

Read this if you want to know how the DAG evaluation works, what --sort changes about the selection, and why --act is the most dangerous flag in the orchestration group.


1. Role & target ​

AspectBehavior
RoleThe DAG Navigator & Task Allocator. Returns one task.
TargetThe active plan_*.md file in the scoped directory.
Cell scopeNone (read-only by default). With --act, delegates to /wbWork which writes to Done.
Side effects allowedReading plans. With --act: everything /wbWork is allowed to do.
Side effects forbiddenWriting to plans directly. /wbNext never touches the plan file itself — it delegates to /wbWork when --act is passed.

The "one answer" principle is deliberate. When multiple tasks are unblocked, /wbNext picks one and commits to it. The selection algorithm is: chronological order (lowest ID first) unless --sort overrides. This means /wbNext is deterministic — same plan state, same flags → same answer. That determinism is what makes --act safe: you know what it will do before it does it.


2. Argument resolution ​

FormExampleWhat /wbNext reads
No argumentCommand: /wbNextSearches current directory for plan_*.md.
Package pathCommand: /wbNext packages/wb-coreReads wb-core's plan specifically.
Wildcard globCommand: /wbNext apps/*Reads all active plans in consumer apps. Returns one unified "next" per app.
Natural languageCommand: /wbNext "what should I do?"Treated as no-arg — NL is tolerated but resolved identically to default behavior.

The wildcard form returns one task per plan, not one task across all plans. This is different from /wbStandup apps/* which aggregates into a single view. /wbNext preserves per-plan scope because a "next task" only makes sense within a single DAG.


3. Flag matrix ​

FlagShortcutPurpose
--sort="<metric>"—Overrides chronological selection. Accepts complexity, risk, priority.
--act-aAuto-executes /wbWork --id="<selected>" on the returned task. No confirmation prompt.

--act is the autonomous mode. It's the only flag in the orchestration group that triggers code changes. /wbNext -a is equivalent to running /wbNext to get the ID, then /wbWork --id="<that ID>" — but without the human step between. Use it in automated chains; avoid it when the plan state is uncertain.

--sort semantics. The metrics aren't computed from external data — they're read from the plan row's metadata (if the plan includes complexity/risk/priority columns). If the plan doesn't have those columns, --sort falls back to chronological with a warning.


4. Pipelines (the agent-native scenarios) ​

📋/wbNext Exhaustive Simulation
Autonomous execution loop/wbNext packages/wb-core -a -e
> /wbNext packages/wb-core -a -e
[SYSTEM] Querying DAG for next unblocked node...
[READ] plan_wb-core_20260504.md
[EXPLAIN] DAG evaluation:
Row 1: ✅ Done, ✅ Valid — complete, skipped.
Row 2: ✅ Done, ✅ Valid — complete, skipped.
Row 3: ⬜ Pending, Deps [1, 2] satisfied — ELIGIBLE.
[NEXT] Task 3: WBC.js decomposition
[ACT] Handing off to /wbWork --id="3"...
[WORK] Row 3: WBC.js decomposition
Editing core2/packages/wb-core/src/WBC.js...
[VERIFY] Running row 3's verify command...
[OK] Row 3 passed verify.
[PLAN] Row 3.Done = ✅
⚠️ Note: The fully autonomous pattern: find next, explain why, do it.

💠 Pipeline Autonomous execution loop ​

The fully autonomous pattern: find next, explain why, do it.

💠 Pipeline Multi-app triage (which app needs work first) ​

The lead wants to know the single most important unblocked task across all consumer apps:

💠 Pipeline Simple next-task query with no frills ​

The most common use case: "what's next?"


5. Edge cases & refusals ​

TriggerWhat /wbNext does
All tasks complete✅ Plan complete. No remaining tasks. Recommendation: /wbRelease or /wbGit.
All remaining tasks blocked❌ All pending tasks are DAG-blocked. No unblocked work available. Run /wbDebug to investigate.
No plan file in scope❌ No active plan found. Run /wbPlan to generate one.
--sort="complexity" but plan has no Complexity column⚠️ Plan lacks complexity metadata. Falling back to chronological order.
--act on a task whose verify command fails/wbWork handles the failure. Row stays ⬜. /wbNext reports the failure in its output summary.
Circular dependency (row A deps row B, row B deps row A)❌ Circular DAG detected between rows A and B. Plan is invalid — fix plan_*.md manually.
Stale statuses (Done ✅ but Valid ⬜)⚠️ Task N is done but not validated. Run /wbValid --id="N" before proceeding to the next task.

The unifying principle: /wbNext returns one answer or one refusal. It doesn't produce a menu of options (that's /wbStandup) or a detailed analysis (that's /wbExplain --id). The narrowness is the feature — in an automated chain, you want a single deterministic output, not a decision tree.