Skip to content
Skillpedia
Testing33k Β· #8503

test-helpers

What it does

This skill creates reusable test helper code for a game project, matched to its engine and systems. It is for developers who write many tests and want less repeated setup code.

When to use it

  • βœ“When a team has finished test setup and wants shared helpers for writing tests.
  • βœ“When developers keep repeating the same setup and assertions across tests.
  • βœ“When a new engine test folder needs starter helper functions.

Skill link

https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-helpers/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-helpers/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCreate test helpers for my Godot project so our tests need less repeated setup code.”

5 new skills a week. 1 minute to read.

How it works

The skill checks the project's engine and language, then writes helper files for setup, assertions, factories and mocks in the folder the engine's test runner uses. It asks before making certain changes.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation

Automation mode: Resolve modes.automation (project.local.yaml β†’ project.yaml β†’ default collaborative). Every AskUserQuestion call and every file write follows .claude/docs/automation-modes.md (collaborative asks always Β· guided major-only Β· autonomous logs and proceeds; automation_always_ask categories always prompt).

Test Helpers

Writing test cases is faster and more consistent when common setup, teardown, and assertion patterns are abstracted into helpers. This skill generates a tests/helpers/ library tailored to the project's actual engine, language, and systems β€” so every developer writes less boilerplate and more assertions.

Output: engine-specific helper files in the engine's helper root β€” the only place its test runner compiles them (.claude/docs/directory-structure.md):

Engine Helper root
Godot tests/helpers/
Unity Assets/Tests/EditMode/Helpers/ β€” inside the EditModeTests assembly /test-setup creates. If PlayMode tests need the same helpers, ask before creating Assets/Tests/Helpers/TestHelpers.asmdef and referencing it from both test assemblies.
Unreal Source/<Module>/Private/Tests/Helpers/

tests/helpers/ below means the helper root for the project's engine.

When to run:

  • After /test-setup scaffolds the framework (first time)
  • When multiple test files repeat the same setup boilerplate
  • When starting to write tests for a new system

Assertions: use the project's test framework, never bare assert()

Generated helpers must assert through the configured test framework's assertion API, resolved from testing.framework β€” not through GDScript's built-in assert().

Two things go wrong with a bare assert() in a helper, and both are silent:

  1. It aborts the run instead of failing the test. A framework assertion records a failure and continues, so one broken expectation yields one red test. A bare assert() halts execution, so the first failure hides every result after it.
  2. It is stripped in release builds. A helper library built on assert() stops asserting entirely in exactly the build you most want checked, and does so without any error β€” the tests still "pass".

Look up the assertion form for the configured framework before generating code. Do not copy the forms in this file or in other skills' examples as authoritative β€” they are illustrative and have drifted (assert_eq, assert_true and assert_that all appear across the repo). If you cannot confirm the correct API for the project's framework, say so and generate no helper rather than guessing.

Helpers must not extend the framework's test-suite base class. A file in tests/helpers/ that extends the suite type is discovered by the runner as a test suite containing zero tests. Helpers are plain classes; only real test files extend the suite.


1. Parse Arguments

Modes:

  • /test-helpers [system-name] β€” generate helpers for a specific system (e.g., /test-helpers combat)
  • /test-helpers all β€” generate helpers for all systems with test files
  • /test-helpers scaffold β€” generate only the base helper library (no system-specific helpers); use this on first run
  • No argument β€” run scaffold if no helpers exist, else all

2. Detect Engine and Language

Read from project.yaml first, falling back to .claude/docs/technical-preferences.md for any key that is absent or empty:

  • engine.name (else the Engine: value)
  • engine.language (else the Language: value)
  • testing.framework (else Framework: from the Testing section)

If the engine is not configured in either source: "Engine not configured. Run /setup-engine first."


3. Load Existing Test Patterns

Scan the engine's test root for patterns already in use (Godot tests/, Unity Assets/Tests/, Unreal Source/<Module>/Private/Tests/):

Glob pattern="tests/**/*_test.*"                  (Godot)
Glob pattern="Assets/Tests/**/*Tests.cs"          (Unity)
Glob pattern="Source/*/Private/Tests/**/*.cpp"    (Unreal)

For a representative sample (up to 5 files), read the test files and extract:

  • Setup patterns (how before_each / setUp / fixtures are written)
  • Common assertion patterns (what is being asserted most often)
  • Object creation patterns (how game objects or scenes are instantiated in tests)
  • Mock/stub patterns (h
FAQ

Does it work with any engine?

It is tailored to the project's engine, such as Godot, Unity or Unreal, and each engine has its own helper folder.

Should I run test setup first?

Yes. The helpers are built on the test framework, so it is best to run test setup first.

Does it write tests for me?

It writes helper code to reduce boilerplate, while the tests themselves are written by developers.

Details

Original description by the author

Generate engine-specific test helper libraries β€” assertion utilities, factory functions, mocks in the engine's test folder. Reduces boilerplate.

repo: Donchitos/Claude-Code-Game-Studios

Popularity

GitHub stars
33k
Ranking position
#8503
License
MIT
Updated
10/18/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills