test-helpers
Fungsinya
Skill ini membuat kode pembantu tes yang bisa dipakai ulang untuk proyek game, disesuaikan dengan engine dan sistemnya. Cocok untuk pengembang yang menulis banyak tes dan ingin lebih sedikit kode pengaturan yang berulang.
Kapan dipakai
- βSaat sebuah tim telah selesai menyiapkan pengujian dan menginginkan pembantu bersama untuk menulis tes.
- βSaat pengembang terus mengulang pengaturan dan asersi yang sama di banyak tes.
- βSaat folder tes engine baru membutuhkan fungsi pembantu awal.
Link skill
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-helpers/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuatkan pembantu tes untuk proyek Godot saya agar tes kami membutuhkan lebih sedikit kode pengaturan yang berulang.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill memeriksa engine dan bahasa proyek, lalu menulis file pembantu untuk pengaturan, asersi, pabrik (factory), dan tiruan di folder yang dipakai oleh penjalan tes engine. Skill meminta persetujuan sebelum membuat perubahan tertentu.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah skill ini bekerja dengan engine apa pun?
Skill disesuaikan dengan engine proyek, seperti Godot, Unity, atau Unreal, dan setiap engine punya folder pembantunya sendiri.
Apakah saya harus menjalankan pengaturan tes dulu?
Ya. Pembantu dibangun di atas kerangka tes, jadi sebaiknya jalankan pengaturan tes terlebih dahulu.
Apakah skill ini menulis tes untuk saya?
Skill menulis kode pembantu untuk mengurangi kode berulang, sedangkan tes itu sendiri ditulis oleh pengembang.
Detail
Deskripsi asli dari pembuat
Generate engine-specific test helper libraries β assertion utilities, factory functions, mocks in the engine's test folder. Reduces boilerplate.
Popularitas
- Bintang GitHub
- 33k
- Peringkat
- #8503
- Lisensi
- MIT
- Diperbarui
- 18/10/2026
Komentar
- β¦
Skill lain dari repositori ini
adopt
33kMemeriksa apakah dokumen proyek game yang sudah ada mengikuti format template studio, lalu menulis rencana migrasi bernomor untuk memperbaiki celah yang ditemukan.
architecture-decision
33kMenulis catatan keputusan arsitektur untuk pilihan teknis, mencakup konteks, alternatif, dan konsekuensi, dengan tinjauan dari peran teknis yang tepat.
architecture-review
33kMemeriksa bahwa keputusan teknis Anda mencakup setiap kebutuhan desain, tidak saling bertentangan, dan sesuai versi mesin, dengan vonis lulus atau kekhawatiran yang jelas.
art-bible
33kMenulis art bible yang mendefinisikan identitas visual game Anda, sehingga produksi aset mengikuti satu rangkaian aturan gaya yang jelas.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.