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.
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..."