keyboard-navigator
Skill1 starsChanged 50 days agoMITView on GitHub
Architects nested inline keyboard navigation, pagination, back-tracking, and callback data budgeting.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- create-db-schemaSkill
- fsm-builderSkill
- i18n-builderSkill
- mini-app-builderSkill
- payment-gateway-setupSkill
- setup-webhookSkill
- tg-api-navigatorSkill
- tg-copywriterSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Follow these constraints when engineering button-based menus:
- Distinctive: line 16
Avoid dead-end menus. Every child view must provide an exit path.
- Distinctive: line 33
If data size exceeds 64 bytes, store the full payload in Redis or database session storage, then pass an integer key in the callback data.
- Very specific: line 36
Update menus in place using editMessageText and editMessageReplyMarkup instead of posting new messages.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Inline Keyboard Navigation Protocol
Follow these constraints when engineering button-based menus:
1. Menu Hierarchy & Breadcrumbs
- Structure menus as a directed tree: Root Menu -> Category -> Item -> Action.
- Dedicate the bottom keyboard row to navigation controls:
« Back: returns to immediate parent state.🏠 Home: resets navigation to the primary start menu.
- Avoid dead-end menus. Every child view must provide an exit path.
2. Dynamic Pagination
- Display page counters in the control row:
[◀ Prev] [Page 2/7] [Next ▶]. - Calculate slice bounds from page number and page size:
offset = page * limit. - Omit or disable boundary buttons when on the first or final page.
- Persist active filter and sort parameters in the callback payload during page turns.
3. Grid Geometry
- Single Column (1 button per row): High-impact actions, checkout confirmations, destructive deletions.
- Double Column (2 buttons per row): General settings, item selections, form options.
- Triple or Quad Column (3-4 buttons per row): Date pickers, numeric keypads, currency selectors.
- Enforce Telegram limits: maximum 8 buttons per row, maximum 100 buttons per message.
4. 64-Byte Callback Data Budget
- Telegram limits
callback_datastrings to 64 bytes. Exceeding this limit causes API rejection. - Encode data with compact delimiters:
action:target_id:page:flags(e.g.,v:9821:2:d). - If data size exceeds 64 bytes, store the full payload in Redis or database session storage, then pass an integer key in the callback data.
5. UI Lifecycle & Chat Cleanliness
- Update menus in place using
editMessageTextandeditMessageReplyMarkupinstead of posting new messages. - Post new messages only when outputting media, reports, or permanent receipts.
- Acknowledge every callback query with
answerCallbackQueryto clear client-side loading indicators. Provide brief toast alerts (show_alert=True) for background errors.
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
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.

