A domain module imports an HTTP client to fetch a customer record. The feature works, but the domain now depends on a transport detail. The next caller needs a different transport and inherits that dependency. A useful agent rule identifies the boundary before the next edit makes it harder to change.
Write the boundary as a decision
In a fictional TypeScript repository, the team might start with this instruction:
When changing packages/domain, keep imports from packages/http out of it.
Domain code defines the behavior; an outer layer supplies I/O through an interface.
If a change needs to cross that boundary, explain the requirement and ask for review.
Inspect the existing interfaces and callers before adding a new one.
Replace those directories and the dependency direction with your actual architecture. There are valid designs where a domain layer depends on an external package; the point is to record the decision your team has made, including what happens when a task conflicts with it. Point to a small existing implementation that shows the intended seam. Check that it is still the pattern the maintainers want before presenting it as canonical.
Cursor's rules documentation puts project rules in
.cursor/rules as .mdc files; it says a plain
.md file there is ignored by the Agents Window. To attach
the decision above to domain files, save it as
.cursor/rules/domain-boundary.mdc with this header above
the text:
---
globs: packages/domain/**
alwaysApply: false
---
The terminal interface can treat rule files differently, and
AGENTS.md is the plain Markdown alternative, so check the
current documentation for the surface you use. Confirm the relevant
instructions are available during a real task. A rule file in the
repository cannot by itself prove that the editor loaded it or that the
agent applied it.
Test the rule against two changes
First, give the agent a small task that tempts a direct
packages/http import in domain code. Ask for a plan and the
files it inspected before edits. Review whether the proposed dependency
points in the intended direction and whether an existing interface fits.
Then inspect the diff and run the relevant tests.
Second, give it a task where the existing boundary is genuinely insufficient. The useful response is a specific conflict and a proposed tradeoff, not an invented abstraction that makes the rule appear satisfied. A reviewer can approve a documented exception or change the rule if the architecture itself needs to evolve.
Where the dependency rule is mechanical, enforce it with the project's existing lint or build tooling too. A check can catch an import; it cannot decide whether the chosen interface expresses the right responsibility. Reviewers still need to trace behavior and tests across the boundary.
Use a shared starting point
AI Lint contains architecture doctrine, named rejects and a pre-code checklist, with wiring prompts for agents including Cursor. Paid packs can be edited for internal standards. Its override protocol records the reason, risk and mitigation for a conflict requiring human approval. It is doctrine the agent reads, not an automatic import checker or a guarantee of compliance.
A Personal license covers one user, including company work: $49 for the App or Systems pack, $79 for the bundle. A Company license covers unlimited internal users in one legal entity: $299 per pack, $499 for the bundle. All are one-time purchases. The free edition is for personal and evaluation use by individuals only and does not cover commercial or company use.