.github/skills/ut-coder/SKILL.md
Generate a complete, compilable unit test file from an Analyst test plan and Architect strategy. Uses AAA pattern, language-specific frameworks (NUnit, JUnit 5, pytest, Vitest), correct mock/real dependency instantiation, constructor null-guard tests, parameterized tests, and setup/teardown hooks. Input is the Analyst JSON plan plus Architect strategy summary. Use when asked to generate test code, write test implementation, create test file, or implement tests from a plan. Also invoked as Phase 3 by the unit-test-generator agent.
npx skillsauth add dneprokos/skills-examples ut-coderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate the complete, compilable test file using the Analyst's test plan and the Architect's strategy decisions. This is Phase 3 of the unit test generation pipeline.
Standalone vs. orchestrated — This skill can run independently given both a JSON test plan (from
ut-analyst) and an Architect strategy summary (fromut-architect), or it can be invoked as Phase 3 by theunit-test-generatoragent, which passes both outputs directly.
Both of the following are required:
ut-analyst (Phase 1). Provides the list of methods, test cases, dependency classifications, null-guard requirements, and non-deterministic call warnings.ut-architect (Phase 2). Provides the mock/real assignment per dependency, the test file path, assertion style, null-guard exception types, and abstraction interfaces for non-deterministic calls.If either input is missing, respond with:
Please provide both the Analyst JSON test plan and the Architect strategy summary. Run
/ut-analystthen/ut-architectfirst.
references/examples-csharp.md for C#references/examples-java.md for Javareferences/examples-python.md for Pythonreferences/examples-typescript.md for TypeScript / Reactreferences/project-patterns.md — load the project-specific conventions (framework versions, namespace format, global usings, mock patterns). If the file doesn't exist or doesn't match the detected language, check for a matching references/project-patterns-{lang}-example.md as a starting template.project-patterns.md conventions. Use the exact test file path from the Architect strategy.real — never mock themmock using the project's mocking libraryGenerate a complete, compilable (or runnable) test file. Follow these structural rules — language-specific syntax and code examples are in the loaded references/examples-{lang}.md file.
Mirror the source file's folder structure in the test directory. The test file name follows the language convention (e.g., MyClassTests.cs, MyClassTest.java, test_my_class.py, MyClass.test.ts). Follow the exact structure shown in the language reference file.
Test names communicate intent without needing to read the test body. The general pattern is:
[MethodUnderTest] / [scenario description] / [expected outcome]
The separator style varies by language — underscores for C# and Java, descriptive strings for Python and TypeScript. Examples and exact conventions are in the language reference file. Either style can use:
WithValidInput / NullArgument / WhenAlreadyInitialized for scenariosReturnsExpectedResult / ThrowsArgumentNullException / CallsDependencyOnce for outcomesEvery test uses Arrange-Act-Assert with inline comments marking each section. For very short tests where one section is trivial, combined labels (// Arrange & Act, // Act & Assert) are acceptable — match the style of the surrounding codebase.
When multiple inputs exercise the same logic with different values, use the language's parameterized test feature rather than duplicating test methods. Keep each case data-only; the test body should be identical across cases. See the language reference for the exact attribute or decorator syntax.
Create mocks for all constructor-injected dependencies and instantiate the system-under-test (SUT) in the before-each hook. If cleanup is needed (open resources, temp files), use the after-each hook. See the language reference for the exact hook syntax.
Group tests by the method or behaviour being tested using the language's grouping mechanism (regions, nested classes, or nested describe blocks). For classes with only one or two public methods, grouping is usually unnecessary. See the language reference for the preferred grouping pattern.
Before finishing, verify each item:
references/project-patterns.md for what's already globally availabledata-ai
Install and configure Windows Credential Manager style secret storage for PowerShell using SecretManagement and SecretStore. Use when users ask to install secret manager support, set up Credential Manager for GitHub token storage, or bootstrap GitHubToken for PR skills.
development
Define the mocking strategy and assertion style for a unit test plan. Classifies each dependency as mock or real, resolves assertion framework and test file location from project patterns, lists constructor null-guard tests with expected exception types, and specifies abstraction interfaces for non-deterministic calls. Input is a JSON test plan from ut-analyst. Use when asked to define mocking strategy, plan test architecture, classify dependencies as mock vs real, or design test structure. Also invoked as Phase 2 by the unit-test-generator agent.
testing
Analyze a class or function and produce a structured JSON test plan. Classifies all dependencies (interface, abstract, valueObject, dto, primitive), detects non-deterministic calls, enumerates test cases using black-box techniques (Equivalence Partitioning, Boundary Value Analysis, Decision Table, State Transition), and lists constructor null-guard requirements. Use when asked to analyze a class for testing, create a test plan, classify dependencies, or produce test case inventory. Also invoked as Phase 1 by the unit-test-generator agent.
development
Generate token usage reports in table format for different time periods. Use for tracking API token consumption, analyzing usage patterns, monitoring token costs by day/week/month periods.