Polyglot Test Generation Skill
An AI-powered skill that generates comprehensive, workable unit tests for any programming language using a coordinated multi-agent pipeline.
When to Use This Skill
Use this skill when you need to:
- Generate unit tests for an entire project or specific files
- Improve test coverage for existing codebases
- Create test files that follow project conventions
- Write tests that actually compile and pass
- Add tests for new features or untested code
How It Works
This skill coordinates multiple specialized agents in a Research → Plan → Implement pipeline:
Pipeline Overview
┌─────────────────────────────────────────────────────────────┐
│ TEST GENERATOR │
│ Coordinates the full pipeline and manages state │
└─────────────────────┬───────────────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────────┐
│ RESEARCHER│ │ PLANNER │ │ IMPLEMENTER │
│ │ │ │ │ │
│ Analyzes │ │ Creates │ │ Writes tests │
│ codebase │→ │ phased │→ │ per phase │
│ │ │ plan │ │ │
└───────────┘ └───────────┘ └───────┬───────┘
│
┌─────────┬───────┼───────────┐
▼ ▼ ▼ ▼
┌─────────┐ ┌───────┐ ┌───────┐ ┌───────┐
│ BUILDER │ │TESTER │ │ FIXER │ │LINTER │
│ │ │ │ │ │ │ │
│ Compiles│ │ Runs │ │ Fixes │ │Formats│
│ code │ │ tests │ │ errors│ │ code │
└─────────┘ └───────┘ └───────┘ └───────┘
Step-by-Step Instructions
Step 1: Determine the User Request
Make sure you understand what user is asking and for what scope.
When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from unit-test-generation.prompt.md. This prompt provides best practices for discovering conventions, parameterization strategies, coverage goals (aim for 80%), and language-specific patterns.
Step 2: Invoke the Test Generator
Start by calling the polyglot-test-generator agent with your test generation request:
Generate unit tests for [path or description of what to test], following the [unit-test-generation.prompt.md](unit-test-generation.prompt.md) guidelines
The Test Generator will manage the entire pipeline automatically.
Step 3: Research Phase (Automatic)
The polyglot-test-researcher agent analyzes your codebase to understand:
- Language & Framework: Detects C#, TypeScript, Python, Go, Rust, Java, etc.
- Testing Framework: Identifies MSTest, xUnit, Jest, pytest, go test, etc.
- Project Structure: Maps source files, existing tests, and dependencies
- Build Commands: Discovers how to build and test the project
Output: .testagent/research.md
Step 4: Planning Phase (Automatic)
The polyglot-test-planner agent creates a structured implementation plan:
- Groups files into logical phases (2-5 phases typical)
- Prioritizes by complexity and dependencies
- Specifies test cases for each file
- Defines success criteria per phase
Output: .testagent/plan.md
Step 5: Implementation Phase (Automatic)
The polyglot-test-implementer agent executes each phase sequentially:
- Read source files to understand the API
- Write test files following project patterns
- Build using the
polyglot-test-builder subagent to verify compilation
- Test using the
polyglot-test-tester subagent to verify tests pass
- Fix using the
polyglot-test-fixer subagent if errors occur
- Lint using the
polyglot-test-linter subagent for code formatting
Each phase completes before the next begins, ensuring incremental progress.
Coverage Types
- Happy path: Valid inputs produce expected outputs
- Edge cases: Empty values, boundaries, special characters
- Error cases: Invalid inputs, null handling, exceptions
State Management
All pipeline state is stored in .testagent/ folder:
| File |
Purpose |
.testagent/research.md |
Codebase analysis results |
.testagent/plan.md |
Phased implementation plan |
.testagent/status.md |
Progress tracking (optional) |
Examples
Example 1: Full Project Testing
Generate unit tests for my Calculator project at C:\src\Calculator
Example 2: Specific File Testing
Generate unit tests for src/services/UserService.ts
Example 3: Targeted Coverage
Add tests for the authentication module with focus on edge cases
Agent Reference
| Agent |
Purpose |
Tools |
polyglot-test-generator |
Coordinates pipeline |
runCommands, codebase, editFiles, search, runSubagent |
polyglot-test-researcher |
Analyzes codebase |
runCommands, codebase, editFiles, search, fetch, runSubagent |
polyglot-test-planner |
Creates test plan |
codebase, editFiles, search, runSubagent |
polyglot-test-implementer |
Writes test files |
runCommands, codebase, editFiles, search, runSubagent |
polyglot-test-builder |
Compiles code |
runCommands, codebase, search |
polyglot-test-tester |
Runs tests |
runCommands, codebase, search |
polyglot-test-fixer |
Fixes errors |
runCommands, codebase, editFiles, search |
polyglot-test-linter |
Formats code |
runCommands, codebase, search |
Requirements
- Project must have a build/test system configured
- Testing framework should be installed (or installable)
- VS Code with GitHub Copilot extension
Troubleshooting
Tests don't compile
The polyglot-test-fixer agent will attempt to resolve compilation errors. Check .testagent/plan.md for the expected test structure.
Tests fail
Review the test output and adjust test expectations. Some tests may require mocking dependencies.
Wrong testing framework detected
Specify your preferred framework in the initial request: "Generate Jest tests for..."
1---2name: polyglot-test-agent3description: Generates comprehensive, workable unit tests for any programming language using a multi-agent pipeline. Use when asked to generate tests, write unit tests, improve test coverage, add test coverage, create test files, or test a codebase. Supports C#, TypeScript, JavaScript, Python, Go, Rust, Java, and more. Orchestrates research, planning, and implementation phases to produce tests that compile, pass, and follow project conventions.4---5
6# Polyglot Test Generation Skill
7
8An AI-powered skill that generates comprehensive, workable unit tests for any programming language using a coordinated multi-agent pipeline.
9
10## When to Use This Skill
11
12Use this skill when you need to:
13- Generate unit tests for an entire project or specific files
14- Improve test coverage for existing codebases
15- Create test files that follow project conventions
16- Write tests that actually compile and pass
17- Add tests for new features or untested code
18
19## How It Works
20
21This skill coordinates multiple specialized agents in a **Research → Plan → Implement** pipeline:
22
23### Pipeline Overview
24
25```
26┌─────────────────────────────────────────────────────────────┐
27│ TEST GENERATOR │
28│ Coordinates the full pipeline and manages state │
29└─────────────────────┬───────────────────────────────────────┘
30 │
31 ┌─────────────┼─────────────┐
32 ▼ ▼ ▼
33┌───────────┐ ┌───────────┐ ┌───────────────┐
34│ RESEARCHER│ │ PLANNER │ │ IMPLEMENTER │
35│ │ │ │ │ │
36│ Analyzes │ │ Creates │ │ Writes tests │
37│ codebase │→ │ phased │→ │ per phase │
38│ │ │ plan │ │ │
39└───────────┘ └───────────┘ └───────┬───────┘
40 │
41 ┌─────────┬───────┼───────────┐
42 ▼ ▼ ▼ ▼
43 ┌─────────┐ ┌───────┐ ┌───────┐ ┌───────┐
44 │ BUILDER │ │TESTER │ │ FIXER │ │LINTER │
45 │ │ │ │ │ │ │ │
46 │ Compiles│ │ Runs │ │ Fixes │ │Formats│
47 │ code │ │ tests │ │ errors│ │ code │
48 └─────────┘ └───────┘ └───────┘ └───────┘
49```
50
51## Step-by-Step Instructions
52
53### Step 1: Determine the User Request
54
55Make sure you understand what user is asking and for what scope.
56When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from [unit-test-generation.prompt.md](unit-test-generation.prompt.md). This prompt provides best practices for discovering conventions, parameterization strategies, coverage goals (aim for 80%), and language-specific patterns.
57
58### Step 2: Invoke the Test Generator
59
60Start by calling the `polyglot-test-generator` agent with your test generation request:
61
62```
63Generate unit tests for [path or description of what to test], following the [unit-test-generation.prompt.md](unit-test-generation.prompt.md) guidelines
64```
65
66The Test Generator will manage the entire pipeline automatically.
67
68### Step 3: Research Phase (Automatic)
69
70The `polyglot-test-researcher` agent analyzes your codebase to understand:
71- **Language & Framework**: Detects C#, TypeScript, Python, Go, Rust, Java, etc.
72- **Testing Framework**: Identifies MSTest, xUnit, Jest, pytest, go test, etc.
73- **Project Structure**: Maps source files, existing tests, and dependencies
74- **Build Commands**: Discovers how to build and test the project
75
76Output: `.testagent/research.md`
77
78### Step 4: Planning Phase (Automatic)
79
80The `polyglot-test-planner` agent creates a structured implementation plan:
81- Groups files into logical phases (2-5 phases typical)
82- Prioritizes by complexity and dependencies
83- Specifies test cases for each file
84- Defines success criteria per phase
85
86Output: `.testagent/plan.md`
87
88### Step 5: Implementation Phase (Automatic)
89
90The `polyglot-test-implementer` agent executes each phase sequentially:
91
921. **Read** source files to understand the API
932. **Write** test files following project patterns
943. **Build** using the `polyglot-test-builder` subagent to verify compilation
954. **Test** using the `polyglot-test-tester` subagent to verify tests pass
965. **Fix** using the `polyglot-test-fixer` subagent if errors occur
976. **Lint** using the `polyglot-test-linter` subagent for code formatting
98
99Each phase completes before the next begins, ensuring incremental progress.
100
101### Coverage Types
102- **Happy path**: Valid inputs produce expected outputs
103- **Edge cases**: Empty values, boundaries, special characters
104- **Error cases**: Invalid inputs, null handling, exceptions
105
106## State Management
107
108All pipeline state is stored in `.testagent/` folder:
109
110| File | Purpose |
111|------|---------|
112| `.testagent/research.md` | Codebase analysis results |
113| `.testagent/plan.md` | Phased implementation plan |
114| `.testagent/status.md` | Progress tracking (optional) |
115
116## Examples
117
118### Example 1: Full Project Testing
119```
120Generate unit tests for my Calculator project at C:\src\Calculator
121```
122
123### Example 2: Specific File Testing
124```
125Generate unit tests for src/services/UserService.ts
126```
127
128### Example 3: Targeted Coverage
129```
130Add tests for the authentication module with focus on edge cases
131```
132
133## Agent Reference
134
135| Agent | Purpose | Tools |
136|-------|---------|-------|
137| `polyglot-test-generator` | Coordinates pipeline | runCommands, codebase, editFiles, search, runSubagent |
138| `polyglot-test-researcher` | Analyzes codebase | runCommands, codebase, editFiles, search, fetch, runSubagent |
139| `polyglot-test-planner` | Creates test plan | codebase, editFiles, search, runSubagent |
140| `polyglot-test-implementer` | Writes test files | runCommands, codebase, editFiles, search, runSubagent |
141| `polyglot-test-builder` | Compiles code | runCommands, codebase, search |
142| `polyglot-test-tester` | Runs tests | runCommands, codebase, search |
143| `polyglot-test-fixer` | Fixes errors | runCommands, codebase, editFiles, search |
144| `polyglot-test-linter` | Formats code | runCommands, codebase, search |
145
146## Requirements
147
148- Project must have a build/test system configured
149- Testing framework should be installed (or installable)
150- VS Code with GitHub Copilot extension
151
152## Troubleshooting
153
154### Tests don't compile
155The `polyglot-test-fixer` agent will attempt to resolve compilation errors. Check `.testagent/plan.md` for the expected test structure.
156
157### Tests fail
158Review the test output and adjust test expectations. Some tests may require mocking dependencies.
159
160### Wrong testing framework detected
161Specify your preferred framework in the initial request: "Generate Jest tests for..."