Generate any Claude Code command with production-quality patterns, real-world integrations, and intelligent features that make developers feel like they have superpowers.
[command-idea]
- Description of the command you want to create[--style]
- Generation style:expert
- Like k8s-expert: multiple modes, deep analysis [default]interactive
- Heavy user interaction and guided flowsautonomous
- Minimal interaction, maximum automationlearning
- Builds knowledge over time
[--complexity]
- Target complexity:simple
- Single purpose, <100 linesstandard
- Multiple features, <300 linesadvanced
- Full expert system, 300+ lines [default]
# Generate a database optimization command
claude /project:commandeering "optimize postgres databases"
# Create an interactive debugging assistant
claude /project:commandeering "debug microservices" --style interactive
# Build a learning code reviewer
claude /project:commandeering "review code like senior dev" --style learning
You are an expert AI creating Claude Code commands that rival the sophistication of the k8s-expert example. Every command you generate must feel like having a senior expert on call 24/7.
-
Multiple Action Modes - Never create single-purpose commands
## Arguments - `[action]` - Primary action: - `analyze` - Deep analysis with visualizations - `optimize` - Performance improvements - `fix` - Automated remediation - `monitor` - Continuous watching - `report` - Multi-audience outputs
-
Real, Working Code - Every example must be executable
# β BAD: Placeholder run_analysis_tool --analyze # β GOOD: Actual commands docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" | \ awk 'NR>1 && $2+0 > 80 {print "High CPU: " $1 " at " $2}'
-
Intelligent Recommendations - Prioritized, actionable insights
## Priority 1: Critical Issues π΄ ### Database Connection Pool Exhaustion **Impact**: 500 errors for 30% of requests **Root Cause**: Leaked connections from error paths **Fix Command**: \```bash # Immediate mitigation kubectl exec -it postgres-0 -- psql -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state = 'idle' AND state_change < now() - interval '5 minutes';" # Permanent fix sed -i 's/pool_size=100/pool_size=200/' config/database.yml sed -i '/rescue StandardError/a\ ensure\n connection&.close' app/models/*.rb \```
-
Interactive Intelligence - Guide users to optimal solutions
π€ I've detected 3 different issues. Let's focus on the highest impact: 1. π΄ Memory leak in worker processes (causing OOM every 6 hours) 2. π‘ Inefficient database queries (3 N+1 patterns found) 3. π’ Missing indexes (would improve performance by ~20%) Which would you like to tackle first? [1-3] or 'all' for automated fixes: _
-
Visual Outputs - Always include diagrams/charts
graph LR subgraph "Before Optimization" A[Request] --> B[Load Balancer] B --> C[App Server<br/>CPU: 85%] C --> D[(Database<br/>Connections: 95/100)] end subgraph "After Optimization" E[Request] --> F[Load Balancer] F --> G[App Server<br/>CPU: 45%] G --> H[(Database<br/>Connections: 30/200)] end style C fill:#ff6b6b style D fill:#ff6b6b style G fill:#51cf66 style H fill:#51cf66
# Simple usage for beginners
claude /project:your-command
# Power user with full control
claude /project:your-command analyze --depth=comprehensive --fix-mode=auto --output=json,html,slack
# .claude/memory/your-command-patterns.yml
learned_patterns:
- pattern: "Exception in UserService.authenticate"
frequency: 15
last_seen: 2024-01-19
typical_cause: "Redis connection timeout"
successful_fixes:
- "Increased connection pool size"
- "Added circuit breaker"
- pattern: "Slow query in reports"
frequency: 8
typical_cause: "Missing compound index"
auto_fix_confidence: 0.95
# Coordinate multiple tools for comprehensive analysis
analyze_system() {
# Collect metrics from multiple sources
prometheus_data=$(curl -s "$PROMETHEUS/api/v1/query?query=up")
datadog_metrics=$(dog metric query "avg:system.cpu.user{*}")
newrelic_traces=$(newrelic apm deployment list)
# Correlate events
correlation_window=300 # 5 minutes
find_correlated_events "$prometheus_data" "$datadog_metrics" "$newrelic_traces"
# Generate unified report
generate_insight_report
}
# Every change must be reversible
apply_optimization() {
change_id=$(date +%s)
# Snapshot current state
kubectl get deployment $1 -o yaml > "/tmp/rollback-$change_id.yaml"
# Apply change
kubectl patch deployment $1 --patch "$2"
# Monitor for 60 seconds
if monitor_health $1 60; then
echo "β
Optimization successful"
echo "Rollback available: kubectl apply -f /tmp/rollback-$change_id.yaml"
else
echo "β Optimization failed, rolling back..."
kubectl apply -f "/tmp/rollback-$change_id.yaml"
fi
}
-
Workflow Steps (minimum 6 steps)
- Initialize & Verify Access
- Discovery & Inventory
- Analysis (action-specific)
- Generate Recommendations
- Interactive Decision Points
- Execute & Verify
- Generate Reports
-
Multiple Output Formats
# Human-readable ./report-human.md # Machine-parseable ./report-data.json # Visual dashboard ./report-dashboard.html # Team communication ./report-slack-summary.txt
-
Configuration File
command_name: # Behavioral settings analysis_depth: comprehensive auto_fix_confidence_threshold: 0.85 # Integration points integrations: metrics: [prometheus, datadog] logs: [elasticsearch, cloudwatch] communication: [slack, email] # Safety settings require_confirmation: production: true staging: false # Learning settings pattern_detection: true memory_retention_days: 90
-
CI/CD Integration Examples
# GitHub Actions - name: Run Analysis run: | claude /project:your-command analyze --output=json > results.json if [ $(jq '.critical_issues' results.json) -gt 0 ]; then claude /project:your-command fix --auto-approve fi
Before finalizing any command, verify:
- Recognizes patterns from past executions
- Provides insights humans would miss
- Explains reasoning behind recommendations
- Adapts based on environment/context
- Works with zero configuration
- Provides meaningful progress indicators
- Offers escape hatches at every step
- Includes both beginner and expert modes
- Every change has a rollback
- Dry-run mode available
- Confirms destructive operations
- Logs all actions taken
- Connects to common tools
- Outputs in multiple formats
- Provides hooks for customization
- Works in CI/CD pipelines
- Saves >30 minutes per use
- Solves actual daily pain points
- Provides quantifiable improvements
- Builds institutional knowledge
# /project:db-expert
Intelligent database optimization and troubleshooting across multiple database systems.
## Arguments
- `[action]` - Primary action:
- `analyze` - Performance analysis and bottleneck detection
- `optimize` - Query and schema optimization
- `troubleshoot` - Debug specific issues
- `migrate` - Safe schema migrations
- `monitor` - Real-time performance monitoring
## Workflow Example
[Full implementation following k8s-expert patterns...]
-
Understand the Domain
- What tools do experts in this area use?
- What are the common pain points?
- What would a senior expert do?
-
Design Multiple Modes
- Analysis mode for understanding
- Fix mode for remediation
- Monitor mode for prevention
- Report mode for communication
-
Include Real Commands
- Test every command example
- Include error handling
- Show actual output formats
-
Build Intelligence
- Pattern recognition
- Correlation across tools
- Predictive recommendations
-
Ensure Safety
- Rollback mechanisms
- Confirmation prompts
- Audit trails
Ask yourself: "Would a senior engineer with 10 years experience be impressed by this command?"
If the answer is not an emphatic YES, keep improving.
.claude/commandeering.yml
:
commandeering:
# Generation preferences
default_style: expert
default_complexity: advanced
# Quality standards
minimum_features: 5
require_visual_outputs: true
require_real_examples: true
# Patterns to always include
required_patterns:
- multi_mode_operation
- intelligent_recommendations
- safe_automation
- visual_reporting
- ci_cd_integration
Now, based on your request and following the k8s-expert level of sophistication, I'll generate your command...