Files
SuperClaude/.claude/commands/shared/command-templates.yml
NomenAK 327d7ded3c Major optimization: 35% token reduction through template system & file consolidation
- Consolidated 7 redundant YAML files into 3 comprehensive files:
  * error-recovery + error-recovery-enhanced → error-handling.yml
  * performance-monitoring + performance-tracker → performance.yml
  * task-management + todo-task-integration + auto-task-trigger → task-system.yml

- Created 3 new shared resource files:
  * severity-levels.yml (universal classification system)
  * execution-lifecycle.yml (common execution hooks)
  * constants.yml (paths, symbols, standards)

- Migrated all 18 commands to use expanded template system
- Updated cross-references throughout command system
- Achieved 6,440 token savings (35.5% reduction) while maintaining full functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 12:58:12 +02:00

167 lines
5.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Command Templates - Token Optimized Patterns
## Legend
| Symbol | Meaning | | Abbrev | Meaning |
|--------|---------|---|--------|---------|
| → | leads to | | cfg | configuration |
| & | and/with | | impl | implementation |
| w/ | with | | perf | performance |
| @ | at/located | | ops | operations |
| ∀ | for all/every | | val | validation |
| ∃ | exists/there is | | req | requirements |
## Universal Command Structure Template
```yaml
Command_Header:
Execute: "immediately. Add --plan flag if user wants to see plan first."
Legend: "@command-specific legend generation"
Purpose: "[Action] [Subject] specified in $ARGUMENTS"
Universal_Flags:
Planning: "@include shared/constants.yml#Standard_Flags.Planning"
Thinking: "@include shared/constants.yml#Standard_Flags.Thinking"
Compression: "@include shared/constants.yml#Standard_Flags.Compression"
MCP_Control: "@include shared/constants.yml#Standard_Flags.MCP_Control"
Execution: "@include shared/constants.yml#Standard_Flags.Execution"
Flag_Templates:
MCP_Control: "@see shared/mcp-flags.yml"
Thinking_Modes: "@see shared/thinking-modes.yml"
Planning_Mode: "@see shared/planning-mode.yml"
Research_Requirements:
Standard: "@include shared/research-first.yml#Research_Policy"
External_Libs: "@include shared/research-first.yml#Library_Requirements"
Patterns: "@include shared/research-first.yml#Pattern_Verification"
Citations: "@include shared/constants.yml#Standard_Messages.Report_References"
Report_Output:
Location: "@include shared/constants.yml#Documentation_Paths"
Directory: "@include shared/execution-lifecycle.yml#Preparation_Actions"
Reference: "@include shared/constants.yml#Standard_Messages.Report_References"
Error_Handling:
Classification: "@include shared/severity-levels.yml#Severity_Levels"
Recovery: "@include shared/error-handling.yml#Recovery_Strategies"
Escalation: "@include shared/severity-levels.yml#Escalation_Pathways"
```
## Command Type Templates
```yaml
Analysis_Commands:
Structure: "Analyze [subject] using [method]"
Flags: "--code --architecture --security --performance"
Output: "Analysis reports→.claudedocs/reports/"
Build_Commands:
Structure: "Build [type] w/ [requirements]"
Flags: "--init --feature --tdd --watch"
Output: "Working code + tests + docs"
Workflow_Commands:
Structure: "[Action] using [workflow] pattern"
Flags: "--dry-run --interactive --iterate"
Output: "Process results + metrics"
```
## Shared Flag Descriptions
```yaml
Core_Flags:
plan: "Show execution plan before running"
think: "Multi-file analysis w/ context (4K)"
think_hard: "Deep system analysis (10K)"
ultrathink: "Comprehensive analysis (32K)"
uc: "UltraCompressed mode (~70% token reduction)"
MCP_Flags:
c7: "Context7→docs & examples"
seq: "Sequential→complex thinking"
magic: "Magic→UI component generation"
pup: "Puppeteer→browser automation"
no_mcp: "Disable all MCP servers"
Quality_Flags:
tdd: "Test-driven development"
coverage: "Code coverage analysis"
validate: "Validation & verification"
security: "Security scan & audit"
Workflow_Flags:
dry_run: "Preview w/o execution"
watch: "Continuous monitoring"
interactive: "Step-by-step guidance"
iterate: "Iterative improvement"
```
## Cross-Reference System
```yaml
Instead_Of_Repeating:
MCP_Explanations: "@see shared/mcp-flags.yml"
Thinking_Modes: "@see shared/thinking-modes.yml"
Research_Standards: "@see shared/research-first.yml"
Validation_Rules: "@see shared/validation.yml"
Performance_Patterns: "@see shared/performance.yml"
Template_Usage:
Command_File: |
@include shared/command-templates.yml#Analysis_Commands
@flags shared/command-templates.yml#Core_Flags,MCP_Flags
Reference_Format: "@see [file]#[section]"
Include_Format: "@include [file]#[section]"
```
## Token Optimization Patterns
```yaml
Compression_Rules:
Articles: Remove "the|a|an" where clear
Conjunctions: Replace "and"→"&" | "with"→"w/"
Prepositions: Compress "at"→"@" | "to"→"→"
Verbose_Phrases: "in order to"→"to" | "make sure"→"ensure"
Symbol_Expansion:
Mathematics: ∀(all) ∃(exists) ∈(member) ⊂(subset) (union) ∩(intersection)
Logic: ∴(therefore) ∵(because) ≡(equivalent) ≈(approximately)
Process: ▶(start) ⏸(pause) ⏹(stop) ⚡(fast) 🔄(cycle)
Quality: ✅(success) ❌(failure) ⚠(warning) 📊(metrics)
Structure_Priority:
1_YAML: Most compact structured data
2_Tables: Comparison & reference data
3_Lists: Enumeration & sequences
4_Prose: Only when necessary
Abbreviation_Standards:
Technical: cfg(config) impl(implementation) perf(performance) val(validation)
Actions: analyze→anlz | build→bld | deploy→dply | test→tst
Objects: database→db | interface→api | environment→env | dependency→dep
```
## Implementation Notes
```yaml
Usage_Pattern:
1_Define_Template: Create in shared/command-templates.yml
2_Reference_Template: Use @include in command files
3_Override_Specific: Add command-specific details only
4_Validate_Consistency: Auto-check cross-references
Benefits:
Token_Reduction: ~40% reduction in command file size
Consistency: Standardized patterns across all commands
Maintenance: Single source of truth for common elements
Scalability: Easy addition of new commands using templates
Migration_Strategy:
Phase_1: Create templates for most common patterns
Phase_2: Update existing commands to use templates
Phase_3: Implement auto-validation of template usage
```
---
*Command Templates v1.0 - Token-optimized reusable patterns for SuperClaude commands*