test

Advanced test implementation command with unit/E2E support, auto-execution, and smart fixing capabilities

9 stars

Best use case

test is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Advanced test implementation command with unit/E2E support, auto-execution, and smart fixing capabilities

Teams using test should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/test/SKILL.md --create-dirs "https://raw.githubusercontent.com/sc30gsw/claude-code-customes/main/skills/test/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/test/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How test Compares

Feature / AgenttestStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Advanced test implementation command with unit/E2E support, auto-execution, and smart fixing capabilities

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Test Command

Implement comprehensive tests with optional test execution and intelligent failure fixing.

## Usage

```bash
/test <target> [options]
```

## Target Specification

| Target Type | Examples | Description |
|-------------|----------|-------------|
| Component Name | `LoginForm`, `UserProfile` | React/Vue/Angular components |
| File Path | `utils/validation`, `hooks/useAuth` | Module and utility files |
| Function Name | `calculateTotal`, `formatDate` | Specific functions |
| Feature Name | `authentication`, `payment` | Entire feature areas |

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `-u` | Unit test mode | ✅ |
| `-e` | E2E test mode + accessibility injection | - |
| `-r` | Auto-run tests with smart fixing | - |
| `-v` | Verbose output mode | - |
| `-c` | Coverage-focused mode (target 90%+) | - |
| `-p` | Performance test mode | - |
| `-w` | Watch mode | - |
| `-f` | Fast mode (parallel + caching) | - |
| `--files=PATTERN` | Specify files by glob | - |
| `--exclude=PATTERN` | Exclude files by glob | - |
| `--include-deps` | Include dependency files | - |
| `--dry-run` | Test design only | - |

## Tool Priorities

**ALWAYS prioritize mcp__serena__ tools over default Claude Code tools:**

### File Operations (Serena MCP First)
- **Reading files**: Use `mcp__serena__find_file` → `Read` (fallback)
- **Searching patterns**: Use `mcp__serena__search_for_pattern` → `Grep` (fallback)
- **Finding symbols**: Use `mcp__serena__find_symbol` → `Glob` (fallback)

### Code Analysis (Serena MCP)
- **Symbol overview**: Use `mcp__serena__get_symbols_overview`
- **Symbol references**: Use `mcp__serena__find_referencing_symbols`
- **Code replacement**: Use `mcp__serena__replace_symbol_body` → `Edit` (fallback)

## Examples

```bash
# Basic Usage
/test LoginComponent -e -r          # E2E tests, run & fix
/test utils/auth -u -r -c           # High-coverage unit tests
/test PaymentForm -e -v             # E2E with verbose output

# File Pattern Specification
/test components --files="Button*" -u -r
/test src --files="**/*.hook.ts" -u -c
/test api --files="**/*Controller.ts" --include-deps -u -r

# Performance-Focused
/test heavyComponent -u -p -f --parallel=8
/test api/bulk -u -p --timeout=60
```

## Test Implementation Flow

### Unit Test Mode (-u)
1. Target code analysis with Serena MCP
2. Test framework detection (Jest, Vitest, Mocha)
3. Test case creation: happy path, error cases, edge cases

### E2E Test Mode (-e)
1. Component analysis for interactive elements
2. E2E framework detection (Cypress, Playwright)
3. Accessibility attribute injection (data-testid, aria-label)
4. E2E test case creation: page loading, user interactions, forms

### Smart Fixing (-r option)
1. Parse error output
2. Classify errors: syntax, assertion, async, mock, E2E-specific
3. Apply appropriate fixing strategy
4. Re-run and iterate (max 10 attempts)

## Output Report

```
📁 Created/Updated Files:
- src/components/LoginForm.test.tsx
- cypress/e2e/user-authentication.cy.ts

🧪 Implemented Test Cases:
[Unit Tests]
✓ LoginForm happy path tests (3 cases)
✓ LoginForm error handling tests (2 cases)

🚀 Test Execution Results:
[1st Run] ❌ 2 failures
[Auto-Fix Applied] ✅
[2nd Run] ✅ All passed (9 tests)
Coverage: 95.2%
```

Related Skills

webapp-testing

9
from sc30gsw/claude-code-customes

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

tanstack-start-server-fn-testing

9
from sc30gsw/claude-code-customes

Unit-test TanStack Start createServerFn handlers via a global vi.mock that combines two patterns from Discussion #2701

serena

9
from sc30gsw/claude-code-customes

Token-efficient Serena MCP command for structured app development and problem-solving

project-guidelines-example

9
from sc30gsw/claude-code-customes

Example project-specific skill template based on a real production application.

notion-bug-pr

9
from sc30gsw/claude-code-customes

Skill that pulls bug tickets (titles containing 「不具合」) from a Notion database, investigates root cause in a GitHub repo, applies fixes, and opens draft PRs. Supports three modes — daily recurring schedule, one-shot at a specific time, or immediate on-demand run. Takes three or four args: Notion database URL, repo path or name, and either HH:MM (daily), "once HH:MM" (one-shot), or "now" (immediate).

graphify

9
from sc30gsw/claude-code-customes

any input (code, docs, papers, images, videos) to knowledge graph. Use when user asks any question about a codebase, documents, or project content - especially if graphify-out/ exists, treat the question as a /graphify query.

chrome

9
from sc30gsw/claude-code-customes

Comprehensive Chrome DevTools development system with native Chrome capabilities for debugging, E2E testing, performance analysis, and browser automation

web-design-guidelines

9
from sc30gsw/claude-code-customes

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

typescript-advanced-types

9
from sc30gsw/claude-code-customes

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.

tanstack-start

9
from sc30gsw/claude-code-customes

Full-stack React framework powered by TanStack Router with SSR, streaming, server functions, and deployment to any hosting provider.

tailwind-css-patterns

9
from sc30gsw/claude-code-customes

Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

skill-creator

9
from sc30gsw/claude-code-customes

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.