| name | no-broken-window |
| description | Detect, establish, and enforce codebase patterns so one violation doesn't erode the standard. Use when user discusses a rule, pattern, or convention they want uniform across the codebase, wants to unify inconsistent behavior, mentions enforcing a standard, preventing drift, or keeping things consistent, or invokes /no-broken-window. |
No Broken Windows
One broken window nobody repairs turns into ten. One hack nobody removes turns into the pattern.
Quick start
User: "Some components import from stores/ directly, some don't — I want consistency."
- Scan codebase, report: "14 components import stores, 6 don't"
- Propose rule: "Only container components import from
stores/"
- Resolve grey areas, then enforce via lint rule
- Document in CONTEXT.md
Workflows
1. Identify the pattern
2. Collaborate on the standard
3. Enforce it
Attempt enforcement in this priority order:
- Lint rule (preferred) — ESLint, Biome, or similar. Catches at dev time.
- Pre-commit hook — script that checks the pattern. Catches at commit time.
- CI check — GitHub Action or similar. Catches at PR time.
- Documentation only — if the rule can't be automated, document in CONTEXT.md or an ADR.
For each enforcement option:
4. Document
Key principles
- One rule, one sentence. If you can't state it in one sentence, it's too vague to enforce.
- Automate or it will rot. A rule without a linter is a suggestion.
- Fix existing violations. Clean up first or create a tracked issue — don't establish a rule the codebase already breaks in 20 places.
- Grey areas are bugs in the rule. If two people could reasonably disagree on whether code violates the rule, the rule needs sharpening.