# "Unlock Cursor AI Full Potential Master Automatic Rule Generation" <!-- ref: @content/youtube/bmad-code/2025-02-17-unlock-cursor-ai-full-potential-master-automatic-r version: 4 updated_at: 2026-10-31T20:14:28.901Z --> From BMad Code, 2025-02-17: Cursor remains ahead of Copilot on agentic coding, but raw Composer output is inconsistent without structured rules. Brian walks through his `cursor-auto-rules-agile-workflow` template — a system that lets Cursor's Composer agent generate, organize, and auto-apply its own rules so the AI improves incrementally from its own mistakes. ## Core Thesis Cursor remains ahead of Copilot on agentic coding, but raw Composer output is inconsistent without structured rules. By shipping a master meta-rule (`0000-cursor-rules.mdc`) that enforces proper YAML front matter, glob patterns, and valid/invalid examples, the agent can reliably self-generate new rules — producing a compounding, self-evolving workflow where the AI gets better over time rather than repeating the same mistakes. ## Key Insights - **Self-evolving rules beat static config**: The agent generates and refines rules from its own errors, so corrections persist across sessions instead of being re-explained each time. - **Front matter is load-bearing**: Auto-application depends entirely on a well-written `description` field and correct `globs`. Prior rule-generators failed because files ended up "in a buggy state" without this. - **File format materially affects LLM performance**: Heavy trial-and-error across markdown, YAML, XML, and JSON landed on a hybrid format that balances context overhead with extractability — tuned especially for Claude Sonnet. - **Numeric prefixes create visual scannability**: `0xx` core, `1xx` tools/MCP, `3xx` testing, `10xx` TypeScript, `11xx` Python, `2xxx` frameworks — scalable as the rule set grows. - **Three rule tiers solve different scopes**: shared project rules (git-committed), Cursor IDE settings (local install), and private underscore-prefixed rules (gitignored via `rules/_*`). - **Valid + invalid example pairs improve rule application** in complex projects — the counterexample is as important as the positive case. - **Comments should be written for AI semantic search**, not just human readers — include key terms the agent will retrieve on. - **Notepads don't persist across projects or sync to GitHub** — an `xnotes/` folder added to `.cursorignore` is the workaround for reusable templates. ## Frameworks / Models - **`cursor-auto-rules-agile-workflow`** — the template repo, applied via `apply-rules.sh` (non-destructive for existing projects). - **`0000-cursor-rules.mdc`** — master meta-rule governing new rule creation. - **Rule prefix taxonomy**: `0xx` core · `1xx` tools/MCP · `3xx` testing · `1xxx` workflows/languages · `2xxx` frameworks. - **Private rule convention**: underscore-prefixed filenames excluded via `.gitignore`. - **xnotes pattern**: cursor-ignored folder for notepad template persistence. ## Actionable Takeaways 1. Run `apply-rules.sh` against any project (new or existing) to bootstrap auto-rule generation without touching existing files. 2. Let Composer pick up the rules file on its own — don't manually open it when asking the agent to create rules. 3. Write code comments optimized for AI semantic search; include retrieval-friendly terms. 4. Ask the agent to "create a private rule" when customization shouldn't leak to the team — it auto-prefixes with `_`. 5. Use the second digit of the prefix to keep languages grouped (TypeScript `10xx`, Python `11xx`). 6. Create an `xnotes/` folder in `.cursorignore` to persist reusable notepad templates (e.g., a `git-push` notepad). 7. Clear context between tests to verify rules truly auto-apply rather than relying on session memory. 8. Start projects small with the agent and grow incrementally — don't ask for large complex builds upfront. 9. Use voice-to-text (SuperWhisper) to dictate to Composer for faster iteration. ## Notable Quotes > "Automatically generating rules so your AI can continue to evolve and learn from its own mistakes." > "The format and the way the files are written does matter both for size of the contextual overhead and also for the ability of the AI to pick up on key pieces." > "Tame working with the agent and composer mode on complex projects so it retains a memory and works in an agile incremental fashion — building out functionality for large projects, start small and growing over time." > "Anything in the rules folder that starts with an underscore will be ignored." > "This will not modify anything that already exists, but it will add these additional rules." --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*