From klair-legacy
Generates and runs unit tests for files listed in spec or feature documents. Identifies testable functions, suggests refactors for coverage, and executes tests incrementally. Use when adding test coverage for new features or refactoring existing code.
npx claudepluginhub ai-builder-team/ai-builder-plugin-marketplace --plugin klair-legacyThis skill uses the workspace's default tool permissions.
Automates unit test creation for files specified in spec or feature documents. Identifies testable code, suggests refactors for better coverage, writes minimal tests for maximum coverage, and runs them incrementally.
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.
Automates unit test creation for files specified in spec or feature documents. Identifies testable code, suggests refactors for better coverage, writes minimal tests for maximum coverage, and runs them incrementally.
Use when:
Trigger phrases: "add tests from spec", "test coverage for feature", "unit tests from spec", "test files from feature"
Locate spec/feature file:
specs/ directoryfeatures/ directoryExtract files touched:
Identify testing frameworks:
Read implementation files:
Identify unit testable code:
Analyze testability issues:
Find existing test files:
Create comprehensive test plan document:
features/<feature-name>/TEST_PLAN.md or specs/<spec-name>/TEST_PLAN.mdStructure of TEST_PLAN.md:
# Test Plan for [Feature Name]
## Overview
- **Spec**: [link to spec file]
- **Files Touched**: [count] files across [count] domains
- **Testable Functions Identified**: [count]
- **Existing Test Coverage**: [count] tests found
- **New Tests Needed**: [count]
---
## Refactoring Suggestions
### File: [filename]
#### Issue: [Issue description]
**What to change**:
```[language]
// Before
[current code snippet]
// After
[refactored code snippet]
Benefits:
Test coverage impact:
Effort: [Low/Medium/High]
Recommendation: [Implement/Skip with reasoning]
calculateTotal() - pure function (3 test cases)validateInput() - validation logic (2 test cases)fetchAndCalculate() (see Refactoring Suggestions)computeMetrics() - business logic (4 test cases)transformData() - data transformation (2 test cases)compute_metrics() - business logic (3 test cases)transform_data() - data transformation (2 test cases)[Space for user notes, modifications, and additional context]
Notify user and request review:
"I've written the test plan to
TEST_PLAN.md. This includes:
- Refactoring suggestions (if any were identified)
- Test plan for all testable functions
Please review the document. If you'd like any changes, let me know and I'll update it. You can:
- Remove or add test cases
- Modify or skip refactoring suggestions
- Adjust priorities or add notes
- Change test case counts
When you're happy with the plan, let me know and I'll proceed with implementation."
Interactive editing:
TEST_PLAN.mdTEST_PLAN.md with requested editsConfirmation:
TEST_PLAN.md to get final approved planCheck refactoring recommendations:
TEST_PLAN.md for refactoring decisionsImplement approved refactors:
Commit refactoring changes:
Re-read TEST_PLAN.md for final test list:
Batch tests by domain:
For each batch:
Run tests immediately:
cd klair-client && pnpm vitest run <test-file-path>cd klair-api && pytest <test-file-path>Handle failures:
Progress tracking:
Run full test suite (optional, ask user):
cd klair-client && pnpm testcd klair-api && pytestUpdate TEST_PLAN.md with results:
Summary report (also show in conversation):
## Test Coverage Summary
✓ klair-client: 8 new tests added
- Widget.test.tsx: 3 tests (all passing)
- utils/calculations.test.ts: 5 tests (all passing)
✓ klair-api: 6 new tests added
- tests/test_calculator.py: 6 tests (all passing)
Total: 14 new test cases, 100% passing
Files created: 1
Files updated: 2 (+ TEST_PLAN.md updated)
*.test.tsx, *.test.ts (next to implementation)tests/test_*.py (in tests/ directory)