agentleFS
AWSKnown publisherawslabs/social-messaging-agent-runtime-toolkit/recipes/rich-messages/AGENTS.md

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…

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
  1. Very specific:

    Import build_rich_message from the copied tool module into src/tools/__init__.py.

    line 14
  2. Very specific:

    Ensure the agent entrypoint runs inside socialagent_notify_context() so the payload is queued and drained by the webhook after the turn (do …

    line 17
  3. Very specific:

    If you rename the tool, update skill.md so the name matches.

    line 18

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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

SourceDestinationPurpose
tool.pysrc/tools/rich_messages.pyPure-Python build_rich_message(message_type, ...) payload builder
skill.mdsrc/skills/rich_messages.mdAgent guidance; references a tool named attach_interactive

Wiring steps

  1. Import build_rich_message from the copied tool module into src/tools/__init__.py.
  2. Define a Strands tool named exactly attach_interactive (the skill references this name) decorated with @tool(context=True).
  3. 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 via await notify.send_message(tool_context.invocation_state.get("phone", ""), result["message"]).
  4. 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).
  5. If you rename the tool, update skill.md so 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_button and address_request are 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.