xarchitecture
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Machine-readable specifications with unique identifiers and authority levels for precise AI code generation
How it fires
How this command gets triggered: by you, by Claude, or both.
/xspecContext preview
What this command does when you run it.
Machine-readable specifications with unique identifiers and authority levels for precise AI code generation
description: Machine-readable specifications with unique identifiers and authority levels for precise AI code generation tags: [specifications, traceability, ai-generation, coverage, requirements, authority]
Manage SpecDriven AI specifications based on the arguments provided in $ARGUMENTS.
**Basic specification analysis:**
/xspec
**Read specifications:**
/xspec --read
**Create new specification:**
/xspec --new "Add contact form"
**Help and options:**
/xspec --help
If $ARGUMENTS contains "help" or "--help": Display this usage information and exit.
First, verify SpecDriven AI project structure: !ls -la specs/ 2>/dev/null || echo "No specs directory found" !find specs/specifications/ -name "*.md" 2>/dev/null | head -5 || echo "No specifications found" !find specs/tests/ -name "*.py" 2>/dev/null | head -5 || echo "No tests found"
Based on $ARGUMENTS, perform the appropriate specification operation:
If reading specifications (--read, --find): !grep -r "#{#" specs/specifications/ | head -10 2>/dev/null || echo "No specification IDs found" !find specs/specifications/ -name "*.md" -exec grep -l "authority=" {} \; 2>/dev/null | head -5
Read and analyze specifications:
If tracing specifications (--trace): !grep -r "$spec_id" specs/tests/ 2>/dev/null || echo "No tests found for specification" !grep -r "$spec_id" . --exclude-dir=specs --exclude-dir=.git 2>/dev/null | head -5
Analyze specification traceability:
If validating specifications (--validate, --machine-readable): !grep -r "#{#[a-z]{3}[0-9][a-z] authority=" specs/specifications/ 2>/dev/null || echo "Invalid specification format" !find specs/specifications/ -name "*.md" -exec grep -E "authority=(system|platform|developer)" {} \; | wc -l
Validate specification compliance:
If creating new specifications (--new): !find specs/specifications/ -name "*.md" -exec grep -o "#{#[a-z]*[0-9][a-z]" {} \; | sort | tail -5 !mkdir -p specs/specifications specs/tests
Create new specification with proper format:
If analyzing coverage (--coverage, --dual-coverage): !grep -r "#{#" specs/specifications/ | wc -l !grep -r "#{#" specs/tests/ | wc -l !python -m pytest --cov=. --cov-report=term-missing specs/tests/ 2>/dev/null || echo "Code coverage not available"
Analyze dual coverage metrics:
If generating from specifications (--generate-test, --ai-implement): @specs/specifications/$spec_file 2>/dev/null || echo "Specification file not found" !find specs/tests/ -name "*test*" | grep "$component" | head -3
Generate AI implementation:
If filtering by authority (--authority): !grep -r "authority=$authority_level" specs/specifications/ 2>/dev/null || echo "No specifications with authority level found"
Manage specification authority:
If identifying gaps (--gaps): !find specs/specifications/ -name "*.md" -exec grep -o "#{#[a-z]{3}[0-9][a-z]" {} \; | sort | uniq > /tmp/spec_ids !find specs/tests/ -name "*.py" -exec grep -o "#{#[a-z]{3}[0-9][a-z]" {} \; | sort | uniq > /tmp/test_ids || touch /tmp/test_ids
Identify specification gaps:
Think step by step about specification management and provide:
1. **Specification Analysis**:
2. **Traceability Assessment**:
3. **Quality Metrics**:
4. **Improvement Recommendations**:
Generate comprehensive specification management report with dual coverage analysis, traceability validation, and actionable recommendations for improving SpecDriven AI development practices.
If no specific operation is provided, analyze current specifi
Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Manage project configuration files, environment variables, and application settings
Continue an execution plan from where it left off across sessions
Interactive debugging support with error analysis and fix suggestions - integrates with Debug Specialist sub-agent for complex…