You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: tailor imsg skill for OpenClaw agents (#100105)
* docs: tailor imsg skill for OpenClaw agents
* docs(imsg-skill): document that poll send echoes --question as a visible comment
* docs(imsg-skill): note inbound native poll question is backfilled from its caption
* docs(imsg-skill): document only shipped poll behavior
Drop the poll caption echo, --comment override, and inbound question
backfill from the imsg skill: those live in imsg PR openclaw/imsg#155,
not shipped imsg 0.12.2 (poll --help exposes only --question/--option).
Also removes the inaccurate 'reply comment whose reply_to is the poll
guid' framing — #155 sends the caption as a plain message, not a reply.
Keeps shipped poll send/vote usage. Re-add once a release ships #155.
---------
Co-authored-by: Omar Shahine <[email protected]>
Use `imsg`to read and send iMessage/SMS via macOS Messages.app.
28
+
Use `imsg`when an OpenClaw agent must act through the user's local macOS Messages.app account: inspect iMessage/SMS history, choose the correct DM or group, send messages/files, reply, react, vote in polls, or use private-API iMessage features.
29
29
30
-
## When to Use
30
+
Do not use this skill for Telegram, Signal, WhatsApp, Discord, Slack, or for replying inside the current OpenClaw conversation when the configured channel already routes the reply.
31
31
32
-
Use when:
32
+
## Agent Flow
33
33
34
-
- User explicitly asks to send iMessage or SMS
35
-
- Reading iMessage conversation history
36
-
- Checking recent Messages.app chats
37
-
- Sending to phone numbers or Apple IDs
34
+
1. Resolve the conversation first.
35
+
2. Choose DM, existing group, or new group.
36
+
3. Pick the lowest-capability command that can do the requested action.
37
+
4. Confirm any send or visible state change unless the user already gave exact recipient, content, and action.
38
+
5. Execute with stable identifiers: prefer `--chat-id` for normal sends/watch/history and `--chat` chat GUID for bridge actions.
38
39
39
-
## When NOT to Use
40
+
Never infer a recipient from a casual name alone when several chats or handles could match. Show the matched display name, handle(s), group participants, and message text/action before sending.
40
41
41
-
Do not use when:
42
+
## Host Requirements
42
43
43
-
- Telegram messages -> use `message` tool with `channel:telegram`
44
-
- Signal messages -> use Signal channel if configured
45
-
- WhatsApp messages -> use WhatsApp channel if configured
46
-
- Discord messages -> use `message` tool with `channel:discord`
47
-
- Slack messages -> use `slack` skill
48
-
- Group chat management (adding/removing members) -> not supported
49
-
- Bulk/mass messaging -> always confirm with user first
50
-
- Replying in current conversation -> just reply normally (OpenClaw routes automatically)
44
+
- macOS 14+ with Messages.app signed in for send/react/bridge actions.
45
+
- Full Disk Access for the process context that runs `imsg` or OpenClaw; reads fail without Messages DB access.
46
+
- Automation permission for Messages.app when using public `send`.
47
+
- Accessibility permission for the process context that runs public `imsg react`; it uses System Events UI automation. Bridge `tapback` uses private API instead.
48
+
- Optional Contacts permission for contact-name resolution.
49
+
- SMS sends require Text Message Forwarding from the user's iPhone to this Mac.
50
+
- Linux reads a copied `chat.db` only; it cannot send, react, launch Messages.app, mark read, or type.
51
51
52
-
## Requirements
52
+
## Resolve Targets
53
53
54
-
- macOS with Messages.app signed in
55
-
- Full Disk Access for terminal
56
-
- Automation permission for Messages.app (for sending)
54
+
Use `--json` reads. Output is newline-delimited JSON; use `jq -s` when `jq` is available, or consume one object per line directly.
- Group create/name/photo/member/leave/delete/mark actions
90
+
- Account, whois, nickname checks
91
+
92
+
Before bridge actions, check:
61
93
62
94
```bash
63
-
imsg chats --limit 10 --json
95
+
imsg status --json
64
96
```
65
97
66
-
### View History
98
+
If the host supports bridge actions but Messages is not injected yet, ask before running `imsg launch`. It kills and relaunches Messages.app to inject the bridge, so treat it as a visible state change:
67
99
68
100
```bash
69
-
# By chat ID
70
-
imsg history --chat-id 1 --limit 20 --json
101
+
imsg launch
102
+
imsg status --json
103
+
```
104
+
105
+
If SIP, library validation, private entitlement checks, or missing selectors still block the capability, do not ask the user to disable SIP casually. Explain that the requested private-API action is unavailable on this host and offer the closest non-bridge action, if one exists.
71
106
72
-
# With attachments info
73
-
imsg history --chat-id 1 --limit 20 --attachments --json
107
+
## DM Scenarios
108
+
109
+
Exact handle, basic send:
110
+
111
+
```bash
112
+
imsg send --to "+14155551212" --text "On my way" --service auto
Formatting ranges are UTF-16 positions. Supported styles include `bold`, `italic`, `underline`, and `strikethrough`; use `--format-file` for generated JSON.
97
142
98
-
-`--service imessage` - Force iMessage (requires recipient has iMessage)
99
-
-`--service sms` - Force SMS (green bubble)
100
-
-`--service auto` - Let Messages.app decide (default)
143
+
## Group Scenarios
101
144
102
-
## Safety Rules
145
+
Inspect before acting:
103
146
104
-
1.**Always confirm recipient and message content** before sending
105
-
2.**Never send to unknown numbers** without explicit user approval
106
-
3.**Be careful with attachments** - confirm file path exists
107
-
4.**Rate limit yourself** - don't spam
147
+
```bash
148
+
imsg group --chat-id 42 --json
149
+
imsg history --chat-id 42 --limit 20 --json | jq -s
Group mutations are highly visible. Confirm the exact group and participant list before changing membership, name, photo, read state, leaving, or deleting.
181
+
182
+
## Reactions and Replies
183
+
184
+
Public `react` is limited: it reacts to the most recent incoming message in the chat.
185
+
186
+
```bash
187
+
imsg react --chat-id 42 --reaction like
188
+
imsg react --chat-id 42 --reaction love
189
+
imsg react --chat-id 42 --reaction dislike
190
+
imsg react --chat-id 42 --reaction laugh
191
+
imsg react --chat-id 42 --reaction emphasis
192
+
imsg react --chat-id 42 --reaction question
193
+
```
194
+
195
+
For a specific message GUID or removal, use bridge `tapback`:
196
+
197
+
```bash
198
+
imsg tapback --chat 'iMessage;-;+15551234567' --message <message-guid> --kind love
199
+
imsg tapback --chat 'iMessage;-;+15551234567' --message <message-guid> --kind love --remove
200
+
```
201
+
202
+
Use `send-rich --reply-to <message-guid>` for threaded replies. Confirm the referenced message if the user says "that" or "the previous one".
203
+
204
+
## Polls
205
+
206
+
Native Apple Messages polls require the bridge. Creation needs at least two `--option` values. Voting requires one of `--option-id`, `--option-index`, or `--option`.
207
+
208
+
Messages renders only the options on a poll balloon; the `--question` title is not shown to recipients. Set `--question` (required) plus at least two `--option` values.
`--since-rowid` is exclusive. Without it, `watch` starts at the newest row. `watch` uses filesystem events plus a low-frequency polling fallback, so it can catch up after missed SQLite sidecar events. Poll objects appear without `--reactions`.
239
+
240
+
For a daemon or multi-chat integration, use `imsg rpc`. It speaks JSON-RPC 2.0 over stdin/stdout. Inspect `imsg status --json` for `rpc_methods` before using newer bridge or poll methods.
241
+
242
+
## Safety Rules
243
+
244
+
- Confirm recipient, chat, and content before every send unless the user's request already contains exact values.
245
+
- Confirm visible state changes: read receipts, typing indicators, edits, unsends, deletes, poll votes, tapbacks, group membership, group name/photo, leaving/deleting chats.
246
+
- Never send to unknown numbers or ambiguous contact-name matches without approval.
247
+
- Confirm attachments exist and are the intended files.
248
+
- Prefer E.164 phone numbers; use `--region US` or another region only when needed for local formats.
249
+
- Do not use bridge actions just because they are available; use them only when the requested behavior needs them.
0 commit comments