一键导入
mcub-modules-creator
Create and update debug MCUB userbot modules in app-debug using the MCUB module API, class-style modules, and inline form/callback docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create and update debug MCUB userbot modules in app-debug using the MCUB module API, class-style modules, and inline form/callback docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Inspect git status, diffs, branches, and prepare commits safely while preserving unrelated user changes.
Run, interpret, and fix MCUB debugger warnings and errors while preserving module behavior and build history.
Navigate and explain local MCUB documentation while routing module and API questions to the right sources and warning against Hikka assumptions.
Statically audit MCUB modules before release for safety, metadata, dependencies, commands, inline callbacks, and release readiness without editing code.
Route OpenAgent MCUB work across repo navigation, debugger fixes, module creation, release workflows, and skill registry management.
Validate, publish, index, commit, and push MCUB modules from debug builds into the MCUB module repository.
| name | MCUB-modules-creator |
| description | Create and update debug MCUB userbot modules in app-debug using the MCUB module API, class-style modules, and inline form/callback docs. |
| keywords | ["мoдyль","мoдyли","module","modules","app-debug","modules-debug","ModuleBase","inline","callback","command"] |
Use this skill when the user asks to create, edit, update, refactor, or debug an MCUB module.
@command(...) from core.lib.loader.module_base.@bot_command(...) only when the user explicitly needs a command handled by the auxiliary bot account.core.lib.loader.module_base and ModuleBase; Hikka-style from .. import utils, loader and loader.Module are not MCUB module style.Before implementing or updating a module, consult the relevant local docs:
API_DOC.mddoc/registration/class-style.mddoc/inline/inline-form.mddoc/inline/callbacks.mdAPI_DOC.md such as:
doc/guides/best-practices.mddoc/guides/module-structure.mddoc/api/module-config.mddoc/api/database.mddoc/api/errors.mdspeedtest-cli or another speed test library.dependencies list when appropriate;All debug modules created by this skill must live under:
app-debug/{module-name}/modules-debug-v{version}.py
Examples:
app-debug/Weather/modules-debug-v1.0.0.py
app-debug/Weather/modules-debug-v1.0.1.py
Rules:
modules_loaded/ unless the user explicitly asks.app-debug/{module-name}/ are build history and must be preserved.modules-debug-v{version}.pyversion = "{version}"1.0.0modules-debug-v*.py files and increment patch version, e.g. 1.0.0 → 1.0.1.Prefer class-style MCUB modules based on ModuleBase.
Minimal skeleton:
from __future__ import annotations
# Standard library
import time
# Third-party dependencies
from telethon import events
# SDK
import core.lib.loader.module_base as loader
import utils
import core.lib.loader.module_config as cfg
class ExampleModule(loader.ModuleBase):
name = "Example"
version = "1.0.0"
author = "by Example, model: {AI model}, total token: {tokens}. @Example"
description: dict[str, str] = {
"ru": "Oпиcaниe мoдyля",
"en": "Module description",
}
@loader.command("example", doc_ru="Пpимep", doc_en="Example")
async def cmd_example(self, event: events.NewMessage.Event) -> None:
await self.edit(event, "Example works!")
Author metadata rule for AI-created modules:
author to this format:author = "by {module_name}, model: {ai_model}, total token: {total_tokens}. @{module_name}"
{module_name} with the actual MCUB module name value.{ai_model} with the AI model name if known; otherwise use unknown.{total_tokens} with the total token count if known; otherwise use unknown.Separate imports into clear groups:
from __future__ import annotations
# Standard library
import asyncio
import time
from typing import Any
# Third-party dependencies
from telethon import events
# Optional external libraries, only when truly needed
import speedtest
# SDK
import core.lib.loader.module_base as loader
import utils
import core.lib.loader.module_config as cfg
Import rules:
# SDK comment.# SDK
import core.lib.loader.module_base as loader
import utils
import core.lib.loader.module_config as cfg
loader, e.g. loader.ModuleBase, @loader.command, @loader.callback.cfg only when module configuration is needed.from .. import utils, loader.Correct MCUB style:
# SDK
import core.lib.loader.module_base as loader
import utils
class ModulesMod(loader.ModuleBase):
name = "modules"
version = "1.0.0"
Incorrect Hikka style for this project:
# SDK
from .. import utils, loader
class ModulesMod(loader.Module):
strings = {"name": "modules"}
Never convert MCUB modules into Hikka modules. Never use loader.Module for MCUB class-style modules; use loader.ModuleBase.
Class-style requirements:
core.lib.loader.module_base / loader as needed:
ModuleBasecommandbot_commandownerpermissioncallbackwatcherloopeventmethodinline_tempon_install, uninstall if documented/available in the local docs.self.client for userbot Telethon client operations.self.db for persistent data.self.cache for temporary TTL-like data.self.log for logging.self.args(event), self.args_raw(event), and self.args_html(event) for command parsing when appropriate.self.answer, self.edit, or self.reply rather than raw event.edit when a robust helper is better.description and command docs (doc_ru, doc_en) when possible.strings for reusable user-facing text.on_load, not in __init__.on_load() and using @method, call:await super().on_load()
on_unload() and using @uninstall, call await super().on_unload().on_install() and using @on_install, call await super().on_install().on_unload.Important: in userbot mode, interactive inline buttons generally require an inline form message.
Prefer the class-style button factory where available:
buttons = [
[self.Button.inline("OK", self.handle_ok, ttl=300)],
[self.Button.url("GitHub", "https://github.com")],
]
await self.kernel.inline_form(event.chat_id, "Title", buttons=buttons)
For callbacks:
# SDK
import core.lib.loader.module_base as loader
@loader.callback(ttl=300)
async def handle_ok(self, event: events.CallbackQuery.Event) -> None:
await event.answer("OK")
Inline rules:
doc/inline/inline-form.md and doc/inline/callbacks.md.Before finishing a module:
app-debug/{module-name}/modules-debug-v{version}.py.name and version metadata match the requested module and file version.@command@bot_command# SDK imports.from .. import utils, loader, loader.Module).python -m py_compile app-debug/{module-name}/modules-debug-v{version}.py
python -m debugger.cli app-debug/{module-name}/modules-debug-v{version}.py
If the mcub-debugger console script is installed, this is also acceptable:
mcub-debugger app-debug/{module-name}/modules-debug-v{version}.py
Debugger rules:
When the user asks to update an existing MCUB module:
app-debug/{module-name}/.modules-debug-v{version}.py.python -m debugger.cli app-debug/{module-name}/modules-debug-v{version}.py and fix debugger errors before finishing.When the user asks to create a new MCUB module:
1.0.0 unless the user specifies another version.app-debug/{module-name}/modules-debug-v{version}.py.ModuleBase module.@command, not Bot API handlers.debugger/ via python -m debugger.cli app-debug/{module-name}/modules-debug-v{version}.py.from .. import utils, loader.loader.Module; use loader.ModuleBase.modules-debug-v*.py builds.app-debug/.