skills/agents-collab/SKILL.md
Foundation rules for how Wopal collaborates with sub-agents such as fae and rook. ⚠️ MUST load before ANY delegation — covers delegation tool APIs, task lifecycle, notifications, status handling, and recovery. 🔴 Trigger: "delegate", "let fae implement", "fae task", "rook review", "check task status", "cancel task", "abort task", "agent collaboration", "委派", "让 fae 执行", "fae 任务", "rook 审查", "检查状态", or any intent to hand work to a sub-agent. 🔴 Never delegate without loading this skill first. Skipping it is serious negligence. Note: this skill does not include workflow-specific prompt templates such as dev-flow templates. Those belong to the corresponding workflow skills.
npx skillsauth add sampx/agent-tools agents-collabInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill defines how Wopal should collaborate with sub-agents at the tool level. When to delegate, and which workflow-specific instructions must appear in the prompt (such as Plan paths or done checkboxes), are decided by higher-level workflow skills such as dev-flow.
Always prefer wopal_task for delegation. Use the built-in task tool only when wopal_task is unavailable.
wopal_task provides bidirectional communication, progress monitoring, and non-blocking execution. Using task means downgrading execution and giving up those capabilities.
Delegation prompts must be precise and complete so the sub-agent can succeed in one pass. Standard format:
Hello <agent>, I am wopal. Because <reason>, please do the following task:
Task: <task description>
Goal: <goal description>
<precise context: absolute paths, file:line anchors, current code, change locations, and boundaries of what must not be changed>
Required location context:
.wopal/): explicitly state the worktree root and warn the sub-agent not to edit the wrong locationCore principle: give complete, precise context up front so rework is minimized.
When delegating code review to rook, you must first define the change carrier. Without it, rook cannot establish a correct review boundary:
| Scenario | Required prompt fields | How rook should review |
|------|----------------|------------------|
| Uncommitted changes | review_type: implementation, project_path, change_scope: working_tree, plus changed file list or an explicit instruction to review git diff / git diff --cached | Review against the working tree or staged diff using planless diff review |
| Committed changes | review_type: implementation, project_path, commit: <hash> or commit_range: <A>..<B>, and background | Review against the git diff for that commit or range; never rely on file paths alone |
Additional rules:
business_logic_review: requested. Otherwise rook should place severe logic concerns in a discussion-only section.wopal_task({
description: "3-5 words",
prompt: "<write the prompt using the format above>",
agent: "fae" // or "rook", "general", etc. Default: "general"
})
// Returns task_id for later monitoring and communication
wopal_task_output({ task_id }) // summary status
wopal_task_output({ task_id, section: "text" }) // text output
wopal_task_output({ task_id, section: "tools" }) // tool calls
wopal_task_output({ task_id, section: "reasoning" }) // reasoning trace
wopal_task_output({ task_id, section: "text", last_n: 3 }) // last 3 text outputs only
Send a message to an idle, waiting, or stuck task to resume execution or correct direction. error tasks cannot be resumed; clean them up with finish and recreate them. The sub-agent will wake up.
wopal_task_reply({ task_id, message: "Continue improving test coverage" })
wopal_task_reply({ task_id, message: "Change direction to...", interrupt: true }) // abort current execution + inject message
| Task state | Behavior |
|---------|------|
| waiting | Send a message and resume execution |
| idle | Clear the idle marker, send a message, and resume execution |
| stuck | Send a message and try again |
| error | Reply is invalid; finish and recreate with valid config |
| running | Must use interrupt=true, otherwise the message is queued |
Forbidden: wopal_task_reply({ message: "Task complete" }) — this wakes the sub-agent and causes pointless extra work. IDLE is already the completion signal. If the output is accepted, end the task with wopal_task_finish.
Pure stop: no message, no wake-up. Afterward you can either finish the task or reply to resume it.
wopal_task_abort({ task_id })
Terminate an idle, waiting, stuck, or error task and delete its sub-session. The sub-agent will not wake up. Running tasks must be aborted first or redirected with reply(interrupt=true).
wopal_task_finish({ task_id })
State model: running | idle | waiting | stuck | error
running: the only active state; the sub-session is executingidle: stopped, with new assistant text, waiting for Wopal acceptancewaiting: stopped, waiting for a native question replystuck: stopped, with evidence of assistant execution but no new assistant text in the current round; can be resumed or cleaned uperror: stopped before entering a recoverable execution chain, such as invalid agent config; must be cleaned up and recreated| State | Meaning | Wopal action |
|------|------|-----------|
| running | Executing | Wait for notifications or inspect output when needed |
| idle | Stopped with output | Accept → finish, or reject → reply |
| waiting | Waiting for native question reply | Use reply to answer via the question.reply path |
| stuck | Execution evidence exists but no fresh output | Inspect output/logs → reply to recover or finish to clean up |
| error | Startup/config-level failure | Inspect cause → finish cleanup → recreate task |
Task state changes are reported through system notifications named [WOPAL TASK *]. Do not poll. Wait for notifications.
| Notification | Trigger | Handling |
|------|---------|---------|
| [WOPAL TASK PROGRESS] | Periodic heartbeat | Understand progress; no action needed |
| [WOPAL TASK IDLE] | Sub-agent session is idle with fresh assistant text | Follow the IDLE decision tree below |
| [WOPAL TASK QUESTION] | Sub-agent used the native question tool and is now waiting | Use reply to answer |
| [WOPAL TASK STUCK] | Assistant execution happened, but the current round stopped without fresh assistant text | Inspect output(section="reasoning") → reply to resume or finish to clean up |
| [WOPAL TASK ERR] | No assistant execution evidence before failure | Inspect the cause → finish cleanup; do not reply |
STUCK is produced when the sub-session stops, there is no new non-synthetic assistant text in the round, but there is prior evidence of assistant execution. ERR means the task never entered a recoverable execution chain. Bash command failures do not trigger ERR. reply cannot change agent type; changing agent type requires a new task.
IDLE notification arrives
↓
① Inspect text output with wopal_task_output(section="text")
↓
② Make acceptance decision
├─ Accepted, no more work needed → wopal_task_finish to free resources
│ ❌ Never do nothing and wait for TTL; zombie tasks waste concurrency slots
├─ Accepted, but may be reused later → keep alive
├─ Not accepted → wopal_task_reply for rework (⚠️ see high-context rules below)
└─ Sub-agent asked a question → wopal_task_reply with the answer
STUCK notification arrives
↓
① Inspect reasoning with wopal_task_output(section="reasoning")
↓
② Decide next action
├─ Reasoning is normal, just no text this round → optionally guide with wopal_task_reply
├─ Dead loop / repeated retries → wopal_task_abort or wopal_task_finish
└─ Abnormal stop (session crash, etc.) → try wopal_task_reply or clean up with wopal_task_finish
ERR notification arrives
↓
① Inspect the error cause with wopal_task_output
↓
② Clean up with wopal_task_finish
↓
③ Recreate a new task if work must continue
Wopal owns delegation rules, review conclusions, and the decision to reuse or replace a task. Fae and rook do not summarize delegation lessons. After receiving a review result, Wopal must actively drive the next step instead of waiting for the user to repeat authorization.
As long as the task is still alive, the scope has not materially changed, and context remains healthy, prefer reply reuse:
| Scenario | Preferred | Avoid |
|------|------|--------|
| Small fae rework | reply to continue | Opening a new fae task |
| Rook returned REVISE/BLOCK and code is fixed | reply the original rook task | Opening a new rook task |
| Supplying more information / continuing work | reply | Finishing then recreating |
Open a new task, or have Wopal finish the work directly, when any of these is true:
Rule of thumb: do not interrupt a healthy running task. If quality is poor after IDLE and context is already high, avoid forcing another hard reply cycle.
When receiving [WOPAL TASK PROGRESS], check context usage:
| Usage | Recommendation | |------|------| | < 45% | No action needed | | 45-55% | Evaluate remaining workload | | ≥ 55% | Consider compaction | | ≥ 75% | Urgent compaction |
Before compacting, confirm there are no uncommitted changes, no blocking dependencies, and the task is not stuck.
Main session: context_manage(action="compact"). After compaction, the plugin sends recovery instructions automatically.
Child session: context_manage(action="compact", session_id="wopal-task-xxx"). After compaction, the plugin sends [WOPAL TASK COMPACTED], and Wopal should use reply with precise recovery instructions.
When multiple agents run in parallel, the file list returned by output may include work produced by other agents. Focus only on the expected artifacts for the current task, and use git status in the relevant project directory to verify them. Do not misclassify other agents' files as anomalies or delete them.
| Prohibition | Reason |
|------|------|
| Delegating without loading this skill | Missing operating rules; errors become likely |
| Frequent output polling | Wastes context; wait for notifications instead |
| Nested wopal_task usage | Sub-agents already have it disabled |
| Repeated reply-based rework on the same task when context > 50% | Quality degrades in high-context sessions |
| reply("Task complete") | Wakes the sub-agent for no meaningful reason |
| Limit | Response | |------|------| | Max concurrency is 3 | Additional tasks queue automatically | | TTL is 30 minutes | Unhandled tasks are auto-cleaned after notification |
See references/troubleshooting.md
tools
Configure ellamaka, a fork of OpenCode with wopal-space mode. MUST use for any task about ellamaka config, agent frontmatter, permission rules, model/provider selection, formatter settings, config loading order, or why config changes are ignored. Trigger on requests about ellamaka or opencode config files, agent permission overrides, restricting subagents, custom/plugin tool permissions (e.g. wopal_task_*), disabling tools, configuring providers or models, formatter setup, config precedence or layering, or debugging settings that do not take effect. Use this skill even when the user says "opencode" if the actual runtime, config path, or behavior is ellamaka. Prefer this skill whenever the answer depends on the difference between ellamaka and upstream opencode, including wopal-space config loading, plugin tool permissions, or agent frontmatter precedence.
development
Plan quality verification for dev-flow. Goal-backward analysis ensures plans WILL achieve their stated goal before execution burns context. ⚠️ MUST use when: (1) Reviewing Plan quality before approve (2) Wopal completes Plan writing and needs quality gate (3) User asks to "check plan", "verify plan", "review plan" (4) Plan enters planning status and needs pre-execution validation 🔴 Trigger automatically when Plan is ready for review, even if user doesn't explicitly say "review". Agent: rook (read-only verification subagent) Mode: verification, not execution
development
Review implementation results for goal achievement and code quality. Supports both Plan-backed review and planless diff review. ⚠️ MUST use when: (1) Wopal delegates rook to review fae implementation output, (2) Prompt contains "review_type: implementation", (3) Prompt contains changed code file list or Plan path + implementation scope, (4) Any code review request from Wopal. 🔴 Trigger even when user does not explicitly mention "review" if the task involves verifying implementation results. This skill is rook-exclusive (only rook agent can load it).
tools
Manage parallel workstreams — list, create, switch, status, progress, complete, and resume