You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/coding-agent/SKILL.md
+56-87Lines changed: 56 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: coding-agent
3
-
description: 'Delegate coding tasks to Codex, Claude Code, OpenCode, or Pi agents via immediate background processes. Use when: (1) building or creating features/apps, (2) reviewing PRs in a temp clone/worktree, (3) refactoring large codebases, (4) iterative coding that needs file exploration. NOT for: simple one-line fixes (just edit), reading code (use read tool), thread-bound ACP harness requests in chat (use sessions_spawn with runtime:"acp"), or any work in ~/clawd workspace (never spawn agents here). All coding-agent runs start with background:true immediately. Claude Code: use --print --permission-mode bypassPermissions (no PTY). Codex/Pi/OpenCode: pty:true required. Completion notification must use openclaw message send, not system event/heartbeat.'
3
+
description: 'Delegate coding tasks to Codex, Claude Code, OpenCode, or Pi agents via immediate background processes. Use when: (1) building or creating features/apps, (2) reviewing PRs in a temp clone/worktree, (3) refactoring large codebases, (4) iterative coding that needs file exploration. NOT for: simple one-line fixes (just edit), reading code (use read tool), thread-bound ACP harness requests in chat (use sessions_spawn with runtime:"acp"), or any work in ~/clawd workspace (never spawn agents here). All coding-agent runs start with background:true immediately. Claude Code: use --print --permission-mode bypassPermissions (no PTY). Codex/Pi/OpenCode: pty:true required. Parent assistant owns completion reporting: capture sessionId, use automatic completion wake/process logs, and report completion or failure itself.'
4
4
metadata:
5
5
{
6
6
"openclaw":
@@ -36,7 +36,7 @@ metadata:
36
36
37
37
Use **bash** with **background:true** for all coding-agent work.
38
38
Do not use a foreground one-shot path here.
39
-
Start the agent, get the `sessionId`, monitor with `process`, and require the worker to notify the user directly when it finishes.
39
+
Start the agent, capture the returned `sessionId`, monitor with `process`, and report completion or failure yourself as the parent assistant.
40
40
41
41
## ⚠️ PTY Mode: Codex/Pi/OpenCode yes, Claude Code no
1. Capture the notification route from the current conversation before spawning:
92
-
-`notifyChannel`
93
-
-`notifyTarget`
94
-
-`notifyAccount` (if applicable)
95
-
-`notifyReplyTo` (if replying to a specific message is desired)
96
-
-`notifyThreadId` (Telegram topic / Slack thread when applicable)
97
-
2. Start the coding CLI with `background:true` immediately.
98
-
3. Include the notification route in the worker prompt and require the worker to call `openclaw message send` on completion.
99
-
4. Monitor with `process action:log` / `poll`.
100
-
5. If the worker needs input or fails before notifying, handle that explicitly yourself. Do not rely on heartbeat.
91
+
1. Start the coding CLI with `background:true` immediately.
92
+
2. Use the correct execution mode:
93
+
- Codex/Pi/OpenCode: `pty:true`
94
+
- Claude Code: `--print --permission-mode bypassPermissions` without PTY
95
+
3. Capture the returned `sessionId` from the background process result.
96
+
4. Tell the worker to print a clear final summary block to stdout (see template below), not to send external messages.
97
+
5. Rely on automatic completion wake if available. When woken, or when the user asks for status, use `process action:log` / `poll` to inspect the session.
98
+
6. Report completion or failure yourself from the parent assistant, using the worker's final summary and any relevant logs.
99
+
7. If automatic completion wake is unavailable or unclear, create a watchdog/check-back (cron) when appropriate, or tell the user that completion requires manual checking.
101
100
102
-
If you do not have a trustworthy notification route, say so and do not claim that completion will notify the user automatically.
101
+
Do not pass channel IDs, account IDs, reply targets, or other routing details into worker prompts unless the user explicitly asks the worker itself to interact externally.
102
+
Do not require workers to use `openclaw message send` for completion; completion reporting belongs to the parent assistant.
git worktree add -b fix/issue-78 /tmp/issue-78 main
283
250
git worktree add -b fix/issue-99 /tmp/issue-99 main
284
251
285
-
bash pty:true workdir:/tmp/issue-78 background:true command:"pnpm install && codex --yolo 'Fix issue #78: <description>. Commit and push after review. Send the completion message with openclaw message send using the provided notify route.'"
286
-
bash pty:true workdir:/tmp/issue-99 background:true command:"pnpm install && codex --yolo 'Fix issue #99 from the approved ticket summary. Implement only the in-scope edits. Send the completion message with openclaw message send using the provided notify route.'"
252
+
bash pty:true workdir:/tmp/issue-78 background:true command:"pnpm install && codex --yolo 'Fix issue #78: <description>. Commit and push after review. Print the final CODING_AGENT_RESULT block to stdout.'"
253
+
bash pty:true workdir:/tmp/issue-99 background:true command:"pnpm install && codex --yolo 'Fix issue #99 from the approved ticket summary. Implement only the in-scope edits. Print the final CODING_AGENT_RESULT block to stdout.'"
287
254
288
255
process action:list
289
256
process action:log sessionId:XXX
@@ -306,22 +273,22 @@ process action:log sessionId:XXX
306
273
7.**Parallel is OK** - run many Codex processes at once for batch work
307
274
8.**NEVER start Codex inside your OpenClaw state directory** (`$OPENCLAW_STATE_DIR`, default `~/.openclaw`) - it'll read your soul docs and get weird ideas about the org chart!
308
275
9.**NEVER checkout branches in ~/Projects/openclaw/** - that's the LIVE OpenClaw instance!
309
-
10.**Always inject the Completion Prompt Snippet**into the worker prompt before spawning. The simplified examples below omit it for brevity — never spawn a worker without it.
276
+
10.**Always include the final summary block instruction**in the worker prompt before spawning. The simplified examples below omit it for brevity — never spawn a worker without it.
310
277
311
278
---
312
279
313
280
## Progress Updates (Critical)
314
281
315
282
When you spawn a coding agent in the background, keep the user in the loop.
316
283
317
-
- Send 1 short message when you start: what is runningand where.
284
+
- Send 1 short message when you start: what is running, where it is running, and the captured `sessionId`.
318
285
- Update only when something changes:
319
286
- a milestone completes
320
287
- the worker asks a question
321
288
- you hit an error or need user action
322
289
- the worker finishes
323
290
- If you kill a session, immediately say you killed it and why.
324
-
- If you are expecting the worker to self-notify with `openclaw message send`, say that clearly in your start update.
291
+
- If automatic completion wake is unavailable or unclear, say whether you created a watchdog/check-back or whether the user must ask for a manual status check.
325
292
326
293
This prevents the user from seeing only a missing reply and having no idea what happened.
327
294
@@ -338,11 +305,11 @@ This prevents the user from seeing only a missing reply and having no idea what
338
305
3.**Respect tool choice.**
339
306
- If the user asked for Codex, use Codex.
340
307
- Orchestrator mode: do not hand-code the patch yourself instead of using the requested coding agent.
341
-
4.**Capture notify routing before spawn.**
342
-
-Completion messaging must have a real route.
343
-
5.**Use direct completion messaging.**
344
-
- Require `openclaw message send`.
345
-
- Do not rely on `openclaw system event` or heartbeat.
308
+
4.**Capture the `sessionId` before moving on.**
309
+
-The parent assistant uses it for `process` log/poll checks and completion reporting.
310
+
5.**Make workers report to stdout.**
311
+
- Require a `CODING_AGENT_RESULT_START` / `CODING_AGENT_RESULT_END` final block.
312
+
- Do not require or use `openclaw message send` for routine completion reporting.
346
313
6.**Do not silently take over.**
347
314
- If a worker fails or hangs, respawn it or ask for direction. Do not quietly switch to hand-editing.
348
315
7.**Monitor with `process`.**
@@ -353,6 +320,8 @@ This prevents the user from seeing only a missing reply and having no idea what
353
320
- Many background Codex sessions can run at once.
354
321
10.**Never start Codex in `~/.openclaw/`.**
355
322
11.**Never checkout branches in `~/Projects/openclaw/`.**
323
+
12.**Keep routing out of worker prompts by default.**
324
+
- Do not pass channel/account/reply IDs unless the user explicitly asks the worker to interact externally.
356
325
357
326
---
358
327
@@ -362,4 +331,4 @@ This prevents the user from seeing only a missing reply and having no idea what
362
331
-**Git repo required**: Codex needs a trusted git directory.
363
332
-**Use `exec` under background orchestration**: short and long tasks follow the same path now.
364
333
-**`submit` vs `write`**: use `submit` to send input plus Enter.
365
-
-**Direct message send beats heartbeat for completion notification**when the user must be told immediately and heartbeat may be disabled.
334
+
-**Parent-owned completion reporting beats worker self-notification**for routine coding-agent delegation: capture `sessionId`, inspect stdout/logs, and report the result yourself.
0 commit comments