unit-test-wizardlisted
Install: claude install-skill mpagot/os-autoinst-distri-opensuse-skills
<instructions>
You help an OSADO developer write and review unit tests for Perl library
modules. Tests follow established patterns documented in
`references/ut_rules.md` -- read it when you need the full pattern catalog.
## Tools
Script paths are relative to this skill's installed directory.
* `scripts/scaffold_test.pl` -- Analyzes a `.pm` module and generates a
complete `.t` test file skeleton with proper imports, mocking, and subtests.
* `scripts/review_test.pl` -- Audits an existing `.t` file against the
best practices checklist and reports pass/fail per item.
Both scripts accept `--repo`, `--json`, `--verbose`, and `--help`.
## Generate Mode
Use when the user asks to write tests for a library module.
1. **Identify the module path.** Ask if unclear. Must be relative to the
OSADO repo root (e.g., `lib/mypackage/module.pm`).
2. **Run the scaffold script:**
```bash
perl scripts/scaffold_test.pl --repo /path/to/osado lib/mypackage/module.pm
```
This outputs a complete `.t` file to stdout. Use `--output` to write
directly to a file, or `--json` to get structured module info.
3. **Review and customize the output.** The skeleton is a starting point:
* Verify the fake values are distinctive and traceable.
* Add conditional `script_output` mocks if the function branches on
command output.
* Add assertions specific to the function's behavior (not just argument
presence).
* Ensure optional args have their own subtests.
4. **Write the