Skip to main content

refactoring-cli

Refactors Python code. Analyses a Python codebase for structural problems and code smells, proposes behaviour-preserving refactorings with a rationale, and applies them under test. Successor to the retired refactor-cli, whose atomic-transformation lane it absorbs.

Status

The refactoring lane is not implemented yet. This repo currently carries the scaffold it was minted from: an agent-first CLI skeleton (identity and introspection verbs), a mesh identity, the vendored skill kit, and a working build/test/deploy baseline. The analyse-propose-apply surface described above is the target, not today's behaviour.

What that scaffold buys is a contract for the domain verbs to land inside — --json on every command, a strict stdout/stderr split, structured errors with remediation hints, and a documented exit-code policy — all enforced in CI by the agent-first rubric gate.

What's here

  • An agent-first CLI cited from teken (afi-cli) — the runtime package has no third-party dependencies.
  • A mesh identityculture.yaml (suffix + backend) and the matching resident prompt file (AGENTS.colleague.md, since this agent runs backend: colleague).
  • The vendored skill kit (18 skills) under .claude/skills/, cited cite-don't-import from guildmaster, devague, and colleague. See docs/skill-sources.md for provenance and the re-sync procedure.
  • A build + deploy baseline — pytest, lint, the agent-first rubric gate, and PyPI Trusted Publishing wired into GitHub Actions.

Quickstart

uv sync
uv run pytest -n auto                 # run the test suite
uv run refactor whoami                # identity from culture.yaml
uv run refactor learn                 # self-teaching prompt (add --json)
uv run teken cli doctor . --strict    # the agent-first rubric gate CI runs

CLI

The console script is refactor; refactoring-cli is the distribution name on PyPI. python -m refactor works too.

Verb What it does
whoami Report this agent's nick, version, backend, and model from culture.yaml.
learn Print a structured self-teaching prompt.
explain <path> Markdown docs for any noun/verb path.
overview Read-only descriptive snapshot of the agent.
doctor Check the agent-identity invariants (prompt-file-present, backend-consistency).
cli overview Describe the CLI surface itself.

Every command supports --json. Results go to stdout, errors/diagnostics to stderr (never mixed). Exit codes: 0 success, 1 user error, 2 environment error, 3+ reserved.

Naming

The rename from the template this repo was scaffolded from is incomplete: the package directory and console script are refactor, while the distribution name, argparse prog, help text, explain catalog, and tests all say refactoring-cli. Finish the rename in one pass before the domain verbs land — CLAUDE.md carries the discovery command and the full target list.

Contributing

Every PR bumps the version, including docs-only and CI-only changes — a version-check job blocks the merge otherwise. See CLAUDE.md for the full conventions (the cicd PR lane, the vendored-skills rule, worktree layout, deploy setup).

License

Apache 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refactoring_cli-0.6.2.tar.gz (158.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refactoring_cli-0.6.2-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file refactoring_cli-0.6.2.tar.gz.

File metadata

  • Download URL: refactoring_cli-0.6.2.tar.gz
  • Upload date:
  • Size: 158.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for refactoring_cli-0.6.2.tar.gz
Algorithm Hash digest
SHA256 db1df857ef1bec7f6a72dbac87a09368c7a516e12fd470ad4440aa4fee875f34
MD5 94ef4e77ff93e48ec10a78c082c86b75
BLAKE2b-256 19a2feb952a04771225a6682235be479b4b64693d0901f7c38632b1af396e5d0

See more details on using hashes here.

File details

Details for the file refactoring_cli-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: refactoring_cli-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for refactoring_cli-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 162e290d763f5ded3ab66eec80b91e73ccd8c38875a4a7dcd716ad21235f39ea
MD5 e71e077b2fecec2cc066b965aefc40d2
BLAKE2b-256 05df2861c2c4ff580f7cf2e1093783e6bbe74450c56572f15a2620b103270655

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.0

2 files

This release

0.6.2 This release

2 files

0.6.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page