<?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: Theodore Creates Co.</title>
    <description>The latest articles on DEV Community by Theodore Creates Co. (@theodorecreatesco).</description>
    <link>https://dev.to/theodorecreatesco</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%2F4219535%2F9cc4c569-cbdc-42f0-8617-77fe3d61edfa.png</url>
      <title>DEV Community: Theodore Creates Co.</title>
      <link>https://dev.to/theodorecreatesco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theodorecreatesco"/>
    <language>en</language>
    <item>
      <title>How to stop Cursor and Claude Code breaking your project: a free AGENTS.md starter</title>
      <dc:creator>Theodore Creates Co.</dc:creator>
      <pubDate>Sat, 31 Oct 2026 18:49:50 +0000</pubDate>
      <link>https://dev.to/theodorecreatesco/how-to-stop-cursor-and-claude-code-breaking-your-project-a-free-agentsmd-starter-2273</link>
      <guid>https://dev.to/theodorecreatesco/how-to-stop-cursor-and-claude-code-breaking-your-project-a-free-agentsmd-starter-2273</guid>
      <description>&lt;p&gt;If you build with Cursor, Claude Code, Copilot or Windsurf, you've probably had at least one of these happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You asked for a small fix and the agent "tidied up" four other files.&lt;/li&gt;
&lt;li&gt;An API key ended up hard-coded in a component, or behind a &lt;code&gt;NEXT_PUBLIC_&lt;/code&gt; prefix where every visitor can read it.&lt;/li&gt;
&lt;li&gt;A new API route works perfectly, for every user, including the ones who shouldn't see that record.&lt;/li&gt;
&lt;li&gt;The agent tried the same broken fix five times, each one making things a bit worse.&lt;/li&gt;
&lt;li&gt;Tests were "fixed" by skipping them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is the model being stupid. It's the model doing exactly what it was asked, with no idea what &lt;em&gt;you&lt;/em&gt; consider off-limits. The fix is cheap: give it a short, clear set of house rules it reads at the start of every session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the rules go
&lt;/h2&gt;

&lt;p&gt;Most AI coding tools now read a plain Markdown instructions file from your project:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;File it reads&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cursor, Copilot, Windsurf, Codex, Zed, Amp and others&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor (project rules)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; is the closest thing to a shared standard, so it makes sense to put the real rules there and have the other files point at it. That's the setup I'll walk through below. All the files are in a free, MIT-licensed repo: &lt;strong&gt;&lt;a href="https://github.com/theodorecreatesco/vibe-coding-rules-starter" rel="noopener noreferrer"&gt;vibe-coding-rules-starter&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Give the agent a rule priority
&lt;/h2&gt;

&lt;p&gt;The most useful thing you can tell an agent is what to do when instructions clash. Without that, "just make it work" quietly beats "don't commit secrets". The starter opens with this:&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;## Rule priority&lt;/span&gt;

When rules clash, follow the higher one and say which you followed:
&lt;span class="p"&gt;
1.&lt;/span&gt; &lt;span class="gs"&gt;**Security guardrails**&lt;/span&gt; (next section): never broken, even if I ask.
   Explain the risk in one line and do the safe version.
&lt;span class="p"&gt;2.&lt;/span&gt; &lt;span class="gs"&gt;**The task I asked for**&lt;/span&gt;: it's my OK for the changes it clearly needs,
   within the guardrails. List them under "Needs your OK".
&lt;span class="p"&gt;3.&lt;/span&gt; &lt;span class="gs"&gt;**Stack conventions**&lt;/span&gt; (the conventions already used in this repo).
&lt;span class="p"&gt;4.&lt;/span&gt; &lt;span class="gs"&gt;**Working style.**&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Say which you followed" matters. It turns a silent decision into one you can see in the reply.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Make security rules specific
&lt;/h2&gt;

&lt;p&gt;"Write secure code" does nothing. Rules the agent can act on look like this:&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="p"&gt;-&lt;/span&gt; Public prefixes (&lt;span class="sb"&gt;`NEXT_PUBLIC_`&lt;/span&gt;, &lt;span class="sb"&gt;`VITE_`&lt;/span&gt;, &lt;span class="sb"&gt;`EXPO_PUBLIC_`&lt;/span&gt;, &lt;span class="sb"&gt;`PUBLIC_`&lt;/span&gt;) ship values
  to every user: never put a secret behind one. Work that needs a secret moves
  to a server or edge function.
&lt;span class="p"&gt;-&lt;/span&gt; Anything touching private data checks the caller (401 if unknown) and that they
  may touch this record (404 if missing or not theirs; 403 if they lack the role).
  Hiding a button isn't security.
&lt;span class="p"&gt;-&lt;/span&gt; Admin features need sign-in plus a role stored in the database and checked on
  the server, never a client flag or hard-coded emails or IDs.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second rule is the one that prevents the most common hole in AI-built apps: an endpoint that checks you're logged in but not that the record is &lt;em&gt;yours&lt;/em&gt;. Change the ID in the URL and you're reading someone else's data.&lt;/p&gt;

&lt;p&gt;It also helps to list the things the agent must never do on its own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Never, in any mode, unless I ask for that exact action
&lt;span class="p"&gt;-&lt;/span&gt; Destructive commands (&lt;span class="sb"&gt;`rm -rf`&lt;/span&gt;, &lt;span class="sb"&gt;`git reset --hard`&lt;/span&gt;, &lt;span class="sb"&gt;`git push --force`&lt;/span&gt;, dropping
  tables, database resets), changing a remote or production database, or disabling,
  skipping or loosening tests, lint rules or type checks to get a pass.
&lt;span class="p"&gt;-&lt;/span&gt; Installing new dependencies without my OK. Check a package's exact name before
  installing (typo-squats are common).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Keep it in scope and stop the spiral
&lt;/h2&gt;

&lt;p&gt;Most "the AI broke my project" stories are scope problems, not security ones. These lines do most of the work:&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="p"&gt;-&lt;/span&gt; Stay in scope: don't rename, reformat or tidy unrelated code.
&lt;span class="p"&gt;-&lt;/span&gt; Make the smallest change; never rewrite a working file wholesale.
&lt;span class="p"&gt;-&lt;/span&gt; Never invent APIs, packages or file paths. Check the installed version's docs.
&lt;span class="p"&gt;-&lt;/span&gt; Debugging: reproduce, read the full error, state the likely cause, make the
  smallest fix. After two failed attempts, stop and summarise the next two options.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two-attempt limit is what stops the debugging spiral. Instead of a sixth guess, you get a summary and a choice.&lt;/p&gt;

&lt;p&gt;For anything bigger than two files, the agent writes a short plan first and waits for your OK. If it's running as a background agent and can't ask, it puts the plan at the top of its summary instead of stalling.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Ask for a report you can check
&lt;/h2&gt;

&lt;p&gt;Finally, tell the agent what "done" looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Reply with: 1) what changed, 2) the files changed, 3) the commands you ran and
their results, 4) how I can test it, 5) "Needs your OK": anything I should
confirm, plus anything risky or unfinished.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point 3 is the important one. "I ran &lt;code&gt;npm test&lt;/code&gt;, 41 passed, lint couldn't run becauseâ€¦" is something you can trust. "Everything should work now" isn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Cursor and Claude Code load it every time
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cursor.&lt;/strong&gt; &lt;code&gt;AGENTS.md&lt;/code&gt; is picked up automatically, but a project rule with &lt;code&gt;alwaysApply: true&lt;/code&gt; makes sure the security section is in every chat, even if &lt;code&gt;AGENTS.md&lt;/code&gt; gets cut short:&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="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Rule priority and security guardrails that apply to every task&lt;/span&gt;
&lt;span class="na"&gt;alwaysApply&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude Code.&lt;/strong&gt; &lt;code&gt;CLAUDE.md&lt;/code&gt; can import another file with &lt;code&gt;@&lt;/code&gt;, so it stays short and repeats only the security essentials as a backup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;@AGENTS.md

AGENTS.md (imported above) holds the full project rules. This file repeats the
essentials so they still apply if AGENTS.md is missing or cut short; if they
ever differ, the security rules here win.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  30-second setup
&lt;/h2&gt;

&lt;p&gt;From the root of your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 1 https://github.com/theodorecreatesco/vibe-coding-rules-starter.git /tmp/vcrs
&lt;span class="nb"&gt;cp&lt;/span&gt; /tmp/vcrs/AGENTS.md /tmp/vcrs/CLAUDE.md &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; .cursor/rules &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cp&lt;/span&gt; /tmp/vcrs/.cursor/rules/security.mdc .cursor/rules/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Already have an &lt;code&gt;AGENTS.md&lt;/code&gt; or &lt;code&gt;CLAUDE.md&lt;/code&gt;? Don't overwrite it. Paste the block between the &lt;code&gt;BEGIN&lt;/code&gt; and &lt;code&gt;END&lt;/code&gt; markers at the top of yours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check it worked:&lt;/strong&gt; start a new chat and ask &lt;em&gt;"What are the top rules in this project?"&lt;/em&gt; It should mention the rule priority and the security guardrails. If it doesn't, the file isn't being loaded. Check it's in the project root, and for Cursor, that the &lt;code&gt;.cursor&lt;/code&gt; folder (hidden by default) was copied.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you share your app
&lt;/h2&gt;

&lt;p&gt;Rules reduce mistakes, they don't guarantee anything. The repo also includes a 10-point checklist to run before you share a link. A few of the checks:&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="p"&gt;-&lt;/span&gt; [ ] &lt;span class="sb"&gt;`.env`&lt;/span&gt; and &lt;span class="sb"&gt;`.env.*`&lt;/span&gt; are listed in &lt;span class="sb"&gt;`.gitignore`&lt;/span&gt; (and &lt;span class="sb"&gt;`.env.example`&lt;/span&gt; holds names only).
      Check: &lt;span class="sb"&gt;`git check-ignore -q .env.local`&lt;/span&gt; should exit with code 0.
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Every API route, server action and edge function checks the user is logged in
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Every one also checks the user owns (or may access) the record
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Spending limits or alerts are set on paid APIs (OpenAI, Anthropic, etc.) and hosting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's also a copy-paste "secret scan" prompt that gets your agent to check the repo (and git history, if it can) for keys, without printing the values.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;You don't need a huge rules file. A clear priority order, specific security rules, a scope limit and a "show me what you ran" report fix most of the damage AI coding tools do. Grab the files from &lt;strong&gt;&lt;a href="https://github.com/theodorecreatesco/vibe-coding-rules-starter" rel="noopener noreferrer"&gt;vibe-coding-rules-starter&lt;/a&gt;&lt;/strong&gt;, and if you improve on them, issues and PRs are welcome.&lt;/p&gt;

&lt;p&gt;If you want versions tuned for a specific stack (Next.js + Supabase, Lovable, Bolt, FastAPI, Expo and others) with a one-command installer, I also sell a &lt;a href="https://www.etsy.com/uk/listing/4601953941" rel="noopener noreferrer"&gt;full Vibe Coding Rules Kit&lt;/a&gt;. The free starter works fine on its own.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Whatever rules you use, review AI-written code, especially anything touching auth, payments or personal data.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cursor</category>
      <category>claude</category>
      <category>security</category>
    </item>
  </channel>
</rss>
