<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lian Zhaofu</title>
    <description>The latest articles on DEV Community by Lian Zhaofu (@lianzhaofu).</description>
    <link>https://dev.to/lianzhaofu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4210645%2F2efa4a49-fbaf-44dc-bec4-2df1410299a8.png</url>
      <title>DEV Community: Lian Zhaofu</title>
      <link>https://dev.to/lianzhaofu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lianzhaofu"/>
    <language>en</language>
    <item>
      <title>Turn Your Cursor Rules Into One Root AGENTS.md</title>
      <dc:creator>Lian Zhaofu</dc:creator>
      <pubDate>Tue, 10 Nov 2026 01:11:55 +0000</pubDate>
      <link>https://dev.to/lianzhaofu/turn-your-cursor-rules-into-one-root-agentsmd-10ni</link>
      <guid>https://dev.to/lianzhaofu/turn-your-cursor-rules-into-one-root-agentsmd-10ni</guid>
      <description>&lt;p&gt;Most of my repos still have Cursor rules in some form. Sometimes a dusty &lt;code&gt;.cursorrules&lt;/code&gt; at the root. Sometimes a pile of &lt;code&gt;.mdc&lt;/code&gt; files under &lt;code&gt;.cursor/rules/&lt;/code&gt;. Sometimes rules I typed in the UI and never exported.&lt;/p&gt;

&lt;p&gt;That is fine for Cursor. It is annoying when the same repo also needs a short brief at the root — &lt;code&gt;AGENTS.md&lt;/code&gt;, or &lt;code&gt;CLAUDE.md&lt;/code&gt; if that is what the team agreed on. Those files do not appear by magic from your Cursor rules. You either copy-paste by hand, or you end up with three slightly different versions that drift.&lt;/p&gt;

&lt;p&gt;I got tired of the drift. Here is the boring workflow I use now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually want in the root file
&lt;/h2&gt;

&lt;p&gt;Not an essay. Not a second README. Something an editor (or a teammate) can skim in under a minute:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the project is&lt;/li&gt;
&lt;li&gt;how we write code here&lt;/li&gt;
&lt;li&gt;what not to touch&lt;/li&gt;
&lt;li&gt;clear do / don’t lines&lt;/li&gt;
&lt;li&gt;which folders matter&lt;/li&gt;
&lt;li&gt;PR / commit habits&lt;/li&gt;
&lt;li&gt;how to run tests (real commands)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cursor rules often already say most of that. They just say it in long paragraphs, with “always” and “never” buried mid-sentence. Sorting beats rewriting.&lt;/p&gt;

&lt;h2&gt;
  
  
  A layout that does not fight Cursor
&lt;/h2&gt;

&lt;p&gt;What stuck for me:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short shared brief at the root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/.cursor/rules/*.mdc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cursor-only detail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Only if that is the team standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/docs/&lt;/code&gt; (optional)&lt;/td&gt;
&lt;td&gt;Longer notes; link from the short root file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep the root file short. Bullets and path globs over prose. If something needs two pages of architecture, put it in docs and link it. Do not dump a design doc into the one file everyone loads every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — gather what is already true
&lt;/h2&gt;

&lt;p&gt;Pull the text you trust today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.cursorrules&lt;/code&gt; if you still have the old single file&lt;/li&gt;
&lt;li&gt;the useful bits from &lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;the same build / test / “do not edit” notes you would tell a new hire&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Paste paths and commands exactly. &lt;code&gt;pnpm test&lt;/code&gt;, &lt;code&gt;cargo clippy&lt;/code&gt;, &lt;code&gt;app/api/**&lt;/code&gt; — those strings should survive under the matching heading. If a converter rewrites them into vaguer English, throw that output away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — sort into the same headings every time
&lt;/h2&gt;

&lt;p&gt;I use eight sections so I am not inventing a new outline per repo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project overview
&lt;/li&gt;
&lt;li&gt;Coding conventions
&lt;/li&gt;
&lt;li&gt;Architecture constraints
&lt;/li&gt;
&lt;li&gt;Do
&lt;/li&gt;
&lt;li&gt;Don’t
&lt;/li&gt;
&lt;li&gt;File and folder scope
&lt;/li&gt;
&lt;li&gt;PR and commit expectations
&lt;/li&gt;
&lt;li&gt;Testing
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you never wrote anything about PRs, leave that section as “Not specified.” Empty honesty is better than inventing a commit style you do not follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — one paste, pick the filename the tool expects
&lt;/h2&gt;

&lt;p&gt;Same content, different filename depending on who opens the repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt; — common shared root brief
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; — when that is the house standard
&lt;/li&gt;
&lt;li&gt;something shorter for a one-off local brief if you need it
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The point is one source of truth for &lt;em&gt;what&lt;/em&gt; you said. Flip the format when the runner changes. Do not maintain three hand-edited forks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — commit the root file; leave Cursor nuance local
&lt;/h2&gt;

&lt;p&gt;Check in &lt;code&gt;/AGENTS.md&lt;/code&gt; (or &lt;code&gt;/CLAUDE.md&lt;/code&gt;) so a fresh clone gets the same brief. Keep UI-only or Cursor-only tips under &lt;code&gt;.cursor/rules/&lt;/code&gt;. Other tools do not need your Cursor UI preferences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tiny example
&lt;/h2&gt;

&lt;p&gt;Raw paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This is a Next.js App Router app. Prefer server components.
Never edit /prisma/migrations by hand.
Run pnpm test and pnpm lint before PR.
Do not commit .env.
API routes live under app/api.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sorted root file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# AGENTS.md
&lt;/span&gt;
&lt;span class="gu"&gt;## Project overview
&lt;/span&gt;Next.js App Router application.

&lt;span class="gu"&gt;## Coding conventions
&lt;/span&gt;Prefer server components.

&lt;span class="gu"&gt;## Architecture constraints
&lt;/span&gt;API routes live under &lt;span class="sb"&gt;`app/api`&lt;/span&gt;.

&lt;span class="gu"&gt;## Do
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Run &lt;span class="sb"&gt;`pnpm test`&lt;/span&gt; and &lt;span class="sb"&gt;`pnpm lint`&lt;/span&gt; before opening a PR.

&lt;span class="gu"&gt;## Don't
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Do not edit &lt;span class="sb"&gt;`/prisma/migrations`&lt;/span&gt; by hand.
&lt;span class="k"&gt;- &lt;/span&gt;Do not commit &lt;span class="sb"&gt;`.env`&lt;/span&gt;.

&lt;span class="gu"&gt;## File and folder scope
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="sb"&gt;`app/api/**`&lt;/span&gt; — API routes

&lt;span class="gu"&gt;## PR and commit expectations
&lt;/span&gt;Not specified.

&lt;span class="gu"&gt;## Testing
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="sb"&gt;`pnpm test`&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;&lt;span class="sb"&gt;`pnpm lint`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing clever happened. The lines landed under headings. That alone stops a lot of guesswork.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy, briefly
&lt;/h2&gt;

&lt;p&gt;Rules often name internal paths, products, and “never touch” folders. Prefer a sort that runs in the browser, does not upload the paste, and does not call a model to “improve” your wording. Structure is the job. Paraphrase is optional and usually unhelpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  When I need the file tonight
&lt;/h2&gt;

&lt;p&gt;When I already have Cursor rules and I just need the root file tonight, I paste into &lt;a href="https://rules2md.com/" rel="noopener noreferrer"&gt;rules2md&lt;/a&gt;. It sorts into &lt;code&gt;AGENTS.md&lt;/code&gt; (or switch to &lt;code&gt;CLAUDE.md&lt;/code&gt;), keeps my wording, marks missing sections as not specified, and stays local in the browser — copy or download, no account. If you would rather hand-author from the section list above, that works too. The outline is the useful part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you merge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Root file short enough to skim
&lt;/li&gt;
&lt;li&gt;Do / don’t are bullets
&lt;/li&gt;
&lt;li&gt;Test and lint commands are copy-pasteable
&lt;/li&gt;
&lt;li&gt;Path globs match the real tree
&lt;/li&gt;
&lt;li&gt;Missing sections say “not specified”
&lt;/li&gt;
&lt;li&gt;Cursor-only detail stays under &lt;code&gt;.cursor/rules/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Teammates know which root file is canonical
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You do not need louder prompts. You need one honest root brief that matches the rules you already keep for Cursor. Sort first. Paraphrase only if you choose to. Treat &lt;code&gt;AGENTS.md&lt;/code&gt; / &lt;code&gt;CLAUDE.md&lt;/code&gt; like &lt;code&gt;README.md&lt;/code&gt;: checked in, short, and kept current.&lt;/p&gt;

&lt;p&gt;If your team splits Cursor rules and root briefs differently, leave a comment — I am still tweaking this on side projects and happy to compare notes.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>devtools</category>
      <category>markdown</category>
      <category>cursor</category>
    </item>
  </channel>
</rss>
