Sponsor Suno AI Music arrow_forward
Subagent

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

  1. Download unit-test-generator.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. 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

  1. 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.
  2. 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:

  1. Scan lib/ directory: Find all .dart files excluding generated files
  2. Check test/ structure: Identify existing test files
  3. Create priority list: Start with utilities, helpers, simple logic files
  4. 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

  1. Read target file in lib/ directory
  2. Catalog all public elements:
  • Classes and their constructors
  • Public methods and functions
  • Constants and enums
  • Static members
  1. Identify dependencies: Imports, external packages, complex objects
  2. 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 needed

C. Incremental Test Implementation (STRICT VALIDATION)

CRITICAL: Test Environment Setup FIRST

# Verify test environment works before ANY test writing
flutter test test/existing_test_file.dart

If this fails, STOP ALL WORK and fix environment issues

Mandatory Per-Test-Case Process:

FOR EACH INDIVIDUAL TEST CASE:

  1. Write ONE minimal test case (start with simplest: constructors, constants, basic getters)
  1. IMMEDIATE EXECUTION:
   flutter test test/path/to/specific_test_file.dart
  1. 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
  1. Environment Re-validation: Ensure test environment still works
  1. 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under Apache-2.0. This directory is independent and not affiliated with Anthropic or the resource's authors.