/rhiza:new¶
Scaffold a new source module and its mirrored test file in a rhiza-managed
Python repo, keeping the 1:1 test/source layout parity that /rhiza:quality
enforces.
The module name may be dotted or slashed for a subpackage (parsing,
utils.parsing, utils/parsing).
What it does¶
Runs the bundled scripts/new_module.py — stdlib-only — which:
- discovers the single package under
src/(the src-layout root); - writes
src/<pkg>/…/<name>.pywith a module docstring and, unless--classis given, one docstringed placeholder function; - writes the matching
tests/<pkg>/…/test_<name>.py— mirroring the module's path relative tosrc/, exactly ascheck_test_layout.pyexpects; - for each
--class Name, addsclass Nameto the module and a matchingTestNameto the test file (satisfying the class-parity rule); - creates any missing
__init__.pyfor new subpackages.
Pass --json for a {created, skipped} report, or --src / --tests to match
non-default source/tests roots.
Notes¶
- Works without the
rhizaCLI installed. - Never overwrites — existing files are reported as skipped, so a re-run is safe.
- Stubs are intentionally minimal (docstrings +
TODOs); the generated test starts as a placeholder to replace with a real assertion. For the layout gate and the rest of the quality bar, see/rhiza:quality.