$npx -y skills add softspark/ai-toolkit --skill command-creatorCreates new Claude Code slash commands with frontmatter and validation. Triggers: new slash command, create command, command scaffold.
| 1 | # Command Creator |
| 2 | |
| 3 | $ARGUMENTS |
| 4 | |
| 5 | Create a new Claude Code slash command following ai-toolkit conventions. |
| 6 | |
| 7 | ## Workflow |
| 8 | |
| 9 | 1. **Capture intent** -- what should the command do and who invokes it? |
| 10 | 2. **Pick scope** -- project command, user command, or plugin command? |
| 11 | 3. **Define frontmatter** -- description, argument hint, allowed tools, model if needed |
| 12 | 4. **Write command body** -- instructions for Claude, not explanation for the user |
| 13 | 5. **Add validation context** -- expected output, constraints, follow-up checks |
| 14 | 6. **Test and iterate** -- invoke the command with representative arguments |
| 15 | |
| 16 | ## Command Locations |
| 17 | |
| 18 | - Project: `.claude/commands/<name>.md` |
| 19 | - User: `~/.claude/commands/<name>.md` |
| 20 | - Plugin: `plugin-name/commands/<name>.md` |
| 21 | |
| 22 | In `ai-toolkit`, command-development guidance belongs in skill form and any reusable command templates should live under `app/skills/<skill-name>/templates/` or KB docs. |
| 23 | |
| 24 | ## Frontmatter Template |
| 25 | |
| 26 | ```yaml |
| 27 | --- |
| 28 | description: "One-line help text shown in /help" |
| 29 | argument-hint: "[target]" |
| 30 | allowed-tools: Read, Grep, Bash |
| 31 | model: sonnet |
| 32 | --- |
| 33 | ``` |
| 34 | |
| 35 | ## Command Authoring Rules |
| 36 | |
| 37 | - Write commands as **instructions for Claude**, not marketing copy for the user |
| 38 | - Keep the first paragraph action-oriented and deterministic |
| 39 | - Use `$ARGUMENTS` early when the command takes user input |
| 40 | - Prefer numbered phases for multi-step workflows |
| 41 | - List required checks explicitly (`lint`, `tests`, `docs`, etc.) |
| 42 | - Avoid hidden assumptions about project structure unless the command is project-specific |
| 43 | - **Description ≥50 chars** with a trigger hint (`Use when…`) — short descriptions cause adjacent commands to fight for the same query |
| 44 | - Include **hard rules** (MUST / NEVER / CRITICAL) so the agent cannot improvise around safety boundaries |
| 45 | - Include **"When NOT to use"** naming 2-3 adjacent commands, to prevent over-triggering |
| 46 | |
| 47 | ## Minimal Template |
| 48 | |
| 49 | ```markdown |
| 50 | --- |
| 51 | description: "{Third-person description, min 50 chars, with trigger hint like 'Use when...'}" |
| 52 | argument-hint: "[arguments]" |
| 53 | allowed-tools: Read, Grep, Bash |
| 54 | --- |
| 55 | |
| 56 | # {Command Title} |
| 57 | |
| 58 | $ARGUMENTS |
| 59 | |
| 60 | Perform the requested task using this workflow: |
| 61 | |
| 62 | 1. Gather context from the repository. |
| 63 | 2. Ask clarifying questions if critical information is missing. |
| 64 | 3. Execute the task using the smallest safe set of changes. |
| 65 | 4. Validate the result. |
| 66 | 5. Summarize outcome and follow-up actions. |
| 67 | |
| 68 | ## Example |
| 69 | |
| 70 | \`\`\` |
| 71 | /{command} example-argument |
| 72 | \`\`\` |
| 73 | |
| 74 | ## Rules |
| 75 | |
| 76 | - **MUST** {non-negotiable rule} |
| 77 | - **NEVER** {forbidden action} |
| 78 | |
| 79 | ## Gotchas |
| 80 | |
| 81 | - {environment-specific trap — only if the command has one; omit the section otherwise} |
| 82 | |
| 83 | ## When NOT to Use |
| 84 | |
| 85 | - For {adjacent use case} -- use `/{other-command}` instead |
| 86 | - If {precondition} is not met |
| 87 | ``` |
| 88 | |
| 89 | Follow [Anthropic's Gotchas guidance](https://agentskills.io/skill-creation/best-practices.md#gotchas-sections): *"concrete corrections to mistakes the agent will make without being told otherwise"* — not general advice. Omit the section when no domain traps exist. |
| 90 | |
| 91 | ## Validation Checklist |
| 92 | |
| 93 | - [ ] Command file uses markdown and valid YAML frontmatter |
| 94 | - [ ] Description ≥50 chars, third-person, with trigger hint |
| 95 | - [ ] At least one concrete code-fenced example |
| 96 | - [ ] `## Rules` with MUST / NEVER / CRITICAL (prescriptive) |
| 97 | - [ ] `## Gotchas` when the command has real environment-specific traps (optional) |
| 98 | - [ ] `## When NOT to Use` section naming 2-3 adjacent commands |
| 99 | - [ ] Body is instruction-oriented, not user-facing prose |
| 100 | - [ ] `$ARGUMENTS` is present when arguments are expected |
| 101 | - [ ] Validation steps are explicit |
| 102 | - [ ] Command has been tested with at least one realistic invocation |