fast-mcp-telegram: Skill for Cursor

.cursor/skills/telegram-patterns/SKILL.md

telegram-patterns is a skill for Cursor from leshchenko1979/fast-mcp-telegram. It costs 12 tokens per session (886 once invoked), scanned A, original, MIT.

A set of coding patterns for Telegram, a messaging platform, using the Telethon Python library. It covers finding chats and users and recognizing text, photos, documents, and other media.

In plain words
What is it for?
It supports code that works with users, groups, channels, saved messages, text messages, photos, and documents.
Why use it?
It helps avoid incorrect Telegram lookups and missing error handling for different kinds of chats and messages.

Skill for Cursor

Written for Cursor: installed under .cursor/.

This is leshchenko1979/fast-mcp-telegram's own configuration. It tells Cursor how to work on fast-mcp-telegram itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fast-mcp-telegram configures →

Reuse

Borrowing it

Nothing to install: this file belongs to leshchenko1979/fast-mcp-telegram. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/leshchenko1979/fast-mcp-telegram/master/.cursor/skills/telegram-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/leshchenko1979/fast-mcp-telegram

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for telegram-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/leshchenko1979/fast-mcp-telegram/telegram-patterns.svg)](https://agentmods.dev/skills/leshchenko1979/fast-mcp-telegram/telegram-patterns)
Your own site
<a href="https://agentmods.dev/skills/leshchenko1979/fast-mcp-telegram/telegram-patterns"><img src="https://agentmods.dev/badge/skills/leshchenko1979/fast-mcp-telegram/telegram-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 886 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 113
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00886
Opus 5 $0.00006 $0.00443
Sonnet 5 $0.00002 $0.00177
Haiku 4.5 $0.00001 $0.00089

Measured 8d ago against content hash 0173f6e04a12, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

telegram-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/skills/telegram-patterns/SKILL.md · 153 lines

How it starts

The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Telegram-Specific Patterns

Entity Resolution

Always resolve chat/user entities using the utility functions:

from src.utils.entity import get_entity_by_id

# ✅ Correct - handles all entity types (users, chats, channels)
entity = await get_entity_by_id(chat_id)
if not entity:
    raise ValueError(f"Could not find chat with ID '{chat_id}'")

# ❌ Wrong - don't use client.get_entity directly
entity = await client.get_entity(chat_id)  # Missing error handling

Special Chat Identifiers

Use these special identifiers for common chats:

# Saved Messages (your own messages)
chat_id = "me"

# Channel IDs (always start with -100)
channel_id = "-1001234567890"

# User IDs (numeric strings)
user_id = "123456789"

# Usernames (without @)
username = "telegram"

Message Content Detection

Check for various types of message content:

# Check for text content
has_text = message.text and message.text.strip()

# Check for media content (photos, documents, etc.)
has_media = hasattr(message, "media") and message.media is not None

# Check for specific media types
is_photo = hasattr(message, "photo") and message.photo is not None
is_document = hasattr(message, "document") and message.document is not None
is_voice = hasattr(message, "voice") and message.voice is not None

Message Iteration

Use proper patterns for iterating through messages:

# ✅ Correct - limit results and handle empty messages
async for message in client.iter_messages(entity, limit=50):
    if not message:
        continue
    # Process message
    await process_message(message)

# ❌ Wrong - no limit can cause performance issues
async for message in client.iter_messages(entity):  # No limit!
    pass

Forwarded Message Handling

Handle forwarded messages properly:

# Check if message is forwarded
if hasattr(message, "forward") and message.forward:
    forward_info = await _extract_forward_info(message)
    original_sender = forward_info.get("sender")
    original_chat = forward_info.get("chat")
    forward_date = forward_info.get("date")

Read the full file on GitHub · 153 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 153 lines · 12 tokens per session scan A 0173f6e04a12

Subscribe to this mod's changes

telegram-patterns is a skill published in the GitHub repository leshchenko1979/fast-mcp-telegram (49 stars, last pushed 15d ago), licensed MIT. It adds 12 tokens to every session and 886 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.