HypDiscordGOD
Overview
Use this skill to turn Discord bot requests into shippable systems with clean architecture, minimal privileged intents, clear configuration, and production-ready command, API, worker, and dashboard structure.
Prefer acting over theorizing: if the repository exists, inspect it and implement directly; if no project exists, scaffold a minimal runnable system immediately.
Default to modern Discord patterns:
- - Prefer slash commands over legacy prefix commands unless the user asks otherwise.
- Prefer
discord.js for Node/TypeScript projects and discord.py for Python projects unless the repo already uses another library. - Keep tokens and secrets in environment variables; never hardcode them.
- Request only the intents and permissions the feature actually needs.
Workflow
- 1. Inspect the repository and detect the stack.
- Decide whether this is:
- a new bot,
- a new feature in an existing bot,
- a refactor/migration,
- a dashboard/API integration task,
- a webhook integration task,
- a worker/queue task,
- a moderation dashboard task,
- a mono-repo starter task,
- or a debugging task.
- 3. Confirm the runtime, package manager, storage model, and bot library already in use.
- Implement the smallest clean change that satisfies the request.
- Add or update configuration examples, command registration, startup instructions, API route notes, auth notes, and worker notes if needed.
- Validate with available tests, type checks, or a dry run when possible.
- If creating a new bot or companion service from scratch, prefer bundled scaffolds and templates before hand-rolling files.
Core Rules
- - Match the existing repository style when one already exists.
- Prefer least privilege for intents, permissions, routes, and secrets.
- Keep Discord snowflakes as strings in JavaScript/TypeScript systems.
- Separate bot runtime, HTTP API, dashboard frontend, and worker concerns when complexity justifies it.
- Treat in-memory sessions as development-grade unless explicitly hardened.
- Call out production gaps clearly: CSRF, durable sessions, refresh token storage, HTTPS, audit logging, and permission enforcement.
Mono-repo Systems
For bot + API + dashboard + worker systems:
- - separate apps clearly
- share schema, config, and type helpers through packages or documented conventions
- leave behind runnable service start points and compose orchestration when possible
- prefer wiring the mono-repo starter to real bundled patterns instead of leaving empty placeholders
- when asked for a full transplant or deep merge, align monorepo app shapes with the richer bundled starters so another agent can upgrade them in place without re-scaffolding
Output Expectations
When completing Discord bot work:
- - Modify the existing project instead of inventing a parallel architecture.
- Include any required environment variables.
- Mention command registration steps if commands changed.
- Mention portal-side steps if intents or permissions must be enabled.
- Keep examples realistic and directly runnable.
- When adding persistence, define schema shape or migration expectations.
- When adding deployment, leave behind runnable deploy artifacts if appropriate.
- When adding transcript support, mention limitations around embeds, edited/deleted messages, and retention unless fully handled.
- When adding dashboard/API integration, identify which auth parts are development-grade versus production-ready.
- When adding OAuth, mention redirect URI requirements, secure session storage expectations, refresh-token handling expectations, and logout behavior.
- When adding queue/worker patterns, explain the responsibility split between API, worker, and bot.
- When adding Prisma or Drizzle, include enough starter assets that another agent can actually use them without rebuilding from scratch.
- When preparing for public release, keep wording generic, remove private assumptions, and ensure the packaged skill stands on its own.
Bundled Assets
Use these when they save time:
- -
assets/discord-js-ts-template/ for a modern slash-command bot starter. - INLINECODE3 for a Bun-oriented starter.
- INLINECODE4 for a SQLite-backed ticket bot with claim, archive/reopen, and transcript support.
- INLINECODE5 for an Express + SQLite companion API starter with OAuth starter auth, guild permission checks, real OAuth guild listing, logout/session handling, CSRF protection, webhook route, shared guild-config access, and queue/worker patterns.
- INLINECODE6 for a React/Vite dashboard frontend starter with multi-guild UX.
- INLINECODE7 for a moderation dashboard API starter with audit logging.
- INLINECODE8 for a Prisma + Postgres starter with guild config and ticket schema.
- INLINECODE9 for a Drizzle + Postgres starter with guild config and ticket schema.
- INLINECODE10 for a multi-service layout starter combining bot, API, dashboard, worker, env template, and Docker Compose.
- INLINECODE11 for basic container deployment artifacts.
References
Read these only if needed:
- - INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
- INLINECODE24
- INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28
HypDiscordGOD
概述
使用此技能将Discord机器人请求转化为可交付的系统,具备清晰的架构、最小化特权意图、明确的配置,以及可用于生产的命令、API、工作进程和仪表盘结构。
优先行动而非理论:如果仓库已存在,直接检查并实现;如果项目不存在,立即搭建一个最小可运行系统。
默认采用现代Discord模式:
- - 除非用户另有要求,优先使用斜杠命令而非传统前缀命令。
- 对于Node/TypeScript项目优先使用discord.js,对于Python项目优先使用discord.py,除非仓库已使用其他库。
- 将令牌和密钥保存在环境变量中,切勿硬编码。
- 仅请求功能实际需要的意图和权限。
工作流程
- 1. 检查仓库并检测技术栈。
- 确定任务类型:
- 新机器人
- 现有机器人的新功能
- 重构/迁移
- 仪表盘/API集成任务
- Webhook集成任务
- 工作进程/队列任务
- 管理仪表盘任务
- 单体仓库启动任务
- 调试任务
- 3. 确认已使用的运行时、包管理器、存储模型和机器人库。
- 实施满足请求的最小干净变更。
- 根据需要添加或更新配置示例、命令注册、启动说明、API路由说明、认证说明和工作进程说明。
- 尽可能通过可用测试、类型检查或空运行进行验证。
- 如果从头创建新机器人或配套服务,优先使用捆绑的脚手架和模板,而非手动创建文件。
核心规则
- - 当现有仓库存在时,匹配其代码风格。
- 对意图、权限、路由和密钥采用最小特权原则。
- 在JavaScript/TypeScript系统中将Discord雪花ID保持为字符串。
- 当复杂度需要时,分离机器人运行时、HTTP API、仪表盘前端和工作进程的关注点。
- 除非明确强化,否则将内存会话视为开发级。
- 明确指出生产环境缺口:CSRF、持久化会话、刷新令牌存储、HTTPS、审计日志和权限执行。
单体仓库系统
对于机器人+API+仪表盘+工作进程系统:
- - 清晰分离应用
- 通过包或文档化约定共享模式、配置和类型辅助工具
- 尽可能保留可运行的服务启动点和编排组合
- 优先将单体仓库启动器连接到真实的捆绑模式,而非留下空占位符
- 当需要完整移植或深度合并时,使单体仓库应用结构与更丰富的捆绑启动器对齐,以便其他代理无需重新搭建即可就地升级
输出期望
完成Discord机器人工作时:
- - 修改现有项目而非发明并行架构。
- 包含所有必需的环境变量。
- 如果命令发生变化,说明命令注册步骤。
- 如果必须启用意图或权限,说明门户端步骤。
- 保持示例真实且可直接运行。
- 添加持久化时,定义模式结构或迁移期望。
- 添加部署时,适当保留可运行的部署产物。
- 添加转录支持时,除非完全处理,否则说明嵌入、编辑/删除消息和保留的限制。
- 添加仪表盘/API集成时,识别哪些认证部分是开发级,哪些是生产就绪。
- 添加OAuth时,说明重定向URI要求、安全会话存储期望、刷新令牌处理期望和登出行为。
- 添加队列/工作进程模式时,解释API、工作进程和机器人之间的职责划分。
- 添加Prisma或Drizzle时,包含足够的启动资产,以便其他代理无需从头重建即可实际使用。
- 准备公开发布时,保持措辞通用,移除私有假设,确保打包的技能独立可用。
捆绑资产
在节省时间时使用这些:
- - assets/discord-js-ts-template/ 用于现代斜杠命令机器人启动器。
- assets/bun-template/ 用于Bun导向的启动器。
- assets/ticket-bot-starter/ 用于基于SQLite的工单机器人,支持认领、归档/重新打开和转录。
- assets/dashboard-api-starter/ 用于Express + SQLite配套API启动器,包含OAuth启动认证、公会权限检查、真实OAuth公会列表、登出/会话处理、CSRF保护、Webhook路由、共享公会配置访问和队列/工作进程模式。
- assets/dashboard-frontend-starter/ 用于React/Vite仪表盘前端启动器,支持多公会用户体验。
- assets/moderation-dashboard-starter/ 用于管理仪表盘API启动器,包含审计日志。
- assets/prisma-starter/ 用于Prisma + Postgres启动器,包含公会配置和工单模式。
- assets/drizzle-starter/ 用于Drizzle + Postgres启动器,包含公会配置和工单模式。
- assets/monorepo-starter/ 用于多服务布局启动器,组合机器人、API、仪表盘、工作进程、环境模板和Docker Compose。
- assets/docker/ 用于基本容器部署产物。
参考资料
仅在需要时阅读:
- - references/discord-bot-planning.md
- references/discord-js-patterns.md
- references/discord-py-patterns.md
- references/persistence-patterns.md
- references/postgres-prisma-drizzle-patterns.md
- references/deployment-patterns.md
- references/dashboard-api-patterns.md
- references/oauth-dashboard-patterns.md
- references/csrf-session-patterns.md
- references/webhook-patterns.md
- references/worker-queue-patterns.md
- references/moderation-dashboard-patterns.md
- references/monorepo-starter-patterns.md
- references/ticket-system-patterns.md
- references/ticket-advanced-patterns.md
- references/ticket-bot-starter-notes.md
- references/troubleshooting.md