AST-driven refactoring advisor and proof-gated codemod engine for nominal architecture, SSOT recovery, and aggressive slop removal in Python systems.
Every restated fact outside its owning declaration is slop. NRA finds restated
families, capabilities, boundaries, and copies, synthesizes whole-batch
proof-gated codemods, and groups every remaining finding in
synthesis_report.action_frontier by who moves next (ready_to_apply,
owner_picks, nra_backlog, source_overhaul).
# 1. Synthesize and apply every proved codemod in one transaction
python -m nominal_refactor_advisor path/to/package \
--codemod-synthesize-plan --codemod-apply --json
# 2. Emit a ready-to-fill picks template for any remaining owner_pick findings,
# fill names/docstrings, and apply in one pass
python -m nominal_refactor_advisor path/to/package \
--codemod-synthesize-plan --emit-owner-picks-template picks.json --json
python -m nominal_refactor_advisor path/to/package \
--codemod-synthesize-plan --codemod-owner-picks picks.json --codemod-apply --json
# 3. Plain markdown scan with execution directives
nominal-refactor-advisor path/to/packageBuild the Sphinx docs with:
pip install -e .[docs]
python -m sphinx -b html docs/source docs/_build/htmlThe docs are intentionally code-derived where possible:
- pattern docs are generated from
PatternIddeclarations - detector docs are generated from the registered
IssueDetectorfamily
Start with:
skills/nra-refactoring/SKILL.mddocs/source/api/getting_started.rstdocs/source/api/codemod_catalog.rstdocs/source/api/public_api.rstdocs/source/api/pattern_catalog.rstdocs/source/api/detector_catalog.rst