agentleFS
3akat-system3akat-system/nexus-starter/.claude/skills/max-api/SKILL.md

max-api

Skill0 starsChanged 6 months agoMITView on GitHub

Max Bot API integration for Max messenger. TRIGGER when: working with Max bots, @maxhub/max-bot-api, ПлюсОдин bot, PlusOne bot, Бот-персонала, Staff bot, max.ru API, bot commands, inline keyboards, webhook, Mini App, message_callback, bot_started, long polling. Contains: API patterns, button types, webhook setup, Mini App bridge, state machine patterns, PM2 deployment, token generation.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    If no response for 8 hours → automatic webhook unsubscription

    line 58

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Max Bot API — Skill

Full reference: [[Knowledge/max-bots/max-bot-api]]

Quick Start

const { Bot, Keyboard } = require('@maxhub/max-bot-api');
const bot = new Bot(process.env.MAX_BOT_TOKEN);
bot.start();

Critical Differences from Telegram

MaxTelegram
Authorization: <token> (no Bearer)Bot <token>
bot_started (not /start)/start command
message_callback (not callback_query)callback_query
ctx.callbackQuery().payloadctx.callbackQuery.data
Webhook: port 443, response within 30 secSame

Common Patterns

Buttons

Keyboard.button.callback('Text', 'payload')   // callback
Keyboard.button.link('Site', 'https://...')    // external link
Keyboard.button.openApp('Open', appUrl)        // Mini App

User State (quiz/onboarding)

const users = {}; // in production → PostgreSQL or Redis
bot.on('bot_started', ctx => { users[ctx.user().user_id] = { step: 0 }; });
bot.on('message_callback', ctx => {
  const u = users[ctx.user().user_id];
  // switch u.step by payload
});

Mini App — URL with Token

const token = require('crypto').createHash('sha256')
  .update(`${userId}_${Date.now()}`).digest('hex').slice(0, 32);
const url = `https://app.example.com?token=${token}&uid=${userId}`;

Webhook vs Long Polling

  • Development: bot.start() — long polling, simple
  • Production: webhook HTTPS 443, POST /subscriptions
  • If no response for 8 hours → automatic webhook unsubscription

Server Deployment

pm2 start bot.js --name bot-name
pm2 save && pm2 startup

Tokens

⚠️ Store in .env, not in code and not in vault:

MAX_BOT_TOKEN=xxxxx

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.