Skip to main content
command CX Codex

test · superclaude-org — Claude Code command: run tests with coverage reports

Execute unit, integration, and e2e tests with code coverage analysis and quality reporting. Auto-detects test frameworks and supports watch mode for continuous testing during development.

MIT ★ 23,950 updated 2026-09-27

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/test.md
Open on GitHub

What test does

The /sc:test command runs your project's tests, identifies the test framework automatically, and generates coverage reports. It handles three test categories: unit tests for individual functions and components, integration tests for cross-module interactions, and e2e tests via Playwright for browser compatibility checks. E2e mode automatically activates the Playwright MCP server.

The command analyzes test results, identifies failure causes, and suggests fixes. Watch mode (--watch) runs tests continuously as you edit files, giving real-time feedback. The --coverage flag produces detailed reports showing which lines and functions are tested.

It works with existing test suites and their configurations but does not create new tests or alter framework settings. E2e testing requires Playwright to be installed in your project.

What it helps with

  • run unit tests and measure code coverage
  • diagnose and fix test failures
  • monitor tests continuously while coding
  • test cross-browser compatibility with e2e

Example prompts for the agent

  • /sc:test
  • /sc:test src/components --type unit --coverage
  • /sc:test --type e2e

How to install test

Manually: put the files in place

.claude/commands/test.md

Call it with /test. For all projects use ~/.claude/commands/

Questions about test

How do I install the test command in Claude Code?

Place the file at .claude/commands/test.md in your project root. Claude Code discovers it automatically and makes it available via /sc:test.

What does the test command do?

Runs tests, analyzes results, generates coverage reports, and helps diagnose failures. It automatically detects which test framework your project uses.

What test types does it support?

Unit tests for individual functions, integration tests for module interactions, and e2e tests for full browser flows using Playwright. Run all at once or pick a type with --type unit|integration|e2e|all.

Source text

test.md · MIT
---
name: test
description: "Execute tests with coverage analysis and automated quality reporting"
category: utility
complexity: enhanced
mcp-servers: [playwright]
personas: [qa-specialist]
---

# /sc:test - Testing and Quality Assurance

## Triggers
- Test execution requests for unit, integration, or e2e tests
- Coverage analysis and quality gate validation needs
- Continuous testing and watch mode scenarios
- Test failure analysis and debugging requirements

## Usage
```
/sc:test [target] [--type unit|integration|e2e|all] [--coverage] [--watch] [--fix]
```

## Behavioral Flow
1. **Discover**: Categorize available tests using runner patterns and conventions
2. **Configure**: Set up appropriate test environment and execution parameters
3. **Execute**: Run tests with monitoring and real-time progress tracking
4. **Analyze**: Generate coverage reports and failure diagnostics
5. **Report**: Provide actionable recommendations and quality metrics

Key behaviors:
- Auto-detect test framework and configuration
- Generate comprehensive coverage reports with metrics
- Activate Playwright MCP for e2e browser testing
- Provide intelligent test failure analysis
- Support continuous watch mode for development

## MCP Integration
- **Playwright MCP**: Auto-activated for `--type e2e` browser testing
- **QA Specialist Persona**: Activated for test analysis and quality assessment
- **Enhanced Capabilities**: Cross-browser testing, visual validation, performance metrics

## Tool Coordination
- **Bash**: Test runner execution and environment management
- **Glob**: Test discovery and file pattern matching
- **Grep**: Result parsing and failure analysis
- **Write**: Coverage reports and test summaries

## Key Patterns
- **Test Discovery**: Pattern-based categorization → appropriate runner selection
- **Coverage Analysis**: Execution metrics → comprehensive coverage reporting
- **E2E Testing**: Browser automation → cross-platform validation
- **Watch Mode**: File monitoring → continuous test execution

## Examples

### Basic Test Execution
```
/sc:test
# Discovers and runs all tests with standard configuration
# Generates pass/fail summary and basic coverage
```

### Targeted Coverage Analysis
```
/sc:test src/components --type unit --coverage
# Unit tests for specific directory with detailed coverage metrics
```

### Browser Testing
```
/sc:test --type e2e
# Activates Playwright MCP for comprehensive browser testing
# Cross-browser compatibility and visual validation
```

### Development Watch Mode
```
/sc:test --watch --fix
# Continuous testing with automatic simple failure fixes
# Real-time feedback during development
```

## Boundaries

**Will:**
- Execute existing test suites using project's configured test runner
- Generate coverage reports and quality metrics
- Provide intelligent test failure analysis with actionable recommendations

**Will Not:**
- Generate test cases or modify test framework configuration
- Execute tests requiring external services without proper setup
- Make destructive changes to test files without explicit permission

© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework

Similar slash commands

All slash commands for Testing and QA →

test by other authors comes first.

From the same set56

The whole set →
requirements-analyst The requirements-analyst subagent turns vague project ideas into requirements, PRDs, and acceptance criteria. Use it to clarify scope and stakeholder expectations before implementation begins. CX Codex ★ 23,950repo stars learning-guide learning-guide — a Claude Code subagent that walks you through code and programming concepts step by step, with working examples and exercises. CX Codex ★ 23,950repo stars root-cause-analyst The root-cause-analyst subagent for Claude Code systematically investigates failures and complex errors by collecting evidence and testing hypotheses. It finds root causes rather than patching symptoms. CX Codex ★ 23,950repo stars security-engineer The security-engineer subagent reviews code for vulnerabilities, maps attack paths, and checks security standards. Use it for audits and risk analysis. CX Codex ★ 23,950repo stars python-expert python-expert writes production Python code guided by SOLID principles and clean architecture. Useful when you need test-driven development, 95%+ test coverage, and OWASP security. CX Codex ★ 23,950repo stars document document builds inline comments, API references, component guides, and user manuals directly from code analysis. CX Codex +1 ★ 23,950repo stars build Handles building, compiling, and packaging projects with automatic error detection and artifact optimization. Runs from Claude Code with configurable environments and build types. CX Codex +1 ★ 23,950repo stars analyze analyze reviews code for quality, security, performance, and architecture. Use it for a whole project or a selected directory. CX Codex +1 ★ 23,950repo stars

Project sponsors

Companies that keep this analytics open