[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F62NP4SAV0B7XECZ759X2J":3,"skill-same:01M7F62NP4SAV0B7XECZ759X2J":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M7F62NP4SAV0B7XECZ759X2J","test-helpers",null,"Generate engine-specific test helper libraries for the project's test suite. Reads existing test patterns and produces tests\u002Fhelpers\u002F with assertion utilities, factory functions, and mock objects tailored to the project's systems. Reduces boilerplate in new test files.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Ftest-helpers\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: test-helpers\ndescription: \"Generate engine-specific test helper libraries for the project's test suite. Reads existing test patterns and produces tests\u002Fhelpers\u002F with assertion utilities, factory functions, and mock objects tailored to the project's systems. Reduces boilerplate in new test files.\"\nargument-hint: \"[system-name | all | scaffold]\"\nuser-invocable: true\nallowed-tools: Read, Glob, Grep, Write\n---\n\n# Test Helpers\n\nWriting test cases is faster and more consistent when common setup, teardown,\nand assertion patterns are abstracted into helpers. This skill generates a\n`tests\u002Fhelpers\u002F` library tailored to the project's actual engine, language,\nand systems — so every developer writes less boilerplate and more assertions.\n\n**Output:** `tests\u002Fhelpers\u002F` directory with engine-specific helper files\n\n**When to run:**\n- After `\u002Ftest-setup` scaffolds the framework (first time)\n- When multiple test files repeat the same setup boilerplate\n- When starting to write tests for a new system\n\n---\n\n## 1. Parse Arguments\n\n**Modes:**\n- `\u002Ftest-helpers [system-name]` — generate helpers for a specific system\n  (e.g., `\u002Ftest-helpers combat`)\n- `\u002Ftest-helpers all` — generate helpers for all systems with test files\n- `\u002Ftest-helpers scaffold` — generate only the base helper library (no\n  system-specific helpers); use this on first run\n- No argument — run `scaffold` if no helpers exist, else `all`\n\n---\n\n## 2. Detect Engine and Language\n\nRead `.claude\u002Fdocs\u002Ftechnical-preferences.md` and extract:\n- `Engine:` value\n- `Language:` value\n- `Framework:` from the Testing section\n\nIf engine is not configured: \"Engine not configured. Run `\u002Fsetup-engine` first.\"\n\n---\n\n## 3. Load Existing Test Patterns\n\nScan the test directory for patterns already in use:\n\n```\nGlob pattern=\"tests\u002F**\u002F*_test.*\" (all test files)\n```\n\nFor a representative sample (up to 5 files), read the test files and extract:\n- Setup patterns (how `before_each` \u002F `setUp` \u002F fixtures are written)\n- Common assertion patterns (what is being asserted most often)\n- Object creation patterns (how game objects or scenes are instantiated in tests)\n- Mock\u002Fstub patterns (how dependencies are replaced)\n\nThis ensures generated helpers match the project's existing style, not a\ngeneric template.\n\nAlso read:\n- `design\u002Fgdd\u002Fsystems-index.md` — to know which systems exist\n- In-scope GDD(s) — to understand what data types and values need testing\n- `docs\u002Farchitecture\u002Ftr-registry.yaml` — to map requirements to tested systems\n\n---\n\n## 4. Generate Engine-Specific Helpers\n\n### Godot 4 (GDUnit4 \u002F GDScript)\n\n**Base helper** (`tests\u002Fhelpers\u002Fgame_assertions.gd`):\n\n```gdscript\n## Game-specific assertion utilities for [Project Name] tests.\n## Extends GdUnitAssertions with domain-specific helpers.\n##\n## Usage:\n##   var assert = GameAssertions.new()\n##   assert.health_in_range(entity, 0, entity.max_health)\n\nclass_name GameAssertions\nextends RefCounted\n\n## Assert a value is within the inclusive range [min_val, max_val].\n## Use for any formula output that has defined bounds in a GDD.\nstatic func assert_in_range(\n    value: float,\n    min_val: float,\n    max_val: float,\n    label: String = \"value\"\n) -> void:\n    assert(\n        value >= min_val and value \u003C= max_val,\n        \"%s %.2f is outside expected range [%.2f, %.2f]\" % [label, value, min_val, max_val]\n    )\n\n## Assert a signal was emitted during a callable block.\n## Usage: assert_signal_emitted(entity, \"health_changed\", func(): entity.take_damage(10))\nstatic func assert_signal_emitted(\n    obj: Object,\n    signal_name: String,\n    action: Callable\n) -> void:\n    var emitted := false\n    obj.connect(signal_name, func(_args): emitted = true)\n    action.call()\n    assert(emitted, \"Expected signal '%s' to be emitted, but it was not.\" % signal_name)\n\n## Assert that a callable does NOT emit a signal.\nstatic func assert_signal_not_emitted(\n    obj: Object,\n    signal_name: String,\n    action: Callable\n) -> void:\n    var emitted := false\n    obj.connect(signal_name, func(_args): emitted = true)\n    action.call()\n    assert(not emitted, \"Expected signal '%s' NOT to be emitted, but it was.\" % signal_name)\n\n## Assert a node exists at path within a parent.\nstatic func assert_node_exists(parent: Node, path: NodePath) -> void:\n    assert(\n        parent.has_node(path),\n        \"Expected node at path '%s' to exist.\" % str(path)\n    )\n```\n\n**Factory helper** (`tests\u002Fhelpers\u002Fgame_factory.gd`):\n\n```gdscript\n## Factory functions for creating test game objects.\n## Returns minimal objects configured for unit testing (no scene tree required).\n##\n## Usage: var player = GameFactory.make_player(health: 100)\n\nclass_name GameFactory\nextends RefCounted\n\n## Create a minimal player-like object for testing.\n## Override fields as needed.\nstatic func make_player(health: int = 100) -> Node:\n    var player = Node.new()\n    player.set_meta(\"health\", health)\n    player.set_meta(\"max_health\", health)\n    return player\n```\n\n**Scene helper** (`tests\u002Fhelpers\u002Fscene_runner_helper.gd`):\n\n```gdscript\n## Utilities for scene-based integration tests.\n## Wraps GdUnitSceneRunner for common patterns.\n\nclass_name SceneRunnerHelper\nextends GdUnitTestSuite\n\n## Load a scene and wait one frame for _ready() to complete.\nfunc load_scene_and_wait(scene_path: String) -> Node:\n    var scene = load(scene_path).instantiate()\n    add_child(scene)\n    await get_tree().process_frame\n    return scene\n```\n\n---\n\n### Unity (NUnit \u002F C#)\n\n**Base helper** (`tests\u002Fhelpers\u002FGameAssertions.cs`):\n\n```csharp\nusing NUnit.Framework;\nusing UnityEngine;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Game-specific assertion utilities for [Project Name] tests.\n\u002F\u002F\u002F Extends NUnit's Assert with domain-specific helpers.\n\u002F\u002F\u002F \u003C\u002Fsummary>\npublic static class GameAssertions\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Assert a value is within an inclusive range [min, max].\n    \u002F\u002F\u002F Use for any formula output defined in GDD Formulas sections.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static void AssertInRange(float value, float min, float max, string label = \"value\")\n    {\n        Assert.That(value, Is.InRange(min, max),\n            $\"{label} ({value:F2}) is outside expected range [{min:F2}, {max:F2}]\");\n    }\n\n    \u002F\u002F\u002F \u003Csummary>Assert a UnityEvent or C# event was raised during an action.\u003C\u002Fsummary>\n    public static void AssertEventRaised(ref bool wasCalled, System.Action action, string eventName)\n    {\n        wasCalled = false;\n        action();\n        Assert.IsTrue(wasCalled, $\"Expected event '{eventName}' to be raised, but it was not.\");\n    }\n\n    \u002F\u002F\u002F \u003Csummary>Assert a component exists on a GameObject.\u003C\u002Fsummary>\n    public static void AssertHasComponent\u003CT>(GameObject obj) where T : Component\n    {\n        var component = obj.GetComponent\u003CT>();\n        Assert.IsNotNull(component,\n            $\"Expected GameObject '{obj.name}' to have component {typeof(T).Name}.\");\n    }\n}\n```\n\n**Factory helper** (`tests\u002Fhelpers\u002FGameFactory.cs`):\n\n```csharp\nusing UnityEngine;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Factory methods for creating minimal test objects without loading scenes.\n\u002F\u002F\u002F \u003C\u002Fsummary>\npublic static class GameFactory\n{\n    \u002F\u002F\u002F \u003Csummary>Create a minimal GameObject with a named component for testing.\u003C\u002Fsummary>\n    public static GameObject MakeGameObject(string name = \"TestObject\")\n    {\n        var go = new GameObject(name);\n        return go;\n    }\n\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Create a ScriptableObject of type T for data-driven tests.\n    \u002F\u002F\u002F Dispose with Object.DestroyImmediate after test.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static T MakeScriptableObject\u003CT>() where T : ScriptableObject\n    {\n        return ScriptableObject.CreateInstance\u003CT>();\n    }\n}\n```\n\n---\n\n### Unreal Engine (C++)\n\n**Base helper** (`tests\u002Fhelpers\u002FGameTestHelpers.h`):\n\n```cpp\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"Misc\u002FAutomationTest.h\"\n\n\u002F**\n * Game-specific assertion macros and helpers for [Project Name] automation tests.\n * Include in any test file that needs domain-specific assertions.\n *\n * Usage:\n *   GAME_TEST_ASSERT_IN_RANGE(TestName, DamageValue, 10.0f, 50.0f, TEXT(\"Damage\"));\n *\u002F\n\n\u002F\u002F Assert a float value is within inclusive range [Min, Max]\n#define GAME_TEST_ASSERT_IN_RANGE(TestName, Value, Min, Max, Label) \\\n    TestTrue( \\\n        FString::Printf(TEXT(\"%s (%.2f) in range [%.2f, %.2f]\"), Label, Value, Min, Max), \\\n        (Value) >= (Min) && (Value) \u003C= (Max) \\\n    )\n\n\u002F\u002F Assert a UObject pointer is valid (not null, not garbage collected)\n#define GAME_TEST_ASSERT_VALID(TestName, Ptr, Label) \\\n    TestTrue( \\\n        FString::Printf(TEXT(\"%s is valid\"), Label), \\\n        IsValid(Ptr) \\\n    )\n\n\u002F\u002F Assert an Actor is in the world (spawned successfully)\n#define GAME_TEST_ASSERT_SPAWNED(TestName, ActorPtr, ClassName) \\\n    TestNotNull( \\\n        FString::Printf(TEXT(\"Spawned actor of class %s\"), TEXT(#ClassName)), \\\n        ActorPtr \\\n    )\n\n\u002F**\n * Helper to create a minimal test world.\n * Remember to call World->DestroyWorld(false) in teardown.\n *\u002F\nnamespace GameTestHelpers\n{\n    inline UWorld* CreateTestWorld(const FString& WorldName = TEXT(\"TestWorld\"))\n    {\n        UWorld* World = UWorld::CreateWorld(EWorldType::Game, false);\n        FWorldContext& WorldContext = GEngine->CreateNewWorldContext(EWorldType::Game);\n        WorldContext.SetCurrentWorld(World);\n        return World;\n    }\n}\n```\n\n---\n\n## 5. Generate System-Specific Helpers\n\nFor `[system-name]` or `all` modes, generate a helper per system:\n\nRead the system's GDD to extract:\n- Data types (entity types, component names)\n- Formula variables and their bounds\n- Common test scenarios mentioned in Edge Cases\n\nGenerate `tests\u002Fhelpers\u002F[system]_factory.[ext]` with factory functions\nspecific to that system's objects.\n\nExample pattern for a `combat` system (Godot\u002FGDScript):\n\n```gdscript\n## Factory and assertion helpers for Combat system tests.\n## Generated by \u002Ftest-helpers combat on [date].\n## Based on: design\u002Fgdd\u002Fcombat.md\n\nclass_name CombatTestFactory\nextends RefCounted\n\nconst DAMAGE_MIN := 0\nconst DAMAGE_MAX := 999  # From GDD: damage formula upper bound\n\n## Create a minimal attacker object for damage formula tests.\nstatic func make_attacker(attack: float = 10.0, crit_chance: float = 0.0) -> Node:\n    var attacker = Node.new()\n    attacker.set_meta(\"attack\", attack)\n    attacker.set_meta(\"crit_chance\", crit_chance)\n    return attacker\n\n## Create a minimal target object for damage receive tests.\nstatic func make_target(defense: float = 0.0, health: float = 100.0) -> Node:\n    var target = Node.new()\n    target.set_meta(\"defense\", defense)\n    target.set_meta(\"health\", health)\n    target.set_meta(\"max_health\", health)\n    return target\n\n## Assert damage output is within GDD-specified bounds.\nstatic func assert_damage_in_bounds(damage: float) -> void:\n    GameAssertions.assert_in_range(damage, DAMAGE_MIN, DAMAGE_MAX, \"damage\")\n```\n\n---\n\n## 6. Write Output\n\nPresent a summary of what will be created:\n\n```\n## Test Helpers to Create\n\nBase helpers (engine: [engine]):\n- tests\u002Fhelpers\u002Fgame_assertions.[ext]\n- tests\u002Fhelpers\u002Fgame_factory.[ext]\n[engine-specific extras]\n\nSystem helpers ([mode]):\n- tests\u002Fhelpers\u002F[system]_factory.[ext]  ← from [system] GDD\n```\n\nAsk: \"May I write these helper files to `tests\u002Fhelpers\u002F`?\"\n\n**Never overwrite existing files.** If a file already exists, report:\n\"Skipping `[path]` — already exists. Remove the file manually if you want it\nregenerated.\"\n\nAfter writing: Verdict: **COMPLETE** — helper files created.\n\n\"Helper files created. To use them in a test:\n- Godot: `class_name` is auto-imported — no explicit import needed\n- Unity: Add `using` directive or reference the test assembly\n- Unreal: `#include \\\"tests\u002Fhelpers\u002FGameTestHelpers.h\\\"`\"\n\n---\n\n## Collaborative Protocol\n\n- **Never overwrite existing helpers** — they may contain hand-written\n  customisations. Only generate new files that don't exist yet\n- **Generated code is a starting point** — the generated factory functions use\n  metadata patterns for simplicity; adapt to the actual class structure once\n  the code exists\n- **Helpers should reflect the GDD** — bounds and constants in helpers should\n  trace to GDD Formulas sections, not invented values\n- **Ask before writing** — always confirm before creating files in `tests\u002F`\n\n## Next Steps\n\n- Run `\u002Ftest-setup` if the test framework has not been scaffolded yet.\n- Use `\u002Fdev-story` to implement stories — helpers reduce boilerplate in new test files.\n- Run `\u002Fskill-test` to validate other skills that may need helper coverage.\n","# Test Helpers\n\nWriting test cases is faster and more consistent when common setup, teardown,\nand assertion patterns are abstracted into helpers. This skill generates a\n`tests\u002Fhelpers\u002F` library tailored to the project's actual engine, language,\nand systems — so every developer writes less boilerplate and more assertions.\n\n**Output:** `tests\u002Fhelpers\u002F` directory with engine-specific helper files\n\n**When to run:**\n- After `\u002Ftest-setup` scaffolds the framework (first time)\n- When multiple test files repeat the same setup boilerplate\n- When starting to write tests for a new system\n\n---\n\n## 1. Parse Arguments\n\n**Modes:**\n- `\u002Ftest-helpers [system-name]` — generate helpers for a specific system\n  (e.g., `\u002Ftest-helpers combat`)\n- `\u002Ftest-helpers all` — generate helpers for all systems with test files\n- `\u002Ftest-helpers scaffold` — generate only the base helper library (no\n  system-specific helpers); use this on first run\n- No argument — run `scaffold` if no helpers exist, else `all`\n\n---\n\n## 2. Detect Engine and Language\n\nRead `.claude\u002Fdocs\u002Ftechnical-preferences.md` and extract:\n- `Engine:` value\n- `Language:` value\n- `Framework:` from the Testing section\n\nIf engine is not configured: \"Engine not configured. Run `\u002Fsetup-engine` first.\"\n\n---\n\n## 3. Load Existing Test Patterns\n\nScan the test directory for patterns already in use:\n\n```\nGlob pattern=\"tests\u002F**\u002F*_test.*\" (all test files)\n```\n\nFor a representative sample (up to 5 files), read the test files and extract:\n- Setup patterns (how `before_each` \u002F `setUp` \u002F fixtures are written)\n- Common assertion patterns (what is being asserted most often)\n- Object creation patterns (how game objects or scenes are instantiated in tests)\n- Mock\u002Fstub patterns (how dependencies are replaced)\n\nThis ensures generated helpers match the project's existing style, not a\ngeneric template.\n\nAlso read:\n- `design\u002Fgdd\u002Fsystems-index.md` — to know which systems exist\n- In-scope GDD(s) — to understand what data types and values need testing\n- `docs\u002Farchitecture\u002Ftr-registry.yaml` — to map requirements to tested systems\n\n---\n\n## 4. Generate Engine-Specific Helpers\n\n### Godot 4 (GDUnit4 \u002F GDScript)\n\n**Base helper** (`tests\u002Fhelpers\u002Fgame_assertions.gd`):\n\n```gdscript\n## Game-specific assertion utilities for [Project Name] tests.\n## Extends GdUnitAssertions with domain-specific helpers.\n##\n## Usage:\n##   var assert = GameAssertions.new()\n##   assert.health_in_range(entity, 0, entity.max_health)\n\nclass_name GameAssertions\nextends RefCounted\n\n## Assert a value is within the inclusive range [min_val, max_val].\n## Use for any formula output that has defined bounds in a GDD.\nstatic func assert_in_range(\n    value: float,\n    min_val: float,\n    max_val: float,\n    label: String = \"value\"\n) -> void:\n    assert(\n        value >= min_val and value \u003C= max_val,\n        \"%s %.2f is outside expected range [%.2f, %.2f]\" % [label, value, min_val, max_val]\n    )\n\n## Assert a signal was emitted during a callable block.\n## Usage: assert_signal_emitted(entity, \"health_changed\", func(): entity.take_damage(10))\nstatic func assert_signal_emitted(\n    obj: Object,\n    signal_name: String,\n    action: Callable\n) -> void:\n    var emitted := false\n    obj.connect(signal_name, func(_args): emitted = true)\n    action.call()\n    assert(emitted, \"Expected signal '%s' to be emitted, but it was not.\" % signal_name)\n\n## Assert that a callable does NOT emit a signal.\nstatic func assert_signal_not_emitted(\n    obj: Object,\n    signal_name: String,\n    action: Callable\n) -> void:\n    var emitted := false\n    obj.connect(signal_name, func(_args): emitted = true)\n    action.call()\n    assert(not emitted, \"Expected signal '%s' NOT to be emitted, but it was.\" % signal_name)\n\n## Assert a node exists at path within a parent.\nstatic func assert_node_exists(parent: Node, path: NodePath) -> void:\n    assert(\n        parent.has_node(path),\n        \"Expected node at path '%s' to exist.\" % str(path)\n    )\n```\n\n**Factory helper** (`tests\u002Fhelpers\u002Fgame_factory.gd`):\n\n```gdscript\n## Factory functions for creating test game objects.\n## Returns minimal objects configured for unit testing (no scene tree required).\n##\n## Usage: var player = GameFactory.make_player(health: 100)\n\nclass_name GameFactory\nextends RefCounted\n\n## Create a minimal player-like object for testing.\n## Override fields as needed.\nstatic func make_player(health: int = 100) -> Node:\n    var player = Node.new()\n    player.set_meta(\"health\", health)\n    player.set_meta(\"max_health\", health)\n    return player\n```\n\n**Scene helper** (`tests\u002Fhelpers\u002Fscene_runner_helper.gd`):\n\n```gdscript\n## Utilities for scene-based integration tests.\n## Wraps GdUnitSceneRunner for common patterns.\n\nclass_name SceneRunnerHelper\nextends GdUnitTestSuite\n\n## Load a scene and wait one frame for _ready() to complete.\nfunc load_scene_and_wait(scene_path: String) -> Node:\n    var scene = load(scene_path).instantiate()\n    add_child(scene)\n    await get_tree().process_frame\n    return scene\n```\n\n---\n\n### Unity (NUnit \u002F C#)\n\n**Base helper** (`tests\u002Fhelpers\u002FGameAssertions.cs`):\n\n```csharp\nusing NUnit.Framework;\nusing UnityEngine;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Game-specific assertion utilities for [Project Name] tests.\n\u002F\u002F\u002F Extends NUnit's Assert with domain-specific helpers.\n\u002F\u002F\u002F \u003C\u002Fsummary>\npublic static class GameAssertions\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Assert a value is within an inclusive range [min, max].\n    \u002F\u002F\u002F Use for any formula output defined in GDD Formulas sections.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static void AssertInRange(float value, float min, float max, string label = \"value\")\n    {\n        Assert.That(value, Is.InRange(min, max),\n            $\"{label} ({value:F2}) is outside expected range [{min:F2}, {max:F2}]\");\n    }\n\n    \u002F\u002F\u002F \u003Csummary>Assert a UnityEvent or C# event was raised during an action.\u003C\u002Fsummary>\n    public static void AssertEventRaised(ref bool wasCalled, System.Action action, string eventName)\n    {\n        wasCalled = false;\n        action();\n        Assert.IsTrue(wasCalled, $\"Expected event '{eventName}' to be raised, but it was not.\");\n    }\n\n    \u002F\u002F\u002F \u003Csummary>Assert a component exists on a GameObject.\u003C\u002Fsummary>\n    public static void AssertHasComponent\u003CT>(GameObject obj) where T : Component\n    {\n        var component = obj.GetComponent\u003CT>();\n        Assert.IsNotNull(component,\n            $\"Expected GameObject '{obj.name}' to have component {typeof(T).Name}.\");\n    }\n}\n```\n\n**Factory helper** (`tests\u002Fhelpers\u002FGameFactory.cs`):\n\n```csharp\nusing UnityEngine;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Factory methods for creating minimal test objects without loading scenes.\n\u002F\u002F\u002F \u003C\u002Fsummary>\npublic static class GameFactory\n{\n    \u002F\u002F\u002F \u003Csummary>Create a minimal GameObject with a named component for testing.\u003C\u002Fsummary>\n    public static GameObject MakeGameObject(string name = \"TestObject\")\n    {\n        var go = new GameObject(name);\n        return go;\n    }\n\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Create a ScriptableObject of type T for data-driven tests.\n    \u002F\u002F\u002F Dispose with Object.DestroyImmediate after test.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static T MakeScriptableObject\u003CT>() where T : ScriptableObject\n    {\n        return ScriptableObject.CreateInstance\u003CT>();\n    }\n}\n```\n\n---\n\n### Unreal Engine (C++)\n\n**Base helper** (`tests\u002Fhelpers\u002FGameTestHelpers.h`):\n\n```cpp\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"Misc\u002FAutomationTest.h\"\n\n\u002F**\n * Game-specific assertion macros and helpers for [Project Name] automation tests.\n * Include in any test file that needs domain-specific assertions.\n *\n * Usage:\n *   GAME_TEST_ASSERT_IN_RANGE(TestName, DamageValue, 10.0f, 50.0f, TEXT(\"Damage\"));\n *\u002F\n\n\u002F\u002F Assert a float value is within inclusive range [Min, Max]\n#define GAME_TEST_ASSERT_IN_RANGE(TestName, Value, Min, Max, Label) \\\n    TestTrue( \\\n        FString::Printf(TEXT(\"%s (%.2f) in range [%.2f, %.2f]\"), Label, Value, Min, Max), \\\n        (Value) >= (Min) && (Value) \u003C= (Max) \\\n    )\n\n\u002F\u002F Assert a UObject pointer is valid (not null, not garbage collected)\n#define GAME_TEST_ASSERT_VALID(TestName, Ptr, Label) \\\n    TestTrue( \\\n        FString::Printf(TEXT(\"%s is valid\"), Label), \\\n        IsValid(Ptr) \\\n    )\n\n\u002F\u002F Assert an Actor is in the world (spawned successfully)\n#define GAME_TEST_ASSERT_SPAWNED(TestName, ActorPtr, ClassName) \\\n    TestNotNull( \\\n        FString::Printf(TEXT(\"Spawned actor of class %s\"), TEXT(#ClassName)), \\\n        ActorPtr \\\n    )\n\n\u002F**\n * Helper to create a minimal test world.\n * Remember to call World->DestroyWorld(false) in teardown.\n *\u002F\nnamespace GameTestHelpers\n{\n    inline UWorld* CreateTestWorld(const FString& WorldName = TEXT(\"TestWorld\"))\n    {\n        UWorld* World = UWorld::CreateWorld(EWorldType::Game, false);\n        FWorldContext& WorldContext = GEngine->CreateNewWorldContext(EWorldType::Game);\n        WorldContext.SetCurrentWorld(World);\n        return World;\n    }\n}\n```\n\n---\n\n## 5. Generate System-Specific Helpers\n\nFor `[system-name]` or `all` modes, generate a helper per system:\n\nRead the system's GDD to extract:\n- Data types (entity types, component names)\n- Formula variables and their bounds\n- Common test scenarios mentioned in Edge Cases\n\nGenerate `tests\u002Fhelpers\u002F[system]_factory.[ext]` with factory functions\nspecific to that system's objects.\n\nExample pattern for a `combat` system (Godot\u002FGDScript):\n\n```gdscript\n## Factory and assertion helpers for Combat system tests.\n## Generated by \u002Ftest-helpers combat on [date].\n## Based on: design\u002Fgdd\u002Fcombat.md\n\nclass_name CombatTestFactory\nextends RefCounted\n\nconst DAMAGE_MIN := 0\nconst DAMAGE_MAX := 999  # From GDD: damage formula upper bound\n\n## Create a minimal attacker object for damage formula tests.\nstatic func make_attacker(attack: float = 10.0, crit_chance: float = 0.0) -> Node:\n    var attacker = Node.new()\n    attacker.set_meta(\"attack\", attack)\n    attacker.set_meta(\"crit_chance\", crit_chance)\n    return attacker\n\n## Create a minimal target object for damage receive tests.\nstatic func make_target(defense: float = 0.0, health: float = 100.0) -> Node:\n    var target = Node.new()\n    target.set_meta(\"defense\", defense)\n    target.set_meta(\"health\", health)\n    target.set_meta(\"max_health\", health)\n    return target\n\n## Assert damage output is within GDD-specified bounds.\nstatic func assert_damage_in_bounds(damage: float) -> void:\n    GameAssertions.assert_in_range(damage, DAMAGE_MIN, DAMAGE_MAX, \"damage\")\n```\n\n---\n\n## 6. Write Output\n\nPresent a summary of what will be created:\n\n```\n## Test Helpers to Create\n\nBase helpers (engine: [engine]):\n- tests\u002Fhelpers\u002Fgame_assertions.[ext]\n- tests\u002Fhelpers\u002Fgame_factory.[ext]\n[engine-specific extras]\n\nSystem helpers ([mode]):\n- tests\u002Fhelpers\u002F[system]_factory.[ext]  ← from [system] GDD\n```\n\nAsk: \"May I write these helper files to `tests\u002Fhelpers\u002F`?\"\n\n**Never overwrite existing files.** If a file already exists, report:\n\"Skipping `[path]` — already exists. Remove the file manually if you want it\nregenerated.\"\n\nAfter writing: Verdict: **COMPLETE** — helper files created.\n\n\"Helper files created. To use them in a test:\n- Godot: `class_name` is auto-imported — no explicit import needed\n- Unity: Add `using` directive or reference the test assembly\n- Unreal: `#include \\\"tests\u002Fhelpers\u002FGameTestHelpers.h\\\"`\"\n\n---\n\n## Collaborative Protocol\n\n- **Never overwrite existing helpers** — they may contain hand-written\n  customisations. Only generate new files that don't exist yet\n- **Generated code is a starting point** — the generated factory functions use\n  metadata patterns for simplicity; adapt to the actual class structure once\n  the code exists\n- **Helpers should reflect the GDD** — bounds and constants in helpers should\n  trace to GDD Formulas sections, not invented values\n- **Ask before writing** — always confirm before creating files in `tests\u002F`\n\n## Next Steps\n\n- Run `\u002Ftest-setup` if the test framework has not been scaffolded yet.\n- Use `\u002Fdev-story` to implement stories — helpers reduce boilerplate in new test files.\n- Run `\u002Fskill-test` to validate other skills that may need helper coverage.\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":25,"user-invocable":26},"Read, Glob, Grep, Write","[system-name | all | scaffold]",true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Ftest-helpers",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":26},[37,40,43],{"tool":38,"command":39},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill test-helpers",{"tool":41,"command":42},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill test-helpers",{"tool":44,"command":45},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill test-helpers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Ftest-helpers\u002FSKILL.md",[],[49,56,61,68,75,82],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]