From test-engineering
Automatically detect and extract repeated test helper code into shared utility modules. Use when generated tests contain duplicated setup, teardown, or assertion logic that should be refactored into reusable test helpers.
npx claudepluginhub issacchaos/local-marketplace --plugin test-engineeringThis skill uses the workspace's default tool permissions.
The helper extraction system automatically detects and extracts repeated test helper code into shared utility modules. This feature was implemented to address Issue #57.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
The helper extraction system automatically detects and extracts repeated test helper code into shared utility modules. This feature was implemented to address Issue #57.
skills/helper-extraction/models.md)Three core data models:
All models support JSON serialization for inter-component communication.
skills/helper-extraction/pattern-detector.md)Analyzes test code to identify three pattern types:
Detection Thresholds (REQ-F-14):
skills/helper-extraction/helper-generator.md)Creates or updates shared helper modules:
skills/templates/helpers/)Language-specific templates for generating helpers:
python-pytest-helpers-template.md - Python/pytest patternsjavascript-jest-helpers-template.md - JavaScript/Jest patternsHelper extraction is integrated into Step 5: Add Mocking and Fixtures:
1. Detect patterns in generated test code
2. If patterns found:
a. Generate helper module
b. Inject import statements
c. Replace inline code with helper calls
3. If extraction fails or no patterns:
a. Fall back to inline helpers (existing behavior)
All 7 supported languages have helper extraction:
| Language | Helper Location | Template |
|---|---|---|
| Python | tests/helpers.py | python-pytest-helpers-template.md |
| JavaScript | tests/helpers/mockHelpers.js | javascript-jest-helpers-template.md |
| TypeScript | tests/helpers/mockHelpers.ts | typescript-jest-helpers-template.md |
| Java | src/test/java/TestUtils.java | java-junit-helpers-template.md |
| C# | tests/TestHelpers.cs | csharp-xunit-helpers-template.md |
| Go | testing_utils_test.go | go-testing-helpers-template.md |
| C++ | tests/test_helpers.h | cpp-gtest-helpers-template.md |
| Rust | tests/common/mod.rs | rust-helpers-template.md |
tests/unit/test_helper_extraction_models.py - 34 tests ✅tests/unit/test_pattern_detector.py - 15 tests ✅Integration tests verify end-to-end helper extraction for all languages (see task breakdown for details).
Before (inline helpers):
def test_api_call():
mock_api = Mock()
mock_api.get.return_value = {"status": "ok"}
user = User(id=1, name="Alice", email="alice@example.com")
result = process(user, mock_api)
assert result["status"] == "ok"
After (extracted helpers):
from tests.helpers import create_mock_api, build_test_user
def test_api_call():
mock_api = create_mock_api()
user = build_test_user(name="Alice")
result = process(user, mock_api)
assert result["status"] == "ok"