npx claudepluginhub danielbodnar/nushell-dev --plugin nushell-devCreate or run tests for Nushell code. **Arguments:** - $1: Action - create, run, or watch - $2: Target file or test directory - --coverage: Generate coverage report (when running) **Actions:** ### create - Generate test file If $1 is "create": 1. Read the target source file: @$2 2. Analyze exported functions and their signatures 3. Generate test file with: - Import statement for the module - Test function for each exported command - Assertion helpers - Test runner function 4. Create test file at `tests/test_[module-name].nu`: ### run - Execute tests If $1 is "run": ...
/testRuns pytest tests for CLI harness on local path or GitHub repo, verifies CLI resolution, and updates TEST.md with results if all pass.
/testRuns TDD workflow: writes failing tests for new features or bugs (Prove-It pattern), implements code to pass them, refactors, and verifies full test suite.
/testExecutes unit, integration, or e2e tests with coverage analysis, quality metrics, failure diagnostics, and optional watch mode or auto-fixes.
/testGenerates test strategy overview, unit and integration test code, coverage analysis, execution plan, and maintenance roadmap for a specified component or feature.
/testLaunches Chrome for manual UI testing at given URL, monitors console errors during interaction, generates report with screenshots and logs on completion.
/testInvokes the testing-coach agent to provide guidance on screen reader, keyboard navigation, and automated testing for the given request.
Create or run tests for Nushell code.
Arguments:
Actions:
If $1 is "create":
Read the target source file: @$2
Analyze exported functions and their signatures
Generate test file with:
Create test file at tests/test_[module-name].nu:
# tests/test_utils.nu - Generated tests for utils.nu
use ../src/utils.nu
# Assertion helpers
def assert-eq [expected: any, actual: any, message?: string] {
if $expected != $actual {
error make { msg: ($message | default $"Expected ($expected), got ($actual)") }
}
}
def assert [condition: bool, message?: string] {
if not $condition {
error make { msg: ($message | default "Assertion failed") }
}
}
# Tests for each exported function
def "test function-name" [] {
# TODO: Add test cases
let result = function-name args
assert-eq expected $result "function-name should return expected"
}
# Test runner
def "test all" [] {
test function-name
# Add more tests...
print "✅ All tests passed"
}
If $1 is "run":
Find test files:
Execute each test file:
!nu $test_file
Collect results and report:
Running tests...
✅ tests/test_utils.nu - 5 passed
❌ tests/test_api.nu - 3 passed, 1 failed
- test fetch-data: Expected 200, got 404
Summary: 8 passed, 1 failed
If --coverage: analyze which functions were tested
If $1 is "watch":
Explain that continuous testing requires external tools like:
watchexec -e nu -- nu tests/test_all.nuProvide a simple watcher script if requested.
Test patterns:
Reference the nushell-tooling skill for testing patterns: ${CLAUDE_PLUGIN_ROOT}/skills/nushell-tooling/SKILL.md
Generated test structure: