Skip to content
Back to skills

Wait For Agent

ASecurity

Wait for another agent to enter WAITING state, then execute follow-up instructions

  • 434 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 9, 2026
toolsbash

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add imbue-ai/mngr --skill wait-for-agent --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Wait For Agent?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Wait For Agent
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/imbue-ai-wait-for-agent-mngr/badge)](https://www.skillsdirectory.com/skills/imbue-ai-wait-for-agent-mngr)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: wait-for-agent
argument-hint: [agent_name] [instructions...]
description: Wait for another agent to enter WAITING state, then execute follow-up instructions
allowed-tools: Bash(mngr list *), Bash(uv run mngr list *), Bash(while true; do*), Skill(imbue-mngr-skills:find-agent)
---

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:

```bash
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 "Agent 'AGENT_NAME' is ready (state: $STATE)"; break ;;
    WAITING)
      if [ "$REASON" = "PERMISSIONS" ]; then
        echo "Agent 'AGENT_NAME' waiting on permissions, continuing to poll..."
        sleep 60
      else
        echo "Agent 'AGENT_NAME' is ready (state: $STATE)"; break
      fi ;;
    "") echo "Agent 'AGENT_NAME' not found, stopping"; break ;;
    *) sleep 60 ;;
  esac
done
```

If this command times out (after 10 minutes), check on the agent by running `tmux capture-pane -t mngr-AGENT_NAME -p -S -30` to see its recent output. The tmux session name format is `mngr-AGENT_NAME`. If it looks like the agent is still actively working, re-run the polling loop. If it looks stuck or dead, inform the user.

## After the Agent is Ready

Once the agent is in WAITING (without a permissions reason), DONE, or STOPPED state, carry out the user's follow-up instructions. If no follow-up instructions were provided, inform the user that the agent is ready.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.