pywf-oss-add-module
Create 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, subpackag
Files1
View on GitHubSKILL.md.claude/skills/pywf-oss-add-module/SKILL.md
GitHubScaffold 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.