Captain's Log: High-authority Pylint module for enforcing Prime Directives (Clean Architecture) and preventing Hull Integrity Breaches (Technical Debt) in Python projects.
Enforcing architectural boundaries, dependency rules, and design patterns to ensure the fleet remains operational and modular.
Features
- Layer Boundary Enforcement: Ensures Prime Directives are maintained between Domain, UseCase, and Infrastructure.
- The Silent Core Rule (W9013): Guarantees that Domain/UseCase layers remain free of
print,logging, and console I/O, forcing delegation to Interfaces/Adapters. - Dependency Injection Checks: Forbids unauthorized instantiation of infrastructure modules within UseCases.
- Design Pattern Enforcement: Detects "naked returns" and other architectural anomalies.
- Law of Demeter: Prevents tight coupling through deep method chains.
- Contract Integrity: Verifies that Infrastructure implements Domain Protocols correctly.
- Anti-Bypass Guard: Prevents "lazy" disabling of Prime Directives without high-level authorization (Justification).
Docking Procedures
pip install pylint-clean-architecture
Flight Manual
Add the plugin to your pyproject.toml or Pylint configuration:
[tool.pylint.main]
load-plugins = ["clean_architecture_linter"]
Run Pylint as usual:
pylint src/
AI Coding Assistant Support
The clean-arch-init command generates architectural instructions for AI agents (like Cursor or GitHub Copilot) to prevent "Split Brain" issues by teaching the AI your project's rules before it writes code.
Usage:
clean-arch-init
Outcome: This creates a customized .agent/instructions.md file based on the layer names defined in the project's Console Calibration.
Console Calibration
The module is calibrated via [tool.clean-arch] in pyproject.toml.
[tool.clean-arch]
# 1. Project Type Presets (generic, cli_app, fastapi_sqlalchemy)
project_type = "generic"
# 2. Strict Visibility Enforcement
visibility_enforcement = true
# 3. Silent Core Calibration
silent_layers = ["Domain", "UseCase"]
allowed_io_interfaces = ["TelemetryPort", "LoggerPort"]
# 4. Shared Kernel (Allow cross-cutting concerns anywhere)
shared_kernel_modules = ["logging_utils", "clean_architecture_linter.interface.telemetry"]
# 5. Custom Layer Mapping (Map directory regex patterns to layers)
[tool.clean-arch.layer_map]
"services" = "UseCase"
"infrastructure/clients" = "Infrastructure"
"domain/models" = "Domain"
Prime Directives
See RULES.md for a complete catalog of enforced Prime Directives and "Clean Fix" examples.
Mission Log
- CHANGELOG.md - Mission history and architectural updates
Contributing
- Fork the repo.
- Install dependencies:
make install. - Run tests:
make test. - Submit a PR.
Release files for pylint-clean-architecture 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylint_clean_architecture-1.5.2.tar.gz | 32.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylint_clean_architecture-1.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.4 kB
Release files / pylint_clean_architecture-1.5.2.tar.gz
| Download URL | pylint_clean_architecture-1.5.2.tar.gz |
|---|---|
| Size | 32.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cd97f380b08d8b428c2c1eb1ba44e06de4b13d3c7141527f13ab97e5ce958ac
|
|
BLAKE2b-256 checksum How to use checksums |
ea5e886637806a8e19c6d7ffa702b61989714c2550a88746cf21bea77a96ed78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 18, 2026.
Transparency logRelease files / pylint_clean_architecture-1.5.2-py3-none-any.whl
| Download URL | pylint_clean_architecture-1.5.2-py3-none-any.whl |
|---|---|
| Size | 36.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a096287399360c710231d2c66cff9b59d2b5afabcaf2b34becbdceeb67a4cb6e
|
|
BLAKE2b-256 checksum How to use checksums |
115923e6cf9917598335ad80b7e2e56592ab9010464d1ecde422ea47166ee449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 18, 2026.
Transparency log