Give Rules and AGENTS.md Clear Scopes
Write compatible instructions for the repository root and booking subdirectory, then test whether either rule spreads too far.
Today's Goals
- Distinguish project Rules from AGENTS.md placement and scope.
- Put stable constraints in short rules and one-time requests in the task.
- Use positive and negative cases to test rule scope.
Plain-Language Walkthrough
Keep enduring instructions out of the task prompt
A workshop keeps safety instructions on the wall, while the day's repair order stays on a work card. Repository guidance has a similar split. Cursor project Rules and AGENTS.md can give Agent stable context about a codebase. The current official Rules documentation describes project rules under .cursor/rules and AGENTS.md as a plain Markdown alternative that can live at the root or in subdirectories. A one-time request, such as changing this week's confirmation copy, belongs in the task conversation. Treating every short-lived preference as a persistent rule makes later tasks carry old assumptions into new work.
In the fictional booking repository, a root instruction might require every code change to report the exact verification command and result. A booking-specific instruction might preserve the customer-facing names of pickup windows. Neither rule should say that Agent may read secrets or change billing whenever it thinks useful. Stable instructions describe how to work within an authorized task; they do not create new authority. The learner's responsibility is to decide where a rule belongs, how to tell when it applied, and what to do when two instructions conflict.
Interview questions
When does a repo instruction belong in AGENTS.md rather than a one-time prompt?仓库指令何时该放 AGENTS.md 而不是一次性提示?
Common in ChinaCommon overseasBasic#cursor#workflow🔒 Unlock this chapter to see the answer keys.
How do path-scoped Rules and nested AGENTS.md affect review?路径规则与嵌套 AGENTS.md 怎样影响审阅?
Common in ChinaCommon overseasIntermediate#cursor#workflow🔒 Unlock this chapter to see the answer keys.
What do you do if two instructions disagree?两条指令冲突时怎么办?
Common in ChinaCommon overseasDeep dive#cursor#workflow🔒 Unlock this chapter to see the answer keys.
