Back to work

Architecture Lint

Module Boundary Linter with a Ratchet · Developer Tools

A single bash script that checks module boundaries in TypeScript and Swift codebases, with a count-based baseline so you can turn it on before cleaning up existing violations.

View source on GitHub

How it was built

Problem

Architecture rules are easy to agree on and hard to enforce retroactively: turning on a boundary linter for the first time on a real codebase means it immediately fails on years of pre-existing violations, so teams either skip enforcement entirely or burn a sprint on a big-bang cleanup before CI can go green.

Decisions

  • Record a per-rule violation count at adoption time and fail CI only when a count rises. It counts rather than tracks individual violations, so fixing one and adding another in the same change still passes; I chose the simpler version and wrote that trade-off down.
  • Kept boundary rules in one list inside the script instead of per-file annotations, so adopting it doesn't touch application code.
  • Kept it to one bash script with no dependencies to install, and made it fail loudly if it's pointed at the wrong folder instead of silently reporting clean.

Outcome

You can turn on boundary checks the same day, on a codebase with existing violations, and CI stops the count from growing while you pay the debt down.

Key features

  • Baseline records how many violations each rule has today; CI fails when a count goes up
  • Boundary rules live in one list at the top of the script, with no annotations in your code
  • Needs only bash, grep and xargs; tested on Linux CI and macOS

Impact

Lets a team turn on architecture enforcement today, on a codebase with years of existing debt.

Tech stack

Shell, CLI

Interested in something like this?

Get in touch