MacHu-GWU/sqlalchemy_upsert_kit-project / .claude/skills/pywf-oss-write-test
pywf-oss-write-test
VerifiedWrite, extend, or fix the unit tests for a module of a pywf open-source Python library, following the source-to-test mapping and run_cov_test conventions, until that module is fully covered. Use when the user asks to add tests, raise coverage, or fix failing tests for a module or subpackage.
Write the tests for one module (or every module of one subpackage) until its own test file reports full coverage and mise run cov passes.
Read ../pywf-oss-base/SKILL.md, then:
- ../pywf-oss-base/references/09-code-style.md
- ../pywf-oss-base/references/10-test-layout.md
- ../pywf-oss-base/references/11-test-writing.md
- ../pywf-oss-base/references/12-coverage.md
Steps
- Locate.
- Read the source module.
- Get its
<test_path>frompython ${CLAUDE_SKILL_DIR}/../pywf-oss-base/scripts/check_test_layout.py --project_root . --source <source_path>. - If the test file is missing, create it there from the template in
11-test-writing.md, never elsewhere.
- Baseline. Run
.venv/bin/python <test_path>, and note the missing lines in theterm-missingreport. - Write the tests, following
11-test-writing.md. - Close the gaps.
- Rerun until the module is at 100%.
- A line that truly cannot run in unit tests may get
# pragma: no cover, only under12-coverage.mdsection 3. - Never change the source just to ease coverage without telling the user.
- Finish.
mise run covpasses, the layout check without--sourcereports 0 problems, andmise run format, thenmise run lint, reports nothing.
Boundaries
- If a test reveals a bug in the source, stop and report it with the failing test as evidence. Fix the source only after the user's yes, or if the user asked for fixes.
- Edit a
run_cov_testblock only to correct its module path. Keep one argument per line.
Next step: pywf-oss-write-doc if the feature is user-facing, otherwise pywf-oss-changelog.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |