Major streamlining achievement: - Eliminate 2,733 lines of duplicate content across commands - Reduce individual command files by ~70% (130-150 → 35-60 lines) - Leverage existing shared/*.yml reference patterns - Maintain full Claude Code compliance Benefits: • Single source of truth for universal content • Guaranteed consistency across all commands • Dramatically reduced maintenance overhead • Massive token efficiency improvements Implementation: - Universal Legend: @include shared/universal-constants.yml#Universal Legend - Universal Flags: @include shared/flag-inheritance.yml#Universal_Always - Command patterns: References to appropriate shared/*.yml files - Template system: Enhanced command-patterns.yml 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2.8 KiB
/test - Create and run comprehensive tests
@include shared/universal-constants.yml#Universal_Legend
Purpose
Create or run comprehensive test suites for code specified in $ARGUMENTS using modern testing frameworks and methodologies.
Syntax
/test [flags] [target]
@include shared/flag-inheritance.yml#Universal_Always
Examples:
/test --tdd- Test-driven development workflow/test --coverage- Generate coverage report/test --watch- Continuous test mode/test --integration- Run integration tests/test --e2e- Run end-to-end tests
Command-Specific Flags
--tdd: "Test-driven development workflow (write failing test→implement→pass)" --coverage: "Generate detailed coverage reports w/ uncovered lines" --integration: "Run integration tests across components/services" --e2e: "Run end-to-end tests w/ real browser/environment" --unit: "Focus on unit tests only (default)" --mutation: "Run mutation testing to verify test quality" --snapshot: "Update/verify snapshot tests" --watch: "Run tests continuously on file changes" --bail: "Stop on first test failure" --parallel: "Run tests in parallel workers" --update-snapshots: "Update all snapshot tests"
Testing Approaches
Unit Testing: Isolated component/function tests | Mock all dependencies | Fast execution | High coverage target
Integration Testing: Component interaction tests | Real service calls | Database transactions | API endpoint tests
E2E Testing: Full user workflows | Browser automation | Real environment | Critical path coverage
TDD Workflow: Red→Green→Refactor cycle | Write minimal code | Comprehensive coverage | Design emergence
Testing Patterns
Test Structure: Arrange-Act-Assert (AAA) | Given-When-Then (BDD) | Setup→Execute→Verify→Teardown
Coverage Targets: Statements: 80%+ | Branches: 75%+ | Functions: 90%+ | Lines: 80%+
Test Organization:
__tests__/ortest/directories*.test.{js,ts}or*.spec.{js,ts}naming- Mirror source structure in test directories
- Group by feature or component
@include shared/quality-patterns.yml#Test_Quality_Standards
Framework Support
JavaScript/TypeScript: Jest (default) | Mocha + Chai | Vitest | Testing Library
Python: pytest (default) | unittest | nose2 | doctest
Go: Built-in testing | Testify | Ginkgo/Gomega
Java: JUnit 5 | TestNG | Mockito | Spring Test
Other: Framework-specific best practices | Native test runners
Deliverables
Test Files: Created in appropriate test directories | Following naming conventions | Comprehensive test cases
Coverage Reports: HTML report in coverage/ | Console summary | Uncovered line identification
CI Configuration: GitHub Actions | CircleCI | Jenkins | GitLab CI
Documentation: Test plan | Test cases | Coverage goals | CI/CD integration
@include shared/universal-constants.yml#Success_Messages