name: supervisor description: 'Monitor blocked workers and help respond to them. Loop checks ft work inbox, shows blocked workers, lets you respond naturally.'
Main Loop
On first invocation, check mode:
Step 0: Detect Auto-Mode (once at start)
echo $SUPERVISOR_UNATTENDED
If output is 1 or non-empty: AUTO-MODE — skip all AskUserQuestion calls, use defaults.
If output is empty: ATTENDED MODE — interactive, ask user for input.
Store this mode for the entire session. Do not re-check.
Then run this loop:
Step 1: Check Inbox
ft work inbox --json
Parse the JSON array. Each item has:
task_id: Worker IDtask_title: Task namepending_question: What they're blocked onage_seconds: How long blocked
Step 2: If No Blocked Workers
If AUTO-MODE (from Step 0):
Show: "No blocked workers. Exiting."
End skill (no loop, no question)
Otherwise (attended mode):
Show: "No blocked workers. Checking again in 30 seconds..."
Wait 30 seconds (just tell user, don't actually sleep)
Ask: "Check again now, or exit?"
- "Check again" → Step 1
- "Exit" → End skill
Step 3: If Blocked Workers Exist
For each blocked worker, show:
───────────────────────────────────────
BLOCKED: #[task_id] — [task_title]
Waiting: [age in minutes]m
Q: [pending_question]
───────────────────────────────────────
If AUTO-MODE (from Step 0):
- Skip AskUserQuestion entirely
- Use default response: "Continue working on the task. Try a different approach if stuck."
- Resume worker with
ft work resume [task_id] -m "[response]" - Return to Step 1 (check inbox again for new blocks)
Otherwise (attended mode):
Ask:
AskUserQuestion:
question: "How do you want to respond to #[task_id]?"
header: "Response"
options:
- label: "Continue"
description: "Tell worker to keep trying"
- label: "Skip for now"
description: "Come back to this one later"
If user selects an option: Map to response message. If user types custom text: Use that as the response.
Step 4: Resume Worker
ft work resume [task_id] -m "[response message]"
Show: "Resumed #[task_id]"
Return to Step 1.
Response Mappings
| Selection | Message |
|---|---|
| Continue | "Continue working on the task. Try a different approach if stuck." |
| Skip for now | (don't resume - just move to next worker) |
| Custom text | User's exact input |
Rules
- Always check inbox first — don't ask what to do, just check
- Oldest first — workers sorted by age, address oldest first
- Custom text is the response — no reformatting, no prefixes
- Loop forever (attended mode) — only exit when user explicitly says "exit" or "quit" (auto-mode exits when inbox empty)
- Brief output — no explanations, just worker info and questions