/generate-command
Intelligent slash command generator with parallel analysis and gold standard best practices
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/generate-command
Context preview
What this command does when you run it.
Intelligent slash command generator with parallel analysis and gold standard best practices
Command definition
generate-command.mdallowed-tools: Read, Write, Task, Bash(mkdir:*), Bash(fd:*), Bash(ls:*), Bash(git:*), Bash(gdate:*), Bash(jq:*), Bash(rg:*)
name: "Generate Command"
description: "Intelligent slash command generator with parallel analysis and gold standard best practices"
author: "wcygan"
tags: ["meta","command"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N`
- Current directory: !`pwd`
- Existing .claude directory: !`ls -la .claude 2>/dev/null || echo "No .claude directory found"`
- Current command structure: !`fd "\.md$" .claude/commands 2>/dev/null | head -5 || echo "No existing commands"`
- Git status: !`git status --porcelain 2>/dev/null | head -3 || echo "Not a git repository"`
- Project type indicators: !`fd "(package\.json|deno\.json|Cargo\.toml|go\.mod|pom\.xml)" . -d 2 | head -3`
Your Task
**CRITICAL: Generate slash commands following the "Program not Conversation" paradigm with parallel analysis for maximum efficiency and gold standard best practices.**
STEP 1: Initialize command generation session with parallel project analysis
- CREATE session state file: `/tmp/generate-command-state-$SESSION_ID.json`
- SET initial state following programming paradigm:
{
"sessionId": "$SESSION_ID",
"phase": "discovery",
"projectType": "auto-detect",
"commandComplexity": "unknown",
"userRequirements": {},
"generatedCommand": null,
"validationPassed": false,
"committed": false
}**FOR complex projects OR extensive existing command structures:**
**CRITICAL: Deploy parallel sub-agents for comprehensive project analysis (5-7x faster discovery)**
IMMEDIATELY launch 5 specialized project analysis agents:
- **Agent 1: Project Architecture Analyzer**: Detect technology stack, build systems, and architectural patterns
- Focus: package.json, deno.json, Cargo.toml, go.mod, pom.xml, tech stack identification
- Tools: File pattern analysis, dependency analysis, build system detection
- Output: Project type classification with recommended command categories
- **Agent 2: Existing Command Pattern Analyzer**: Analyze existing .claude/commands structure and patterns
- Focus: Command organization, naming conventions, complexity patterns, best practices usage
- Tools: Command file analysis, pattern recognition, structure mapping
- Output: Command ecosystem analysis with improvement opportunities
- **Agent 3: Workflow Discovery Agent**: Identify common project workflows and pain points
- Focus: Git patterns, CI/CD usage, testing strategies, deployment workflows
- Tools: Git history analysis, configuration analysis, workflow pattern detection
- Output: Workflow automation opportunities with priority ranking
- **Agent 4: Tool Ecosystem Analyzer**: Map available tools and integration opportunities
- Focus: Available CLI tools, external APIs, existing automation, tool compatibility
- Tools: Tool availability checking, integration analysis, permission mapping
- Output: Tool integration strategy with security considerations
- **Agent 5: Best Practices Validator**: Ensure adherence to gold standard patterns
- Focus: Session management, security patterns, error handling, state management
- Tools: Best practices checking, security validation, pattern compliance
- Output: Compliance assessment with specific improvement recommendations
**Sub-Agent Coordination:**
- Each agent saves findings to `/tmp/command-generation-agents-$SESSION_ID/`
- Parallel execution provides 5-7x speed improvement over sequential analysis
- Cross-agent correlation identifies optimal command design patterns
- Results synthesized for intelligent command specification guidance
STEP 2: Intelligent command specification with programming paradigm guidance
TRY:
**PROCEDURE gather_command_requirements():**
USING parallel analysis results, PROVIDE intelligent project-based suggestions:
**Programming Paradigm Questions (Think "Program not Conversation"):**
1. **Command Purpose & Deterministic Behavior**: What specific, repeatable task should this command automate?
Examples by project type (from parallel analysis):
- **Deno projects**: "test-coverage-report", "benchmark-performance", "security-audit"
- **Rust projects**: "cargo-vulnerability-scan", "performance-profile", "cross-compile"
- **Go projects**: "generate-mocks", "integration-test-parallel", "memory-profile"
- **Multi-language**: "dependency-sync", "security-scan-all", "docs-generate"
2. **Command Name & Namespacing**: What should the slash command be called?
- **Must be kebab-case**: e.g., "security-audit", "test-parallel"
- **Namespace consideration**: git/, analyze/, ops/, code/, meta/
- **Accessibility**: `/namespace:command-name` or `/command-name`
3. **Input Pattern & State Management**:
- **No input**: Deterministic execution based on project state
- **Single argument**: Use `$ARGUMENTS` token with validation
- **Structured input**: Design state-based input collection
- **Session state**: `/tmp/command-state-$SESSION_ID.json` pattern
4. **Execution Model (CRITICAL for performance)**:
- **Simple Sequential**: Linear steps, no parallelism needed
- **Parallel Sub-Agent**: Benefits from Task tool delegation (5-10x faster)
- **Interactive Checkpoint**: User approval points with state preservation
- **Resumable Workflow**: Long-running with checkpoint/resume capability
5. **Programming Constructs Needed**:
- **Control Flow**: IF/ELSE, FOR EACH, WHILE loops
- **Error Handling**: TRY/CATCH/FINALLY blocks
- **State Machines**: Phase transitions with validation
- **Unique Sessions**: Nanosecond timestamps for isolation
6. **Security & Tool Permissions** (Minimal Principle):
- **File operations**: Read, Write, Edit, MultiEdit (specify necessity)
- **Shell commands**: Bash with scoped restrictions (e.g., Bash(git:*))
- **External APIs**: WebFetch, WebSear
Read more
allowed-tools: Read, Write, Task, Bash(mkdir:*), Bash(fd:*), Bash(ls:*), Bash(git:*), Bash(gdate:*), Bash(jq:*), Bash(rg:*) name: "Generate Command" description: "Intelligent slash command generator with parallel analysis and gold standard best practices" author: "wcygan" tags: ["meta","command"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N`
- Current directory: !`pwd`
- Existing .claude directory: !`ls -la .claude 2>/dev/null || echo "No .claude directory found"`
- Current command structure: !`fd "\.md$" .claude/commands 2>/dev/null | head -5 || echo "No existing commands"`
- Git status: !`git status --porcelain 2>/dev/null | head -3 || echo "Not a git repository"`
- Project type indicators: !`fd "(package\.json|deno\.json|Cargo\.toml|go\.mod|pom\.xml)" . -d 2 | head -3`
Your Task
**CRITICAL: Generate slash commands following the "Program not Conversation" paradigm with parallel analysis for maximum efficiency and gold standard best practices.**
STEP 1: Initialize command generation session with parallel project analysis
- CREATE session state file: `/tmp/generate-command-state-$SESSION_ID.json`
- SET initial state following programming paradigm:
{
"sessionId": "$SESSION_ID",
"phase": "discovery",
"projectType": "auto-detect",
"commandComplexity": "unknown",
"userRequirements": {},
"generatedCommand": null,
"validationPassed": false,
"committed": false
}**FOR complex projects OR extensive existing command structures:**
**CRITICAL: Deploy parallel sub-agents for comprehensive project analysis (5-7x faster discovery)**
IMMEDIATELY launch 5 specialized project analysis agents:
- **Agent 1: Project Architecture Analyzer**: Detect technology stack, build systems, and architectural patterns
- Focus: package.json, deno.json, Cargo.toml, go.mod, pom.xml, tech stack identification
- Tools: File pattern analysis, dependency analysis, build system detection
- Output: Project type classification with recommended command categories
- **Agent 2: Existing Command Pattern Analyzer**: Analyze existing .claude/commands structure and patterns
- Focus: Command organization, naming conventions, complexity patterns, best practices usage
- Tools: Command file analysis, pattern recognition, structure mapping
- Output: Command ecosystem analysis with improvement opportunities
- **Agent 3: Workflow Discovery Agent**: Identify common project workflows and pain points
- Focus: Git patterns, CI/CD usage, testing strategies, deployment workflows
- Tools: Git history analysis, configuration analysis, workflow pattern detection
- Output: Workflow automation opportunities with priority ranking
- **Agent 4: Tool Ecosystem Analyzer**: Map available tools and integration opportunities
- Focus: Available CLI tools, external APIs, existing automation, tool compatibility
- Tools: Tool availability checking, integration analysis, permission mapping
- Output: Tool integration strategy with security considerations
- **Agent 5: Best Practices Validator**: Ensure adherence to gold standard patterns
- Focus: Session management, security patterns, error handling, state management
- Tools: Best practices checking, security validation, pattern compliance
- Output: Compliance assessment with specific improvement recommendations
**Sub-Agent Coordination:**
- Each agent saves findings to `/tmp/command-generation-agents-$SESSION_ID/`
- Parallel execution provides 5-7x speed improvement over sequential analysis
- Cross-agent correlation identifies optimal command design patterns
- Results synthesized for intelligent command specification guidance
STEP 2: Intelligent command specification with programming paradigm guidance
TRY:
**PROCEDURE gather_command_requirements():**
USING parallel analysis results, PROVIDE intelligent project-based suggestions:
**Programming Paradigm Questions (Think "Program not Conversation"):**
1. **Command Purpose & Deterministic Behavior**: What specific, repeatable task should this command automate?
Examples by project type (from parallel analysis):
- **Deno projects**: "test-coverage-report", "benchmark-performance", "security-audit"
- **Rust projects**: "cargo-vulnerability-scan", "performance-profile", "cross-compile"
- **Go projects**: "generate-mocks", "integration-test-parallel", "memory-profile"
- **Multi-language**: "dependency-sync", "security-scan-all", "docs-generate"
2. **Command Name & Namespacing**: What should the slash command be called?
- **Must be kebab-case**: e.g., "security-audit", "test-parallel"
- **Namespace consideration**: git/, analyze/, ops/, code/, meta/
- **Accessibility**: `/namespace:command-name` or `/command-name`
3. **Input Pattern & State Management**:
- **No input**: Deterministic execution based on project state
- **Single argument**: Use `$ARGUMENTS` token with validation
- **Structured input**: Design state-based input collection
- **Session state**: `/tmp/command-state-$SESSION_ID.json` pattern
4. **Execution Model (CRITICAL for performance)**:
- **Simple Sequential**: Linear steps, no parallelism needed
- **Parallel Sub-Agent**: Benefits from Task tool delegation (5-10x faster)
- **Interactive Checkpoint**: User approval points with state preservation
- **Resumable Workflow**: Long-running with checkpoint/resume capability
5. **Programming Constructs Needed**:
- **Control Flow**: IF/ELSE, FOR EACH, WHILE loops
- **Error Handling**: TRY/CATCH/FINALLY blocks
- **State Machines**: Phase transitions with validation
- **Unique Sessions**: Nanosecond timestamps for isolation
6. **Security & Tool Permissions** (Minimal Principle):
- **File operations**: Read, Write, Edit, MultiEdit (specify necessity)
- **Shell commands**: Bash with scoped restrictions (e.g., Bash(git:*))
- **External APIs**: WebFetch, WebSear
A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Other commands on claude-cmd.
- /agent-browser-automation
Automate browser interactions for development testing using Puppeteer MCP
Open command - /agent-prep-merge
Prepare branches for merging across multiple worktrees and coordinate integration
Open command - /agent-persona-accessibility-expert
Transform into accessibility expert for WCAG compliance and inclusive design
Open command - /agent-persona-api-designer
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Open command - /agent-persona-backend-specialist
Transform into backend specialist for scalable API and system design
Open command - /agent-persona-cloud-architect
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies
Open command

