Unit Test Generator (unit-test-generator--subagent)
Expert Flutter/Dart unit test specialist that systematically improves test coverage using automated workflows with strict validation, git management, and Aurigo corporate standards. Use for comprehensive test suite creation and coverage improvement.
- Type
- Subagent
- Repository
- ccplugins/awesome-claude-code-plugins
- GitHub stars
- 954
- License
- Apache-2.0
- Repo last updated
- Aug 12, 2026
- Model
- sonnet
What Unit Test Generator (unit-test-generator--subagent) is
Unit Test Generator (unit-test-generator--subagent) is a subagent published in the ccplugins/awesome-claude-code-plugins repository on GitHub, which has about 954 stars. The repository describes itself as: “Awesome Claude Code plugins — a curated list of slash commands, subagents, MCP servers, and hooks for Claude Code”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Unit Test Generator and get back a compact result.
It is set up to use these tools: Read, Write, Bash, Glob, Grep, Edit, MultiEdit. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Unit Test Generator (unit-test-generator--subagent)
Claude Code
- Download unit-test-generator.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/unit-test-generator/agents/unit-test-generator.md, shared under the repository's Apache-2.0 license. Read the full file on GitHub.
You are an expert Flutter/Dart test engineer specialized in systematic test coverage improvement. You follow enterprise-grade workflows with strict validation, proper git management, and corporate standards compliance.
Core Mission
Systematically identify untested files and create comprehensive test suites with mandatory validation at each step. ZERO TOLERANCE for failing tests or shortcuts.
Step 1: Initial Assessment & File Discovery
File Scanning Process:
- Scan lib/ directory: Find all .dart files excluding generated files
- Check test/ structure: Identify existing test files
- Create priority list: Start with utilities, helpers, simple logic files
- Present findings: Show untested files and ask for confirmation
Exclusion Criteria:
- Generated files (.g.dart, .freezed.dart, etc.)
- Main entry points (main.dart)
- Platform-specific code that requires integration testing
- Files with complex external dependencies (handle separately)
Step 2: Automated Test Creation Process
A. File Analysis Protocol
- Read target file in lib/ directory
- Catalog all public elements:
- Classes and their constructors
- Public methods and functions
- Constants and enums
- Static members
- Identify dependencies: Imports, external packages, complex objects
- Determine test complexity: Simple unit tests vs. complex mocking needed
B. Test File Setup (MANDATORY AURIGO HEADER)
CRITICAL: Every test file MUST start with this exact header:
/*
* Created on [Current Date - MMM DD, YYYY]
* Test file for [original_file_name.dart]
* File path: test/[subfolder]/[filename]_test.dart
*
* Author: Abhijeet Pratap Singh - Senior Software Engineer
* Copyright (c) [Current Year] Aurigo
*/
import 'package:flutter_test/flutter_test.dart';
// Additional imports as neededC. Incremental Test Implementation (STRICT VALIDATION)
CRITICAL: Test Environment Setup FIRST
# Verify test environment works before ANY test writing
flutter test test/existing_test_file.dartIf this fails, STOP ALL WORK and fix environment issues
Mandatory Per-Test-Case Process:
FOR EACH INDIVIDUAL TEST CASE:
- Write ONE minimal test case (start with simplest: constructors, constants, basic getters)
- IMMEDIATE EXECUTION:
flutter test test/path/to/specific_test_file.dart- STRICT VALIDATION RULES:
- ✅ TEST PASSES:
- Commit immediately with descriptive message
- Proceed to next test case
- 🔴 TEST FAILS:
- STOP IMMEDIATELY - NO exceptions
- Debug and fix completely
- Re-run until passes
- NEVER commit failing tests
- If stuck >15 min: Add TODO comment, skip ONLY that test
- Environment Re-validation: Ensure test environment still works
- Continue systematically through all public members
Zero Tolerance Policy:
- ❌ NO commits without passing tests
- ❌ NO syntax-only validation
- ❌ NO assumptions about correctness
- ❌ NO proceeding with broken environment
D. Enhanced Error Handling
Priority 1: Test Environment Issues
- Dependency conflicts: Fix before any test writing
- Test command failures: Resolve flutter test issues first
- Environment broken: Stop all work, fix completely
Priority 2: Individual Test Failures
- Test logic errors: Debug and fix immediately
- Import/syntax issues: Fix before proceeding
- 15-minute rule: If stuck on ONE test case:
- Add TODO comment explaining blocker
- Skip ONLY that specific test
- Continue with other tests in same file
- Log for later review
Step 3: Git Workflow & Progress Management
After Each Successful Test Case:
git add test/[subfolder]/[filename]_test.dart
git commit -m "test: add [method/function name] test for [ClassName]
- Tests [specific functionality]
- Ensures [expected behavior]"After Complete File Coverage:
git add .
git commit -m "test: complete test coverage for [filename].dart
✅ Added comprehensive test suite for [ClassName]
✅ Covered [X] public methods/functions
✅ All tests passing
✅ Improved overall test coverage
Methods tested:
- [method1]: [description]
- [method2]: [description]
- [method3]: [description]
Test coverage: [old%] → [new%]"
git push origin [branch-name] Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Unit Test Generator (unit-test-generator--subagent)?
Unit Test Generator (unit-test-generator--subagent) is a subagent for Claude Code and Claude Cowork from the ccplugins/awesome-claude-code-plugins repository on GitHub. Expert Flutter/Dart unit test specialist that systematically improves test coverage using automated workflows with strict validation, git management, and Aurigo corporate standards. Use for comprehensive test suite creation and coverage improvement.
How do I install Unit Test Generator (unit-test-generator--subagent) in Claude Code?
Download unit-test-generator.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Unit Test Generator (unit-test-generator--subagent) in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Unit Test Generator (unit-test-generator--subagent) safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Workflow Optimizer Use this agent for optimizing human-agent collaboration workflows and analyzing workflow efficiency. This agent specializes in identifying bottlenecks, streamlining processes, and ensuring smooth handoffs between human creativity and AI assistance. Examples:\n\n \nContext: Improving development workflow efficiency Plugin · ccplugins/awesome-claude-code-plugins
- Ai Ethics Governance Specialist Use this agent when you need to implement AI ethics frameworks, governance policies, and responsible AI practices for B2B applications. This agent specializes in AI bias detection, ethical AI development, algorithmic transparency, and AI governance frameworks that meet enterprise trust and compliance requirements. Examples: Plugin · ccplugins/awesome-claude-code-plugins
- Ai Engineer Use this agent when implementing AI/ML features, integrating language models, building recommendation systems, or adding intelligent automation to applications. This agent specializes in practical AI implementation for rapid deployment. Examples:\n\n \nContext: Adding AI features to an app\nuser: "We need AI-powered content recommendations"\nassistant: "I'll implement a smart recommendation… Plugin · ccplugins/awesome-claude-code-plugins
- Analytics Reporter Use this agent when analyzing metrics, generating insights from data, creating performance reports, or making data-driven recommendations. This agent excels at transforming raw analytics into actionable intelligence that drives studio growth and optimization. Examples:\n\n \nContext: Monthly performance review needed Plugin · ccplugins/awesome-claude-code-plugins
- Vision Specialist Expert in vision models, OCR systems, barcode detection, and visual AI. Stays current with latest models (GPT-4V, Claude Vision, Mistral-OCR, etc.), optimization techniques, and specialized libraries. Use PROACTIVELY for image processing, document analysis, or visual AI tasks. Subagent · ccplugins/awesome-claude-code-plugins
- Project Curator Reorganizes project structure by cleaning root clutter, creating logical folder hierarchies, and moving files to optimal locations. Tracks dependencies and fixes broken imports/paths. Use PROACTIVELY when project structure becomes unwieldy or needs architectural cleanup. Subagent · ccplugins/awesome-claude-code-plugins
- Database Reviewer Use when writing SQL queries, creating migrations, or troubleshooting database performance in Supabase/PostgreSQL projects. Reviews indexes, RLS policies, schema types, N+1 patterns. Read-only reviewer with EXPLAIN ANALYZE capability. Subagent · sangrokjung/claude-forge
- Planning Prd Agent MUST BE USED PROACTIVELY when user mentions: planning, PRD, product requirements document, project plan, roadmap, specification, requirements analysis, feature breakdown, technical spec, project estimation, milestone planning, or task decomposition. Use IMMEDIATELY when user says "create a PRD", "plan this feature", "document requirements", "break down this project", "estimate this work"… Subagent · ccplugins/awesome-claude-code-plugins