.cursor/skills/ut-architect/SKILL.md
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.
npx skillsauth add dneprokos/skills-examples ut-architectInstall 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.
Define the mocking strategy, assertion style, and test structure from the Analyst's dependency classification. This is Phase 2 of the unit test generation pipeline.
Standalone vs. orchestrated — This skill can run independently given a JSON test plan produced by
ut-analyst, or it can be invoked as Phase 2 by theunit-test-generatoragent, which passes the Analyst's output directly.
A JSON test plan produced by the ut-analyst skill (Phase 1). The plan must include:
dependencies[] with classification set for every entryconstructorNullGuards[] listing interface/abstract constructor parametersnonDeterministicCalls[] if any were detectedlanguage and testFilePathIf no JSON plan is provided and the user has not run Phase 1, respond with:
Please provide the Analyst JSON test plan first. Run
/ut-analyston your source class to generate it, then paste the output here.
references/project-patterns.md — load the active project's test framework, assertion library, null-exception convention, and test file path rules. This determines assertion style (e.g., FluentAssertions vs. AssertJ vs. plain assert) and the exact exception type to expect in null-guard tests.For each dependency in the plan:
| Classification | Strategy | Rationale |
|---|---|---|
| interface | mock | Behavioral contract — must be isolated |
| abstract | mock | Behavioral contract — must be isolated |
| valueObject | real | Immutable data — real instances are simpler and more accurate |
| dto | real | Data container — construct with real values |
| primitive | real | Value type — no isolation needed |
Rule: Never mock Value Objects, DTOs, records, data classes, or primitives. Construct real instances. This is mandatory and overrides any other guidance.
Use references/project-patterns.md to determine:
MyClassTests.cs, MyClassTest.java, test_my_class.py, MyClass.test.ts)For each entry in constructorNullGuards[]:
project-patterns.md)Language defaults if not specified in project-patterns.md:
| Language | Null exception |
|---|---|
| C# | ArgumentNullException |
| Java | NullPointerException |
| Python | TypeError or ValueError |
| TypeScript | TypeError |
For each entry in nonDeterministicCalls[], specify:
IDateTimeProvider)interface → mockEmit a concise strategy summary:
## Architect Strategy
- Mocked: [IRepository, IEmailService, IDateTimeProvider]
- Real instances: [Address, Money, CreateUserDto]
- Constructor null-guards: [repository → ArgumentNullException("repository"), emailService → ArgumentNullException("emailService")]
- Non-deterministic abstractions: [DateTime.UtcNow → inject IDateTimeProvider → mock with fixed DateTimeOffset]
- Test file: [path/to/MyClassTests.cs]
- Assert style: FluentAssertions (.Should())
If running standalone (not skipReview: true): After emitting the summary, stop and ask:
"Architect phase complete. Review the strategy above. Reply 'continue' to generate the test code, or provide feedback to adjust."
If skipReview: true (passed by user or orchestrator): Emit the summary and continue without pausing.
data-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
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.
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.