Command registry integration

From aAAaqwq/AGI-Super-Team · View interactive version

Command registry integration is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Integrate new chat commands into OpenClaw's formal command registry

How to use this skill

Skill file

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

Do NOT use this when

Source map: where to look first

  1. src/auto-reply/commands-registry.data.ts
  1. src/auto-reply/commands-registry.ts
  1. src/auto-reply/reply/commands-core.ts
  1. src/auto-reply/reply/commands-*.ts
  1. src/auto-reply/status.ts
  1. Tests:

Minimal integration path

1) Add registry entry

In commands-registry.data.ts, add a defineChatCommand({...}) entry with:

This is what makes the command:

2) Implement a focused handler

Create src/auto-reply/reply/commands-<name>.ts.

Typical shape:

Prefer bridging to existing logic over reimplementation.

Examples:

3) Wire into the command chain

In commands-core.ts:

Keep ordering intentional:

4) Add minimal regression tests

At minimum cover:

Good minimal test pattern:

Acceptance checklist

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):

  1. registry entry
  2. handler file
  3. execFile bridge to existing script
  4. test mocked subprocess call

For pure in-repo logic:

  1. registry entry
  2. handler file
  3. call existing TS helper/service
  4. 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:

Example outputs to mention

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.