A pipx-first CLI for architecture-aware collaboration between humans and coding agents.
Project description
enclosure
Coding agents are brilliant.
They are also very enthusiastic strangers in your house.
enclosure is a tiny CLI that gives them a room, a map, a few house rules, and a polite reminder that the production database is not a toy chest.
It creates a project-local operating contract for humans and agents: readable rules, architecture boundaries, local recipes, and checks that turn "please understand this repo" into something visible, reviewable, and repeatable.
Small tool. Big reduction in "wait, why did it touch that?"
The ambition is simple: be the smallest powerful thing in the category.
The Problem
Most AI coding failures do not start with bad syntax.
They start with missing context.
The agent does not know which module owns the behavior. It does not know that this folder is legacy, that this layer must stay inward-facing, that a public package seam exists for a reason, or that the team has a very specific way of adding new features.
Humans know these things. Usually in meetings, memory, code review scars, and that one message in Slack nobody can find anymore.
enclosure makes that knowledge sit inside the repository.
Not as a manifesto. As files.
What Enclosure Gives You
enclosure gives your repo an enclosure for agents: a small, explicit place where cooperation starts.
.enclosure/enclosure.yamldescribes architecture tags, layer flow, exclusions, and dependency rules..enclosure/rules/mirrors shared guidance that agents can read before improvising..enclosure/rules/local/keeps repository-specific decisions where humans can review and tune them..enclosure/recipes/holds local recipes for project-shaped scaffolding.AGENTS.mdand.github/copilot-instructions.mdpoint coding assistants toward the contract.
The point is not to make agents obedient little robots. That would be boring, and also fiction.
The point is to make cooperation cheaper. The agent can still reason, explore, and help, but it starts from boundaries the team can see.
Why It Feels Different
Many tools in this space try to become the new center of gravity.
enclosure does the opposite.
It stays small, local, and boring in the best possible way. No platform migration. No ceremony tax. No giant dashboard asking if you are having a productive transformation journey today.
You run it in a repo. It writes a contract. You and your agents use that contract. When the shared baseline changes, you update it. When the local rules need nuance, you edit normal files.
That is the trick: enclosure is powerful because it does not try to own your workflow. It gives the workflow a skeleton, then gets out of the way.
Capabilities
- Bootstrap or refresh a local collaboration contract.
- Validate architecture boundaries, dependency flow, and file shape.
- Map modules, layers, hotspots, unknown files, and dependency pressure.
- Validate local rule documents.
- Inspect, preview, and render project-shaped recipes.
Command syntax lives in --help. Human-facing command guidance lives beside the command implementation and is available with --docs.
Install
pipx install enclosure
Try it without committing to the relationship:
pipx run enclosure --help
enclosure supports Python 3.11+.
Quick Start
cd your-repo
enclosure workspace sync init
$EDITOR .enclosure/enclosure.yaml
enclosure architecture health
enclosure architecture boundaries
Then tell your coding agent to start in .enclosure/.
That one instruction changes the conversation. Instead of "look around and guess," the agent gets a doorway into the repo's actual operating model.
For command-level documentation:
enclosure --docs
enclosure architecture --docs
enclosure workspace recipe --docs
Configuration Sketch
architecture:
language: python
root: src/enclosure/features
exclusions: [.venv/**, .enclosure/**, tests/**, libraries/**]
shape:
max_classes_per_file: -1
max_interfaces_per_file: -1
max_types_per_file: -1
max_abstract_classes_per_file: -1
max_functions_per_file: -1
max_methods_per_class: -1
max_declared_args_per_function: -1
max_declared_args_per_method: -1
max_lines_count_per_function: -1
max_lines_count_per_method: -1
max_lines_count_per_class: -1
allow_optional_function_args: true
allow_optional_method_args: true
allow_optional_class_properties: true
allow_imports_aliases: true
enforce_joined_imports: false
allowed_imports_crossing_types: [module, symbol]
boundaries:
tags:
- { name: feature, match: &feature "*", except: [], exclude: [] }
- { name: module, match: &module "*/*", except: ["*/__init__"], exclude: [] }
- { name: module_api, match: &module_api "*/*/__init__", except: [], exclude: [] }
- { name: domain, match: &domain "*/*/domain", except: [], exclude: [] }
- { name: application, match: &application "*/*/application", except: [], exclude: [] }
- { name: infrastructure, match: &infrastructure "*/*/infrastructure", except: [], exclude: [] }
- { name: ui, match: &ui "*/*/ui", except: [], exclude: [] }
rules:
- { source: *feature, disallow: [*feature], allow: [*module_api], allow_same_match: true }
- { source: *module, disallow: [*module], allow: [*module_api], allow_same_match: true }
- { source: "*/config/domain", disallow: [*module], allow: [*domain], allow_same_match: true }
- { source: *domain, disallow: [*application, *infrastructure, *ui], allow: [], allow_same_match: false }
- { source: *infrastructure, disallow: [*application, *ui], allow: [], allow_same_match: false }
- { source: *application, disallow: [*ui], allow: [], allow_same_match: false }
- { source: *ui, disallow: [*infrastructure], allow: [], allow_same_match: false }
flow:
layers: [ui, application, infrastructure, domain]
module_tag: feature
analyzers: [backward-flow, no-cycles]
map:
top: 20
clusters:
group_depth: 5
top: 20
files_top: 5
health:
top: 5
workspace:
recipe:
skip: []
rules:
local:
max_content_chars: 2400
sync: {}
For report-size limits such as top and files_top, -1 means unlimited,
0 means show none, and any positive value caps the result.
The syntax is intentionally small. It describes seams, not the meaning of life.
Who It Is For
Use enclosure if:
- you work with coding agents and want them to understand repo boundaries before editing;
- your team has architecture rules that live mostly in people's heads;
- you want generated files to follow local recipes instead of generic templates;
- you like tools that are small enough to understand and useful enough to keep.
Skip it if you want an all-seeing platform that manages every decision for you. enclosure is not trying to become your boss. It already has plans this weekend.
The Human Part
Good agent collaboration is not about replacing human judgment.
It is about reducing the amount of judgment wasted on preventable mess.
Humans decide the architecture. Humans review the contract. Humans tune the local rules. Agents get a better starting point, a smaller blast radius, and a way to explain their work in the language of the repository.
That is why enclosure is small but powerful: it does not make the agent smarter by magic. It makes the room clearer.
And clear rooms produce better work.
Release Notes
See CHANGELOG.md.
Contributing
Ideas, issues, and pull requests are welcome.
Start with CONTRIBUTING.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enclosure-1.0.4.tar.gz.
File metadata
- Download URL: enclosure-1.0.4.tar.gz
- Upload date:
- Size: 73.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3da4adfcccd89068db967c7c5304ae3f5d093f0d8bc07b9271db5c8aed44b55a
|
|
| MD5 |
adff32584b407feb8443852fd244d074
|
|
| BLAKE2b-256 |
c9ed83dd3d030005f30ae6f2f41bb4c8279a7141a09a54a2b4e93c7cff0f6f2e
|
Provenance
The following attestation bundles were made for enclosure-1.0.4.tar.gz:
Publisher:
release.yml on 9orky/enclosure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
enclosure-1.0.4.tar.gz -
Subject digest:
3da4adfcccd89068db967c7c5304ae3f5d093f0d8bc07b9271db5c8aed44b55a - Sigstore transparency entry: 1630406989
- Sigstore integration time:
-
Permalink:
9orky/enclosure@65e8304325d64c57cae89c91a14725e9a065d7a5 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65e8304325d64c57cae89c91a14725e9a065d7a5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file enclosure-1.0.4-py3-none-any.whl.
File metadata
- Download URL: enclosure-1.0.4-py3-none-any.whl
- Upload date:
- Size: 103.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c09e3526eb66df5614fc05d9cf66c69905d0112efc04a6ba7a5ee5b20f97a8e
|
|
| MD5 |
54e2147cd1d79781c4c45808d8344233
|
|
| BLAKE2b-256 |
329a592463fda42783cae351f7477eb1eb2893bedf42cea85cad707e5a827322
|
Provenance
The following attestation bundles were made for enclosure-1.0.4-py3-none-any.whl:
Publisher:
release.yml on 9orky/enclosure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
enclosure-1.0.4-py3-none-any.whl -
Subject digest:
7c09e3526eb66df5614fc05d9cf66c69905d0112efc04a6ba7a5ee5b20f97a8e - Sigstore transparency entry: 1630407022
- Sigstore integration time:
-
Permalink:
9orky/enclosure@65e8304325d64c57cae89c91a14725e9a065d7a5 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/9orky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65e8304325d64c57cae89c91a14725e9a065d7a5 -
Trigger Event:
release
-
Statement type: