agentleFS
DevRohit06DevRohit06/discli/skills/discord-slash-commands/SKILL.md

discord-slash-commands

Skill35 starsChanged 9 months agoMITView on GitHub

Generate Discord slash command definitions for discli. Creates the JSON file used by `discli serve --slash-commands`. Supports string, integer, number, boolean params with descriptions and optional flags.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user wants to:

    line 12
  2. Distinctive:

    Create slash commands for their Discord bot

    line 13
  3. Distinctive:

    Add new commands to an existing slash commands file

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Discord Slash Command Generator

Generate slash command JSON definitions for use with discli serve --slash-commands commands.json.

When to Use

Use this skill when the user wants to:

  • Create slash commands for their Discord bot
  • Generate the JSON file for discli serve --slash-commands
  • Add new commands to an existing slash commands file
  • Understand the slash command format

JSON Format

[
  {
    "name": "command-name",
    "description": "What this command does (shown in Discord UI)",
    "params": [
      {
        "name": "param_name",
        "type": "string",
        "description": "Shown as placeholder text",
        "required": true
      }
    ]
  }
]

Rules

  • name: lowercase, no spaces, max 32 chars. Use hyphens: my-command
  • description: max 100 chars. Shown in Discord's command picker
  • params: optional array. Each param has name, type, description
  • type: one of string, integer, number, boolean
  • required: defaults to true. Set false for optional params
  • Max 25 commands per bot, max 25 params per command

Common Patterns

Simple command (no params)

{"name": "ping", "description": "Check if the bot is alive"}

Single required param

{"name": "ask", "description": "Ask the bot a question", "params": [
  {"name": "question", "type": "string", "description": "Your question"}
]}

Multiple params, some optional

{"name": "remind", "description": "Set a reminder", "params": [
  {"name": "message", "type": "string", "description": "What to remind you about"},
  {"name": "minutes", "type": "integer", "description": "Minutes from now", "required": false}
]}

Boolean flag

{"name": "search", "description": "Search messages", "params": [
  {"name": "query", "type": "string", "description": "Search terms"},
  {"name": "include-bots", "type": "boolean", "description": "Include bot messages", "required": false}
]}

Example: Full Bot Command Set

[
  {"name": "help", "description": "Show available commands"},
  {"name": "ask", "description": "Ask the AI a question", "params": [
    {"name": "question", "type": "string", "description": "Your question"}
  ]},
  {"name": "summarize", "description": "Summarize recent conversation", "params": [
    {"name": "messages", "type": "integer", "description": "Number of messages to summarize", "required": false}
  ]},
  {"name": "translate", "description": "Translate text", "params": [
    {"name": "text", "type": "string", "description": "Text to translate"},
    {"name": "language", "type": "string", "description": "Target language"}
  ]},
  {"name": "poll", "description": "Create a quick poll", "params": [
    {"name": "question", "type": "string", "description": "Poll question"},
    {"name": "option1", "type": "string", "description": "First option"},
    {"name": "option2", "type": "string", "description": "Second option"},
    {"name": "option3", "type": "string", "description": "Third option (optional)", "required": false}
  ]},
  {"name": "config", "description": "Configure bot settings", "params": [
    {"name": "setting", "type": "string", "description": "Setting name"},
    {"name": "value", "type": "string", "description": "New value", "required": false}
  ]},
  {"name": "stats", "description": "Show server statistics"},
  {"name": "clear", "description": "Clear conversation history"}
]

Handling in Python

async def on_slash_command(event: dict, send) -> None:
    command = event["command"]
    args = event.get("args", {})
    token = event["interaction_token"]

    if command == "ask":
        question = args.get("question", "")
        # ... process question ...
        await send("interaction_followup", interaction_token=token, content=answer)

    elif command == "help":
        await send("interaction_followup", interaction_token=token,
                    content="Available commands: /ask, /help, /stats")

Usage

Save the JSON to a file, then:

discli serve --slash-commands commands.json

Commands sync to all servers on bot startup. The slash_commands_synced event confirms completion.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.