com um clique
launch-task
// Create a sub-agent to perform a larger task. Use when work is large enough to warrant a separate context, involves multi-file changes, or benefits from isolation.
// Create a sub-agent to perform a larger task. Use when work is large enough to warrant a separate context, involves multi-file changes, or benefits from isolation.
Use immediately when the user asks you to do something net-new -- a task you haven't done before, no existing skill applies, and getting it right will require nontrivial research, exploration, or experimentation. When doing this, give a very short confirmation message to the user's request, then load this immediately before responding further. Your confirmation message shouldn't mention loading the skill. Skip when an applicable single skill already exists or for pure dev/code-writing work.
Use when you want to create a new web view for the user. Covers scaffolding a new FastAPI service (canonical path) and the escape hatch for wrapping a pre-existing third-party server, plus diagnostic references when things misbehave.
Use whenever you want to use latchkey commands or interact with third-party or self-hosted services (Slack, Google Workspace, Dropbox, GitHub, Linear, Coolify...) using their HTTP APIs on the user's behalf.
Use to read and write files and directories on the user's local filesystem.
Push local improvements to shared infrastructure (skills, scripts, CLAUDE.md scaffolding, Dockerfile, services.toml) back to the parent template repo so other agents derived from the template benefit. Opens a separate per-feature PR per logical fix; never pushes directly to upstream `main`. Do not push agent-specific content (PURPOSE.md, memory, runtime state). For pulling updates from upstream, use the `update-self` skill instead.
Extend, refactor, or verify a crystallized skill under `.agents/skills/`, or a shared script or reference under `.agents/shared/` that other skills consume. Invoke at turn-end when you had to do additional repeatable work around the artifact (absorb flow), or when you and the user discussed a change and you applied it live (verify flow).
| name | launch-task |
| description | Create a sub-agent to perform a larger task. Use when work is large enough to warrant a separate context, involves multi-file changes, or benefits from isolation. |
Pick a short kebab-case slug $NAME for this dispatch (e.g.
fix-login-bug, add-search-feature). It is used for the worker name,
its branch (mngr/$NAME), and the local runtime path
(runtime/launch-task/$NAME/). Names must be unique.
Write a clear task file with YAML frontmatter (so the worker can address
reports back to you) followed by the human-readable task description.
The frontmatter contains lead_agent and lead_report_dir.
mkdir -p runtime/launch-task/$NAME
{
cat << FRONTMATTER_EOF
---
lead_agent: $MNGR_AGENT_NAME
lead_report_dir: runtime/launch-task/$NAME/reports/
---
FRONTMATTER_EOF
cat << 'BODY_EOF'
# Task: <title>
## What to do
<description of what needs to be done and why>
## Context
<any relevant context: file paths, prior attempts, constraints>
## Success criteria
<what "done" looks like -- be specific>
## Reporting back
When you reach a terminal state (success or stuck) or have a
mid-flight question that blocks progress, write a single
`report.md` to the directory given by the `lead_report_dir`
frontmatter field above (resolved relative to your worktree --
the lead has already pushed that directory into your worktree
before sending this task; create the directory yourself with
`mkdir -p` if it does not yet exist). Frontmatter shape:
---
type: status # or `gate` for a mid-flight question
name: done # or `stuck` for a terminal failure; or `question` for a gate
---
<body: address the user directly; one short paragraph for terminal
statuses, the question itself for gate reports>
Then push the report directory back to the lead:
mngr push <lead_agent>:<lead_report_dir> \
--source <lead_report_dir> \
--uncommitted-changes=merge
(Substitute the actual values from the frontmatter; the trailing
slashes matter, and `--uncommitted-changes=merge` is required because
the lead's worktree usually has uncommitted state.) For a mid-flight
gate, stop your turn after pushing -- the lead will reply via
`mngr message` and you resume. For terminal statuses, the run ends.
BODY_EOF
} > runtime/launch-task/$NAME/task.md
mngr create $NAME -t worker \
--label workspace=$MINDS_WORKSPACE_NAME
Omit --message-file here. Sending the task message at create time
races with the runtime-dir push in Step 3 -- the worker could read the
message and try to find runtime/launch-task/$NAME/ before it has been
pushed into its worktree. Send the task as a follow-up in Step 4
instead.
The worker's worktree is a fresh checkout that does not see your
gitignored runtime/. Push the runtime dir so the worker has the task
file (and a writable home for its report.md) at the path the
frontmatter names.
mngr push $NAME:runtime/launch-task/$NAME/ \
--source runtime/launch-task/$NAME/ \
--uncommitted-changes=merge
If the task references other gitignored files (datasets, credentials, extra transcripts), push them now too with the same pattern.
Now that the runtime dir is in place, send the task file as the worker's first message:
mngr message $NAME --message-file runtime/launch-task/$NAME/task.md
Launch the poll as a background task (run_in_background: true) and
continue with whatever else you were doing. The report file appears at
runtime/launch-task/$NAME/reports/report.md once the worker pushes
back.
# Run with Bash run_in_background: true
timeout 30m bash -c '
while [ ! -f runtime/launch-task/'"$NAME"'/reports/report.md ]; do sleep 5; done
cat runtime/launch-task/'"$NAME"'/reports/report.md
'
You own this poll for the lifetime of the dispatch. Without it, gate reports never reach the user and the worker deadlocks waiting for a reply. Reports surface as task notifications when the background job completes; handle them at that point, not by blocking on the poll.
Follow .agents/shared/references/lead-proxy.md for parsing the
report's frontmatter (type + name), deciding whether to answer a
gate yourself vs. escalate to the user, consuming the report so the
next push can land a fresh report.md, and acting on terminal statuses
(done -> merge the worker's branch; stuck or 30m timeout without a
report -> diagnose worker liveness, then surface to the user per
references/worker-failure.md if the worker is genuinely wedged).
Flow-specific substitutions when reading lead-proxy.md:
$NAMEmngr/$NAMEruntime/launch-task/$NAME/reports/runtime/launch-task/$NAME/reports/consumed/question (mid-flight; default-escalate to the user
unless you can answer from context).done (merge); stuck (failure flow).mngr wait for completion signaling on these workers;
it does not interact reliably with stop hooks or worker-spawned
sub-agents. The report file is the contract.references/worker-failure.md -- do not
silently retry.STOPPED with uncommitted work, default to mngr start <worker> and message it to continue -- the worktree is preserved
across restart. See references/dead-worker-recovery.md for the
manual salvage fallback when restart isn't viable.mngr push before sending the task message (see Step 3).