Can the cursor rule create subdirectories?

Can the cursor .rules create subdirectories?

yes you can, you can create subdirectories inside rules so its like .cursor/rules/frontend or .cursor/rules/backend. i always do this for separate rules.

yes, cursor rules can reference subdirectories. if you mean can a rule tell cursor to create files in subdirectories, absolutely. for example i use a rule like:

when creating a page.tsx file in the Next.js app directory, always create a corresponding error.tsx file in the same directory.

cursor follows that and creates both files in whatever subdirectory the page lives in.

if you mean can you organize your .cursor/rules/ folder with subdirectories, that also works. you can have .cursor/rules/react/components.mdc and .cursor/rules/python/fastapi.mdc and cursor will pick them all up. the glob patterns in the frontmatter determine when each rule applies regardless of where the .mdc file lives in the rules folder.