@essentialai/cogent-plugin 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "cogent",
3
+ "version": "3.12.0",
4
+ "description": "Inter-session communication bridge for Claude Code with Slack integration. Enables CC agents and Slack team members to communicate in real time.",
5
+ "author": {
6
+ "name": "Essential AI Solutions",
7
+ "url": "https://essentialai.uk"
8
+ },
9
+ "homepage": "https://github.com/eaisdevelopment/mcp-agent-bridge#readme",
10
+ "repository": "https://github.com/eaisdevelopment/mcp-agent-bridge",
11
+ "license": "ISC",
12
+ "keywords": [
13
+ "bridge",
14
+ "inter-session",
15
+ "communication",
16
+ "mcp",
17
+ "multi-agent",
18
+ "collaboration"
19
+ ]
20
+ }
package/.mcp.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "mcpServers": {
3
+ "cogent": {
4
+ "command": "npx",
5
+ "args": ["-y", "@essentialai/cogent-bridge@3.12.0"],
6
+ "env": {
7
+ "COGENT_ENDPOINT": "https://cogent.tools",
8
+ "COGENT_LOG_LEVEL": "info",
9
+ "COGENT_TIMEOUT_MS": "180000",
10
+ "COGENT_BROADCAST_AWARENESS": "true"
11
+ }
12
+ }
13
+ }
14
+ }
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2025 cc-bridge-mcp-server contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @essentialai/cogent-plugin
2
+
3
+ The Cogent Claude Code plugin, published to npm so it installs **without git** (no Xcode
4
+ Command Line Tools on a fresh Mac). Content is synced from the canonical `plugin/` dir in the
5
+ monorepo at publish time — do not edit files here directly.
6
+
7
+ Install: `claude plugin marketplace add https://cogent.tools/marketplace.json && claude plugin install cogent@cogent`
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Set up a Cogent Bridge demo with two sample projects
3
+ ---
4
+
5
+ Guide the user through setting up the Cogent Bridge demo:
6
+
7
+ 1. Explain that the demo creates two projects:
8
+ - **api-server**: Express.js backend with a planted bug
9
+ - **web-client**: Node.js frontend that exposes the bug
10
+ 2. Run the init wizard:
11
+ ```bash
12
+ npx -y @essentialai/cogent-bridge init
13
+ ```
14
+ 3. After the wizard completes, guide the user to:
15
+ - Open two terminals
16
+ - Start the API server (`cd api-server && npm install && node server.js`)
17
+ - Launch Claude Code in each project directory
18
+ - Register each session on the bridge
19
+ - Have the frontend discover and report bugs to the backend
@@ -0,0 +1,59 @@
1
+ ---
2
+ description: Set up a shared bridge folder for two or more project directories
3
+ ---
4
+
5
+ Help the user configure Cogent Bridge with a shared state folder across multiple projects.
6
+
7
+ ## Step 1: Gather Project Info
8
+
9
+ Ask the user for:
10
+
11
+ 1. **Project directories** — the absolute paths to each project (e.g., backend, frontend). Minimum 2.
12
+ 2. **Shared state path** — where to store `cogent-state.json`. Suggest a path alongside their projects, e.g., if projects are at `/code/myapp/backend` and `/code/myapp/frontend`, suggest `/code/myapp/cogent-share`. Default: `~/.cogent` (global, shared across all projects).
13
+
14
+ If arguments were provided ($ARGUMENTS), try to parse them. Supported formats:
15
+ - `/cogent:init /path/to/backend /path/to/frontend` — two project paths, default shared folder
16
+ - `/cogent:init /path/to/backend /path/to/frontend --share /path/to/share` — explicit shared folder
17
+
18
+ ## Step 2: Create `.mcp.json` in Each Project
19
+
20
+ For **each** project directory, check if `.mcp.json` already exists:
21
+
22
+ - **If it exists**: Read it, add or update the `cogent` entry under `mcpServers`, preserving other servers. Write it back.
23
+ - **If it doesn't exist**: Create a new `.mcp.json`.
24
+
25
+ The `.mcp.json` content for each project:
26
+
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "cogent": {
31
+ "command": "npx",
32
+ "args": ["-y", "@essentialai/cogent-bridge"],
33
+ "env": {
34
+ "COGENT_STATE_PATH": "<shared-state-path>",
35
+ "COGENT_LOG_LEVEL": "info",
36
+ "COGENT_TIMEOUT_MS": "180000"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ If the shared state path is the default (`~/.cogent`), omit the `COGENT_STATE_PATH` env var (the server uses it by default).
44
+
45
+ ## Step 3: Create Shared Directory
46
+
47
+ Create the shared state directory if it doesn't exist:
48
+
49
+ ```bash
50
+ mkdir -p <shared-state-path>
51
+ ```
52
+
53
+ ## Step 4: Report Results
54
+
55
+ Show the user:
56
+ - Which `.mcp.json` files were created or updated
57
+ - The shared state path being used
58
+ - Remind them to **restart Claude Code** in each project for the changes to take effect
59
+ - After restarting, they can use `/cogent:register` in each session to join the bridge
@@ -0,0 +1,117 @@
1
+ ---
2
+ description: Register this session on the Cogent Bridge as a peer
3
+ ---
4
+
5
+ Register this Claude Code session on the Cogent Bridge.
6
+
7
+ Parse $ARGUMENTS for these patterns:
8
+ - `channel is "<name>", channel password "<password>" your peer name "<peerId>", ORGID "<org_id>"`
9
+ - `channel name "<name>", channel password "<password>", peer name "<peerId>", ORGID "<org_id>"`
10
+ - `channel is "<name>", channel password "<password>" your peer name "<peerId>"`
11
+ - `channel is "<name>", space password "<password>" your peer name "<peerId>"`
12
+ - `<peerId> [label]` (legacy format, no cloud session)
13
+
14
+ Capture `<org_id>` as an optional parsed value — extract **only** the Org_ID token itself (the value in quotes after `ORGID`); **trim surrounding whitespace and ignore any trailing text** (e.g. a peer name pasted on the same line). A stray space or extra word changes the value and makes the Team join fail with an opaque "the channel name, password, or Org_ID is incorrect" — even when the Org_ID is otherwise right. If you can't cleanly isolate the Org_ID, ask the user to confirm it rather than guessing. If present it identifies a **Team (business) channel**.
15
+
16
+ ## Which channel? (precedence — check the project `.env` BEFORE local-only)
17
+
18
+ Resolve the channel in this order; **only the last resort is local-only**:
19
+
20
+ 1. **From `$ARGUMENTS`** — if a channel name + password (with an optional Org_ID) were provided, use them.
21
+ 2. **From the project `.env`** — if arguments named no channel, the repo almost always configures one in `.env` under a `#COGENT…` comment header. Read it (never assume it is absent):
22
+ ```bash
23
+ grep -nE '^#COGENT|^CHANNEL_(NAME|PASSWORD|ORG_ID|PEER_NAME|PEER_LABEL)=' .env 2>/dev/null
24
+ ```
25
+ - **Exactly one `#COGENT…` block** → use it: channel=`CHANNEL_NAME`, password=`CHANNEL_PASSWORD`, Org_ID=`CHANNEL_ORG_ID` (present ⇒ **Team** channel), peer=`CHANNEL_PEER_NAME`, label=`CHANNEL_PEER_LABEL`.
26
+ - **More than one `#COGENT…` block** → list their headers and **ask the user which channel to join**. Never guess.
27
+ 3. **Local-only** — follow the bridge-setup skill **only** when there is neither an argument channel nor any `#COGENT` block in `.env`.
28
+
29
+ When a channel resolved from step 1 or 2, follow **Cloud Channel Setup** below.
30
+
31
+ > ⚠️ **Never fall through to local-only while a `#COGENT` block exists in `.env`.** Local-only puts you on a *different bridge* than peers who joined the cloud channel — they will not see each other (this was the real cause of "our two agents can't reach each other"). `.env` first; local-only is the last resort.
32
+
33
+ ## Cloud Channel Setup
34
+
35
+ When channel name and password are provided:
36
+
37
+ ### Step 1: Join the existing channel
38
+
39
+ **If an Org_ID was provided (Team channel):**
40
+
41
+ Call `cogent_join_session` with:
42
+ - `channel`: the channel name exactly as the user provided it
43
+ - `secret`: the channel password
44
+ - `orgId`: the Org_ID parsed from arguments
45
+
46
+ The client auto-routes an Org_ID join to the Team relay (`app.cogent.tools`); a free join uses the default relay. You do not configure the endpoint — passing `orgId` is what selects the Team relay.
47
+
48
+ **CRITICAL — never drop the Org_ID.** If this join fails, do NOT retry `cogent_join_session` without `orgId`. A Team channel is org-isolated; retrying without the Org_ID would silently land you on a *different, public* free channel that happens to share the name — masking the real failure and breaking isolation. Treat any Team-join failure as a hard error (see Step 2).
49
+
50
+ **If no Org_ID was provided (free channel):**
51
+
52
+ Call `cogent_join_session` with:
53
+ - `channel`: the channel name exactly as the user provided it
54
+ - `secret`: the channel password
55
+
56
+ **IMPORTANT**: The `channel` parameter takes the human-readable channel name, NOT a UUID or Claude Code session ID.
57
+
58
+ ### Step 2: If join fails — free channels only
59
+
60
+ **This step applies ONLY when no Org_ID was provided.**
61
+
62
+ Only if Step 1 returns an error (session not found), call `cogent_create_session` with:
63
+ - `label`: the channel name (must match pattern `/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/`)
64
+ - `secret`: the channel password
65
+
66
+ **If an Org_ID WAS provided and Step 1 fails:** do NOT call `cogent_create_session`, and do NOT retry the join without the Org_ID. Report a clear failure instead:
67
+
68
+ > Could not join Team channel `<channel name>`. The channel name, password, or Org_ID may be incorrect, or the channel has not been created yet. Team channels are created by an Org-Admin in the Cogent portal — the agent cannot create them.
69
+
70
+ ### Step 3: Register as peer
71
+
72
+ The cloud channel you joined in Step 1 is bound **automatically** (from this process's `cogent_join_session`). Do **NOT** pass the channel UUID as `sessionId`.
73
+
74
+ Call `cogent_register_peer` with:
75
+ - `peerId`: the peer name (from arguments or `CHANNEL_PEER_NAME`)
76
+ - `sessionId`: **this session's LOCAL Claude Code session id** — the id the relay uses to wake you (`claude --resume <id>`) for auto-reply. Discover it exactly as in the **bridge-setup** skill's "Discover Session ID" step (newest `~/.claude/projects/<cwd-with-non-alnum-as-dashes>/*.jsonl`). ⚠️ Passing the **channel UUID** here silently breaks auto-reply: a channel UUID is not a resumable session, so inbound directed messages fail with `DELIVERY_NO_ACK` — the peer looks online but never answers.
77
+ - `cwd`: the absolute working directory path
78
+ - `label`: `CHANNEL_PEER_LABEL`, or derive from peerId (capitalize, replace hyphens with spaces)
79
+ - `mode`: `"agent"` (default — auto-replies to directed messages). Use `"observer"` only to monitor a channel without auto-replying; an observer is not woken, so its local session id does not matter.
80
+
81
+ ### Step 4: Confirm
82
+
83
+ Call `cogent_list_peers` to show who is online.
84
+
85
+ Then display a summary block with **all** of the following fields:
86
+
87
+ **If an Org_ID was used (Team channel):**
88
+
89
+ ```
90
+ - Peer ID: <peerId>
91
+ - Label: <label>
92
+ - Channel: <channel name>
93
+ - Secret: <channel password>
94
+ - Org_ID: <org_id>
95
+ - Transport: WebSocket (cloud relay)
96
+
97
+ To map this channel to a Slack channel, run this slash command in Slack:
98
+ /cogent map <channel-name> <secret> <org-id>
99
+ ```
100
+
101
+ **If no Org_ID was used (free channel):**
102
+
103
+ ```
104
+ - Peer ID: <peerId>
105
+ - Label: <label>
106
+ - Channel: <channel name>
107
+ - Secret: <channel password>
108
+ - Transport: WebSocket (cloud relay)
109
+ - Channel ID (for Slack): <sessionId from Step 1 or 2>
110
+
111
+ To map this channel to a Slack channel, run this slash command in Slack:
112
+ /cogent map <sessionId> <secret>
113
+ ```
114
+
115
+ **IMPORTANT**: Always show the Slack `/cogent map` command, with the form that matches the channel type:
116
+ - **Team channel (Org_ID was used):** `/cogent map <channel-name> <secret> <org-id>` — all THREE are required. Omitting the Org_ID makes the Slack map fail ("the channel name, password, or Org_ID is incorrect"). Use the channel **name**, not the UUID sessionId.
117
+ - **Free channel (no Org_ID):** `/cogent map <sessionId> <secret>`.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Send a message to another peer on the Cogent Bridge
3
+ ---
4
+
5
+ Send a message to another peer on the Cogent Bridge.
6
+
7
+ Parse $ARGUMENTS for:
8
+ - First word: target peer ID
9
+ - Remaining text: message content
10
+
11
+ If no arguments provided, first call `cogent_list_peers` to show available
12
+ targets, then ask the user who to message and what to say.
13
+
14
+ Use `cogent_send_message` with the current session's registered peer ID as
15
+ `fromPeerId`. If this session is not registered yet, suggest running
16
+ `/cogent:register` first.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Check Cogent Bridge status -- list peers, health, and recent messages
3
+ ---
4
+
5
+ Check the current state of the Cogent Bridge:
6
+
7
+ 0. **If the system reminder lists `mcp__cogent__*` (or
8
+ `mcp__plugin_cogent_cogent__*`) as deferred tools, reload their schemas
9
+ first with one ToolSearch call** before proceeding:
10
+
11
+ ```
12
+ ToolSearch query: "select:mcp__cogent__cogent_list_peers,mcp__cogent__cogent_health_check,mcp__cogent__cogent_get_history"
13
+ ```
14
+
15
+ The MCP server is still attached after compaction; only the schemas were
16
+ demoted. Do not fall back to curl or a custom HTTP CLI.
17
+
18
+ 1. Call `cogent_list_peers` to show all registered peers and their status
19
+ 2. Call `cogent_health_check` to verify bridge health
20
+ 3. Call `cogent_get_history` with limit 5 to show recent messages
21
+
22
+ Present the results in a clear summary. Flag any peers that appear stale
23
+ or any health check failures.
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@essentialai/cogent-plugin",
3
+ "version": "3.12.0",
4
+ "description": "Cogent — Claude Code plugin (skills + slash-commands + MCP server) for the cross-agent comms fabric.",
5
+ "author": { "name": "Essential AI Solutions Ltd.", "url": "https://essentialai.uk" },
6
+ "homepage": "https://cogent.tools",
7
+ "license": "ISC",
8
+ "private": false,
9
+ "publishConfig": { "access": "public" },
10
+ "files": [".claude-plugin", "commands", "skills", ".mcp.json", "README.md", "LICENSE"],
11
+ "scripts": {
12
+ "sync": "node scripts/sync-from-plugin.mjs",
13
+ "prepack": "node scripts/sync-from-plugin.mjs"
14
+ }
15
+ }
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: bridge-setup
3
+ description: >
4
+ Automatically set up this Claude Code session as a bridge peer.
5
+ Discovers the current session ID, registers on the Cogent Bridge, and
6
+ confirms readiness for inter-session communication. Use when the user
7
+ asks to "register on the bridge", "set up the bridge", or "join the bridge".
8
+ ---
9
+
10
+ # Cogent Bridge Setup
11
+
12
+ You are setting up this Claude Code session as a peer on the Cogent Bridge for
13
+ inter-session communication.
14
+
15
+ ## Cloud Channel Mode
16
+
17
+ If the user provided a **channel name** (or "space") and **password**, handle the
18
+ cloud session BEFORE registering the peer:
19
+
20
+ 1. **Try joining first**: Call `cogent_join_session` with:
21
+ - `channel`: the channel name (e.g., "mt-space") — this is the human-readable name, NOT a UUID
22
+ - `secret`: the channel password
23
+ This triggers server-side label resolution (label -> UUID).
24
+
25
+ 2. **Create only if join fails with "not found"**: Call `cogent_create_session` with:
26
+ - `label`: the channel name (must match `/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/`)
27
+ - `secret`: the channel password
28
+ Do NOT invent a different label. If the format is invalid, tell the user.
29
+
30
+ 3. **If create fails with "label already in use"**: The session exists but join failed.
31
+ Try `cogent_join_session` again with `channel` set to the channel name.
32
+
33
+ ## Step 1: Discover Session ID
34
+
35
+ Run this command to find your current Claude Code session ID:
36
+
37
+ ```bash
38
+ ls -t ~/.claude/projects/$(pwd | sed 's/[^a-zA-Z0-9-]/-/g')/*.jsonl 2>/dev/null | head -1 | xargs -I{} basename {} .jsonl
39
+ ```
40
+
41
+ If no session file is found, try the alternate path format (replacing only `/`):
42
+
43
+ ```bash
44
+ ls -t ~/.claude/projects/$(pwd | tr '/' '-')/*.jsonl 2>/dev/null | head -1 | xargs -I{} basename {} .jsonl
45
+ ```
46
+
47
+ If still nothing, inform the user that no active session was found and suggest
48
+ they may need to check their Claude Code installation.
49
+
50
+ ## Step 2: Determine Peer Identity
51
+
52
+ If the user provided a peer ID and/or label, use those. Otherwise:
53
+ - **Default peer ID**: the current directory name, lowercased, with non-alphanumeric
54
+ characters replaced by hyphens (e.g., `klaire_backend` becomes `klaire-backend`)
55
+ - **Default label**: `Cogent_` followed by the directory name with non-alphanumeric
56
+ characters replaced by underscores (e.g., `Cogent_klaire_backend`)
57
+
58
+ Ask the user to confirm or customize these defaults before registering.
59
+
60
+ ## Step 3: Register on the Bridge
61
+
62
+ Call `cogent_register_peer` with:
63
+ - `peerId`: the chosen peer ID
64
+ - `sessionId`: the UUID discovered in Step 1
65
+ - `cwd`: the absolute working directory path (output of `pwd`)
66
+ - `label`: the chosen label
67
+
68
+ ## Step 4: Confirm Registration
69
+
70
+ After successful registration, inform the user:
71
+ - Their peer ID and label
72
+ - If cloud mode: the channel name and password so the other peer can join with the same values
73
+ - They can send messages to other peers using `cogent_send_message`
74
+ - They can check who else is on the bridge using `cogent_list_peers`
75
+ - Incoming messages arrive with a `[Cogent Bridge message from ...]` header
76
+ - They should respond to incoming messages directly (NOT via cogent_send_message)
77
+
78
+ ## Message Handling Protocol
79
+
80
+ When you receive a message with a `[Cogent Bridge message from ...]` header:
81
+ - Your entire response is automatically relayed back to the sender
82
+ - Do NOT use `cogent_send_message` to reply -- just answer directly and normally
83
+ - Read carefully, investigate the issue, and respond with specifics
84
+ - Include file names and line numbers when discussing code changes
85
+
86
+ ## Recovery: deferred MCP tools after compaction
87
+
88
+ After a Claude Code conversation compacts, the system reminder may list
89
+ `mcp__cogent__*` (or `mcp__plugin_cogent_cogent__*`) under "deferred tools",
90
+ with the warning that schemas are not loaded and direct calls will fail
91
+ with `InputValidationError`. **The MCP server is still attached -- only the
92
+ tool schemas were dropped from prompt context to save tokens.** The bridge's
93
+ WebSocket and auto-relay keep running through this; inbound messages still
94
+ reach you, and your replies still relay outbound.
95
+
96
+ What to do:
97
+
98
+ 1. **Do NOT fall back to a custom HTTP CLI, curl-against-the-relay, or
99
+ anything that bypasses the MCP server.** That is cargo-culting around a
100
+ non-bug. The dogfooding contract is to use the native MCP tools.
101
+
102
+ 2. **Reload the tool schemas with ToolSearch.** Pass the names you need as a
103
+ `select:` query, for example:
104
+
105
+ ```
106
+ ToolSearch query: "select:mcp__cogent__cogent_join_session,mcp__cogent__cogent_register_peer,mcp__cogent__cogent_list_peers,mcp__cogent__cogent_health_check,mcp__cogent__cogent_send_message,mcp__cogent__cogent_get_history"
107
+ ```
108
+
109
+ Once the result includes those `<function>` definitions, you can call the
110
+ tools normally for the rest of the turn.
111
+
112
+ 3. **If a directed `cogent_send_message` hangs for minutes**, the target peer
113
+ is probably gone (Slack human peers come and go with activity; CC peers
114
+ may have exited). Verify with `cogent_list_peers` first, and prefer
115
+ `toPeerId: "*"` (broadcast) when you do not need a synchronous reply.
116
+
117
+ 4. **If the local MCP server is genuinely disconnected** (system reminder
118
+ explicitly says "MCP server disconnected", not "deferred tools"), the
119
+ recovery is to restart Claude Code. ToolSearch cannot reattach a
120
+ disconnected server -- it can only re-expose schemas of an already-
121
+ attached one.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: communication-protocol
3
+ description: Autonomous communication protocol for Cogent Bridge. Loaded automatically when the plugin is active. Instructs CC agents to respond to incoming messages without asking the operator for permission.
4
+ ---
5
+
6
+ ## Cogent Bridge Communication Protocol
7
+
8
+ You are connected to the Cogent communication bridge. Other AI agents and human team members (via Slack) may send you messages at any time.
9
+
10
+ ### Autonomous Communication Rules
11
+
12
+ 1. **Respond immediately to messages addressed to you** — do NOT ask the operator for permission to reply. This is autonomous inter-agent and human-agent communication: reply directly and continue your work. Whether a given message needs a reply is governed by the addressing rules below — **silence is the correct, expected response to a message aimed at another peer** (it is not rudeness or a missed message).
13
+
14
+ ### Peer Addressing — When to Respond vs. Read Silently
15
+
16
+ All messages are broadcast to all peers so everyone stays context-aligned. However, some messages are addressed to a specific peer using a `[→ peerId]` prefix:
17
+
18
+ - **`[→ your-peer-id] ...`** — this message is directed at YOU. You MUST respond. **Send your reply as a broadcast (`toPeerId: "*"`) by default** so the whole team can see the answer and stay context-aligned — use a targeted reply (`toPeerId: "<sender>"`) only when the content is private/sensitive or clearly irrelevant to everyone else.
19
+ - **`[→ other-peer-id] ...`** — this message is directed at another peer, **not you**. Read it for context only and **stay completely silent — send no message at all.** Do NOT reply, do NOT acknowledge, and do NOT post a "standing down" / "staying silent" / "this isn't for me" note — those still post to the channel and are noise. Producing no output is the whole point. (Rare exception: break silence only if you hold information the addressed peer clearly cannot have and the team needs it right now.)
20
+ - **No `[→ ...]` prefix** — genuine broadcast to the whole team. Respond only if the message is genuinely relevant to your role.
21
+
22
+ Example:
23
+ ```
24
+ [→ backend] BE, what port does your API run on? ← backend must respond; frontend reads silently
25
+ [→ frontend] FE: show me the user card component ← frontend must respond; backend reads silently
26
+ Hey team, standup in 5 mins ← everyone may respond
27
+ ```
28
+
29
+ 2. **Check for messages proactively** — after completing any significant task, call `cogent_get_history` to see if anyone sent you a message while you were working. If there are unread messages, respond to them before starting the next task.
30
+
31
+ 3. **Messages from Slack users** (platform: "slack") are from human team members. Respond clearly and concisely — they don't have your full codebase context. Summarize what you're doing rather than dumping raw code.
32
+
33
+ 4. **Messages from CC agents** (platform: "cc") are from other Claude Code instances working on related codebases. Be specific and technical — share file paths, function signatures, API contracts.
34
+
35
+ 5. **When reporting status**, include: what you've done, what you're working on now, and any blockers.
36
+
37
+ 6. **When sharing API changes**, include: HTTP method, path, request/response types, and whether it's a breaking change.
38
+
39
+ 7. **Default to broadcast** (`toPeerId: "*"`) for your replies and messages in a shared channel, so every peer — agents and humans (including browser/Slack peers) — stays context-aligned and can follow the whole conversation. Use a targeted message (`toPeerId: "peer-name"`) **only** when the reply is private/sensitive, or you are deliberately addressing one peer with content the rest of the team does not need. When in doubt, broadcast.
40
+
41
+ ### Multi-Platform Awareness
42
+
43
+ - Messages may come from human team members via Slack or Google Chat
44
+ - When you see `platform: "slack"` or `platform: "gchat"`, the sender is a human
45
+ - When you see `platform: "cc"`, the sender is another Claude Code agent
46
+ - Respond to human messages clearly — avoid raw code dumps, summarize what changed and why
47
+ - Respond to agent messages technically — share exact file paths, function signatures, error messages
48
+
49
+ ### Slash Commands Available in Slack
50
+ Team members in Slack can interact with the session using:
51
+ - `/cogent peers` — see all connected agents and humans
52
+ - `/cogent send @your-peer-id <message>` — send a direct message to a specific agent
53
+ - `/cogent status` — check session health and connected peers
54
+ - `/cogent map <sessionId> <secret>` — connect a Slack channel to a COGENT session