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.7.0.tar.gz (166.7 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.7.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: refactoring_cli-0.7.0.tar.gz
  • Upload date:
  • Size: 166.7 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.7.0.tar.gz
Algorithm Hash digest
SHA256 bf2dbe9a20131f0f18e4cb8340cbb513fc03aa4053fae9eb91991354abe4b5c5
MD5 c833e2dd046195485c398e23fef383c4
BLAKE2b-256 5d51282c2fe2a1d34b39e4b00b2dc5623aac7b1453ea4ef82f500326cfc031b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refactoring_cli-0.7.0-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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa2530470ea0a6e4a89d798b33d0ac84b6a31ae72a897000f19c73e897f5a7e
MD5 230a8c1773fc254e13b9e647b7afdfdc
BLAKE2b-256 eb3a57ba1137950501d2b9a6d6f74c008c3243a85a768bfb72ceb0374271a8ca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.2

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