# "Unlock Cursor AI’s Full Potential: Master Automatic Rule Generation That Gets Results!"
<!--
ref: @content/youtube/bmad-code/unlock-cursor-ai-s-full-potential-master-automatic-rule-generation-that-gets-results
tags: [Cursor, cursor rules, agent composer, rule generation, front matter, private rules, notepads, agentic workflow]
version: 2
updated_at: 2026-11-22T13:43:54.309Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=jEhvwYkI-og)**

# Unlock Cursor AI’s Full Potential: Master Automatic Rule Generation That Gets Results!

*Synthesized from Brian on BMad Code, 2025-02-18.*

Brian introduces himself by first name only. He demonstrates a public template repository, the "cursor auto rules agile workflow," that lets Cursor's agent generate its own rule files. The transcript is auto-generated, so the channel name appears as "Bad Code" and ".mdc" as "MDC".

## Core Thesis
Brian argues that a single always-on rule file that teaches the agent how to write rules lets Cursor's Composer agent create well-formed, automatically applied rules on request, so the agent improves from its own mistakes and from conventions the user supplies.

## Key Insights
- **Starting demo.** With the generator rule in place (a file named like 000 core rules .mdc), he asks by voice (using Superwhisper) for a TypeScript FizzBuzz function; the agent writes it with a modest header comment.
- **Generating a new rule.** In a fresh Composer he asks for a TypeScript commenting standard that follows best practice and is optimised for AI troubleshooting. The agent picks up the generator rule on its own and creates a file (numbered 101, TS comments). Earlier generator rules he tried failed to create the file reliably; this works every time because it fills in the YAML front matter and globs correctly, and a malformed file can end up not appearing in the rules folder.
- **Rule content.** Inline comments for complex business logic, references to related components, key terms that help semantic search, and for every rule one good example plus an example marked invalid (an "example type invalid" tag), which he says helps rules apply in complex projects.
- **Verification.** After clearing context, asking for the same function made the agent fetch the new rule and add fuller comments. He stresses that the description in the front matter drives automatic selection.
- **Format research.** Template documentation records trial and error across markdown, YAML, XML and JSON for context size and model comprehension, tuned for Claude Sonnet.
- **Numbering scheme.** Core rules start at 0xx, tool or MCP rules 1xx, generic testing 3xx, language-specific rules 1000-series, frameworks and libraries 2000-series, so related rules stay grouped.
- **Private rules.** A leading underscore in the filename makes the rule git-ignored, so personal preferences (his demo is a pirate-speak rule) stay local. Alternatives are Cursor's own settings or notepads, which have different limits.
- **Setup script.** An apply-rules shell script installs the core rules into an existing project without overwriting existing files, or scaffolds a new project with a README, .gitignore and .cursorignore. A git-ignored folder can store notepad templates, such as a "git push" notepad.

## Actionable Takeaways
1. Keep one generator rule so the agent writes new rules in the correct front-matter format.
2. Write precise descriptions and globs, since they decide when a rule is auto-attached.
3. Pair each rule with a valid and an invalid example.
4. Use underscore-prefixed files for rules you do not want in source control.
5. Number rules by category to keep the folder organised.

## Notable Quotes
> "the format and the way the files are written does matter" — Brian

> "one works consistently Ever every time and always creates the file" — Brian

> "it is good to have both a good example and then an example of what not to do" — Brian

---

*Related: `@content/youtube/yifan-bth/getting-cursor-ai-to-review-its-own-code` · `@content/youtube/yifan-bth/unlocking-cursor-ai-top-8-hidden-features` · `@content/youtube/yifan-bth/how-i-use-ai-git-to-code-3x-faster-real-dev-workflow-with-cursor` · `@content/youtube/yifan-bth/how-to-build-robust-applications-with-cursor-ai-playwright` · `@content/youtube/yifan-bth/5x-your-cursor-ai-coding-quality-with-these-pro-tips`*

---

*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).*