hung-phan/pmtui/pmtui-spawn
Claude Code and agent skill by hung-phan/pmtui
- community
Checking that the SKILL.md file is still in the repository.
Dispatch one independent part of your task to a child job. A child job is one headless agent run that does the task, reports a result and exits. Invoke when another agent could do that part without you. Dispatch it with one complete Message, poll for its result, and act on the JSON. Use --session instead when the part needs an agent that stays, which makes a persistent session you can message.
Install
npx vskill@latest install hung-phan/pmtui/pmtui-spawnSKILL.md
The same SKILL.md was published earlier as hung-phan/pmtui/pmtui-spawn.
Spawn a child job
A child is a JOB. It is one agent run. It does the task, it reports a result, and it exits. It is not a session you talk to. You cannot message it, and it cannot ask you anything.
- Spawn only independent work that can proceed without you. Do the rest yourself.
- Write the Message as a complete spec. Name the target. Name the change. Name the constraints.
Name the ownership, which is the set of files the child may edit. Name the observable acceptance. The child is told the Message and nothing else.
- Make one request id, and keep it. Every later check uses that same id. The cancel uses it too.
``bash id=$(cat /proc/sys/kernel/random/uuid 2>/dev/null || uuidgen | tr 'A-F' 'a-f') "$PMTUI_BIN" spawn --request-id "$id" --title "<short title>" --message "<Target / Change / Constraints / Ownership / Acceptance>" --wait 120 --json ``
--wait sets how long to wait for the child's RESULT. The limit is 120 seconds. A short task returns its result inside this one call.
TO SPAWN SEVERAL: dispatch them all first, then ask once. Each command waits for its own child. So one command after another puts independent children in series.
``bash for task in "<task 1>" "<task 2>" "<task 3>"; do id=$(cat /proc/sys/kernel/random/uuid 2>/dev/null || uuidgen | tr 'A-F' 'a-f') "$PMTUI_BIN" spawn --request-id "$id" --title "<short title>" --message "$task" --wait 0 --json & done wait ``
--wait 0 dispatches and returns at once. Read the outcome of all of them with step 5. In a git repository each child gets its own worktree and its own branch, so children cannot overwrite each other. Name the ownership even so. Two children sent to the same file both commit, and then a person must choose between them.
- Parse the JSON on stdout even when the exit code is nonzero.
--waitwaited for the child's
RESULT, so state is usually the answer:
done: reportresult.summaryto the human. In a git repository the child worked in its own
worktree. work.branch and work.commit name its commit, work.touched lists what it changed, and work.uncommitted reports changes it never committed. That commit is NOT in the human's checkout. Say the branch is ready, and let the human apply it with a in the dashboard.
needs_human: relayresult.summaryas the child's question. Do not re-dispatch it.ended_without_result: the run crashed, or something killed it. Tell the human, and name
error.message. A new attempt needs a new id.
cancelled: something stopped it on purpose. Do not retry it in silence.in_progressorqueued: the child still works. Go to step 5.needs_attention: tell the human that the child needs a person at its terminal.failed: act onerror.code:request_conflict: this id already names a request with other arguments. Rerun the
command with the original arguments and the same --request-id to check on it. Never make a new id for the same task.
request_unwritable: rerun the same command, with the same--request-id, later.dir_not_allowed: stop and ask the human.invalid_argument,dir_not_found,message_too_longorinvalid_request: nothing ran.
Fix the argument, then retry with a new id.
job_failed: the child ran, and it reports that the task failed. Readresult.summary,
then decide. Any retry needs a new id.
- Any other code: stop and tell the human the code and its message.
outcome_unknown: stop and tell the human. Never spawn a replacement.
- Use this step only for
in_progressorqueued. The child still works, and you cannot know for
how long. Do your own work. At your next pause, ask about every child in one call:
``bash "$PMTUI_BIN" spawn --status --json ``
You get one line per child, with its state and what it reported, and no ids to remember. Read it until your child reaches one of the terminal states in step 4. The dispatch command also works again under the same --request-id, and it waits again. Never make a new id for the same task. No clock stops a child. Cancel one when you decide it is no longer worth the wait.
- To stop a child you no longer want, cancel it by id:
``bash "$PMTUI_BIN" spawn --request-id "$id" --cancel --json ``
The command reports cancel_requested. Keep checking as in step 5, until the receipt reads cancelled.
- A job cannot spawn. A session can, at any depth. Ask for the children the work needs.
Ask for a session instead of a job
A job is for work that ends. Some work does not end in one run. It needs an agent that stays.
Add --session to ask for a SESSION instead of a job. A session is a persistent agent. It is the same thing a human makes with n in the dashboard. It takes your Message as its first turn.
Read state from the JSON. ready means the session is up. Exit 0 means the same. This form waits for no result, because a session reports none.
A session is a PEER after that. Talk to it with your pmtui-message skill. Address it by the id inside session.
Five rules change for a session:
- It reports no result. Nothing writes
resultorworkfor it. - You cannot cancel it. Its human closes it with
d. - It stays on the dashboard after its agent exits.
- It can ask for children of its own. A job cannot, because a job gets no way to ask.
- It has its own human and its own goal. It carries no orders from you.
Ask for a session when the work needs many turns, or an answer from you. Ask for a job for every other part. A job is cheaper, and it ends by itself.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pmtui-spawn/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hung-phan/pmtui/pmtui-spawn)