Skip to content

Commit 692e7fa

Browse files
rldyourmndclaude
andcommitted
feat(flow): add cmux delegation and completion-signal contract to cmux skills
cmux-orchestrator gains a Delegation Mechanics section (cmux send --surface with per-task RLDYOUR_TASK_ID/RLDYOUR_WORKER_ALLOWED_PATHS, read-screen/events observation, report+notify completion rule) and the worker prompt template now requires the notify-with-exit-code signal; cmux-worker gains the matching Completion Signal section (verified against manaflow-ai/cmux v0.64.14). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d955879 commit 692e7fa

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

plugins/rldyour-flow/skills/cmux-orchestrator/SKILL.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ Run the rldyour macOS cmux orchestrator workflow. This skill is distinct from `r
3737

3838
6. Review diffs, resolve conflicts, run final validation, and own commits/push/fullrepo/Serena sync when policy allows them.
3939

40+
## Delegation Mechanics (cmux)
41+
42+
- Delegate by sending the task into the worker surface with per-task scope:
43+
`cmux send --surface <surface-id> "export RLDYOUR_TASK_ID=<task-id> RLDYOUR_WORKER_ALLOWED_PATHS=<colon-separated-paths>; <task instruction>\n"`.
44+
- Observe workers without taking over their terminals:
45+
`cmux read-screen --workspace <workspace-id> --surface <surface-id> --scrollback --lines <n>`,
46+
or subscribe to `cmux events --cursor-file <file> --reconnect`.
47+
- Treat a task as finished only after both completion signals: the JSON report
48+
and the worker's `cmux notify --title "worker <worker-id>" --body "task <task-id> exit <code>"`.
49+
cmux emits no per-command exit-code event on its own.
50+
4051
## Worker Prompt Template
4152

4253
```markdown
@@ -53,7 +64,9 @@ Forbidden actions: push, branch deletion, fullrepo publish, system install, proj
5364
Allowed commands: <exact list or class>
5465
Validation expected: <command or NOT_PROVEN>
5566

56-
Return a JSON report plus concise notes. Do not perform global sync.
67+
Return a JSON report plus concise notes, then run
68+
`cmux notify --title "worker ${RLDYOUR_WORKER_ID}" --body "task ${RLDYOUR_TASK_ID} exit <code>"`.
69+
Do not perform global sync.
5770
```
5871

5972
## Non-Negotiables

plugins/rldyour-flow/skills/cmux-worker/SKILL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ Run a bounded worker task delegated by the cmux orchestrator.
1717
- Do not commit unless the orchestrator explicitly delegates commit permission for the task ID.
1818
- If assigned scope is unclear or dirty files are outside scope, stop and report.
1919

20+
## Completion Signal
21+
22+
The orchestrator exports `RLDYOUR_TASK_ID` and `RLDYOUR_WORKER_ALLOWED_PATHS` at
23+
delegation time; an empty `RLDYOUR_WORKER_ALLOWED_PATHS` means no delegated
24+
write scope. Finish every task with both signals:
25+
26+
1. The JSON report (file path below when requested; create the directory on demand).
27+
2. `cmux notify --title "worker ${RLDYOUR_WORKER_ID}" --body "task ${RLDYOUR_TASK_ID} exit <code>"`
28+
with the real exit code, because cmux emits no per-command exit-code event.
29+
2030
## Report
2131

2232
Return this JSON plus concise notes:

0 commit comments

Comments
 (0)