Skip to content

Commit 7522d9e

Browse files
committed
feat(cli): add slash commands for agent-comms actions
Adds 11 slash commands the user can invoke directly: /agent-comms:agents, :rooms, :whoami /agent-comms:join <room>, :leave <room> /agent-comms:dm <agent> <msg>, :send <room> <msg> /agent-comms:read <room> /agent-comms:status <active|idle|busy> /agent-comms:hide, :show Each command body is a short prompt that tells Claude which agent_comms action to call and how to format the result. No backing scripts — Claude invokes the MCP tool directly. commands/ added to package.json files array so it ships in the npm package.
1 parent 8ef9149 commit 7522d9e

11 files changed

Lines changed: 57 additions & 0 deletions

File tree

commands/dm.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Send a direct message to an agent
3+
argument-hint: <agent-id-or-name> <message>
4+
---
5+
6+
Parse `$ARGUMENTS` as `<target> <message>` — first whitespace-separated token is the target agent id or name; everything after is the message body. Call the `agent_comms` MCP tool with `action: "dm"`, `target: <target>`, `content: <message>`, and `streamingBehavior: "steer"`. Confirm with a single line containing the returned message id. If the target is unknown, surface the error verbatim.

commands/hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description: Hide this session from agent discovery (still DM-able if id is known)
3+
---
4+
5+
Call the `agent_comms` MCP tool with `action: "update"` and `visibility: "hidden"`. Confirm with a single line.

commands/join.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Join a room
3+
argument-hint: <room-name>
4+
---
5+
6+
Call the `agent_comms` MCP tool with `action: "join_room"` and `room: "$ARGUMENTS"`. Confirm with a single line — room name and current member count. If the room doesn't exist, surface the error verbatim.

commands/leave.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Leave a room
3+
argument-hint: <room-name>
4+
---
5+
6+
Call the `agent_comms` MCP tool with `action: "leave_room"` and `room: "$ARGUMENTS"`. Confirm with a single line. If the room doesn't exist or you're not a member, surface the error verbatim.

commands/read.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Read recent messages from a room
3+
argument-hint: <room>
4+
---
5+
6+
Call the `agent_comms` MCP tool with `action: "read_room"` and `room: "$ARGUMENTS"`. Present each message on its own line in chronological order, using the format `[HH:MM] <sender>: <content>`. If `<sender>` is a long fingerprint, truncate to the last 8 characters. No commentary.

commands/rooms.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description: List all rooms in the mesh
3+
---
4+
5+
Call the `agent_comms` MCP tool with `action: "list_rooms"` and present the result as a compact list — one room per line — showing the name, type, and member count, with a `[✓]` marker for rooms this session has joined. Don't add commentary.

commands/send.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Broadcast a message to a room
3+
argument-hint: <room> <message>
4+
---
5+
6+
Parse `$ARGUMENTS` as `<room> <message>` — first whitespace-separated token is the room name; everything after is the message body. Call the `agent_comms` MCP tool with `action: "send"`, `target: <room>`, `content: <message>`, and `streamingBehavior: "info"`. Confirm with a single line containing the returned message id. If the room isn't joined, surface the error verbatim.

commands/show.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description: Make this session visible to agent discovery
3+
---
4+
5+
Call the `agent_comms` MCP tool with `action: "update"` and `visibility: "visible"`. Confirm with a single line.

commands/status.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Set this session's presence status
3+
argument-hint: <active|idle|busy>
4+
---
5+
6+
Validate that `$ARGUMENTS` is one of `active`, `idle`, or `busy`. If invalid, print an error and stop. Otherwise call the `agent_comms` MCP tool with `action: "update"` and `status: "$ARGUMENTS"`. Confirm with a single line: the new status.

commands/whoami.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description: Show this session's agent identity, status, and room memberships
3+
---
4+
5+
Call the `agent_comms` MCP tool with `action: "whoami"` and present the result concisely: agent ID (short form), name, current status, visibility, and the list of joined rooms. No commentary.

0 commit comments

Comments
 (0)