Test Framework Detection
Detection scripts and patterns for identifying test frameworks across all supported languages. Use when detecting test infrastructure, analyzing project testing setup, identifying coverage tools, or when user mentions test detection, framework identification, testing setup analysis.
What this skill does
# Test Framework Detection
**CRITICAL: The description field above controls when Claude auto-loads this skill.**
## Overview
Provides detection scripts and patterns for identifying installed test frameworks, coverage tools, CI workflows, and testing infrastructure across JavaScript/TypeScript, Python, Go, and Rust projects.
## Instructions
### 1. Detection Strategy
Detection uses a **confidence scoring** approach (mirrors `stack-detector` pattern):
- **Evidence file exists** + **dependency declared** = high confidence match
- **Evidence file only** = medium confidence (may be leftover)
- **Dependency only** = low confidence (installed but not configured)
### 2. Running Detection
**Full detection orchestrator:**
```bash
bash scripts/detect-test-frameworks.sh [project-path]
```
**Language-specific detection:**
```bash
bash scripts/detect-node-testing.sh [project-path] # Jest, Vitest, Mocha, AVA
bash scripts/detect-python-testing.sh [project-path] # pytest, unittest, nose2
bash scripts/detect-go-testing.sh [project-path] # go test, testify
bash scripts/detect-rust-testing.sh [project-path] # cargo test, criterion
bash scripts/detect-ci-workflows.sh [project-path] # GitHub Actions, GitLab CI
```
### 3. Detection Patterns
**JavaScript/TypeScript:**
| Framework | Evidence Files | Dependencies |
|-----------|---------------|--------------|
| Vitest | `vitest.config.ts`, `vitest.config.js` | `vitest` in devDependencies |
| Jest | `jest.config.js`, `jest.config.ts`, `jest.config.mjs` | `jest` in devDependencies |
| Mocha | `.mocharc.yml`, `.mocharc.json`, `.mocharc.js` | `mocha` in devDependencies |
| AVA | `ava.config.js`, `ava.config.cjs` | `ava` in devDependencies |
| Playwright | `playwright.config.ts`, `playwright.config.js` | `@playwright/test` in devDependencies |
**Python:**
| Framework | Evidence Files | Dependencies |
|-----------|---------------|--------------|
| pytest | `pytest.ini`, `pyproject.toml` [tool.pytest], `setup.cfg` [tool:pytest], `conftest.py` | `pytest` in requirements/pyproject |
| unittest | `test_*.py` files with `import unittest` | stdlib (always available) |
| nose2 | `unittest.cfg`, `setup.cfg` [unittest] | `nose2` in requirements |
**Go:**
| Framework | Evidence Files | Dependencies |
|-----------|---------------|--------------|
| go test | `*_test.go` files | stdlib (always available) |
| testify | `*_test.go` with `testify` imports | `github.com/stretchr/testify` in go.mod |
**Rust:**
| Framework | Evidence Files | Dependencies |
|-----------|---------------|--------------|
| cargo test | `#[cfg(test)]` modules, `tests/` directory | stdlib (always available) |
| criterion | `benches/` directory | `criterion` in Cargo.toml dev-dependencies |
### 4. Coverage Tool Detection
| Tool | Language | Evidence |
|------|----------|----------|
| v8/c8 | Node.js | `c8` in devDependencies or `--coverage` in test script |
| istanbul/nyc | Node.js | `nyc` in devDependencies |
| coverage.py | Python | `coverage` in requirements, `.coveragerc` |
| go cover | Go | Built-in, `go test -cover` |
| tarpaulin | Rust | `cargo-tarpaulin` installed |
### 5. Output Format
Detection writes an expanded `testing` key to `.claude/project.json`:
```json
{
"testing": {
"unit": {
"framework": "vitest",
"config": "vitest.config.ts",
"command": "npm run test"
},
"api_contract": {
"framework": "newman",
"collections": [],
"auth_strategy": "none"
},
"e2e": {
"framework": "playwright",
"config": "playwright.config.ts"
},
"smoke": {
"health_endpoint": "/api/health",
"critical_paths": ["/", "/login"]
},
"coverage": {
"tool": "v8",
"threshold": 80
},
"ci_workflows": [".github/workflows/test.yml"],
"ai_detected": false,
"llm_evals_plugin": "llm-evals"
}
}
```
### 6. CI Workflow Detection
Scans `.github/workflows/*.yml` and `.gitlab-ci.yml` to identify:
- Which test types are already running in CI
- Test commands used in CI vs local
- Coverage reporting in CI
- Test result artifact storage
### 7. AI Framework Detection
Flags `ai_detected: true` when any of these are found:
- `@ai-sdk/` packages in dependencies
- `langchain` in dependencies
- `openai` SDK in dependencies
- `@anthropic-ai/sdk` in dependencies
- `transformers` in Python dependencies
When AI is detected, notes that LLM eval testing should use the `llm-evals` plugin.
## Available Scripts
1. **detect-test-frameworks.sh** - Main orchestrator that runs all detectors
2. **detect-node-testing.sh** - Detect Jest, Vitest, Mocha, AVA, Playwright for Node.js
3. **detect-python-testing.sh** - Detect pytest, unittest, nose2 for Python
4. **detect-go-testing.sh** - Detect go test, testify for Go
5. **detect-rust-testing.sh** - Detect cargo test, criterion for Rust
6. **detect-ci-workflows.sh** - Detect GitHub Actions and GitLab CI test workflows
## Available Templates
1. **project-json-testing-schema.json** - JSON schema for the expanded testing key
2. **detection-report.md** - Template for detection result reporting
## Available Examples
1. **node-project-detection.md** - Example detection for a Node.js/TypeScript project
2. **python-project-detection.md** - Example detection for a Python project
3. **multi-stack-detection.md** - Example detection for a multi-language project
## Requirements
- bash shell for running detection scripts
- jq for JSON processing
- Access to project root directory
## Progressive Disclosure
- Read `examples/node-project-detection.md` for Node.js detection walkthrough
- Read `examples/python-project-detection.md` for Python detection walkthrough
- Read `templates/project-json-testing-schema.json` for the complete schema definition
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.