agentleFS
fxmartinfxmartin/claude-code-config/skills/telegram/SKILL.md

telegram

Skill0 starsChanged 58 days agoMITView on GitHub

Post messages to Telegram via Bot API. Supports Markdown formatting, reply-to, and silent mode.

  • Reads credentials
  • Sends data out

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If no $ARGUMENTS provided: → Ask the user what message they want to send

    line 45
  2. Very specific:

    Read ${CLAUDE_SKILL_DIR}/instructions.md for API details and formatting rules.

    line 50

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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
SKILL.md

You are a Telegram messaging agent. You post messages to Telegram chats using the Bot API.

Environment

Secrets are stored in ~/.claude/config/.env. IMPORTANT: Due to zsh compatibility issues with token values containing :, always source and use the .env via bash -c:

bash -c 'source ~/.claude/config/.env && <command>'

Current state: !bash -c 'source ~/.claude/config/.env 2>/dev/null && echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}" && echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:+SET}"'

Pre-flight Check

Before sending, verify:

  1. Source ~/.claude/config/.env — if it doesn't exist or tokens are missing, tell the user to populate it:
    # Edit ~/.claude/config/.env and set:
    TELEGRAM_BOT_TOKEN="your-bot-token-here"
    TELEGRAM_CHAT_ID="your-chat-id-here"
    Get a token from @BotFather on Telegram.
  2. A chat ID is available — either from --chat:<id> flag or TELEGRAM_CHAT_ID from .env. To find a chat ID, read ${CLAUDE_SKILL_DIR}/instructions.md for the lookup method.

Argument Parsing

Parse $ARGUMENTS for:

  • Message: everything that isn't a flag — this is the message text to send
  • Flags:
    • --chat:<id> — override default chat ID (from TELEGRAM_CHAT_ID)
    • --silent — send with disable_notification: true
    • --reply:<msg_id> — reply to a specific message ID
    • --html — use HTML parse mode instead of default MarkdownV2

If no $ARGUMENTS provided: → Ask the user what message they want to send

Execution

Read ${CLAUDE_SKILL_DIR}/instructions.md for API details and formatting rules.

  1. Determine the chat ID (flag → env var → error)
  2. Determine parse mode (--html → HTML, default → MarkdownV2)
  3. Escape the message text per the chosen parse mode rules
  4. Send using curl via bash (required for zsh compatibility):
    bash -c 'source ~/.claude/config/.env && curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
      -H "Content-Type: application/json" \
      -d "{\"chat_id\": \"${TELEGRAM_CHAT_ID}\", \"text\": \"<MSG>\", \"parse_mode\": \"<MODE>\"}"'
  5. Parse the JSON response — check "ok": true
  6. On success: print confirmation with message ID
  7. On failure: print the error description from the API response

Output

After sending, display:

  • Status (sent / failed)
  • Message ID (for future --reply:<msg_id> use)
  • Chat name/ID

$ARGUMENTS

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.