test-helpers
できること
このスキルは、ゲームプロジェクトのエンジンと仕組みに合わせて、再利用できるテストヘルパーのコードを作成します。多くのテストを書き、繰り返しのセットアップコードを減らしたい開発者向けです。
使う場面
- ✓チームがテストのセットアップを終え、テストを書くための共通ヘルパーを必要としているとき。
- ✓テストごとに同じセットアップやアサーションを何度も書いているとき。
- ✓新しいエンジンのテストフォルダに、最初のヘルパー関数が必要な場合。
スキルのリンク
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-helpers/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Godotプロジェクト用のテストヘルパーを作成して、テストで繰り返すセットアップコードを減らしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルはプロジェクトのエンジンと言語を確認し、テストランナーが使うフォルダに、セットアップ、アサーション、ファクトリー、モック用のヘルパーファイルを書きます。一部の変更を行う前には確認を求めます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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-setupscaffolds 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:
- 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. - 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
scaffoldif no helpers exist, elseall
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 theEngine:value)engine.language(else theLanguage:value)testing.framework(elseFramework: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
よくある質問
どのエンジンでも使えますか?
Godot、Unity、Unrealなど、プロジェクトのエンジンに合わせて作られ、エンジンごとに専用のヘルパーフォルダがあります。
先にテストのセットアップが必要ですか?
はい。ヘルパーはテストフレームワークの上に作られるため、先にテストのセットアップを行うのが最善です。
テスト自体も書いてくれますか?
ヘルパーのコードを書いて定型的な作業を減らします。テストそのものは開発者が書きます。
詳細
作者による元の説明
Generate engine-specific test helper libraries — assertion utilities, factory functions, mocks in the engine's test folder. Reduces boilerplate.
人気
- GitHubのスター
- 33k
- ランキング
- #8503
- ライセンス
- MIT
- 更新日
- 2026/10/18
コメント
- …
このリポジトリの他のスキル
adopt
33k既存のゲームプロジェクトの文書がスタジオのテンプレートの形式に従っているか確認し、ギャップを直すための番号付きの移行計画を書きます。
architecture-decision
33k技術的な選択についてアーキテクチャの判断記録を書き、背景、代替案、影響を記載し、適切な技術の役割によるレビューを受けます。
architecture-review
33k技術的な判断がすべての設計要件を満たし、互いに矛盾せず、エンジンのバージョンに合うかを確認し、明確な合格または懸念の判定を出します。
art-bible
33kゲームのビジュアルのアイデンティティを定義するアートバイブルを書き、アセット制作が一つの明確なスタイルのルールに従うようにします。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。