agentleFS
bInference-LabbInference-Lab/bInference/.agents/skills/test-telegram/SKILL.md

test-telegram

Skill2 starsChanged 2 days agoMITView on GitHub

Proves what the owner sees and taps in Telegram, first on the synthetic Bot API in tests, then on a live test bot before a release that touches ingress. Use when a change reaches the telegram package, cards, notices, fast commands or pairing.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only for a release that touches ingress, and only by a maintainer with a test bot:

    line 47
  2. Distinctive:

    Stop the engine and check that nothing still polls the bot.

    line 60
  3. Distinctive:

    Write down what you saw on screen, step by step.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
SKILL.md

Test Telegram

The owner's Telegram chat is a key: a tap there confirms a trade. Every change to what the bot reads or sends is proven on the synthetic Bot API in CI. A release that changes ingress (polling, the webhook, pairing, screening, callbacks) also gets one run on a live bot.

1. The synthetic Bot API

createFakeBotApi() from @binference/telegram/testing answers grammY in memory, through its fetch option or as the Http port. It behaves like Telegram where it matters to us:

  • updates wait under Telegram's offset rules until a getUpdates passes them (push, pending);
  • a button press arrives as a callback_query (press), and each press takes one answer;
  • HTML is parsed as strictly as Telegram does, with the 4,096-character and 64-byte callback limits;
  • each message keeps its buttons through every edit (messages, edits, deleted, answers);
  • failNext(method, failure) makes the next call refuse with a status and retry_after, fail before it reaches Telegram (network), or succeed and lose its answer (lostAnswer).

2. Pick the test

What changedWhere to prove it
A card, a receipt, a notice textthe module's test and its .zh.test.ts, then the message keys in i18n
A fast command or its buttonpackages/telegram/src/commands/, then compose-commands.test.ts in cli
Update intake and the poll workerpackages/telegram/src/updates/ and polling/, with the real worker started
Pairing, the owner check, secret screeningpairing/, ingress/, screening/
A card from proposal to tap to fillpackages/cli/src/compose/compose-telegram.test.ts, mcp-paper-swap.test.ts
Delivery after a lost answer or a 429notices/ with failNext, then compose-notices.test.ts

Assert what a person sees: the text a reader saw (sent()), the buttons, the edit, the deletion of a pasted key, the answer to a press. Test a forged press too: another user, a group chat, data that is not ours. Each must do nothing.

pnpm vitest run packages/telegram/src --maxWorkers=2
pnpm vitest run packages/cli/src/compose/compose-telegram.test.ts --maxWorkers=2

3. The live run before a release

Only for a release that touches ingress, and only by a maintainer with a test bot:

  1. A bot made for testing at BotFather, and a Telegram account that is not a real owner's. The token goes into the keychain or a secret source of config.json5, never into a file in the repo, a shell history or a log.
  2. A scratch state folder (BINFERENCE_HOME="$(mktemp -d)") and an agent in paper mode. No real wallet, no funds.
  3. Set up, start and pair from the printed start link. Then check, in English and in Chinese:
    • the command menu, and each fast command's reply;
    • a paper swap's card, its tap, the receipt, and a tap after the card expired;
    • a text shaped like a private key, deleted at once with a warning;
    • a message from a second account and from a group, both ignored;
    • a new pairing with binference telegram pair, and the note the first owner gets.
  4. Stop the engine and check that nothing still polls the bot. Revoke the test token at BotFather if it was shown anywhere.

Write down what you saw on screen, step by step. A log line is not proof that a person saw it.

4. Report

The tests you ran and what they assert. For a live run: the version, each check of step 3 with what the chat showed, and the cleanup. Leave out tokens, ids of real accounts and chat text that is not from the test.

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.