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.yml; Smelt turns those decisions into actionable checks that can run
locally, in prek hooks 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, prek 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.4.0
- Share local policy across independent workspaces with
extends, explicit overrides andconfig show --sources. - Adopt optional reviews for implicit optional defaults (SMT321), deep object
navigation (SMT322) and
Base-prefixed class names (SMT323). - Get clearer cycle witnesses, shared-helper findings and API ownership evidence; unknown inline suppression identifiers now produce SMT901.
smelt initcreatessmelt.yml; existingsmelt.yamlfiles still work. Custom rules must migrateBaseRuletoRuleand the old protocol toRuleContract. JSON schema 2 and the default rule set stay unchanged.
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.yml 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
- Inspect the policy with
smelt context <feature-or-path>. - Edit, then run
smelt check --changed --format jsonand address findings. - Run focused tests, stage the intended changes, and run
smelt check --staged --fail-on warningandprek run --all-files. Inspect hook fixes, stage the intended result, and rerun until checks pass. - Run a full
smelt checkin 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,
prek 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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smelt_cli-0.4.0.tar.gz | 652.5 kB | With provenance | Details for smelt_cli-0.4.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| smelt_cli-0.4.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for smelt_cli-0.4.0-py3-none-win_amd64.whl |
| smelt_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for smelt_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl |
| smelt_cli-0.4.0-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details for smelt_cli-0.4.0-py3-none-manylinux_2_28_aarch64.whl |
| smelt_cli-0.4.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for smelt_cli-0.4.0-py3-none-macosx_11_0_arm64.whl |
| smelt_cli-0.4.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for smelt_cli-0.4.0-py3-none-macosx_10_12_x86_64.whl |
Total release size: 6.9 MB
Release files / smelt_cli-0.4.0.tar.gz
| Download URL | smelt_cli-0.4.0.tar.gz |
|---|---|
| Size | 652.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0529512282985f32e97da65002209afdfbaf370eaa4908906284493e1c5c074
|
|
BLAKE2b-256 checksum How to use checksums |
e153f89e58b17eb4a831b97d1338a95d09019c3affca1cc0509a92447e973dcb
|
| 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 logRelease files / smelt_cli-0.4.0-py3-none-win_amd64.whl
| Download URL | smelt_cli-0.4.0-py3-none-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
89110cb46e5fe7e5b0fbe2c890b926bbfef47f540fa2f94678b664a20c4d0bfe
|
|
BLAKE2b-256 checksum How to use checksums |
588bd5747c8b9a25ab791c1fbd03f8b8a15a1d829f717fa0371eb5dd9c7b6696
|
| 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 logRelease files / smelt_cli-0.4.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | smelt_cli-0.4.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 |
a3d53f1fa6de44f74283147444949e075c7da113fc46cac18336dfbc2d04bd3a
|
|
BLAKE2b-256 checksum How to use checksums |
2b96ca455236cf6a553a2629ca6f93325464732d170704dff795205e9d0c6692
|
| 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 logRelease files / smelt_cli-0.4.0-py3-none-manylinux_2_28_aarch64.whl
| Download URL | smelt_cli-0.4.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 |
cedd5fff0dd8662af2caa5ecdae0ec31765434696f8e064bd8208e3caa805d06
|
|
BLAKE2b-256 checksum How to use checksums |
daefc17571c3ea116d46d5f3c6b4ee517e2f2c68095034a9645e37a284aea871
|
| 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 logRelease files / smelt_cli-0.4.0-py3-none-macosx_11_0_arm64.whl
| Download URL | smelt_cli-0.4.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 |
126855a20dd887a8ca30c7c11edb4e9de1b458f4dd047138acbe38a5bf6ea1b8
|
|
BLAKE2b-256 checksum How to use checksums |
549670605ef65c2d1c255f64c573f19f532b62800a7cb13b425635050b07b355
|
| 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 logRelease files / smelt_cli-0.4.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | smelt_cli-0.4.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b0770b2d3934229e86db6e429cc204b8a85de3a33e4e6a5a286190867e05c549
|
|
BLAKE2b-256 checksum How to use checksums |
093f231bf3dbdcdf56ea0f555ee3c00bb8a8bb73dff47b37f8daf50f283be145
|
| 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 logSecurity for smelt-cli 0.4.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.
Attestation for smelt_cli-0.4.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 logA 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.