Bylaws
Architecture linter for Swift. You write project rules in Swift and enforce them in tests, the CLI or a SwiftPM plugin. Aimed at teams using agents.
View on GitHub ↗- Stars
- ★ 48
- Last commit
- 18 Oct 2026
- Maintenance
- Active
- Licence
- MIT
- Category
- Other
- GitHub
- theblixguy/swift-bylaws
Overview
Bylaws is an architectural linter for Swift, built for developers and coding agents. You write project rules in Swift that the compiler cannot enforce, such as which layers may depend on each other, and Bylaws reports violations with the file, line and rule. Rules run from a CLI or as part of your Swift Testing suite.
Features
- Rules inspect declarations, function calls and other Swift syntax
- Checks where files and types belong and restricts references between files, folders or modules
- Compares Package.swift with the imports in your sources and finds dependency cycles
- Most rules run without a build; some can read the compiler index
- Run from the CLI with bylaws lint or as Swift Testing tests
Requirements
The source doesn't list any requirements, so check the project's own docs before you install.
Install
Install the CLI and run your rules from the project root
brew install theblixguy/tap/bylaws bylaws lintOr add the Bylaws product to a test target and run rules with swift test
Example
Write a rule that keeps print calls inside your logging layer; bylaws lint then fails and points at any stray print in Sources.
Works with
Listed in
Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.
More in this category
apfel
Command-line tool, chat mode and local OpenAI-compatible server for the on-device model in Apple's FoundationModels framework. Needs macOS 26 and Apple silicon.
MCP Swift SDK
The official Swift SDK for building MCP clients and servers.
iCTRL
Runs a long-lived XCUITest on a real iPhone and exposes an HTTP API so agents can tap, type, read the UI and take screenshots. Meant for testing on your own devices.