Skip to content
Closed
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
42 changes: 41 additions & 1 deletion skills/hcom-agent-messaging/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Tell any agent:

---

## What agents can do
## What agents can do

- Message each other (@mentions, intents, threads, broadcast)
- Read each other's transcripts (ranges, detail levels)
Expand All @@ -50,6 +50,37 @@ Tell any agent:

---

## `hcom send` vs `hcom term inject` — when to use which

**`hcom send`** — for task instructions, questions, coordination between agents.
The recipient's AI tool receives the message through its hooks and processes it as a first-class input. The sender can then `hcom listen` for a reply.

```bash
# Correct: task delegation via messaging
hcom send silo "Run focus-routing E2E: cd ~/repos/dasha-code && npm run test:e2e -- --only focus-routing"
hcom listen 60 # wait for reply
```

**`hcom term inject`** — for terminal-level control only: pressing Enter on a confirmation prompt, approving a tool call, typing 'y' to proceed. The target AI tool does NOT know the text came from another agent. Do NOT use for task instructions.

```bash
# Correct: approve a pending prompt
hcom term inject silo --enter # press Enter
hcom term inject silo "y" --enter # type 'y' and press Enter

# WRONG: sending task instructions via inject
# The AI tool may not be at a prompt, text may be lost or garbled
hcom term inject silo "Run the E2E tests now" # DON'T DO THIS
```

**Rules:**
- **Sending tasks/instructions to another agent** → always `hcom send`
- **Approving a prompt, pressing enter, typing a short confirmation** → `hcom term inject`
- **Never mix**: don't `term inject` a task then `hcom listen` for a reply — `listen` only receives `hcom send` messages, not terminal output
- **Always quote inject text**: `hcom term inject <name> "quoted text" --enter`

---

## Setup

If the user invokes this skill without arguments:
Expand Down Expand Up @@ -101,6 +132,15 @@ hcom reset all && hcom hooks add
hcom claude # Fresh start
```

### "No inject port for ..."

This means `hcom term` could not resolve the display name to a running PTY instance.

1. **Check hcom version:** Multi-hyphen tags (e.g., `vc-p0-p1-parallel-vani`) require hcom ≥ 0.7.5. Run `pip install --upgrade hcom` if needed.
2. **Check the instance is running:** `hcom list` — is the base instance name present and `active`?
3. **Check PTY wrapping:** The instance must have been launched via `hcom N <tool>` (PTY-wrapped). Instances started with `hcom start` from inside a session do not get PTY injection ports.
4. **Try the base name directly:** `hcom term <base-name>` (e.g., `hcom term vani` instead of `hcom term vc-p0-p1-parallel-vani`).

### "messages not arriving"

1. **Check recipient:** `hcom list` — are they `listening` or `active`?
Expand Down
Loading
Loading