Skip to content

serejaris/telegram-skills / skills/tg-widgets

tg-widgets

Verified

Use when building or sending a Telegram message widget (HTML bubble, HTMLBubbles, `sendWidget`, `messageMediaWidget`, Bot API 10.4): an interactive HTML, CSS and JS program inside a chat bubble, such as a game, poll, calculator or live ticker. Teaches everything needed to write one: size, bubble, input, sandbox rules, state and requests, sending, and which chats accept a widget in production. Not for Mini Apps or Rich Messages.

tests/test_widget_tool.py

View on GitHub
import importlib.util
import unittest
import os
import pathlib

path = pathlib.Path(__file__).parents[1] / "scripts" / "widget_tool.py"
spec = importlib.util.spec_from_file_location("widget_tool", path)
tool = importlib.util.module_from_spec(spec)
spec.loader.exec_module(tool)


class WidgetToolTest(unittest.TestCase):
    def test_small_widget_is_ok(self):
        assert tool.measure(b"<p>hello</p>")["verdict"] == "ok"

    def test_incompressible_html_is_too_large(self):
        assert tool.measure(os.urandom(5000))["verdict"] == "too_large"

    def test_over_html_limit_is_too_large_even_if_it_compresses(self):
        assert tool.measure(b"a" * 40000)["verdict"] == "too_large"

    def test_examples_fit(self):
        for example in (path.parents[1] / "examples").glob("*.html"):
            assert tool.measure(example.read_bytes())["verdict"] != "too_large", example
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall