Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 48 additions & 12 deletions .opencode/skills/cmux-orchestrator/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,58 @@
---
name: cmux-orchestrator
description: "Оркестратор cmux на macOS: один user-facing терминал делегирует задачи worker-терминалам, собирает JSON-отчёты с notify-сигналом завершения и владеет финальной валидацией и синком. Используй для: cmux orchestrator, оркестрация терминалов, делегируй воркерам, multi-agent terminal workflow. EN triggers: cmux orchestrator, multi-agent terminal workflow, delegate workers, collect worker reports."
description: "Оркестратор cmux v3 для OpenCode: macOS cmux orchestrator, multi-agent terminal workflow, видимый head terminal, typed task envelopes, report-authoritative completion. Используй для: cmux orchestrator, делегируй воркерам. EN triggers: cmux v3 head, visible-terminal orchestration. EN: cmux v3 head."
---

# cmux-orchestrator

Use this skill only when project policy enables `execution.mode = "orchestrator"` and `cmux.enabled = true` on macOS. Linux, WSL, and Windows remain in `standard` mode.
Generated from root `config/cmux-adapter-projections.json`. Do not edit manually.

The orchestrator talks to the user, reads project policy, creates bounded worker tasks, collects JSON worker reports, reviews diffs, runs final validation, and owns commits/push/fullrepo/Serena sync when policy allows those actions.
Use this skill only when OpenCode is the machine-identified visible head terminal for rldyour macOS cmux orchestrator mode.

Workers must receive explicit file/command scope and must not push, delete branches, publish fullrepo, install system configs, mutate project policy, run final sync, or commit unless delegated for the task ID.
## Native Adapter Notes

Stable cmux setup uses project-local `.cmux/cmux.json` `commands` and workspace layout. Do not rely on nightly-only `actions` for the required path.
- OpenCode may be a visible head or a visible worker when the root run manifest assigns that role.
- Native plugin events may mirror status, but report files remain completion authority.

Delegation mechanics: send each task into the worker surface with per-task scope
(`cmux send --surface <surface-id> "export RLDYOUR_TASK_ID=<task-id> RLDYOUR_WORKER_ALLOWED_PATHS=<colon-separated-paths>; <task instruction>\n"`),
observe workers with `cmux read-screen --workspace <workspace-id> --surface <surface-id> --scrollback --lines <n>`
or `cmux events --cursor-file <file> --reconnect`, and treat a task as finished only after both
completion signals: the JSON report and the worker's
`cmux notify --title "worker <worker-id>" --body "task <task-id> exit <code>"`.
cmux emits no per-command exit-code event on its own.
## Current Implementation Status

- `typed-task-report-protocol`: `IMPLEMENTED`.
- `live-start-fail-closed`: `IMPLEMENTED`.
- `compact-template`: `IMPLEMENTED`.
- `workspace-group-topology`: `PLANNED`.
- `delegation-command`: `PLANNED`.
- `worktree-scheduler`: `PLANNED`.
- `adapter-native-projections`: `IMPLEMENTED`.
- `stop-finalization-receipt`: `PLANNED`.

Treat `PLANNED` and `NOT_PROVEN` entries as unavailable in production.

## Authority

- Root `config/cmux-orchestrator-policy.json` owns the protocol and safety rules.
- Root `config/cmux-task.schema.json` owns immutable task envelopes.
- Root `config/cmux-worker-report.schema.json` owns worker reports.
- Root `config/cmux-implementation-status.json` separates implemented behavior from planned target architecture.
- Runtime state belongs under `$(git rev-parse --git-common-dir)/rldyour/cmux/<run-id>/`.
- Worker completion authority is `$(git rev-parse --git-common-dir)/rldyour/cmux/<run-id>/tasks/<task-id>/report.json` with a valid digest; notifications are UI hints only.

## Head Duties

1. Verify exactly one visible head terminal is active for the run.
2. Use `ry-cmux start` only through the root implementation; live starts must fail closed when caller workspace, surface, socket, or doctor evidence is missing.
3. Create immutable task envelopes and task-local instructions; never put task text into cmux terminal input.
4. Wake workers with a bounded helper command containing only run/task identifiers.
5. Collect schema-valid worker reports, verify task/attempt/worker/scope binding, then integrate changes as the head.
6. Own final validation, commits, push, fullrepo publication, Serena sync, and owner-facing summary.

## Forbidden Delegation Patterns

- Do not send arbitrary task prose through cmux input.
- Do not pass write scopes through shell environment snippets.
- Do not treat `read-screen`, event streams, or notifications as completion authority.
- Do not let workers push, publish fullrepo, mutate project policy, run system install, delete branches, or run final sync.
- Do not claim Workspace Groups, isolated worktree scheduling, retry materialization, or durable Stop receipts unless the status registry marks them `IMPLEMENTED`.

## Worker Wake-Up Shape

The only terminal input sent to a worker is a helper wake-up command with safe identifiers. The task envelope and instructions file remain on disk and are validated by the worker helper before work starts.
63 changes: 49 additions & 14 deletions .opencode/skills/cmux-worker/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
---
name: cmux-worker
description: "Роль worker внутри macOS cmux orchestrator: scoped-задача в выделенном скоупе, JSON-отчёт плюс обязательный notify-сигнал с exit-кодом, без push/fullrepo/system install/policy mutation. Используй для: cmux worker, воркер-задача, scoped report, выполнение делегата. EN triggers: cmux worker role, scoped worker task, worker JSON report."
description: "Воркер cmux v3 для OpenCode: cmux worker role, typed task envelope, heartbeat, scoped JSON report, no push/fullrepo. Используй для: cmux worker, worker report. EN triggers: cmux v3 worker. EN: cmux v3 worker."
---

# cmux-worker

Use this skill only inside a cmux orchestrator session with `RLDYOUR_EXECUTION_MODE=orchestrator` and `RLDYOUR_AGENT_ROLE=worker`.
Generated from root `config/cmux-adapter-projections.json`. Do not edit manually.

Worker rules:
Use this skill only when OpenCode is assigned as a visible cmux worker terminal. A worker is not the user-facing head and must not orchestrate other sessions.

- Work only inside the assigned file/directory scope.
- Do not talk to the user as the primary respondent.
- Do not push, force-push, delete branches, publish fullrepo, install system configs, mutate project policy, or run final flow sync.
- Do not commit unless explicitly delegated by the orchestrator.
- Return a JSON report with `status`, `files_changed`, `commands_run`, `findings`, `risks`, and `needs_orchestrator_action`.
## Native Adapter Notes

Runtime worker report files belong under `.serena/cache/cmux-orchestrator/<workspace-id>/<task-id>.json` and must not be committed.
- OpenCode may be a visible head or a visible worker when the root run manifest assigns that role.
- Native plugin events may mirror status, but report files remain completion authority.

Completion signal: the orchestrator exports `RLDYOUR_TASK_ID` and
`RLDYOUR_WORKER_ALLOWED_PATHS` at delegation time (empty allowed-paths means no
delegated write scope). Finish every task with both signals: the JSON report and
`cmux notify --title "worker ${RLDYOUR_WORKER_ID}" --body "task ${RLDYOUR_TASK_ID} exit <code>"`
with the real exit code, because cmux emits no per-command exit-code event.
## Current Implementation Status

- `typed-task-report-protocol`: `IMPLEMENTED`.
- `live-start-fail-closed`: `IMPLEMENTED`.
- `compact-template`: `IMPLEMENTED`.
- `workspace-group-topology`: `PLANNED`.
- `delegation-command`: `PLANNED`.
- `worktree-scheduler`: `PLANNED`.
- `adapter-native-projections`: `IMPLEMENTED`.
- `stop-finalization-receipt`: `PLANNED`.

Treat `PLANNED` and `NOT_PROVEN` entries as unavailable in production.

## Required Runtime Identity

- `RLDYOUR_EXECUTION_MODE=orchestrator`.
- `RLDYOUR_AGENT_ROLE=worker`.
- `RLDYOUR_WORKER_ID` matches the immutable task assignment.
- `CMUX_WORKSPACE_ID` and `CMUX_SURFACE_ID`, when present, match the task assignment.

## Task Authority

- Task content lives in the root-owned immutable task envelope and task-local instructions file.
- Allowed paths are a JSON array in the task envelope, not shell text.
- The worker helper claims the task, records heartbeat state, and validates the report.
- Completion authority is a schema-valid report at `$(git rev-parse --git-common-dir)/rldyour/cmux/<run-id>/tasks/<task-id>/report.json` with `report_digest`.
- `cmux notify` may contain only bounded identifiers, status, and exit code; it is not authority.

## Worker Duties

1. Accept only the assigned run/task through the worker helper.
2. Work only inside the assigned repository/worktree and scope.
3. Stop and report `blocked` or `not_proven` when scope, identity, or evidence is ambiguous.
4. Record commands and checks in the report.
5. Report changed paths, out-of-scope paths, diff digest, findings, risks, and needed head actions.

## Forbidden Actions

- Do not push, force-push, tag, publish fullrepo, delete branches, mutate project policy, run system install, or run final sync.
- Do not delegate nested visible workers.
- Do not create hidden or daemon-style orchestration processes.
- Do not treat native subagents, compose jobs, hooks, or background tasks as rldyour cmux workers.
- Do not claim success when the report was not written and validated.
10 changes: 3 additions & 7 deletions .opencode/skills/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@
"path": ".opencode/skills/cmux-orchestrator/SKILL.md",
"domain": "orchestrator",
"triggers": [
"cmux orchestrator",
"multi-agent terminal workflow",
"delegate workers",
"collect worker reports"
"cmux v3 head",
"visible-terminal orchestration"
],
"requires_mcp": [],
"network": false
Expand All @@ -92,9 +90,7 @@
"path": ".opencode/skills/cmux-worker/SKILL.md",
"domain": "orchestrator",
"triggers": [
"cmux worker role",
"scoped worker task",
"worker JSON report"
"cmux v3 worker"
],
"requires_mcp": [],
"network": false
Expand Down
Loading