Agent skill

Bot API Update

by phptg in phptg/bot-api

Implement support for a new Telegram Bot API version in this package.

BSD-3-ClauseAuto-check passed

Install Bot API Update

skills CLI
$ npx skills add phptg/bot-api --skill bot-api-update -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install phptg/bot-api bot-api-update --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/phptg/bot-api.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/bot-api-update .claude/skills/bot-api-update && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bot-api-update
GitHub stars
130
Token cost
~2.1k tokens
SKILL.md length
1,017 words
Files
2 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Implement support for a new Telegram Bot API version in this package.

  • Works in 8 steps: Repository state → Download the official pages → Is anything actually missing? → …
  • Asked to update the library to a new Bot API version
  • SKILL.md covers 1. Repository state, 2. Download the official pages, 3. Is anything actually missing? and 4. Write the plan, plus 4 more sections
  • Runs Python scripts from its folder; calls git, composer and curl; reaches core.telegram.org

What it does

Bot API Update is an agent skill from phptg/bot-api. Implement support for a new Telegram Bot API version in this package. Use when asked to update the library to a new Bot API version.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/telegram_page_to_md.py`).

It works with Telegram. The repository describes itself as: PHP library to interact with Telegram Bot API. The licence is BSD-3-Clause.

When your agent uses it

  • Asked to update the library to a new Bot API version

Example prompts

  • “/bot-api-update”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Repository state
  2. Download the official pages
  3. Is anything actually missing?
  4. Write the plan
  5. Agree the plan with the user
  6. Implement, item by item
  7. cs-fix and rector
  8. Verification

What it can do on your machine

Read from SKILL.md and the folder at commit 407a2d0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • composer
    • curl
    • python3
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • core.telegram.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bot API Update loads about 2.1k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 1,017 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from phptg/bot-api at commit 407a2d0, republished under its BSD-3-Clause licence (© phptg). 1,017 words, ~2,075 tokens.

Download SKILL.mdSave it as .claude/skills/bot-api-update/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bot-api-update
description
Implement support for a new Telegram Bot API version in this package. Use when asked to update the library to a new Bot API version.

Telegram Bot API version update

Port a new Telegram Bot API release into this package, end to end.

Read AGENTS.md before writing any code — it holds the layout, class shapes, test patterns and changelog rules the resulting diff is judged by. When in doubt, open a class added by the previous Bot API commit (git log --oneline --grep='Telegram Bot API') and copy its shape.

Copy the shape only, never the location: older commits still put new classes into the legacy subdirectories (src/Method/UpdatingMessage/DeleteEphemeralMessage.php, src/Type/Payment/BotSubscriptionUpdated.php). Where a file goes is decided by AGENTS.md alone — every new type lands in src/Type, every new method in src/Method.

1. Repository state

bash
git status --porcelain          # must be empty
git branch --show-current
git fetch origin

A dirty working tree stops the skill: report it and ask the user what to do.

If the current branch is already a Bot API branch (apiXY) started from the current origin/master tip, stay on it and continue from wherever it left off — do not switch, do not create a new branch, and skip to the first unfinished item of runtime/bot-api-update/plan.md.

Otherwise take the fresh master tip; the branch itself is created in step 3, once the target version is known:

bash
git switch master
git pull --ff-only origin master

2. Download the official pages

Everything this skill downloads or generates lives in runtime/bot-api-update/ — runtime/ is fully gitignored, and the own subdirectory keeps these files apart from the other tools' output.

bash
mkdir -p runtime/bot-api-update
curl -fsS -o runtime/bot-api-update/api-changelog.html https://core.telegram.org/bots/api-changelog
curl -fsS -o runtime/bot-api-update/api.html https://core.telegram.org/bots/api
python3 .claude/skills/bot-api-update/scripts/telegram_page_to_md.py \
    runtime/bot-api-update/api-changelog.html runtime/bot-api-update/api-changelog.md
python3 .claude/skills/bot-api-update/scripts/telegram_page_to_md.py \
    runtime/bot-api-update/api.html runtime/bot-api-update/api.md

api-changelog.md says what changed; api.md (the full reference, several thousand lines — grep it, never read it whole) gives the exact field names, types and optionality needed to write the classes. Each type and method is a #### <Name> heading followed by one | field | type | description line per field, so sed -n '/^#### Foo$/,/^#### /p' prints exactly one definition.

3. Is anything actually missing?

  • Newest released version: the first #### <date> block in runtime/bot-api-update/api-changelog.md, whose first line is **Bot API X.Y**.
  • Version the package supports: the line in README.md that reads ✔️ Telegram Bot API X.Y (<date>) is **fully supported**.

If they match, the work is already done: tell the user that the package is up to date with Bot API X.Y and stop — no branch, no plan, no commits.

If the package is behind by more than one release, cover every missing release in this run, oldest first, in one plan.

Otherwise create the branch, named like the previous ones (api102 for 10.2, api10 for 10.0, api96 for 9.6 — api + the version digits without the dot):

bash
git switch -c api103

4. Write the plan

Put the plan in runtime/bot-api-update/plan.md (gitignored — it is a working document, never committed).

Split it as finely as it can reasonably be split. Rules for slicing:

  • One new type class = one item. One new method class = one item.
  • One new field on an existing type = one item; several new fields on the same type coming from the same changelog bullet may share one item.
  • One changelog bullet that adds the same parameter to a dozen methods = one item (it is one logical change and one CHANGELOG.md line).
  • A new interface plus its ValueProcessor and ObjectFactory registration = one item; each implementation of that interface is its own item.
  • Every item covers its own tests. Tests are never a separate trailing item.
  • Order items so dependencies come first (types before the methods that use them).

Close the plan with these fixed items:

  1. Update the supported-version line in README.md.
  2. Add the CHANGELOG.md entries.
  3. composer cs-fix + composer rector (step 7).
  4. Verification (step 8).

Item template:

markdown
## Bot API 10.3

- [ ] 1. Add `EphemeralMessageParameters` type
      Changelog: Added the class EphemeralMessageParameters ...
      Files: src/Type/EphemeralMessageParameters.php, tests/Type/EphemeralMessageParametersTest.php
      Changelog entry: New: Add `EphemeralMessageParameters` type.

Cross-check the finished plan against the changelog bullets: every bullet of the target version must be traceable to at least one item, including "Supported ...", "Replaced ..." and "Renamed ..." bullets, which are easy to miss.

The CHANGELOG.md entries reference a PR that does not exist yet: this skill never pushes the branch and never opens a pull request — the user does that themselves once the work is reviewed. Only the number is needed here, and it is the next free issue/PR number:

bash
gh issue list --state all --limit 1 --json number
gh pr list --state all --limit 1 --json number

Take the larger number, add 1, and confirm that number with the user in step 5.

Show full SKILL.md (389 more words)Show less

5. Agree the plan with the user

Show the user the plan (summary plus the item list) and the PR number you intend to use, and ask for confirmation or corrections. Do not start implementing before they answer. Apply whatever they change to runtime/bot-api-update/plan.md first.

6. Implement, item by item

For each item, in order:

  1. Implement the source change following AGENTS.md (backward compatibility is preserved; new constructor parameters go last with a default).
  2. Write or extend the tests in the same step.
  3. Run the affected tests: vendor/bin/phpunit --filter=<TestClass>.
  4. Commit only the files of this item:
    bash
    git add <files>
    git commit -m "Add EphemeralMessageParameters type"
    English, imperative, one line — the PR is squashed, so these are working notes.
  5. Mark the item [x] in runtime/bot-api-update/plan.md.

Never git add -A — runtime/ is ignored, but stray files are not worth the risk. Never commit anything under runtime/.

If an item turns out to be wrong or to need splitting, update runtime/bot-api-update/plan.md and tell the user what changed, then continue.

7. cs-fix and rector

bash
composer cs-fix
composer rector
composer test

Review the diff these tools produce before committing it — rector occasionally rewrites something in a way that conflicts with the project style. Commit as Apply cs-fix and rector.

8. Verification

Report all four results to the user, honestly, with the actual output of anything that fails.

  1. Completeness. Walk the changelog bullets of the target version one by one and confirm each is implemented in src/. Confirm every [ ] in runtime/bot-api-update/plan.md is now [x].
  2. Tests.
    bash
    composer test
  3. Coverage — must be 100%.
    bash
    XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text   # or `composer coverage` for HTML
    If PHPUnit warns No code coverage driver available (the usual case in this environment — neither Xdebug nor PCOV is installed), say so plainly instead of claiming coverage. Then fall back to a manual check: every class added or changed in this branch (git diff --stat master...HEAD -- src) has a corresponding test that exercises the new code, including every new facade method in src/TelegramBotApi.php. Tell the user that CI (Coveralls) gives the authoritative number.
  4. Static analysis — must be clean.
    bash
    composer psalm
    composer dependency-analyser

Finish with a short summary: version ported, number of commits, what each verification step returned, and anything left open. Leave the branch local and unpushed — say that pushing it and opening the PR is up to the user.

© phptg, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in .claude/skills/bot-api-update of phptg/bot-api.

  • SKILL.md
  • scripts/telegram_page_to_md.py

Open the folder on GitHubat commit 407a2d0

Compare with similar skills

Bot API Update next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bot API Update compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bot API Update this skillphptg/bot-api130—~2.1kAutomated safety check: PassBSD-3-Clause
Process Inboxtelegramdesktop/tdesktop33k2 repos~4.5kAutomated safety check: PassGPL-3.0
Perform Tasktelegramdesktop/tdesktop33k2 repos~3kAutomated safety check: PassGPL-3.0
Custom Mode Creator for claude-memthedotmack/claude-mem97k—~2.4kAutomated safety check: PassApache-2.0
Continuetelegramdesktop/tdesktop33k2 repos~9.4kAutomated safety check: PassGPL-3.0
Rebasetelegramdesktop/tdesktop33k1 repos~3.7kAutomated safety check: PassGPL-3.0

Similar skills

  • Process Inbox

    telegramdesktop/tdesktop

    Process the local ignored ai-tdesktop inbox into durable, independently testable Telegram Desktop task records while task execution worktrees remain active.

    33k GitHub starsUsed in 2 repos~4.5k tokens
    Productivity & AutomationAuto-check passed
  • Perform Task

    telegramdesktop/tdesktop

    Resolve, start or resume, implement, review, test, and publish exactly one existing ai-tdesktop task by short slug or full dated id, including rare blocked retries and split-required results.

    33k GitHub starsUsed in 2 repos~3k tokens
    Productivity & AutomationAuto-check passed
  • Walks you through creating, installing and verifying a custom claude-mem mode, including note types, tags and optional Telegram alerts for chosen memories.

    97k GitHub stars~2.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Continue

    telegramdesktop/tdesktop

    Continue autonomous Telegram Desktop development from the shared ai-tdesktop repository.

    33k GitHub starsUsed in 2 repos~9.4k tokens
    Productivity & AutomationAuto-check passed
  • Rebase

    telegramdesktop/tdesktop

    Drive an intent-aware rebase of the current checkout, resolving every conflict by reading the history behind both sides instead of by making the markers disappear.

    33k GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check passed
  • Claude To Im

    op7418/Claude-to-IM-skill

    Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the user can chat with Claude from their phone.

    2.9k GitHub stars~3.4k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check: notes

Works with

Questions about Bot API Update

What does Bot API Update do?

Implement support for a new Telegram Bot API version in this package. Bot API Update is an agent skill from phptg/bot-api. Implement support for a new Telegram Bot API version in this package.

When should I use Bot API Update?

Bot API Update fits situations like: asked to update the library to a new Bot API version.

How do I install Bot API Update in Claude Code?

Run `npx skills add phptg/bot-api --skill bot-api-update -a claude-code`. Or copy the skill folder (.claude/skills/bot-api-update in phptg/bot-api) into .claude/skills/bot-api-update in your project. Claude Code loads it when a task matches its description.

How do I install Bot API Update in Codex?

Run `npx skills add phptg/bot-api --skill bot-api-update -a codex`. Or copy the skill folder (.claude/skills/bot-api-update in phptg/bot-api) into .agents/skills/bot-api-update in your project. Codex loads it when a task matches its description.

Can I use Bot API Update in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add phptg/bot-api --skill bot-api-update -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bot-api-update, .gemini/skills/bot-api-update, .github/skills/bot-api-update and .opencode/skills/bot-api-update in your project.

What does Bot API Update need to run?

Going by SKILL.md and its folder, Bot API Update needs Python for the scripts in its folder and the command-line tools its instructions call (git, composer, curl, python3 and gh). Our summary lists: Python 3.

Does Bot API Update access the network?

SKILL.md names 1 domain. In commands or code: core.telegram.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Bot API Update safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Bot API Update use?

Bot API Update is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bot API Update use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bot API Update?

Skills that share tags, products or a category with Bot API Update: Process Inbox (telegramdesktop/tdesktop, 33k stars), Perform Task (telegramdesktop/tdesktop, 33k stars), Custom Mode Creator for claude-mem (thedotmack/claude-mem, 97k stars) and Continue (telegramdesktop/tdesktop, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bot API Update?

phptg (a GitHub organization) maintains it in phptg/bot-api, which has 130 GitHub stars. The repository was last updated on September 25, 2026.

Source: phptg/bot-api on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.