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 identity — culture.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.

Metadata

Release files for refactoring-cli 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refactoring-cli 0.7.0
File Size Uploaded Provenance
refactoring_cli-0.7.0.tar.gz 166.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for refactoring-cli 0.7.0
File Interpreter ABI Platform
refactoring_cli-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 189.3 kB

Release files / refactoring_cli-0.7.0.tar.gz

Download URL refactoring_cli-0.7.0.tar.gz
Size 166.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bf2dbe9a20131f0f18e4cb8340cbb513fc03aa4053fae9eb91991354abe4b5c5
BLAKE2b-256 checksum
How to use checksums
5d51282c2fe2a1d34b39e4b00b2dc5623aac7b1453ea4ef82f500326cfc031b9
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / refactoring_cli-0.7.0-py3-none-any.whl

Download URL refactoring_cli-0.7.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfa2530470ea0a6e4a89d798b33d0ac84b6a31ae72a897000f19c73e897f5a7e
BLAKE2b-256 checksum
How to use checksums
eb3a57ba1137950501d2b9a6d6f74c008c3243a85a768bfb72ceb0374271a8ca
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for refactoring-cli 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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