message-agents
ALWAYS invoke this skill when sending a message record to a registered agent-mail name with its one-line doorbell, discovering a Prowl coding-agent recipient, or sending facts, ownership proposals, state reports, authorizations, or acknowledgements to another agent pane.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- message-agents
- description
- ALWAYS invoke this skill when sending a message record to a registered agent-mail name with its one-line doorbell, discovering a Prowl coding-agent recipient, or sending facts, ownership proposals, state reports, authorizations, or acknowledgements to another agent pane.
- allowed-tools
- Write, {{! tool('use_skill') !}}, Bash(python3 "${CLAUDE_SKILL_DIR}/scripts/agent_message.py":*), {{! tool('ask_user') !}}
- argument-hint
- <JSON message request>
02 资源文件 1
- 脚本scripts/agent_message.py49.5 KB
03 SKILL.md 正文
<objective> One message delivered on the route its request selects — a message record in the agent-mail store with its one-line doorbell, or a source-owned message envelope submitted into one complete Prowl pane — with delivery kept distinct from acknowledgement, agreement, authorization, and ownership, or a doorbell line from the caller's own pane resolved to its sender and store id. </objective>
<route_selection>
The request shape selects one of three routes. A request carrying recipient as an agent-mail name, correlation, body, and ackRequired is a mail request and follows <mail_route>. A request carrying recipientPath, facts, and a pane-bound kind and no recipient, body, or ackRequired is a Prowl request and follows <workflow>. A request carrying line and agents is a doorbell resolution and follows <mail_route> step 8. A request that mixes the fields of two of these shapes, a request that matches none, and an empty or whitespace request are invalid-schema before any discovery or delivery; the bundled script rejects fields outside the selected route's shape. The recovery names each route's own required fields: kind, correlation, sender, recipient, subject, body, and ackRequired for the mail route; recipientPath, kind, subject, and facts for the Prowl route; and line and agents for the doorbell route.
</route_selection>
<mail_route>
- Read
$ARGUMENTSas one JSON message request with exactlykind,correlation,sender,recipient,subject,body, andackRequired, plusauthorityonly on a same-worktreedelegation-request, plus an optionalrepositoryand an optionaldoorbellendpoint.senderis the caller's own registered agent-mail name andrecipientis one registered name.kindis one oforder,fact,question,answer,delegation-request,delegation-completed,delegation-failed,delegation-rejected, ordelegation-unavailable.correlationis the thread every reply to one exchange shares. A same-worktreedelegation-requestcarriesauthoritywith exactlyownerequal tosenderandgitMutation: false; anauthorityof any other shape — a missing owner, another owner,gitMutationadmitted, or any extra field — reaches no record. Supplyingauthorityon a same-worktree delegation is the sender's obligation; the script rejects no request for lacking it. The record body opens with that authority rendered.doorbellnames where the recipient's pane is found and nothing else:{"recipientPath": "<absolute worktree, repository, or working-directory path>"}for a Prowl pane, or{"agent": "<the herdr agent name>"}for a herdr pane.doorbellnever enters the record; remove it from the request before step 2.repositorynames the repository whose mail project receives the send, as the caller names it, and the script carries it unchanged into the capability'ssendrequest; a request withoutrepositoryyields a send request carrying none, and the capability then selects the project.repositoryselects the store and never enters the record or the doorbell, and the caller names it only when the send must reach a mail project other than the capability's default. - Pass the request to the bundled script's
mail-requestoperation. It returns therecordand the completecapabilitysend request for the agent-mail capability. - Use skill
coding-agents:operate-agent-mailonce with thatcapabilityrequest unchanged. Preserve its complete result. - Pass the capability result to the bundled script's
mail-resultoperation ascapabilityResult. Asucceededresult whosedata.recordcarries the store-assignedidreturnsstatus: "delivered"with thedoorbell.textline[<Label> <<sender>>] mail <id>when the capability result'sresponsecarries a renderablesender_display_namefor the sender, and[<sender>] mail <id>otherwise. A label is unrenderable when it is empty, carries a line break, or carries any of[,],<,>; the doorbell then takes the unlabeled form and the full label stays in the preserved capability result. Any other capability result returnsdelivery-failedwith the capability's status and detail preserved. Delivery is the record in the store; stop here ondelivery-failed. - Resolve the doorbell endpoint. Without
doorbell, ring nothing: report the delivered record withdoorbell.submitted: falseand say that no endpoint was named. WithrecipientPath, use skillcoding-agents:operate-prowlonce forresolve-targetwith that path, exactly as<workflow>step 2 does, and select the candidate by the same rules as<workflow>step 3; onidentity-unavailableor an unresolved caller identity, report the exact detail beside the delivered record and ring nothing. Withagent, the herdr capability selects the session by that name and no resolution runs. - Ring the doorbell: send exactly
doorbell.textand nothing else into the resolved endpoint. For a Prowl pane, fill the selected candidate'ssendRequestTemplatetextwithdoorbell.textand use skillcoding-agents:operate-prowlonce with that request; pass the complete checkedsendresult back tomail-resultasdoorbellTransportbeside the samecapabilityResult, anddoorbell.submittedis true only withstatus: "succeeded",commandExitCode: 0, andresponse.data.input.trailing_enter_sent: true. For a herdr pane, use skillcoding-agents:operate-herdronce forpromptwith theagentselector anddoorbell.text; a herdr prompt carries no trailing-Enter record, somail-resultreceives nodoorbellTransport, reportsdoorbell.submitted: false, and the herdrpromptresult is reported beside it as the doorbell's own evidence. No JSON and no record body reaches a pane. An unsubmitted doorbell leaves the message delivered and is reported beside it; never send the doorbell twice. - Report the store-assigned
id,correlation,status,doorbell, and the recipient by its registered name.deliveredmeans the record exists in the store; it NEVER means acknowledged, agreed, authorized, or owned. A read is the recipient's private record that it judged the message, and an acknowledgement is the read its sender can observe; both are the recipient's ownreadandacknowledgeoperations through the agent-mail capability, and this skill performs neither. - To resolve a doorbell that arrives in the caller's own pane, pass its
lineand theagentsnames from the live inventory — the agent-mail registrations or the environment capability's agent list — to the bundled script'sdoorbelloperation. The line takes either form from step 4. The script reads the stable name inside<…>, or the bare name in the unlabeled form, and looks up only that name; a label never resolves a sender. It returns thesenderandid, and rejects a line whose stable name is absent from that inventory even when its label names a registered agent; then find the record through the agent-mail capability'slistfor the caller's own name withincludeBodies, and judge it with the capability'sread, or withacknowledgeonly when the sender is meant to see the judgment.
</mail_route>
<workflow>
- Read
$ARGUMENTS. When it is empty or whitespace, stop withinvalid-schemaand require one JSON message request containingrecipientPath,kind,subject, andfacts; perform no discovery or delivery. Otherwise interpret it as that request, withrecipientPathholding the recipient's absolute worktree, repository, or working-directory path and with any applicable optional message fields. The request may carrytoPaneonly as a complete pane identity that matches the selected candidate and may carryhandbackonly as the complete structured block returned by/operate-prowl plan-handback. When required data is absent, stop and name it before discovery or delivery; never invent message data or ask for a pane UUID. - Use skill
coding-agents:operate-prowlonce forresolve-targetwith the supplied path. Preserve the complete result. It returns the checked inventory, complete caller and participants, and non-caller candidates whosesendRequestTemplatealready selects each pane with immediate-return mode and normal trailing-Enter behavior. - Require a complete resolved caller and one selected candidate. On
identity-ambiguouswithcaller: null, report the exact detail as an unresolved caller-identity conflict and stop; never ask the operator to select from the empty candidate set. Otherwise, when the request carriestoPane, match it against the captured non-caller candidates before considering cardinality: exactly one matching candidate selects it, while zero or multiple matches stop withinvalid-identity. WithouttoPane, use the sole candidate onsucceeded. Onidentity-ambiguous, use{{! tool('ask_user') !}}for one single-select question: number candidates in resolver order, show each candidate's complete pane, worktree, branch, and repository, and map the answer back to that exact captured candidate and itssendRequestTemplatewithout rerunning resolution. When the runtime's option cap is below the candidate count, include the complete numbered inventory in the question and accept an exact candidate number through its free-form response; never omit a candidate. Onidentity-unavailable, report the exact detail and participant worktrees. NEVER select by title, focus, position, prose, or the caller's pane. - Build the bundled script's
discoveryinput directly from the resolver result:calleris the returned caller,targetsis the returned complete participant list, andstatusisprowl-pane. SettoPanefrom the selected candidate's complete participant. This source-owned bridge uses the captured resolver result directly; never write an intermediate file or run an ad hoc transformation script. - Build the bundled script's message request with the selected candidate's
toPane,kind,subject,facts, optionalrequest, optionalhandback, optionalcorrelation, optionalmutationTarget, optionalobservedState, and optionalaccepted.recipientPathhas completed target resolution and never enters the envelope.kindis exactlyownership-proposal,fact,acknowledgement,mutation-state, ormutation-authorization. An acknowledgement, mutation-state report, or mutation authorization MUST reuse the active proposal UUID; an initiating proposal or fact MUST omit it so the adapter creates a new UUID. An acknowledgement MUST carry booleanaccepted; every other kind omits it. Only afactproduction request carrieshandback. When it does, use skillcoding-agents:operate-prowlforplan-handbackwith the captured caller as sender, the selected participant as recipient, and that block's semanticcompletionText; require a successful result whose returned handback matches the request byte-for-byte, and pass the complete result to the bundled script as top-levelhandbackPlan. Reject top-levelcommand,handbackCommand,returnPane, oradapterPathfields and never reconstruct the block. - For a delegated mutation, use the source-owned handshake:
- An
ownership-proposalcarriesmutationTargetwith exactpane,worktree,branch,repository, fullhead, andstatusvalues; pane, worktree, branch, and repository match the live recipient identity. - A
mutation-stateresponse carries the same target plusobservedStatewith exactworktree,branch,repository, fullhead, andstatusvalues matching the live sender identity. - A
mutation-authorizationcarries the checked target and observed state and targets that same live recipient. Any mismatch returnsinvalid-identitybefore delivery planning.
- An
- Pass the discovery and message request to the bundled script's
buildoperation. It returns the completeenvelopeand a semanticdeliverycontainingtoPaneandtext. - Confirm the selected candidate template's pane equals the delivery's complete
toPane, fill its nulltextwith the delivery's exact text, and use skillcoding-agents:operate-prowlonce with that request. NEVER alter itspaneornoWait, construct a second request, usenoEnter, or retry after the editor becomes free. - Pass the envelope and the exact environment result to the bundled script's
resultoperation. Setdeliveredtrue only when the Prowl capability returned a complete checkedsendresult withstatus: "succeeded",commandExitCode: 0, and publicresponse.data.input.trailing_enter_sent: true; preserve that complete result undertransport. The bundled script rejects delivered status when any checked transport or submission field is absent or inconsistent. Prefilled text that remains in the recipient editor is not delivered. - Report the complete
correlation, checkedcommandExitCode, and deliverystatus. Once trailing Enter is confirmed, the turn is queued and no second send is needed.deliveredmeans only that the environment capability accepted transport; it NEVER means acknowledged, agreed, authorized, or owned. Stop with the exact status and detail ondelivery-failed,invalid-identity,environment-unavailable, orinvalid-schema.
</workflow>
<command_forms>
Every operation takes its JSON request from stdin. Write the request with the file-write tool to a file in the scratch directory the harness names for this session, under a file name unique to the agent and the request, and submit it through the input redirect < <request-file>. Where the harness names no scratch directory, use the one the environment designates, such as $RUNNER_TEMP on a hosted runner. A request carries message bodies, quotes, and JSON that the dangerous-command guard refuses in a heredoc, a pipe, or an inline argument. The request shapes:
mail-request:{"messageRequest":{"kind":"fact","correlation":"<thread>","sender":"<own-name>","recipient":"<name>","subject":"<subject>","body":"<body>","ackRequired":false}}, with"repository":"<repository>"added tomessageRequestonly when the caller names onemail-result:{"capabilityResult":{},"doorbellTransport":null}doorbell:{"line":"[<sender>] mail <id>","agents":[]}build:{"discovery":{},"messageRequest":{},"handbackPlan":null}result:{"envelope":{},"delivered":false,"commandExitCode":1,"transport":{},"detail":"<exact-environment-detail>"}
python3 "${CLAUDE_SKILL_DIR}/scripts/agent_message.py" <operation> < <request-file>
Every operation exits 0 on its success shape — record present for mail-request, status: "delivered" for mail-result, id present for doorbell, delivery.status: "ready" for build, status: "delivered" for result — and 2 otherwise. On invalid-schema or invalid-identity the output is the three-field {schemaVersion, status, detail} object. On delivery-failed the output is the full delivery result: mail-result returns status, capabilityStatus, detail, commandExitCode, and the three agreement flags acknowledged, agreed, and ownershipEstablished set to false; result returns status, correlation, commandExitCode, transport, detail, and the same three flags.
</command_forms>
<constraints>
- ALWAYS preserve complete source-supplied agent, pane, worktree, branch, repository, run, correlation, mutation-target, observed-state, and transport identities.
- ALWAYS report the selected target using the exact
recipientPathsupplied by the caller on the Prowl route, and the registeredrecipientname on the mail route, while using a resolved pane UUID only inside the delivery or doorbell operation. - ALWAYS invoke
coding-agents:operate-prowlfor source-owned target resolution and Prowl delivery,coding-agents:operate-agent-mailfor mail delivery and for the recipient's list, read, and acknowledge, andcoding-agents:operate-herdrfor a herdr doorbell; the bundled script executes no command and reads no store. - ALWAYS send a doorbell as exactly the one line
doorbell.textreturns —[<Label> <<sender>>] mail <id>or[<sender>] mail <id>— into an endpoint the request named and the environment capability resolved; no JSON and no record body reaches a pane, and no message record is written under.spx/. - ALWAYS preserve a production request's complete source-generated
handbackblock unchanged. - ALWAYS require the matching complete successful
/operate-prowl plan-handbackresult before building a production request. - NEVER accept or construct a handback command, return-pane field, or cross-skill adapter path.
- ALWAYS retain each complete command result in the active tool context and feed it into the next source-owned operation; the request files of
<command_forms>are the only files this workflow writes, and no redirect that writes a result to a path is part of it. - NEVER pass a request through a heredoc, a pipe, or an inline argument, and NEVER remove a request file; the harness clears its scratch directory.
- NEVER scan transcript files, use another terminal multiplexer, or ask the operator to relay a message as a fallback.
- NEVER resolve a sender, select a recipient, or select an endpoint by a doorbell's label; the stable name and the store id are the only identities.
- NEVER select an endpoint by title, focus, position, inferred prose, or an undeclared environment.
- ALWAYS leave a delivered record's read and acknowledgement to the recipient's own
readandacknowledgeoperations; this skill sends a record and never reads or acknowledges one on a recipient's behalf. - NEVER convert transport success or a stored record into acknowledgement, agreement, ownership, mutation authorization, or continuation state.
</constraints>
<testing>
Before release, exercise envelope_correlation, build_envelope, send_request, delivery_request, and delivery_result with complete resolver identities and controlled environment-result payloads. Run the documented build input-redirect form and require delivery.status: "ready"; run the documented result form with a complete successful send payload and require status: "delivered", then remove or alter each required transport field and require rejection. The matrix covers authoritative toPane selection from ambiguous candidates, caller exclusion, optional run-identity preservation and rejection, accepted and rejected acknowledgements, all message kinds, complete HEAD/status validation, exact mutation target/state matching, a production request that preserves the source-generated handback block only with its matching complete plan-handback result, rejection of caller-authored executable handback fields, malformed identities and optional fields, and transport results that never establish acknowledgement, agreement, authorization, or ownership.
The mail route's exercised properties: every record kind maps to a record the agent-mail capability accepts unchanged; the capability's checked send result over the store's captured reply maps to delivered with the store id and the doorbell line, and a rejected or absent store maps to delivery-failed with the capability's status and detail; generated doorbells, labeled and unlabeled, parse back to their stable sender name and id; a label that is empty or carries a line break or any of [, ], <, > renders the unlabeled form; a doorbell whose label names a registered agent while its stable sender is absent from the inventory is rejected; a sender absent from the inventory and a line carrying more than the doorbell are rejected; a delivered result requires every checked capability field and a zero exit code; a delegation request carrying an authority other than exactly the sender as owner and gitMutation: false reaches no record, while an absent authority is the sender's obligation and the script rejects nothing for lacking it.
Recorded exercised payload/results:
mail-requestwith afactrequest → onerecordand thecapabilitysend request;mail-resultwith the capability's succeeded result →status: "delivered", the store id, anddoorbell.text[<sender>] mail <id>, or[<Label> <<sender>>] mail <id>when the capability result'sresponsecarries a renderablesender_display_name, withsubmitted: falseuntil a checked doorbell transport is supplied.buildwith a complete resolver-selected recipient and afactrequest → one envelope anddelivery.status: "ready"for that recipient pane.resultwithdelivered: true, matching zero exit codes,status: "succeeded", andresponse.data.input.trailing_enter_sent: true→status: "delivered"; changing the trailing-Enter field to false →invalid-schema.resultwithdelivered: false, exit code 7, anddetail: "transport rejected"→status: "delivery-failed"while acknowledgement, agreement, and ownership remain false.
</testing>
<failure_modes>
Transport success was inferred from an exit code alone. Claude passed delivered: true and commandExitCode: 0 without the checked /operate-prowl result, so downstream output claimed delivery with no transport evidence to inspect. The exit code establishes only one field of the environment result. Pass the complete checked send result under transport; the bundled script rejects delivered status when any required field is absent or inconsistent.
Continuation prose remained in the editor. Claude treated a successful immediate-return send as a submitted turn even though the operator could still see editable text. Require response.data.input.trailing_enter_sent: true; a prefill or absent submission field is a delivery failure.
A request was sent with no way for the answer to come back. Claude asked a recipient to produce a result and sent no return path, then had no signal when the recipient finished. Polling is blocked by design, so the sender read the recipient's pane once, saw nothing, and moved on while the finished result sat on disk. A production request carries the complete handback block returned by /operate-prowl plan-handback, so the recipient can send one line back on completion.
A pane UUID was requested from the operator. Claude asked which pane to send to, when the operator had already named the target the only way they can — by worktree or working directory. Resolve the operator's naming against the live inventory and report the target back in the same terms.
A blocked redirect was rewritten as another program. Claude redirected public inventory and discovery JSON into $SP/agents.json and $SP/discovery.json. The dangerous-command guard blocked the redirect, a compound command because it carried a shell variable. Claude wrote a Python replacement and continued, discarding the guard result. Use /operate-prowl's resolve-target result directly in the active tool context; an output redirect carrying a shell variable is no part of this workflow. Rewriting the blocked operation as another program is forbidden.
</failure_modes>
<success_criteria>
- Target resolution passes only with one complete non-caller candidate selected from the complete checked inventory for
recipientPath, with any suppliedtoPanematching that candidate. - Build passes only with one validated envelope and one semantic delivery bound to the target's complete pane UUID.
- A production request preserves one source-generated handback block only when the complete successful
plan-handbackresult carries the same block, and rejects every caller-authored executable handback field. - Delivery passes only after
/operate-prowlreturns a checked successful result whose public input record confirms trailing Enter was sent; every failure preserves its exact status, detail, and command exit code when present. - A mail delivery passes only when
mail-resultreturnsstatus: "delivered"from asucceededcapability result whosedata.recordcarries the store-assignedid; the doorbell text is[<Label> <<sender>>] mail <id>for a renderable sender label and[<sender>] mail <id>otherwise, anddoorbell.submittedis true only with a checked Prowlsendresult carryingtrailing_enter_sent: true. - A
delivery-failedmail result preserves the capability's exact status and detail, and adelegation-requestcarrying anauthorityother than exactlyownerequal tosenderandgitMutation: falseproduces no record; an absentauthorityis the sender's obligation and the script rejects nothing for lacking it. - A doorbell resolution, labeled or not, returns the stable sender name and id only for a stable name present in the supplied inventory, and the record is then found with the agent-mail capability's
listand judged with itsread. - Caller, recipient, mutation-target, and observed-state identities validate before delivery.
- Transport delivery remains distinct from acknowledgement, agreement, authorization, ownership, and continuation.
</success_criteria>
04 同仓库更多 Skills
plugin
暂无简介
sanitize-powerpoint
ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.
draw-excalidraw
ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.
typescript-test-standards
TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-code-standards
TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-architecture-standards
TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.