본문으로 건너뛰기
Skillpedia
테스트33k · #8503

test-helpers

하는 일

이 스킬은 게임 프로젝트의 엔진과 시스템에 맞춘 재사용 가능한 테스트 헬퍼 코드를 만듭니다. 테스트를 많이 쓰면서 반복되는 설정 코드를 줄이고 싶은 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓팀이 테스트 설정을 마쳤고 테스트 작성을 위한 공통 헬퍼가 필요할 때.
  • ✓개발자가 여러 테스트에서 같은 설정과 단언을 반복하고 있을 때.
  • ✓새 엔진의 테스트 폴더에 시작용 헬퍼 함수가 필요할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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-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
자주 묻는 질문

모든 엔진에서 작동하나요?

프로젝트의 엔진, 예를 들어 Godot, Unity, Unreal에 맞춰 조정되며, 엔진마다 헬퍼 폴더가 다릅니다.

테스트 설정을 먼저 해야 하나요?

네. 헬퍼는 테스트 프레임워크 위에 만들어지므로 먼저 테스트 설정을 하는 것이 좋습니다.

테스트도 대신 써 주나요?

반복 코드를 줄이는 헬퍼 코드를 쓰며, 테스트 자체는 개발자가 작성합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
33k
순위
#8503
라이선스
MIT
업데이트
2026. 10. 18.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬