cmux 会话目标设置
cmux-goal
使用原生目标 API 设置或验证经授权的会话目标;仅当会话兼容 Claude Code 时,才使用经过验证的 cmux composer 作为后备方案。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- cmux-goal
- description
- Set or verify an authorized session goal using a native goal API, with a verified cmux composer fallback only for a compatible Claude Code session.
03 SKILL.md 正文
cmux-goal
Use when the user asks to set a session goal. Loading this skill does not set a goal, create a persistent hook, authorize a mission, or communicate with an outside agent. A goal's completion criteria cannot expand the task's access, publication, spending, or other action permissions.
Resolve the objective and existing state
Accept literal condition text, from-bead <id>, or harden first: <goal>.
For a referenced issue/bead/document, read its actual contents through an
authorized source; an unavailable tracker is a blocker to deriving criteria,
not permission to install it. Preserve the user's requested scope.
Consult relevant available prior conversation, task history, and repository
criteria when they change the goal. Do not invoke absent /ms, /history,
ironclad, test infrastructure, or local hooks merely because the source
workflow named them. This package is self-contained for goal formulation.
Query active goal state using the runtime's supported read API first. Keep an
existing matching goal. Do not clear or replace an existing different goal
unless the user explicitly requested that change. If no read API exists, use
only a command verified as read-only on the active runtime. A revision pin
does not establish command semantics: for example, Claude Code versions where
/goal <condition> sets a goal will mutate state when given /goal active,
even if an older source revision presents that form as a query. Do not probe
an uncertain command against the user's session. If no compatible read-only
query is verified, leave goal state unverified and do not attempt activation.
For an explicitly authorized replacement, record the prior objective and actual unfinished status in the existing task record, formulate the new condition, then use a supported clear/cancel operation in this session and verify cleared state before setting it. Never fabricate completion, edit runtime state files, or invent a clear API. An unavailable clear route blocks replacement, not independent authorized work. A fresh explicit request to resume a matching paused goal permits a supported resume operation; verify active readback. Never substitute an unverified focused composer for the caller's own session.
Formulate verifiable exit criteria
Make the condition concise, binary where practical, tied to concrete evidence, and bounded by the requested task. Prefer existing authoritative criteria and checkers. If the user supplied a criteria document, preserve its exact scope and make it accessible to the session before referencing it. A short goal can point to a verified absolute document path where that runtime requires one; do not create or rewrite a canonical document merely to satisfy this adapter.
Define required outputs, checks, relevant revision/artifact, and what blocked dependencies mean. An unavailable external gate is a blocker to report, not a license to loop forever or weaken completion criteria. Local test evidence may aid diagnosis; it does not satisfy a required remote CI gate unless the user or authoritative project contract explicitly makes them equivalent.
Choose the mechanism
Prefer a native goal API when the active runtime exposes one and verify its persisted state. Do not infer native goal availability from a tool name in another runtime, and do not call a progress-plan tool a Stop-hook goal.
For the cmux composer fallback, read cmux-steer and its submission contract. Verify the installed target is a compatible Claude Code session with the documented builtin. The source claimed a session-scoped Stop hook and purple indicator; their existence and behavior must be verified on that build.
cmux identify --json
# Resolve only caller.workspace_ref and caller.surface_ref for self-targeting.
cmux tree --all --workspace "$WS_REF"
# TEXT is the approved literal /goal command, passed as one argument.
cmux send --workspace "$WS_REF" --surface "$SURFACE_REF" "$TEXT"
cmux send-key --workspace "$WS_REF" --surface "$SURFACE_REF" enter
Use TEXT equal to /goal <condition> only after inspecting the current
input state. If caller is null, self-targeting is not established; never
substitute the globally focused surface. A user-named different session must
be resolved explicitly, and external-agent communication approval must cover
that named agent and goal-setting action.
Do not inject a builtin into a shell, active generation, unrelated queued prompt, approval dialog, or existing composer draft. If self-submission must wait until the session is idle, use an available safe runtime route or provide the exact command for the user. Do not schedule hidden self-keystrokes, install hooks, interrupt work, or clear draft input as a fallback.
Verify and continue
Query persisted goal state directly after creation and check the exact
condition and session. A runtime confirmation such as “Goal set” or a verified
session-scoped hook can support the result. OK surface:N, typed input, UI
color, or a processing label alone does not prove the goal was installed.
Use only the bounded retry in the submission contract if Enter demonstrably
did not submit. Do not recreate a matching goal or replace it to resolve an
uncertain response. Report active, already matching, or not verified
with the observed evidence. If setup is blocked, provide the usable command
or warning and continue any independently authorized mission work; never
claim the goal is enforced. /goal clear is outside ordinary goal setup.
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.