MacHu-GWU/sqlalchemy_upsert_kit-project / .claude/skills/pywf-oss-add-module
pywf-oss-add-module
VerifiedCreate a new module or subpackage in a pywf open-source Python library, together with its mirrored test file, its all.py, and its api.py export. Use when the user asks to add a module, file, subpackage, or new feature area to the package.
Scaffold a new module or subpackage that follows the template's layout, import, and test conventions before any real logic is written.
Read ../pywf-oss-base/SKILL.md, then:
- ../pywf-oss-base/references/08-package-files.md
- ../pywf-oss-base/references/09-code-style.md
- ../pywf-oss-base/references/10-test-layout.md
- ../pywf-oss-base/references/11-test-writing.md
Steps
-
Pin down the target.
- Get the dotted path (
<package_name>.subpackage.module_name), whether it is a module or a subpackage, and whether its names are public. - If the user gave only a feature description, propose a path, and confirm it before creating files.
- Get the dotted path (
-
Create the source.
- A module gets the file header, a one-line module docstring, and the imports it needs.
- A subpackage gets
__init__.py(header only) and, if it exposes names, its ownapi.py. - Every public function and class gets at least a one-line docstring.
-
Create the test files, at the path the script prints, never one worked out by hand:
python ${CLAUDE_SKILL_DIR}/../pywf-oss-base/scripts/check_test_layout.py --project_root . --source <package_name>/subpackage/module_name.py- For a module, write the test file from the template in
11-test-writing.md, with a placeholder test. - For a new subpackage folder, also create its
all.py.
- For a module, write the test file from the template in
-
Export.
- If the names are public, add one line per name to the nearest
api.py. If the user wants it, also expose a new subpackage'sapifrom the parentapi.py. - In the matching
test_..._api.py, touch each new name (_ = api.ClassName).
- If the names are public, add one line per name to the nearest
-
Verify.
- The layout check without
--sourcereports 0 problems. .venv/bin/python <test_path>runs the new test file.mise run format, thenmise run lint, reports nothing.
- The layout check without
Output
List the files you created, the api.py lines you added, and the layout-check result.
Next step: pywf-oss-write-test, once the logic is written.
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 |