skills/generate-tests/SKILL.md
Generate C++ unit and functional tests from PRD/TechDoc specifications
npx skillsauth add sipherxyz/universal-ue-skills generate-testsInstall 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.
Role: Test Engineer Input: PRD/TechDoc (pasted or file reference) Output: C++ automation test files Platform: Unreal Engine 5.7
Generate comprehensive C++ test cases from feature specifications (PRD/TechDocs). Produces unit tests and functional tests by default, with optional integration and performance tests.
/qa-testing:generate-tests
Then provide the PRD by either:
docs/features/charged-attack.md/qa-testing:generate-tests <file-or-paste> [options]
Options:
--include-integration Generate integration tests
--include-perf Generate performance tests
--output <path> Override output directory
--dry-run Preview without writing files
# Paste PRD directly
/qa-testing:generate-tests
> Here's the Charged Attack PRD: [paste content]
# Reference a file
/qa-testing:generate-tests docs/features/parry-system.md
# With performance tests
/qa-testing:generate-tests docs/features/50-enemy-combat.md --include-perf
# Override output location
/qa-testing:generate-tests docs/features/combo.md --output Plugins/SipherComboGraph/Private/Tests/
1. RECEIVE PRD/TechDoc
↓
2. ANALYZE content:
- Identify target system (Combat, AI, GAS, UI)
- Extract testable requirements
- Determine test file location
↓
3. GENERATE test cases:
- Unit tests (logic, calculations)
- Functional tests (behavior with world/actors)
- Integration/Performance (if requested)
↓
4. WRITE test files to appropriate location
↓
5. REPORT summary of generated tests
Analyze PRD content to determine target system and output location:
| Keywords Found | System | Default Output Location |
|----------------|--------|-------------------------|
| combo, attack, damage, hit, parry, dodge, hitstop | Combat | Plugins/SipherComboGraph/Private/Tests/ |
| parry, deflect, block, counter | Parry | Plugins/SipherParryV2/Private/Tests/ |
| AI, behavior, patrol, aggro, coordinator, slot | AI | Plugins/SipherAIScalableFramework/Private/Tests/ |
| ability, effect, attribute, GAS, gameplay tag | GAS | Source/S2/Private/Core/ASC/Tests/ |
| UI, widget, viewmodel, HUD, menu, MVVM | UI | Source/S2/Private/UI/Tests/ |
| hit reaction, stagger, knockback | HitReaction | Plugins/SipherHitReaction/Private/Tests/ |
| QTE, quick time, prompt | QTE | Plugins/SipherQTE/Private/Tests/ |
| Multiple systems mentioned | Integration | Source/S2/Private/Tests/Integration/ |
Follow project standard: Sipher.{TestType}.{Domain}.{Category}.{TestName}
// Unit test
"Sipher.Unit.Combat.ChargedAttack.DamageScalingMinCharge"
// Functional test
"Sipher.Functional.Combat.ChargedAttack.FullChargeAppliesStagger"
// Integration test
"Sipher.Integration.Combat.ChargedAttackWithParryCounter"
// Performance test
"Sipher.Perf.Combat.ChargedAttack50Enemies"
Extract test cases from PRD by identifying these patterns:
| PRD Pattern | Test Type | Example | |-------------|-----------|---------| | Specific numbers/thresholds | Unit | "damage scales from 100% to 300%" → test min/mid/max | | "When X, then Y" | Functional | "When fully charged, adds stagger" → test stagger applied | | "Can/Cannot" | Both + Negative | "Can cancel with dodge" → test cancel works | | "If...else" conditions | Branch coverage | Each branch gets a test | | State transitions | State tests | Test each transition | | Time-based behavior | Timing tests | Test at boundary times | | Edge cases mentioned | Edge case tests | Test boundary conditions |
// {Feature}Tests.cpp
#include "Misc/AutomationTest.h"
#include "{RelevantHeaders}.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
F{Feature}_{TestCategory}_{TestName},
"Sipher.Unit.{Domain}.{Feature}.{TestName}",
EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter)
bool F{Feature}_{TestCategory}_{TestName}::RunTest(const FString& Parameters)
{
// Arrange
// Set up test data
// Act
// Call the function being tested
// Assert
// Verify expected outcomes
TestEqual("Description", Actual, Expected);
return true;
}
// {Feature}FunctionalTests.cpp
#include "Misc/AutomationTest.h"
#include "Tests/Fixtures/SipherTestFixtures.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
F{Feature}_{Scenario},
"Sipher.Functional.{Domain}.{Feature}.{Scenario}",
EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
bool F{Feature}_{Scenario}::RunTest(const FString& Parameters)
{
// Arrange
FSipherCombatTestFixture Fixture(1); // Or appropriate fixture
// Grant abilities, set up state
// Act
// Perform the action being tested
Fixture.TickCombat(Duration);
// Assert
TestTrue("Expected outcome", Condition);
return true;
}
// {Feature}PerfTests.cpp
#include "Misc/AutomationTest.h"
#include "Tests/Fixtures/SipherTestFixtures.h"
#include "Tests/Performance/PerformanceTestHelpers.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
FPerf_{Feature}_{Scenario},
"Sipher.Perf.{Domain}.{Feature}.{Scenario}",
EAutomationTestFlags::EditorContext | EAutomationTestFlags::PerfFilter)
bool FPerf_{Feature}_{Scenario}::RunTest(const FString& Parameters)
{
// Arrange
FSipherCombatTestFixture Fixture(EnemyCount);
FSipherPerfMetrics Metrics;
FSipherPerfBaseline Baseline = FSipherPerfBaseline::Load(TestName);
// Act - Run scenario
Metrics.StartCapture();
for (float Time = 0; Time < TestDuration; Time += DeltaTime)
{
Metrics.BeginFrame();
Fixture.TickCombat(DeltaTime);
Metrics.EndFrame();
}
Metrics.StopCapture();
// Assert
float Regression = Metrics.CompareToBaseline(Baseline);
TestTrue("Frame time regression under threshold",
Regression < SipherPerfConfig::FrameTimeRegressionThreshold);
return true;
}
Use shared fixtures from Source/S2/Private/Tests/Fixtures/:
| Fixture | Purpose | Usage |
|---------|---------|-------|
| FSipherTestWorld | Creates test world | Basic world setup |
| FSipherTestPlayer | Player with ASC | FSipherTestPlayer Player(World) |
| FSipherTestEnemy | Enemy with AI | FSipherTestEnemy Enemy(World, Class, Location) |
| FSipherCombatTestFixture | Full combat setup | FSipherCombatTestFixture Fixture(EnemyCount) |
After generation, report:
## Generated Tests for: {Feature Name}
**Target System:** {Detected System}
**Output Location:** {Path}
### Unit Tests (X tests)
- Sipher.Unit.{Domain}.{Feature}.{Test1}
- Sipher.Unit.{Domain}.{Feature}.{Test2}
...
### Functional Tests (Y tests)
- Sipher.Functional.{Domain}.{Feature}.{Test1}
- Sipher.Functional.{Domain}.{Feature}.{Test2}
...
### Files Created
- `{Path}/{Feature}Tests.cpp` (X tests)
- `{Path}/{Feature}FunctionalTests.cpp` (Y tests)
**Next Steps:**
1. Review generated tests for accuracy
2. Implement any missing fixture methods used
3. Run tests locally: `UnrealEditor-Cmd S2.uproject -ExecCmds="Automation RunTests Sipher.*.{Feature}; Quit"`
4. Create PR with test files
Tests are mandatory for these systems (enforced by CI):
Editor tools and non-runtime utilities are exempt.
skill: generate-tests
invoke: /qa-testing:generate-tests
type: code-generation
category: testing
scope: Source/**/Tests/, Plugins/**/Tests/
development
This skill should be used when implementing features in isolation using git worktrees. Triggers on "create worktree", "isolated workspace", "parallel development", or when starting implementation that should not affect main workspace.
testing
Manage VFX team issues on GitHub Projects - timeline scheduling, status updates, member commit checks, bulk assign. Use when managing VFX team project board, adding issues to timeline, checking member progress, or bulk-updating issue fields.
tools
Generate C++ validation rules from JSON definitions. Use when team updates ValidationRules.json or asks to add/modify validation rules.
development
Check codebase for Microsoft Xbox XR (Xbox Requirements) compliance issues. Scans for account picker, cloud saves, achievements, Quick Resume, and Xbox certification requirements. Use before console submission or when preparing for Microsoft certification. Triggers on "XR", "Xbox certification", "Microsoft compliance", "Xbox cert", "Xbox requirements", "GDK compliance".