Chapter 6: The agent

Rules file

Also called Cursor rules, Path-scoped rules

Instructions that load only when they apply, usually when the agent touches certain files. A rule for database code stays out of the context until the agent opens database code.

One big instructions file is paid for on every request, even when a tenth of it matters. Scoped rules keep that file short. The risk is the opposite one: if the agent never opens a matching file, it never sees the rule.

Say it to your agent

“Move the SQL conventions out of AGENTS.md into .cursor/rules/sql.mdc with globs: src/db/**. Then open src/db/users.ts and confirm the rule attached.”

The workshop

Name a word, or describe what you mean in everyday language.