Test Framework Auto-Detector & Generator
Detects which test framework a project already uses (Jest, Vitest, Pytest, Go testing, and more) and writes new tests in that project's existing style, not a generic template.
Test Framework Auto-Detector & Generator is a free AI skill for testing & quality checks. Detects which test framework a project already uses (Jest, Vitest, Pytest, Go testing, and more) and writes new tests in that project's existing style, not a generic template. It works with Claude, Claude Code, Cursor and is ready to use out of the box.
About this skill
Generic AI-written tests often use the wrong framework, the wrong assertion style, or ignore existing test file conventions entirely, so they get rewritten by hand anyway. This skill inspects the project first — package.json, config files, existing test files, import statements — to identify the framework and its conventions (naming pattern, mocking approach, setup/teardown style, assertion library), then writes new tests that look like they belong in the codebase. It covers unit, integration, and basic end-to-end cases, and flags untestable code (tight coupling, hidden side effects) instead of writing a hollow test around it.
What it does
Given a file or function to test, the skill first identifies the testing framework already in use by inspecting config and existing test files, matches its naming and structure conventions, then generates unit tests covering the happy path, edge cases, and error conditions using the project's actual assertion and mocking style — instead of defaulting to a generic framework the project doesn't use.
What is included
- Full SKILL.md with the framework-detection checklist (config files, imports, existing test patterns)
- Convention-matching guide: naming, file placement, mocking style, assertion library per framework
- Edge-case and error-path checklist to run before writing a test, so coverage isn't just the happy path
- Guidance for flagging untestable code instead of writing a test that doesn't actually verify behavior
- Worked example: detecting Vitest from a React project and generating a matching test file
How to use it
1. Download the test-framework-auto-detector-generator-SKILL.md file 2. Add it to your agent's skills folder (e.g. .claude/skills/ for Claude Code) or upload it in a Claude.ai/Cursor chat 3. Point it at a file or function and ask for tests 4. Review the generated tests, which should already match your project's existing framework and conventions
Examples
Write tests for this function. [pastes a calculateDiscount function from a project that already uses Vitest with React Testing Library]
Detected framework: Vitest, based on vitest.config.ts and existing *.test.tsx files using describe/it and @testing-library conventions. Generated a matching test file covering: standard discount calculation, zero and negative input handling, discount caps above 100%, and a missing-price argument case — using the same describe/it structure and expect() assertions as the rest of the test suite, plus a note that the function currently swallows invalid input silently rather than throwing, which is worth a look.
FAQ
Which frameworks does it detect?
What if my project has no tests yet?
Does it just test the happy path?
Will it write a test around code that's hard to test?
Does this replace a human code reviewer?
Can it update existing tests instead of only writing new ones?
Related Skills
QA Test Case Generator
Generates a structured set of test cases — happy path, edge cases, and negative tests — from a feature description or user story.
Automated Test Suite Architect
Design maintainable automated test suites with test layers, boundaries, fixtures, mocks, coverage goals, CI execution, and ownership.
Role Based Access Control Test Planner
Plan role-based access-control testing with users, roles, permissions, resources, inheritance, escalation, revocation, audit, and negative tests.
Related Prompts
Edge Case & Test Case Generator
Analyzes a function or feature and generates a comprehensive list of edge cases and corresponding test cases, catching scenarios developers commonly miss.
AI Prompt Evaluation Suite Designer
Design a rigorous evaluation suite for testing a prompt or AI feature before shipping, covering edge cases, grading criteria, and regression tracking.