Agent skill
command-registry-integration
Install this agent skill to your Project
npx add-skill https://github.com/aAAaqwq/AGI-Super-Team/tree/master/skills/command-registry-integration
SKILL.md
command-registry-integration
Integrate a new chat command into OpenClaw’s formal command registry and command handling chain so it appears in /commands, supports native slash registration where applicable, and avoids brittle text-intercept hacks.
Use this when
- You need a real built-in chat command such as
/foo - The command must appear in
/commands - The command should ride the formal command detection / registry / handler path
- You want the smallest-source-change path for adding a command
Do NOT use this when
- A plugin command is enough and you do not need a built-in source command
- A skill command (
/skill name) already solves the problem - You are trying to intercept plain text with ad-hoc regexes outside the command pipeline
Source map: where to look first
src/auto-reply/commands-registry.data.ts- Source of truth for built-in command registry entries
- Controls
/commandsvisibility and native command metadata
src/auto-reply/commands-registry.ts- Detection, normalization, arg parsing, native spec export
src/auto-reply/reply/commands-core.ts- Main built-in handler chain
src/auto-reply/reply/commands-*.ts- Concrete handlers; add the new command here
src/auto-reply/status.ts/commandsand/helprendering tests depend on registry descriptions
- Tests:
src/auto-reply/commands-registry.test.tssrc/auto-reply/reply/commands.test.tssrc/auto-reply/status.test.ts
Minimal integration path
1) Add registry entry
In commands-registry.data.ts, add a defineChatCommand({...}) entry with:
keynativeNamedescriptiontextAliasortextAliasescategoryargs/argsParsing/acceptsArgsonly if needed
This is what makes the command:
- detectable from text
- eligible for native slash export
- visible in
/commands
2) Implement a focused handler
Create src/auto-reply/reply/commands-<name>.ts.
Typical shape:
- early return if text commands disabled
- early return if normalized command doesn’t match
/name - auth gate via
rejectUnauthorizedCommand(...)if needed - parse args minimally
- return
{ shouldContinue: false, reply: { text } }
Prefer bridging to existing logic over reimplementation.
Examples:
- shell out to an existing Python/CLI script with
execFile - call an existing library/service helper
- keep formatting logic close to existing implementation if already standardized elsewhere
3) Wire into the command chain
In commands-core.ts:
- import the handler
- insert it into
HANDLERS
Keep ordering intentional:
- before generic fallthrough
- near related info/status/tool handlers
4) Add minimal regression tests
At minimum cover:
- registry/list visibility (
/commandsrendering contains the command) - handler routing (
/foo ...reaches your handler and parses args as expected)
Good minimal test pattern:
- mock
node:child_processif bridging to CLI/Python - call
handleCommands(buildCommandTestParams(...)) - assert invoked argv + reply text
Acceptance checklist
-
commands-registry.data.tscontains the new command entry -
/commandsoutput includes the command - text command detection works
- native name is set if native slash export is desired
- handler is connected in
commands-core.ts - auth gating is correct
- args route correctly
- tests cover registry visibility and execution path
- no duplicate business logic if an existing script/helper already exists
Common pitfalls
1) Added handler, forgot registry entry
Result: command may work only in ad-hoc paths, but won’t appear in /commands or native registration.
2) Added registry entry, forgot handler
Result: command is detected and listed but falls through to agent flow.
3) Wrong scope / nativeName
If you want native slash command support, do not leave it text-only by accident.
4) Re-implementing existing business logic
If a Python/CLI script already exists, bridge to it first. Reimplementation increases drift.
5) Missing tests for descriptions
/commands assertions often depend on exact description strings from the registry.
6) Ad-hoc regex interception
Do not bolt text interception onto unrelated stages. Use the command registry + handler chain.
Recommended implementation pattern
For existing external logic (best for MVP):
- registry entry
- handler file
execFilebridge to existing script- test mocked subprocess call
For pure in-repo logic:
- registry entry
- handler file
- call existing TS helper/service
- test reply payload
Verification commands
From the repo root, usually:
pnpm vitest run src/auto-reply/commands-registry.test.ts src/auto-reply/reply/commands.test.ts src/auto-reply/status.test.ts
Or project standard test runner if customized in package.json.
Deliverable template
When done, report:
- files changed
- command execution chain
- how to verify
- any blockers / follow-ups
Example outputs to mention
/commandsnow shows/yourcommand/yourcommand --jsonroutes to existing implementation- native slash metadata exported via
nativeName
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
model-fallback
模型自动降级与故障切换。当主模型请求失败、超时、达到速率限制或配额耗尽时,自动切换到备用模型,确保服务连续性。支持多供应商、多优先级的智能模型选择,提供健康监控、自动重试和错误恢复机制。
multimodal-gen
多模态内容生成(图片、视频)。当用户需要生成图片、生成图像、生成视频、AI绘画、AI作图、画一张图、做个视频、文生图、文生视频时使用此技能。自动调用 multimodal-agent 进行生成。
auth-manager
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
github-automation
自动化 GitHub 操作。当用户需要推送代码到 GitHub、管理仓库、创建 PR、处理 Issue、git push 失败时使用此技能。优先使用 mcporter call github.push_files 而不是 git push。
geo-agent
Automated GEO (Generative Engine Optimization) agent for boosting brand visibility in AI search engines. Manages keywords, researches real competitors, generates comparison articles with target brand prominence, auto-publishes to Chinese content platforms (Zhihu/Baijiahao/Sohu/Toutiao), monitors AI search engine indexing, and reports results. Use when: user wants GEO automation, AI search optimization, multi-platform article publishing, or brand visibility in AI answers.
token-reporter
每日自动统计 OpenClaw 实例 Token 消耗和工作产出,上报到飞书多维表格。扫描 JSONL 日志按模型聚合 token,收集各 agent 当日工作摘要,写入飞书 Bitable。触发:'token报告'、'token report'、'日报'、'每日汇报'、'飞书上报'。
Didn't find tool you were looking for?