con un clic
orchestrator-investigate
Investigate and resolve a stuck orchestrator work unit.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Investigate and resolve a stuck orchestrator work unit.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Collaboratively refine a high-level ambition into a set of chunk prompts.
Migrate the project's ACTIVE chunks to the present-tense, intent-owning standard. Audits each chunk's goal against the code it claims to govern; rewrites retrospective framing inline; logs over-claims that need operator triage; historicalizes chunks with no enduring intent. Designed for full-corpus migrations — fans out across many parallel sub-agents at 5 chunks per agent.
Create a new chunk of work and refine its goal. Use when the operator wants to start new intent-bearing work, chunk something, define a piece of work, or break work into a chunk.
Update code references in the current chunk and move both the PLAN.md and the GOAL.md to the ACTIVE state.
Wake an entity by loading its identity, memories, and operational context
Set up a project steward via interactive interview
Basado en la clasificación ocupacional SOC
| name | orchestrator-investigate |
| description | Investigate and resolve a stuck orchestrator work unit. |
This command investigates why an orchestrator work unit is stuck (typically in NEEDS_ATTENTION status) and guides you through resolution.
Chunk to investigate: $ARGUMENTS
If no chunk name is provided, first run ve orch status to identify
chunks needing attention.
Follow these phases systematically. Do not skip phases or propose fixes without completing the investigation.
ve orch status
Confirm the chunk is in NEEDS_ATTENTION (or unexpected state). Note the work unit counts.
ve orch work-unit show $ARGUMENTS
Note the status, phase, attention_reason, and displaced_chunk fields.
ls -la .ve/chunks/$ARGUMENTS/log/
Determine current phase by which logs exist:
plan.txt only → PLAN phaseplan.txt + implement.txt → IMPLEMENT phase# Does worktree exist?
ls -la .ve/chunks/$ARGUMENTS/worktree 2>/dev/null && echo "worktree exists" || echo "no worktree"
# Check git worktree list
git worktree list | grep $ARGUMENTS
# Check if branch exists
git branch -a | grep $ARGUMENTS
grep -i "$ARGUMENTS\|error\|failed\|merge" .ve/orchestrator.log | tail -50
Look for error messages that explain why the chunk is stuck.
If logs exist, check the end of the most recent phase log:
tail -c 20000 .ve/chunks/$ARGUMENTS/log/complete.txt 2>/dev/null || \
tail -c 20000 .ve/chunks/$ARGUMENTS/log/implement.txt 2>/dev/null || \
tail -c 20000 .ve/chunks/$ARGUMENTS/log/plan.txt 2>/dev/null
Look for ResultMessage at the end - subtype='success' means the agent
completed, subtype='error' means it failed.
Based on evidence gathered, identify which scenario applies:
Symptoms:
error: Your local changes to the following files would be overwritten by mergeDiagnosis: Main repo had uncommitted changes when orchestrator tried to merge.
Symptoms:
CONFLICT or Automatic merge failedDiagnosis: Branch and main diverged with conflicting changes.
Symptoms:
subtype='error' or no ResultMessage at endDiagnosis: Agent encountered an error during the phase.
Symptoms:
Chunk '<name>' not found in worktreeDiagnosis: Worktree was created but chunk docs weren't present (race condition or branch issue).
Symptoms:
git worktree list shows prunable entriesDiagnosis: Git worktree is in inconsistent state.
Symptoms:
git log shows commits mentioning the chunk on main (creating a "merge illusion")git diff main..orch/$ARGUMENTS shows implementation changes that aren't on mainDiagnosis: The FUTURE chunk's documentation (GOAL.md, PLAN.md) was committed to main
via the initial chunk-create commit. The orchestrator ran PLAN/IMPLEMENT in a worktree,
but a later phase (REVIEW or COMPLETE) failed. This leaves implementation code on the
orch/ branch while main only has the docs.
Diagnostic steps:
# Check for unmerged implementation commits on the branch
git log --oneline orch/$ARGUMENTS ^main
# See which files exist on branch but not main
git diff --name-status main..orch/$ARGUMENTS
# Verify GOAL.md exists on main but implementation doesn't
git show main:docs/chunks/$ARGUMENTS/GOAL.md >/dev/null 2>&1 && echo "GOAL.md on main"
Symptoms:
attention_reasonsrc/orchestrator/*, src/ve.py) rather than chunk contentDiagnosis: A bug in VE/orchestrator code (missing import, schema error, API change) is causing every chunk that reaches a particular phase to fail. The fix is in the VE codebase, not in any individual chunk.
Diagnostic steps:
# Check how many chunks are in NEEDS_ATTENTION
ve orch status
# List all work units needing attention and compare reasons
ve orch attention list
# Check orchestrator log for repeated errors
grep -i "error\|exception\|traceback" .ve/orchestrator.log | tail -50
# Look for errors referencing VE code
grep -E "src/(orchestrator|ve)" .ve/orchestrator.log | tail -20
⚠️ CRITICAL:
status DONEvsdelete
ve orch work-unit status <chunk> DONE— Marks the work unit complete but preserves the branch. Use this when you've manually merged the branch to main.ve orch work-unit delete <chunk>— Removes the work unit AND force-deletes the branch (usesgit branch -D). Use this ONLY when you're certain the branch has no unmerged work.When in doubt, use
status DONE— you can always delete the branch later withgit branch -dwhich will warn if unmerged commits exist.
Execute the resolution for the diagnosed scenario:
# Check main is clean
git status
# If main has uncommitted changes, commit or stash them first
# git stash OR git add . && git commit -m "..."
# Attempt merge
git merge orch/$ARGUMENTS --no-edit
# If conflicts occur, resolve them:
# 1. Edit conflicted files to resolve
# 2. git add <resolved-files>
# 3. git commit --no-edit
# Delete merged branch
git branch -d orch/$ARGUMENTS
# Update work unit to DONE
ve orch work-unit status $ARGUMENTS DONE
# Start merge (expect conflicts)
git merge orch/$ARGUMENTS --no-edit || echo "Conflicts expected"
# List conflicted files
git diff --name-only --diff-filter=U
# For each conflicted file:
# 1. Open and resolve conflicts (look for <<<<<<< markers)
# 2. Choose appropriate resolution based on context
# 3. git add <file>
# Complete merge
git commit --no-edit
# Cleanup
git branch -d orch/$ARGUMENTS
ve orch work-unit status $ARGUMENTS DONE
If the agent failed and you want to retry:
# Reset work unit to allow retry
ve orch work-unit status $ARGUMENTS READY
Or if the failure is unrecoverable, mark as needing manual intervention:
# Delete work unit and handle manually
ve orch work-unit delete $ARGUMENTS
# Remove corrupted worktree
rm -rf .ve/chunks/$ARGUMENTS/worktree
git worktree prune
# Reset to READY to trigger worktree recreation
ve orch work-unit status $ARGUMENTS READY
# Prune worktrees
git worktree prune
# Remove directory if it exists
rm -rf .ve/chunks/$ARGUMENTS/worktree
# Check branch state
git branch -a | grep $ARGUMENTS
# If branch has useful commits, merge manually (see Resolution A)
# Otherwise, reset work unit to retry
⚠️ WARNING: Do NOT use
work-unit deletehere — it will force-delete the branch withgit branch -D, losing your implementation commits. Usestatus DONEafter merging instead.
# 1. Verify the branch exists and has unmerged commits
git branch -a | grep $ARGUMENTS
git log --oneline orch/$ARGUMENTS ^main
# 2. Merge the implementation branch to main
git merge orch/$ARGUMENTS --no-edit
# 3. If conflicts occur, resolve them:
# - Edit conflicted files
# - git add <resolved-files>
# - git commit --no-edit
# 4. If the chunk status was wrongly set to ACTIVE, reset it
ve chunk activate $ARGUMENTS --status IMPLEMENTING
# 5. Run chunk-complete to update code_references and finalize
# (invoke /chunk-complete skill manually)
# 6. Commit the completion changes
git add docs/chunks/$ARGUMENTS && git commit -m "Complete chunk: $ARGUMENTS"
# 7. Clean up: delete the merged branch and mark work unit done
git branch -d orch/$ARGUMENTS
ve orch work-unit status $ARGUMENTS DONE
This resolution is for bugs in VE/orchestrator code, NOT individual chunk failures.
# 1. Identify the bug from error messages
grep -E "error|exception" .ve/orchestrator.log | tail -30
# 2. Fix the bug in the VE codebase
# (e.g., src/orchestrator/scheduler.py, src/orchestrator/phases.py)
# 3. Commit the fix
git add src/ && git commit -m "Fix: <describe the bug>"
# 4. Stop and restart the orchestrator to pick up the fix
ve orch stop
ve orch start
# 5. Batch retry all affected work units
# For each NEEDS_ATTENTION chunk, reset to READY:
ve orch attention list
# Then for each chunk listed:
ve orch work-unit status <chunk-name> READY
# 6. Verify chunks resume execution
ve orch status
Note: This is NOT a case for
work-unit delete— the implementation work exists on branches and should be retried, not discarded.If a future
ve orch retry-allcommand is added, use that instead of manual iteration.
After applying resolution:
# Check orchestrator status
ve orch status
# Verify work unit state
ve orch work-unit show $ARGUMENTS
# If merged, verify changes are on main
git log --oneline -5
Present findings to the user:
| Field | Value |
|---|---|
| Chunk | $ARGUMENTS |
| Root Cause | (describe what caused the stuck state) |
| Resolution | (describe what was done to fix it) |
| Current Status | (DONE / READY for retry / Deleted) |
If the chunk was merged, confirm the implementation is now on main.