Generates new Claude Code custom slash command prompts following the established template structure...
This skill generates well-structured custom slash commands for Claude Code. These commands are stored in .claude/commands/*.md and can be invoked with /command-name. This skill focuses exclusively on creating slash commands, not system or user prompts.
Custom slash commands are Markdown files that:
.claude/commands/ (project-level) or ~/.claude/commands/ (personal)/command-name$1, $2, $ARGUMENTS@filename!command (requires allowed-tools frontmatter)Every slash command has 6 core sections:
The Purpose section provides a 1-3 sentence overview of what the slash command does. It should be clear, concise, and answer: "What problem does this command solve?"
✅ Do:
❌ Don't:
# Purpose
Generate a concise engineering implementation plan based on user requirements and relevant documentation, then save it to the specs directory for future reference.
# Purpose
Analyze code files for common security vulnerabilities including SQL injection, XSS, insecure dependencies, and authentication issues. Provides detailed findings with remediation suggestions.
# Purpose
Create and command an agent to accomplish a small task then delete the agent when the task is complete.
# Purpose
This command does stuff with files. It's useful for when you need to work on things.
Too vague - doesn't explain what it actually does
# Purpose
This command first reads all the files in the directory, then it parses them using the Read tool, after that it analyzes the content by looking for specific patterns, then it generates a report with all the findings, and finally it saves everything to a file in the output directory with proper formatting and structure.
Too detailed - this belongs in Workflow section
The Variables section defines all dynamic and static values used throughout the command. This creates a clear contract for what inputs the command expects and what constants it uses.
Variables that come from user input when invoking the command:
$1 - First argument$2 - Second argument$3 - Third argument (and so on...)$ARGUMENTS - All arguments as a single stringFixed values used within the command:
MAX_RESULTS: 50)OUTPUT_DIR: "specs")SLEEP_INTERVAL: 10 seconds)DATE_FORMAT: "YYYY-MM-DD")✅ Do:
VAR1, VAR2)❌ Don't:
## Variables
FILE_PATH: $1
## Variables
USER_PROMPT: $1
DOCUMENTATION_URLS: $2
OUTPUT_FORMAT: $3
## Variables
PROBLEM_DESCRIPTION: $1
SLEEP_INTERVAL: 10 seconds
MAX_RETRIES: 3
OUTPUT_DIR: "specs"
## Variables
# Dynamic variables (from user input)
REPOSITORY_URL: $1
BRANCH_NAME: $2
COMMIT_MESSAGE: $3
# Static configuration
MAX_FILE_SIZE: 1000000 # 1MB in bytes
ALLOWED_EXTENSIONS: [".py", ".js", ".ts", ".go"]
DEFAULT_BRANCH: "main"
TIMEOUT_SECONDS: 300
## Variables
None (uses current working directory)
# Static configuration
OUTPUT_FILE: "codebase-analysis.md"
MAX_DEPTH: 3
The Codebase Structure section describes relevant project organization that helps Claude understand where to find or place files. This section is OPTIONAL - only include it when the command needs to work with specific directory structures.
✅ Include when:
❌ Skip when:
✅ Do:
❌ Don't:
## Codebase Structure
project/ ├── specs/ # Implementation plans and specifications ├── src/ # Source code └── tests/ # Test files
## Codebase Structure
apps/orchestrator_3_stream/ ├── backend/ │ ├── main.py # FastAPI server entry point │ ├── modules/ │ │ ├── database.py # Database operations │ │ ├── agent_manager.py # Agent lifecycle management │ │ └── websocket_manager.py # Real-time event broadcasting │ └── prompts/ # Agent system prompts └── frontend/ └── src/ ├── components/ # Vue components └── stores/ # Pinia state management
## Codebase Structure
apps/ ├── orchestrator_db/ # Central database schema │ ├── models.py # Pydantic models (source of truth) │ └── migrations/ # SQL migration files ├── orchestrator_1_term/ # CLI orchestrator └── orchestrator_3_stream/# Web UI orchestrator
## Codebase Structure
(This section intentionally omitted - command works on any file structure)
Or simply don't include the section at all.
The Instructions section provides detailed rules, constraints, and guidelines that Claude must follow when executing the command. This is where you define the "guardrails" for the task.
How to know when the task is complete
What NOT to do, limitations, boundaries
Code quality, formatting, best practices
Special scenarios to handle
Which tools to use and how
How to handle failures
✅ Do:
❌ Don't:
## Instructions
- Focus on security-critical issues only
- Identify specific line numbers for each issue
- Categorize by severity: Critical, High, Medium, Low
- Provide remediation suggestions with code examples
- Do NOT modify code, only analyze and report
## Instructions
- You can know a task is completed when you see an `agent_logs` from `check_agent_status` that has a `response` event_category followed by a `hook` with a `Stop` event_type
- Run this workflow for BOTH agents in sequence - complete the scout phase entirely before starting the build phase
- The scout agent provides READ-ONLY analysis - the build agent performs actual implementation
- Do NOT delete agents after completion - leave them for inspection and debugging
- Pass the scout's findings to the build agent as context for implementation
- If interrupted with an additional task, return to your sleep + check loop after completing the interruption
## Instructions
- Use git commands ONLY - no file modifications
- All bash commands must use the Bash tool with git prefix
- Show maximum 20 commits to avoid overwhelming output
- Include commit hash, author, date, and message in output
- Do NOT run git commands that modify history (rebase, reset, etc.)
- Handle missing files gracefully - report if file not found in git
## Instructions
- Generate production-quality code with proper error handling
- Include comprehensive type annotations/hints
- Add detailed documentation (comments, docstrings)
- Follow existing code style and conventions in the project
- Ensure all imports and dependencies are correctly declared
- Do NOT use placeholder code or TODOs
- Verify implementation with type checks and linters
The Workflow section provides step-by-step numbered actions that Claude must execute to accomplish the command's goal. This is the "recipe" for task completion.
Each workflow should:
✅ Do:
FILE_PATH, USER_PROMPT)Report section to report the completed work"❌ Don't:
## Workflow
1. Read the file at FILE_PATH using the Read tool
2. Analyze for security vulnerabilities:
- SQL injection risks
- Cross-site scripting (XSS)
- Insecure authentication
- Hardcoded secrets
- Dependency vulnerabilities
3. Categorize findings by severity
4. Generate remediation suggestions
5. Now follow the `Report` section to report the completed work
## Workflow
### Phase 1: Scout (Analysis)
1. **(Create Scout)** Run `create_agent` to create a scout agent using the `scout-report-suggest-fast` subagent_template based on PROBLEM_DESCRIPTION
- Name the agent something descriptive like "scout-{problem-keyword}"
2. **(Command Scout)** Run `command_agent` to command the scout agent to investigate PROBLEM_DESCRIPTION
- Instruct the agent to provide a detailed scout report with findings
3. **(Check Scout)** The scout agent will work in the background:
- Use `Bash(sleep ${SLEEP_INTERVAL})`
- Every SLEEP_INTERVAL seconds run `check_agent_status`
- Continue until you see a `response` event_category followed by a `hook` with a `Stop` event_type
4. **(Report Scout)** Retrieve and analyze the scout's findings
- Extract key information: affected files, root causes, suggested resolutions
### Phase 2: Build (Implementation)
5. **(Create Build Agent)** Run `create_agent` to create a build agent using the `build-agent` subagent_template
6. **(Command Build Agent)** Run `command_agent` with the scout's findings
7. **(Check Build Agent)** Monitor the build agent with sleep + check loop
8. **(Report Build)** Report the implementation results
9. Now follow the `Report` section to report the completed work
## Workflow
1. Use Glob to find all Python files in the current directory: `**/*.py`
2. For each file found:
- Read the file using the Read tool
- Check for `TODO` or `FIXME` comments
- If found, record the file path and line number
3. If no TODOs found in any files:
- Report "No TODOs found in codebase"
- Skip to Report section
4. If TODOs found:
- Categorize by type (TODO, FIXME, HACK, etc.)
- Group by file
- Count total occurrences
5. Now follow the `Report` section to report the completed work
## Workflow
1. Parse the USER_PROMPT to understand requirements
2. For each URL in DOCUMENTATION_URLS:
- Use WebFetch to retrieve documentation
- Extract relevant sections for implementation
- Note any code examples or patterns
3. Use Glob to find similar implementations in codebase: `**/*{keyword}*`
4. Read 2-3 example files to understand existing patterns
5. Create implementation plan with these sections:
- **Overview**: Brief summary of what needs to be built
- **Requirements**: Parsed user requirements
- **Technical Approach**: Architecture decisions
- **Implementation Steps**: Numbered actions
- **Files to Modify**: List of files and changes
- **Testing Strategy**: Verification approach
6. Generate descriptive filename from USER_PROMPT
7. Save plan to `specs/[filename].md` using Write tool
8. Now follow the `Report` section to report the completed work
The Report section defines the exact output format that Claude should present to the user after completing the workflow. This ensures consistent, well-structured results.
The Report section:
✅ Do:
[filename], [count])❌ Don't:
## Report
Present findings in this format:
## Security Review: [filename]
**Total issues found**: [count]
**Severity breakdown**: Critical: [count], High: [count], Medium: [count], Low: [count]
**Files analyzed**: [count]
**Scan duration**: [time]
## Report
Present findings in this format:
## Security Review: [filename]
### Summary
- Total issues found: [count]
- Critical: [count]
- High: [count]
- Medium: [count]
- Low: [count]
### Findings
#### [Severity] - [Issue Type]
**Location**: Line [number]
**Code**:
\`\`\`[language]
[vulnerable code]
\`\`\`
**Issue**: [Description of the vulnerability]
**Remediation**:
\`\`\`[language]
[fixed code]
\`\`\`
**Explanation**: [Why this fix works]
[Repeat for each finding]
## Report
Present the history in this format:
## Git History: [filename]
| Commit | Author | Date | Message |
| ------ | ------ | ------ | --------- |
| [hash] | [name] | [date] | [message] |
| [hash] | [name] | [date] | [message] |
**Total commits shown**: [count] (limited to last 20)
**File path**: `[FILE_PATH]`
## Report
Present the analysis in this format:
## Codebase Structure Analysis
### Project Overview
**Name**: [project name from config]
**Type**: [web app, CLI tool, library, etc.]
**Primary Language**: [language]
**Framework**: [framework if identified]
### Directory Structure
\`\`\`
[root]/
├── [dir1]/ - [purpose]
├── [dir2]/ - [purpose]
├── [dir3]/ - [purpose]
└── [dir4]/ - [purpose]
\`\`\`
### Key Files
- `[file1]` - [purpose]
- `[file2]` - [purpose]
- `[file3]` - [purpose]
### Technologies Detected
- [technology 1]
- [technology 2]
- [technology 3]
### Entry Points
- [main entry point file and location]
### Notable Patterns
- [observation 1]
- [observation 2]
## Report
Communicate to the user where you are at each step of the workflow:
1. **Scout Phase Starting**: "Creating scout agent to analyze {PROBLEM_DESCRIPTION}..."
2. **Scout Working**: "Scout agent is analyzing the codebase... (checking every {SLEEP_INTERVAL} seconds)"
3. **Scout Complete**: "Scout analysis complete. Key findings: [summary of scout's report]"
4. **Build Phase Starting**: "Creating build agent to implement the solution..."
5. **Build Working**: "Build agent is implementing changes... (checking every {SLEEP_INTERVAL} seconds)"
6. **Build Complete**: "Implementation complete. Changes made: [summary of build agent's work]"
7. **Final Summary**: "Scout-and-build workflow complete. Scout agent '{SCOUT_AGENT_NAME}' and build agent '{BUILD_AGENT_NAME}' are both available for inspection."
Read PROMPT_TEMPLATE.md (in this skill directory) to understand the latest structure
Ask the user:
Create frontmatter with:
model: claude-sonnet-4-5-20250929 (always)description: (concise /help menu text)argument-hint: (if takes arguments)allowed-tools: (if restricting tools)Follow the detailed guidelines above for:
Save to .claude/commands/[command-name].md
Use lowercase with hyphens for multi-word names
Invoke with: /[command-name] [arguments]
Verify it behaves as expected
Iterate based on results
---
model: claude-sonnet-4-5-20250929
description: [Brief description for /help menu]
argument-hint: [arg1] [arg2] (optional)
allowed-tools: [Only if restricting] (optional)
---
✅ Always:
model: claude-sonnet-4-5-20250929❌ Never:
disable-model-invocation (allow agents to trigger commands)This meta-prompt skill helps you create production-quality custom slash commands for Claude Code by:
app_docs/PROMPT_TEMPLATE.mdRemember: Slash commands are stored in .claude/commands/*.md and invoked with /command-name. They support arguments, file references, bash execution, and can be project-wide or personal.
This skill includes local reference materials:
orch_one_shot_agent.md - Simple agent lifecycle workfloworch_scout_and_build.md - Multi-phase workflow with sequential agentsplan.md - Complex document generation with detailed formattingquestion.md - Read-only analysis with tool restrictionsREADME.md - Guide to understanding and using the examplesAlways reference these local files when creating new slash commands to ensure consistency with project patterns.