Discordlancer's discord.js conventions - adding a command, the command gate (owner-only, project channel, client, stage), replies and deferring, user-facing errors, channel permissions, invites and join tracking, and testing in the real server. Use whenever work touches src/discord/, a slash command, a button, channel or invite handling, or the bot's wording, even if the user only says "add a command", "the bot says", "the channel" or "the invite".
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
discord.js 14.27, a gateway bot on one server (DISCORD_GUILD_ID). For library details, check the discord.js guide and API docs through Context7 before relying on memory. Read typescript-node and surreal-data first.
src/discord/commands/<name>.ts exporting a Command (see src/discord/command.ts):
access: everyone or owner.where: anywhere or project.stages: optional; the command works only at these stages.definition: built with SlashCommandBuilder.execute(run): does the work.COMMANDS in src/discord/commands/index.ts. It's registered on our server at startup, or with npm run commands:register.helpText lists it at the right stages.src/discord/client.ts)Before execute runs, checkGate refuses, with a private reply and a refused event:
Then execute runs. The handler records command.<name> with outcome ok, refused or failed. Only commands with where: 'project' are filed under the channel's project, because a command that works anywhere may be about another project.
interaction.deferReply() first, then editReply.flags: MessageFlags.Ephemeral; the old ephemeral: true is deprecated) for anything only the caller needs. Use public replies for results both people should see, like /add-github or /cancel.UserError with a plain, honest message for anything the person can act on. It's shown as is and recorded as refused. Never put secrets or internal details in it.failed. safeReply handles a deferred interaction too.GitHubError are turned into UserError in the command.src/discord/texts.ts: STAGE_LABEL, NEXT_STEP, welcomeText. Keep it short and plain.src/discord/channels.ts)Projects category. They're hidden from @everyone and visible to the bot and Boran. Each client gets a member-specific overwrite.owner-desk, for notices such as unmatched joins.src/discord/joins.ts)created whose invite has just disappeared, and hadn't expired, is the one. The database is the source of truth, so this survives restarts. If none or several match, Boran is told in owner-desk and uses /link-client./new-project deletes the old one, and so does cancelling a project that is still waiting for its client.checkGate, helpText, matchJoin, projectCard, texts. Use fakes for services, like createGitHub(env, { fetch }).dl-test-*, and list what was created so Boran can clean up.TODO.md.boranfurkan/discordlancer
6bd7b62
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.