Agent SkillsTinyAGI/tinyagi › send-user-message

send-user-message

GitHub

通过TinyAGI API向绑定的Discord、Telegram或WhatsApp用户主动发送通知、警报或消息。支持心跳任务及多目标选择,可附带文件附件,实现Agent与用户的异步通信。

.agents/skills/send-user-message/SKILL.md TinyAGI/tinyagi

Trigger Scenarios

需要主动向用户发送通知或警报 在心跳任务中无用户交互时发起沟通 指定特定渠道或用户进行消息推送

Install

npx skills add TinyAGI/tinyagi --skill send-user-message -g -y
More Options

Non-standard path

npx skills add https://github.com/TinyAGI/tinyagi/tree/main/.agents/skills/send-user-message -g -y

Use without installing

npx skills use TinyAGI/tinyagi@send-user-message

指定 Agent (Claude Code)

npx skills add TinyAGI/tinyagi --skill send-user-message -a claude-code -g -y

安装 repo 全部 skill

npx skills add TinyAGI/tinyagi --all -g -y

预览 repo 内 skill

npx skills add TinyAGI/tinyagi --list

SKILL.md

Frontmatter
{
    "name": "send-user-message",
    "description": "Send a proactive message to a paired user via their channel (Discord, Telegram, or WhatsApp). Use when the agent needs to notify, alert, or send an unsolicited message to a user — especially during heartbeat invocations, scheduled tasks, or when the agent wants to reach out without a prior user message in the current conversation. Triggers: 'send message to user', 'notify user', 'alert user', 'message the user on discord\/telegram\/whatsapp', or any need to proactively communicate with a paired sender."
}

Send User Message

Send a message to a paired user via the TinyAGI API server (POST /api/responses). The message is delivered by the channel client (Discord, Telegram, or WhatsApp) that polls the API for pending responses.

When to use

  • Proactively notify a user (e.g., task completion, status update, alert)
  • Send a message during a heartbeat invocation (no active user conversation)
  • Reach a specific user on a specific channel when multiple pairings exist

Workflow

1. Identify the target

If you already know the target from the current conversation context (channel and senderId from the incoming message), skip to step 2.

If you are running from a heartbeat invocation or are unsure which user to send to, list available targets first:

<skill_dir>/scripts/send-message.sh list-targets

This reads pairing.json and prints all approved pairings with their channel, senderId, and sender (display name). Pick the appropriate target.

2. Send the message

<skill_dir>/scripts/send-message.sh send \
  --channel <channel> \
  --sender-id <senderId> \
  --sender "<display name>" \
  --message "<your message>"

With file attachments:

<skill_dir>/scripts/send-message.sh send \
  --channel telegram \
  --sender-id 123456 \
  --sender "Alice" \
  --message "Here's the report you requested." \
  --files "/Users/you/.tinyagi/files/report.pdf,/Users/you/.tinyagi/files/chart.png"

Parameters:

  • --channel: One of discord, telegram, whatsapp
  • --sender-id: The channel-specific user ID (from pairing.json or conversation context)
  • --sender: Human-readable display name of the recipient
  • --message: The message text to send (max 4000 chars)
  • --agent: (Optional) Agent ID to attribute the message to
  • --files: (Optional) Comma-separated absolute file paths to attach (files must exist on disk)

The script POSTs to POST /api/responses which enqueues the message in the SQLite responses table for the channel client to pick up.

3. Choosing a target when multiple pairings exist

When there are multiple approved pairings and you need to decide who to message:

  • If the task or context specifies a user by name, match against the sender field
  • If the task specifies a channel, filter by channel
  • If ambiguous, prefer the most recently approved pairing
  • If still ambiguous, send to all relevant targets (run the send command once per target)

Notes

  • The script POSTs to the API server (default http://localhost:3777), configurable via TINYAGI_API_PORT env var
  • Messages include a senderId field so channel clients can route agent-initiated messages to the correct user
  • For heartbeat-context messages, set --agent to identify which agent is sending

Version History

  • 2db3a03 Current 2026-07-25 10:16

Same Skill Collection

.agents/skills/agent-browser/SKILL.md
.agents/skills/imagegen/SKILL.md
.agents/skills/schedule/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/skills-manager/SKILL.md
.agents/skills/tasks/SKILL.md
.agents/skills/memory/SKILL.md
.agents/skills/tinyagi-admin/SKILL.md

Metadata

Files
0
Version
2db3a03
Hash
c06a60bc
Indexed
2026-07-25 10:16

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 07:55
浙ICP备14020137号-1 $Гость$