| name | wait-for-agent |
| description | Wait for another agent to enter WAITING state, then execute follow-up instructions |
The user's message contains an agent name and optional follow-up instructions. Extract the agent name (the first word) and treat everything after it as follow-up instructions.
Agent Name Resolution
Skip this step if the user seems to have provided the exact name of the agent -- just use the first word of their input directly as the target. Otherwise (for example they pasted a branch name like mngr/foo, or described the agent instead of naming it), run the /imbue-mngr-skills:find-agent skill, which explains how to find the exact agent name.
Polling
Run the following bash command (with a 600000ms timeout), substituting AGENT_NAME with the resolved agent name. The loop returns immediately if the agent is already in a ready state:
while true; do
OUTPUT=$(mngr list --include 'name == "AGENT_NAME"' --format '{state}|{plugin.claude.waiting_reason}' 2>/dev/null | head -1)
STATE="${OUTPUT%%|*}"
REASON="${OUTPUT#*|}"
echo "[$(date '+%H:%M:%S')] Agent 'AGENT_NAME' state: ${STATE:-NOT_FOUND} (reason: ${REASON:-none})"
case "$STATE" in
DONE|STOPPED) echo ; ;;
WAITING)
[ = ];
60
;
;;
) ; ;;
*) 60 ;;