Kilocode Mode Creator
Create custom modes for Kilocode with proper structure and validation.
Argument Parsing
Parse arguments to detect:
-aflag: Auto mode (no questions, generate based on description)- Everything else: Mode description/requirements
Workflow
If -a flag is present (Auto Mode)
Generate the mode immediately based on the description provided. Infer all fields intelligently:
- Parse the description to extract mode purpose
- Generate all required fields:
slug: kebab-case identifier derived from namename: Display name with appropriate emojidescription: Short summaryroleDefinition: Detailed role descriptiongroups: Appropriate tool access based on mode purpose
- Add optional fields if relevant:
whenToUse: If the mode has specific trigger conditionscustomInstructions: If special behaviors are needed
- Output the YAML configuration
If -a flag is NOT present (Interactive Mode)
Ask clarifying questions for anything not specified. Questions to consider:
- Mode purpose: What should this mode do? What's its specialty?
- Name and emoji: What should it be called? Any preferred emoji?
- Tool access: Which capabilities does it need?
read- Read filesedit- Edit files (can restrict with fileRegex)browser- Web browsingcommand- Run commandsmcp- MCP tools
- File restrictions: Should editing be limited to specific file types?
- Behavior guidelines: Any specific instructions or personality traits?
Ask only about what's missing or unclear. Don't ask about things already specified.
Output Format
Generate YAML format for .kilocodemodes (project) or custom_modes.yaml (global):
customModes:
- slug: mode-slug
name: "Emoji Mode Name"
description: Short description for mode selector
roleDefinition: |
Detailed description of the mode's role, expertise, and personality.
Can be multiple lines for comprehensive role definition.
groups:
- read
- [edit, {fileRegex: '\\.ext$', description: "File type restriction"}]
- browser
- command
- mcp
whenToUse: Optional guidance for automated mode selection
customInstructions: |
Optional additional behavioral guidelines.
Validation Rules
- slug: Only letters, numbers, hyphens. Must be unique.
- fileRegex in YAML: Single backslash (
\.md$) - fileRegex in JSON: Double backslash (
\\.md$)
Reference
See references/mode-schema.md for complete field documentation and examples.