Skip to main content

rw-style

A Python CLI for adding and safely updating project guidance. Choose Python, scripts, dbt, component, and report conventions, with Editorial Reports or Decision Desk styling and risk-focused verification.

Requires Python 3.11+. uv provides the usual isolated CLI workflow. platformdirs supplies portable per-user library paths.

Start here

Run directly from PyPI:

uvx rw-style init ../my-project

In an interactive terminal, init and add open a TUI picker by default:

  • Arrow keys (or j/k) navigate; Space selects; Enter applies.
  • Escape or q cancels without changing files.
  • Press ?, h, or F1 for scrollable help; Enter/Escape returns to the picker without applying anything. rw-style help shows the same content without requiring a terminal.
  • Core and verification guidance are always included.
  • init selects a stack, additional guides, a visual profile, and optional tooling.
  • add shows installed guides and lets you select more without removing them.

The default bundle is rw-data-stack: Python + uv, Bun, Playwright, and GitHub guidance, without requiring React, FastAPI, or another framework. GitHub defaults recommend private repositories, worktrees for new features, and focused PRs; they never create repositories or change visibility automatically. Stack defaults stay checked in the picker. Choose stack none for individual guide selections. dbt and report-specific guides remain opt-in. A stack selects instructions; it does not install its tools or generate application code.

The picker needs a terminal with curses support (typically Linux/macOS), at least 40 columns × 10 rows. Explicit selection flags or --no-interactive skip it. Non-TTY and TERM=dumb runs never prompt.

For a persistent installation, use uv tool install rw-style. To pin this release, use uvx rw-style@0.3.0 ....

From a checkout, use uv run rw-style or uvx --no-cache --from . rw-style ...; --no-cache avoids reusing an earlier local tool environment after source edits. Building the repository does not publish anything automatically.

Agent-friendly commands

# Default rw-data-stack guidance, with no prompt or tool changes
uvx rw-style init ../my-project --no-interactive

# Minimal core/testing, plus selected guidance without the default stack
uvx rw-style init ../minimal-project --stack none --guide python

# Explicit choices also bypass the picker
uvx rw-style init ../research-project \
  --guide scripts --guide dbt --guide components --guide reports \
  --profile editorial \
  --style "Keep raw source data unchanged." \
  --verify "uv run pytest tests/reporting -q"

# Add guides later; without --guide, a terminal opens the picker
uvx rw-style add ../my-project --guide scripts --guide dbt

# Refresh installed guidance and change only explicitly supplied settings
uvx rw-style update ../my-project \
  --style "Use type hints on public functions." \
  --verify "uv run pytest -q"

# Switch visual profile without losing the other guides
uvx rw-style update ../research-project --profile decision-desk

The path defaults to the current directory. Built-in guide choices are python, bun, playwright, github, scripts, dbt, components, and reports; imported guides use local:NAME. Profiles are editorial and decision-desk. add requires at least one guide when the picker is not used.

Repeat --style or --verify for multiple entries. On update, supplying an option replaces that entire list; omitted settings are preserved. Verification commands are documented, never executed. Style prose does not configure tools. Custom commands may need separately installed tools.

add preserves installed guide versions; update refreshes them from the version of rw-style being run. Identical additions and unchanged updates are no-ops.

Local guides and reusable stacks

Import a trusted, self-contained UTF-8 Markdown file into a per-user library:

uvx rw-style guides import ~/Documents/team-style.md --name team-style
uvx rw-style guides list
uvx rw-style init ../team-project --guide local:team-style
uvx rw-style add ../my-project --guide local:team-style
uvx rw-style help

There is no upload/server step. platformdirs.user_data_path("rw-stylizer", appauthor=False) stores library data outside uvx's disposable environments. guides list prints the exact path (typically ~/.local/share/rw-stylizer/guides on Linux). New library directories/files use private permissions on POSIX. The public package and command are rw-style; the Python module, library paths, project directory .rw-stylizer/, and managed markers retain their legacy names so existing imports and project setups continue to work without migration.

Imports copy the file; editing the original source does not update the library. Re-importing the same name refuses to overwrite it. Edit the stored Markdown instead, then explicitly run update in projects that should receive the change. Projects contain independent, committed copies and no machine-specific paths. Adding other guides works even without an existing custom guide's source; refreshing that custom guide requires it to be available under the same local name. Local guide and project-side edit conflicts are checked before project writes.

Names use lowercase letters/digits/hyphens, start with a letter, and are at most 64 characters. Imports are limited to 1 MiB. Common relative Markdown/HTML links and file/unsafe URL schemes are rejected: use self-contained text, same-document anchors, or explicit http/https/mailto links. No assets are copied. These are portability checks, not a full HTML/CSS/JS sanitizer or renderer. Only import instructions you trust; agents may follow them.

To define another stack, import its guides first, then a TOML preset:

description = "Our Rust tooling conventions"
guides = ["local:rust-style"]
uvx rw-style stacks import ~/Documents/rust-stack.toml --name rust
uvx rw-style stacks list
uvx rw-style init ../rust-project --stack local:rust

Preset files accept only description and guides; they cannot execute commands or install dependencies. They live beside the guide library in stacks/. local: names cannot collide with built-ins. Presets are initial selections: their later edits do not silently alter project selections, and project updates do not require the original preset. Use add for more guides; stack migration and guide removal are not implemented.

What it changes

Guidance-only mode creates:

AGENTS.md                         # Only a marked section is managed
.rw-stylizer/
  state.json                      # Selections and ownership hashes
  testing-strategy.md
  guides/
    core.md
    python.md
    bun.md
    playwright.md
    github.md
    ...selected modules/profile...
    local/
      ...selected custom guides...

An existing AGENTS.md is retained and receives a managed section. Subsequent commands preserve all bytes outside that section. Existing tool settings, dependencies, lockfiles, Git metadata, and application code stay untouched. Selecting dbt/components/reports does not install their associated tools.

Optional starter tooling

uvx rw-style init ../new-project --tooling
# Or add starter tooling to an already initialized project:
uvx rw-style update ../my-project --tooling

This explicitly uses uv to initialize a bare Python project if needed, adds Ruff and pytest as development dependencies, and creates ruff.toml/pytest.ini. Ruff uses an 88-character line-length setting and import sorting. uv add --dev --frozen ruff pytest does not sync an environment or resolve a lockfile. Run uv sync in the target afterwards. The Python guide must be selected; tooling setup does not install Bun or Playwright.

Existing Ruff/pytest configuration causes tooling setup to stop rather than overwrite or shadow it—even if it came from an earlier rw-stylizer run. Guidance updates without --tooling still work normally.

Update safety and recovery

  • Commit AGENTS.md and .rw-stylizer/, including state.json, with your project.
  • Put handwritten rules outside the managed AGENTS section, or supply them through --style/--verify. Do not put secrets in either instructions or metadata.
  • Ownership record format 1 is supported and upgraded on update. Existing projects retain their guide choices; they do not silently acquire new stack defaults. To add GitHub guidance to an older project, use add --guide github.
  • Direct edits to managed guide files, missing files, or malformed metadata/markers block updates. The CLI reports conflicts rather than overwriting or merging.
  • To reconcile a local edit, save its useful project-specific rules outside the managed section, restore the affected managed files from your known-good project revision, then retry. Do not edit ownership hashes just to bypass the check.
  • Symlinks at generated output paths are refused. Unknown project files are not adopted or removed.
  • Run one mutating command per project at a time. Existing files are replaced atomically, but the complete operation is not a cross-file transaction. On an I/O/uv failure, inspect the reported attempted paths and restore a consistent known-good setup before retrying. uv may already have updated pyproject.toml.

Exit codes: 0 success/no-op, 1 setup/conflict failure, 2 argument error, 130 cancellation. Guides are instructions for cooperating agents, not automatic enforcement. This CLI does not run tests, generate an application, or configure CI.

Guides and specification

These files are included in the source distribution:

  • Guide catalog: docs/guides/README.md
  • Accepted testing strategy: docs/testing-strategy.md
  • CLI behavior specification: docs/cli-spec.md
  • Release notes: CHANGELOG.md

The guide files are canonical Markdown sources, packaged into both distribution formats. Generated project copies are not duplicate templates maintained in Python.

Develop and verify

uv sync --locked
uv run rw-style --help
uv run ruff format --check .
uv run ruff check .
uv run pytest -q
uv build

The tests include isolated real-uv setup checks without downloads or paid calls. Packaging verification should also run the built wheel through uvx outside this checkout. TUI changes require actual terminal inspection; this CLI has no web UI, so Playwright is for the generated guidance's web/report workflows, not its picker.

Metadata

Release files for rw-style 0.3.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 rw-style 0.3.0
File Size Uploaded Provenance Actions
rw_style-0.3.0.tar.gz 50.5 kB Without provenance Details for rw_style-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rw-style 0.3.0
File Interpreter ABI Platform Actions
rw_style-0.3.0-py3-none-any.whl Python 3 none any Details for rw_style-0.3.0-py3-none-any.whl

Total release size: 93.3 kB

Release files / rw_style-0.3.0.tar.gz

Download URL rw_style-0.3.0.tar.gz
Size 50.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e6af621d402d76236b80409d62f80747c8608fced08181dc5f4913ac02faa93a
BLAKE2b-256 checksum
How to use checksums
5c53441b43fa4d6f039b2d63618331660043dfcc8b48066c040261d709bcc0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rw_style-0.3.0-py3-none-any.whl

Download URL rw_style-0.3.0-py3-none-any.whl
Size 42.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c54a0c302623fee0dd43401e36f95bab7ae9beafdbff67714f4b1a784cd28b66
BLAKE2b-256 checksum
How to use checksums
dbecc2f12d1d20b575c9a82eb856b55902c3099884ce842eb53a50cafdb845fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rw-style 0.3.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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