Skip to content
Development
Skill

/test-deep

Context-aware test orchestration. Use when: smart test selection, failure triage, progressive test ladder, test failure analysis. Not for: writing tests (use post-dev-test), reviewing tests (use codex-test-review), generating tests (use codex-test-gen), full manual run (use

From plugin
sd0x-dev-flow
195102 skills16 agents5 hooks

Claude Code

$ npx -y skills add sd0xdev/sd0x-harness --skill test-deep --agent claude-code

SKILL.md

test-deep.SKILL.md
name: test-deep
description: "Context-aware test orchestration. Use when: smart test selection, failure triage, progressive test ladder, test failure analysis. Not for: writing tests (use post-dev-test), reviewing tests (use codex-test-review), generating tests (use codex-test-gen), full manual run (use verify). Output: test results + triage report + fixer actions."
allowed-tools: Read, Grep, Glob, Bash, Write, Agent, AskUserQuestion, Skill

Test Deep — Context-Aware Test Orchestration

Supplementary Agent

When test failures occur, dispatch background triage:

Agent({ description: "Analyze test failure root cause and suggest fixes", subagent_type: "verify-app", prompt: `Analyze the following test failure: <failure output> Identify root cause and suggest minimal fix.` })

Trigger

  • Keywords: context-aware testing, smart test, test orchestration, test triage, test failure analysis, test deep, run relevant tests

When NOT to Use

| Scenario | Alternative | |----------|------------| | Writing new tests | `/post-dev-test` | | Reviewing test coverage | `/codex-test-review` | | Generating unit tests | `/codex-test-gen` | | Full manual test run | `/verify` | | Code review | `/codex-review-fast` |

Prohibited Actions

❌ git add | git commit | git push — per @rules/git-workflow.md

This skill runs tests and may apply safe fixers, but does **not** commit. To commit, offer the menu per `rules/git-workflow.md` § Proactive Offer — a commit option on any real branch, a push option only where `review-state.js offer` allows one — and invoke `/smart-commit --execute` on selection; never print the command for the user to copy.

Workflow

flowchart TD
    U[User: /test-deep] --> S[Phase 0: Test Selection]
    S --> |git diff mapping| T[Test Targets]
    S --> |no mapping| F1[Framework --changedSince]
    S --> |low confidence| F2[Full Suite]
    T --> L[Phase 1: Progressive Ladder]
    F1 --> L
    F2 --> L
    L --> |unit| R1[Run Unit Tests]
    R1 --> |pass| R2[Run Integration Tests]
    R1 --> |fail| TR[Phase 2: Triage Pipeline]
    R2 --> |pass| R3[Run E2E Tests]
    R2 --> |fail| TR
    R3 --> |pass| DONE[All Pass]
    R3 --> |fail| TR
    TR --> P[Parser: Structured Tags]
    P --> LLM[LLM: Root Cause + Action]
    LLM --> FC[Phase 3: Fixer Catalog Lookup]
    FC --> SG{Safety Gate}
    SG --> |safe| AUTO[Auto-run Fix]
    SG --> |side-effect| ASK[AskUserQuestion]
    SG --> |destructive| BLOCK[Manual Only]
    AUTO --> L
    ASK --> |approved| L

Phase 0: Test Selection

Map code changes to test targets. See `references/test-selection.md` for full strategy.

**Strategy priority**:

| Priority | Method | When | |----------|--------|------| | 1 | Git diff filename mapping | Default — map changed files to test files via Glob | | 2 | Framework native | Jest `--changedSince`, Vitest `--changed` | | 3 | Full suite fallback | Config change, no mapping, `--all` flag |

**Steps**: 1. Collect changed files: union of unstaged + staged + untracked (`--branch` uses merge-base) 2. Apply filename mapping rules to generate candidate test paths 3. Glob-confirm each candidate exists 4. Classify confirmed tests by layer (unit / integration / e2e)

**Full suite escalation triggers**: config file changed, CI/CD file changed, package dependency changed, no test files mapped, `--all` flag.

Phase 1: Progressive Ladder

Execute tests layer-by-layer with fail-fast.

| Layer | Directory Pattern | Timeout | Fail Behavior | |-------|------------------|---------|---------------| | Unit | `test/unit/**`, `test/scripts/lib/**`, unclassified | 60s | Fail-fast → triage | | Integration | `test/integration/**` | 300s | Fail-fast → triage | | E2E | `test/e2e/**` | 600s | Enter triage |

**Fail-fast rule**: Unit fail → skip integration + e2e. Integration fail → skip e2e.

**Override**: `--no-fail-fast` disables this behavior (run all layers regardless).

**Layer detection**: Classify test files by directory prefix. Files not matching any integration/e2e pattern → treat as unit.

**Execution**: Run tests using project's configured test command (from `package.json` scripts or `CLAUDE.md`). Capture stdout/stderr and exit code.

Phase 2: Failure Triage Pipeline

When failures occur, analyze and classify. See `references/triage-pipeline.md` for full spec.

Step 1: Output Parser

Extract structured tags from test output (no classification — just structure):

| Tag | Description | |-----|-------------| | `exit_code` | Process exit code | | `error_signatures[]` | Regex-matched error patterns | | `failing_tests[]` | Failed test names | | `failing_files[]` | Failed test file paths | | `env_hints[]` | Environment clues (testnet, localhost, etc.) | | `stack_depth` | Stack trace line count |

Step 2: LLM Root Cause Analysis

Feed parser tags + compressed output to LLM for classification:

| Classification | Definition | Typical Action | |---------------|------------|----------------| | `code_bug` | Logic error in code | Fix code | | `infra` | Infrastructure issue (port, dependency) | Restart / reinstall | | `environment` | External precondition unmet | Fixer catalog action | | `flaky` | Non-deterministic failure | Retry + quarantine tag |

**Mandatory secret redaction** before LLM analysis — per `@rules/logging.md`:

  • API keys, private keys, tokens, passwords, mnemonics, URLs with credentials
  • See `references/triage-pipeline.md` for redaction patterns

Step 3: Safety-Gated Action

Route `suggested_fixer` through safety gate:

| Tier | Auto-run? | Confirmation | Examples | |------|-----------|-------------|---------| | `safe` | Yes | None | retry, clear_cache | | `side-effect` | No | AskUserQuestion | reinstall_deps, restart_server | | `destructive` | Blocked | Manual only | Reset state, drop tables |

**Default-deny**: Unknown fixer → `side-effect` tier (require confirmation).

Phase 3: Fixer Execution

Lookup fixer from catalog, check tier, execute or prompt. See `refe

Read more
@sd0xdev
Ships withsd0x-dev-flow

Language: English | 繁體中文 | 简体中文 | 日本語 | 한국어 | Español The harness layer for Claude Code. Let the model choose the path. Keep "done" verifiable. Claude has discretion inside a closed, test-pinned anchor set.

195102 skills16 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
195
Star history of sd0xdev/sd0x-dev-flow on GitHub, a chart by star-history.com

Other skills on sd0x-dev-flow.

adr

adr

Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as…

agentctl-setup

agentctl-setup

Install and set up the optional agentctl mod (task scope, refusal before execution, evidence that goes stale, model-free…

architecture

architecture

Architecture design and documentation. Produces 3-architecture.md with component diagrams, data flow, integration points, and…

ask

ask

Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or…

best-practices

best-practices

Industry best practices conformance audit with mandatory adversarial debate. Produces audit artifact: verdict (OK/WARN/FAIL) +…

bug-fix

bug-fix

Bug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev),…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about test-deep.

Which coding agents can use test-deep?
test-deep installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.