You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/settings/repo-rules.mdx
+2-34Lines changed: 2 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,18 +61,9 @@ Codegen automatically searches for the following types of rule files in your rep
61
61
62
62
### Example Rule Files
63
63
64
-
Here are examples of how you might structure automatic rule files in your repository:
64
+
Here are examples of how you might structure agent rules in your repository:
65
65
66
-
**`.cursorrules` example:**
67
-
68
-
```
69
-
Use TypeScript for all new code
70
-
Follow the existing code style in the repository
71
-
Always add JSDoc comments for public functions
72
-
Prefer functional components over class components in React
73
-
```
74
-
75
-
**`.cursor/rules/backend.mdc` example:**
66
+
**`AGENTS.md` example:**
76
67
77
68
```markdown
78
69
# Backend Development Rules
@@ -157,26 +148,3 @@ Perfect for repository-specific requirements that may override organization defa
157
148
-**Build and Deployment:**
158
149
- "Run `npm run build` before committing to ensure the build passes."
159
150
- "This repository deploys automatically on merge to main - ensure all tests pass."
160
-
161
-
### Rule Hierarchy in Action
162
-
163
-
Here's how user, organization, and repository rules work together:
164
-
165
-
**User Rule:** "I prefer detailed error messages with context"
166
-
**Organization Rule:** "Use TypeScript for all new code"
167
-
**Repository Rule:** "This legacy project uses JavaScript - do not convert existing files"
168
-
**Result:** The agent will use JavaScript for this specific repository (repository rule wins), but will still include detailed error messages (user rule applies) since there's no conflict.
169
-
170
-
<Tip>
171
-
Keep your rules concise and clear. Overly complex or numerous rules might
172
-
confuse the agent or lead to suboptimal performance. Focus on the most
173
-
critical guidelines for your organization and repositories.
174
-
</Tip>
175
-
176
-
<Note>
177
-
All agent rules (user, organization, repository, and automatic rule files) are
178
-
applied *in addition* to any global prompting strategies or agent
179
-
capabilities. They provide a hierarchical layer of instruction that helps
180
-
ensure consistent behavior across your personal work, organization, and
0 commit comments