social-messaging-agent-runtime-toolkit / rich-messages
AGENTS.md4 starsChanged 8 days agoApache-2.0View on GitHub
AI-optimized wiring guide. Goal: attach WhatsApp interactive elements (buttons, lists, media, location) to agent replies. buttons, list_menu, link_button, image, video, location, location_request. The builder returns the correctly-wrapped {"type", "payload"} shape that notify.send_message expects — pass result["message"] through unchanged. call_button and address_request are not supported — WhatsApp silently drops both on standard WABA tiers. None. The builder reads no environment variables. None. The builder makes no AWS calls. Delivery uses the existing SMART (Social Messaging Agent Runtime Toolkit) notify path, which…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- blueprints/appointment-scheduler/AGENTS.mdAGENTS.md
- blueprints/minimal/AGENTS.mdAGENTS.md
- blueprints/personal-assistant/AGENTS.mdAGENTS.md
- recipes/generate-image/AGENTS.mdAGENTS.md
- recipes/voice-reply/AGENTS.mdAGENTS.md
- socialagent-admin-console/AGENTS.mdAGENTS.md
- blueprints/appointment-scheduler/CLAUDE.mdCLAUDE.md
- blueprints/minimal/CLAUDE.mdCLAUDE.md
- blueprints/personal-assistant/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- image_generationSkill
- rich_messagesSkill
- voice_replySkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Import build_rich_message from the copied tool module into src/tools/__init__.py.
- Very specific: line 17
Ensure the agent entrypoint runs inside socialagent_notify_context() so the payload is queued and drained by the webhook after the turn (do …
- Very specific: line 18
If you rename the tool, update skill.md so the name matches.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — rich-messages recipe
AI-optimized wiring guide. Goal: attach WhatsApp interactive elements (buttons, lists, media, location) to agent replies.
Files copied by socialagent recipe add rich-messages
| Source | Destination | Purpose |
tool.py | src/tools/rich_messages.py | Pure-Python build_rich_message(message_type, ...) payload builder |
skill.md | src/skills/rich_messages.md | Agent guidance; references a tool named attach_interactive |
Wiring steps
- Import
build_rich_messagefrom the copied tool module intosrc/tools/__init__.py. - Define a Strands tool named exactly
attach_interactive(the skill references this name) decorated with@tool(context=True). - In the tool: call
build_rich_message(message_type, ...). If the result has an"error"key,raise ValueError(result["error"])so the agent sees the failure and can retry. Otherwise send the already-wrapped payload viaawait notify.send_message(tool_context.invocation_state.get("phone", ""), result["message"]). - Ensure the agent entrypoint runs inside
socialagent_notify_context()so the payload is queued and drained by the webhook after the turn (do not send mid-turn). - If you rename the tool, update
skill.mdso the name matches.
Supported message types
buttons, list_menu, link_button, image, video, location, location_request. The builder returns the correctly-wrapped {"type", "payload"} shape that notify.send_message expects — pass result["message"] through unchanged.
call_buttonandaddress_requestare not supported — WhatsApp silently drops both on standard WABA tiers.
Required env vars
None. The builder reads no environment variables.
Required IAM actions
None. The builder makes no AWS calls. Delivery uses the existing SMART (Social Messaging Agent Runtime Toolkit) notify path, which already has the necessary socialmessaging permissions — no new IAM statements required.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

