Skip to main content

smelt

Smelt is a static checker for Python codebases maintained by people and coding agents. Describe your architecture and adopt source and test conventions in smelt.yaml; Smelt turns those decisions into actionable checks that can run locally, in pre-commit and in CI.

Use it both as architecture as code and as an executable style guide: agents can inspect the policy before editing, check their changes, and iterate on findings before the same project-wide checks run in CI.

What Smelt supports

Area Examples Learn more
Architecture Layer and feature boundaries, third-party dependencies, cycles, composition roots, wiring, and coverage of production code by policy Architecture
Package contracts Required modules and public entry points; checks for imports of private implementation modules Package contracts
Source conventions Package-scoped import styles, module names and headers, public-first ordering, internal helpers, and selected readability checks Source conventions
Test conventions Mirrored test paths and opt-in reviews of outcomes, mocks, private access, async awaits, waits, and test-only public members Test policies
Agent and CI workflows Policy briefings, staged and changed checks, JSON, GitHub annotations, SARIF, pre-commit and debt baselines Integrations, agent workflow, CLI and reports, adoption

The rule catalog lists each check, its activation and default severity. Most rules are opt-in; a declared architecture, package or test policy activates the corresponding checks. See rule activation.

What's new in 0.3.0

  • Review missing package exports with opt-in SMT109, and internal constants and type aliases with opt-in SMT320.
  • Use --format concise for short feedback. JSON reports now use schema 2; integrations must resolve shared usage scopes and request full coverage explicitly.
  • Get more precise definition ordering, public-API preservation, multiline suppressions and outcome/deadline checks through directly executed test helpers.

See the upgrade guide for required steps, copyable examples and changes in findings, or the changelog for details.

Quick start

Smelt requires Python 3.12 or newer. Install the smelt-cli package (the unrelated PyPI package smelt is not this project):

uv tool install smelt-cli
# or: pip install smelt-cli

From your project root:

smelt init --maintainability  # draft smelt.yaml and select source/test checks
smelt check --show-hints --fail-on warning
smelt context <feature-or-path>  # inspect the policy before making a change
smelt explain SMT101             # understand a finding and its configuration

Review the generated configuration before adopting it: inference proposes a starting point, including architecture when recognizable; it does not decide your intended design. Small libraries can use named checks without features or layers. See configuration and adoption.

To run without installing, use uvx --from smelt-cli smelt check. From a local checkout, use uv tool install .. Run Smelt with a Python version that can parse the project's syntax; see Python versions. Building from a checkout or source distribution requires Rust 1.88+ and a platform linker. Release wheels include the native client.

Agent loop and enforcement

  1. Inspect the policy with smelt context <feature-or-path>.
  2. Edit, then run smelt check --changed --format json and address findings.
  3. Run focused tests, stage the intended changes, and run smelt check --staged --fail-on warning and prek run --all-files. Inspect hook fixes, stage the intended result, and rerun until checks pass.
  4. Run a full smelt check in CI to enforce the adopted policy project-wide.

For strict architecture coverage, add --strict-coverage; it requires every discovered production file to have a role or a reasoned exclusion. Changed checks compare against HEAD by default, including uncommitted changes. For PRs, --changed --base origin/main compares against the merge base. The integration guide includes a reusable agent instruction, pre-commit configuration, and GitHub Actions example. The agent workflow explains staged checks, partial staging and caching.

Scope

Smelt analyzes Python source statically. It checks the policies and rule patterns it supports, not arbitrary runtime behavior, dynamic imports, or test effectiveness. Many review-oriented checks are advisory and require judgment; a clean report does not establish correctness. Use tests, type checking, and tools such as Ruff alongside Smelt. See the vision and scope and each rule's page for its precise limits.

Documentation and development

Start with the documentation index, or browse the configuration reference, rule catalog, and changelog. For development setup, checks, rule contributions, and releases, see CONTRIBUTING.md.

Metadata

Release files for smelt-cli 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 smelt-cli 0.3.0
File Size Uploaded Provenance Actions
smelt_cli-0.3.0.tar.gz 596.4 kB With provenance Details for smelt_cli-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for smelt-cli 0.3.0
File Actions
smelt_cli-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for smelt_cli-0.3.0-py3-none-win_amd64.whl
smelt_cli-0.3.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for smelt_cli-0.3.0-py3-none-manylinux_2_28_x86_64.whl
smelt_cli-0.3.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for smelt_cli-0.3.0-py3-none-manylinux_2_28_aarch64.whl
smelt_cli-0.3.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for smelt_cli-0.3.0-py3-none-macosx_11_0_arm64.whl
smelt_cli-0.3.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for smelt_cli-0.3.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 6.7 MB

Release files / smelt_cli-0.3.0.tar.gz

Download URL smelt_cli-0.3.0.tar.gz
Size 596.4 kB
Tags Source
SHA-256 checksum
How to use checksums
052b5a84d1a015d9c8edde6f59377f1e50581bfd7521307769aacf6283ec772c
BLAKE2b-256 checksum
How to use checksums
c4f06e5008671e40727afa86de4b85d9a479a75ca0c265d75b6bfaf4c728ff57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / smelt_cli-0.3.0-py3-none-win_amd64.whl

Download URL smelt_cli-0.3.0-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b599b378cd74d93c5dcea26074d65c2a1c55f70fb999c14f390bc72120598c63
BLAKE2b-256 checksum
How to use checksums
fd3c1b606031d63d1c23527e98885fc81252116625a4d4b728e672d1c52726c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / smelt_cli-0.3.0-py3-none-manylinux_2_28_x86_64.whl

Download URL smelt_cli-0.3.0-py3-none-manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
0393a7bc6a6d65a02df3ca60e6de55362000d6ba9d5873661e321fd300270e6b
BLAKE2b-256 checksum
How to use checksums
9af8a110db6a3d8036be6457c08ae915aede0cbf0e08d030e74bae2c79fdb836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / smelt_cli-0.3.0-py3-none-manylinux_2_28_aarch64.whl

Download URL smelt_cli-0.3.0-py3-none-manylinux_2_28_aarch64.whl
Size 1.2 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
768c22eeeb99a01808ddcd312924169e3eb245013a2c74c89da484ec0b859d09
BLAKE2b-256 checksum
How to use checksums
4b2d1226f7637f3d06470f860e03e47a49eaf48b6476a8e4bb7194003e80ef30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / smelt_cli-0.3.0-py3-none-macosx_11_0_arm64.whl

Download URL smelt_cli-0.3.0-py3-none-macosx_11_0_arm64.whl
Size 1.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
340361e71cfe0545a6ee86d7051b44c526f11fe63d855def1e70c39a6ed6d4b4
BLAKE2b-256 checksum
How to use checksums
a6c3a2f8e2e30dd959fd0c77ae4ab1107397406d943abc5a05a13f3748ce85a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / smelt_cli-0.3.0-py3-none-macosx_10_12_x86_64.whl

Download URL smelt_cli-0.3.0-py3-none-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c20de17080768c6ddd2d05a7e1cb41faa101286b61df2eeba35afa6c8686b3c3
BLAKE2b-256 checksum
How to use checksums
edab9ac1d881f1c8e1ce6dd500f65cc4fbc9295aba4a05eac065b5abd89ea569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for smelt-cli 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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for smelt_cli-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

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.

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