Skip to content

fix: encode status verification rules into parallel-orchestrator agent and taskMaestro skill #888

@JeremyDev87

Description

@JeremyDev87

Purpose

Lessons from 2026-03-22 parallel execution must be encoded into the orchestration agent and skill so ALL users avoid the same mistakes — not just one session's memory.

Background

5 categories of detection failure occurred during 19-issue parallel execution:

  1. Stale RESULT.json inherited from previous wave → false completion
  2. Completed spinner (Crunched for 2m) misclassified as active
  3. OMC "thinking" in status bar ≠ productive work (error recovery loop)
  4. Error messages outside tail range (30+ lines up) missed
  5. RESULT.json issue number not validated against assigned task

These are systemic — any user running taskMaestro will hit the same problems.

Changes

1. packages/rules/.ai-rules/agents/parallel-orchestrator.json

Add to systemPrompt under workflow knowledge:

## Status Verification Rules (MANDATORY)

### RESULT.json is NOT the source of truth alone
- ALWAYS validate RESULT.json `issue` field matches the assigned task
- ALWAYS cross-verify with capture-pane even when RESULT.json exists
- Stale RESULT.json from previous waves WILL exist if cleanup was imperfect

### Active vs Completed Spinner Discrimination
- ACTIVE: `✻ Verb-ing… (Xm · ↓ tokens)` — ellipsis + token stream
- COMPLETED: `✻ Past-tense for Xm Ys` — no ellipsis, past tense verb
- NEVER classify completed spinners as "working"

### Error Detection Requires Broad Scan
- Scan last 30 lines for error patterns, not just last 8
- "thinking" in OMC status bar does NOT mean productive work when errors are visible
- Duration on same step > 5min with no token change = STALLED

### git add Safety
- NEVER use `git add -A` or `git add .` in worktrees
- ALWAYS stage specific files by name
- RESULT.json and TASK.md must NEVER be committed

2. .claude/skills/taskmaestro/SKILL.md

Add to watch and status subcommands:

### Status Verification Protocol (MANDATORY)

When checking worker status, follow this exact sequence:

1. **RESULT.json check WITH validation**:
   ```bash
   RESULT=$(cat "$WT/RESULT.json" 2>/dev/null)
   if [ -n "$RESULT" ]; then
     RESULT_ISSUE=$(echo "$RESULT" | jq -r '.issue')
     if [ "$RESULT_ISSUE" != "$EXPECTED_ISSUE" ]; then
       echo "STALE: expected $EXPECTED_ISSUE, got $RESULT_ISSUE"
       rm "$WT/RESULT.json"  # Remove stale
       # Fall through to capture-pane check
     fi
   fi
  1. Capture-pane 3-factor analysis:

    • Factor 1: Error scan (30 lines) — FAIL|Error:|Cannot find|fatal:
    • Factor 2: Active spinner — … (Xm · ↓|↑|thinking|tokens)
    • Factor 3: Completed spinner — Crunched|Sautéed|Brewed|Worked for (= IDLE)
  2. Cross-verify: Even if RESULT.json says "success", confirm capture-pane shows idle/prompt state

Worktree Artifact Cleanup

After creating worktrees in start, always:

for WT in $WORKTREES; do
  rm -f "$WT/RESULT.json" "$WT/TASK.md"
done

### 3. Worker prompt template in `assign`

Add to completion protocol:

IMPORTANT: When using git add, NEVER use git add -A or git add ..
Always add specific files: git add path/to/file1 path/to/file2
RESULT.json and TASK.md must NEVER be committed to git.


## Acceptance Criteria

- [ ] parallel-orchestrator.json systemPrompt includes status verification rules
- [ ] taskMaestro watch/status includes RESULT.json issue validation
- [ ] taskMaestro watch includes 3-factor analysis protocol
- [ ] taskMaestro start includes artifact cleanup after worktree creation
- [ ] taskMaestro assign worker prompt includes `git add` safety rule
- [ ] All rules are tool-agnostic where possible
- [ ] Can be merged independently

## References

- parallel-orchestrator: `packages/rules/.ai-rules/agents/parallel-orchestrator.json`
- taskMaestro: `.claude/skills/taskmaestro/SKILL.md`
- Parent: #866
- Related: #864 (status detection), #887 (stale RESULT.json)

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixsub-issue상위 이슈의 하위 작업

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions