一键导入
new-command
Scaffold a new slash command in app/commands. Use when asked to add or create a slash command, a subcommand, or an autocomplete option.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new slash command in app/commands. Use when asked to add or create a slash command, a subcommand, or an autocomplete option.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scaffold a persistent button, modal, or select-menu handler in app/components. Use when asked to handle a component interaction by customId.
Scaffold a right-click context-menu command (on a user or message) in app/context. Use when asked to add a context-menu or right-click command.
Scaffold a gateway event handler in app/events. Use when asked to react to a Discord event like GuildMemberAdd, MessageCreate, or Ready.
Scaffold a new text (prefix) command in app/prefixes, e.g. ".ping". Use when asked to add a message-based or prefix command.
Scaffold an HTTP API route in app/routes on the Elysia server. Use when asked to add an HTTP endpoint, REST route, or webhook receiver.
Scaffold a scheduled task (cron or interval) in app/tasks. Use when asked to run something periodically, on a timer, or on a schedule.
| name | new-command |
| description | Scaffold a new slash command in app/commands. Use when asked to add or create a slash command, a subcommand, or an autocomplete option. |
.agents/context.md (Commands section) and .agents/agents.md if not already loaded.app/commands/<group>/<name>.ts (group folders only organize files; the URL-facing name comes from the builder).BaseCommand, decorated with @Command, with a SlashCommandBuilder on data and an execute(context) method.import { SlashCommandBuilder } from "discord.js";
import { Command, BaseCommand, CommandContext } from "engine";
@Command({ cooldown: 5, guilds: ["*"] })
export default class Ping extends BaseCommand {
data = new SlashCommandBuilder().setName("ping").setDescription("Replies with Pong!");
async execute(context: CommandContext) {
await context.interaction.reply("Pong!");
}
}
cooldown in seconds, cooldown_scope of "user" (default), "guild", "channel", or "global".guilds: array of guild ids, or ["*"] for global. Omitted options fall back to config.commands.guards: [owner_only, in_guild, dm_only, nsfw_only, has_perms(...), bot_has_perms(...)] or custom (context) => true | string functions, imported from "engine".subcommands field ({ "name": handler, "group/name": handler }) and call this.run_subcommands(context) from execute. Never write a hand-rolled switch on subcommand names..setAutocomplete(true) on the option and implement an optional autocomplete(interaction) method; dispatch routes it automatically.globals field, read via context.globals.InteractionCreate router; engine/dispatch.ts owns routing.helpers/embeds, helpers/pagination, helpers/dialog, helpers/form, or engine/ui (Components V2) over hand-built payloads.Run bun run typecheck and bun run lint. Remind the user to run bun run deploy so Discord picks up the new command.