<?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: Facun</title>
    <description>The latest articles on DEV Community by Facun (@facundola).</description>
    <link>https://dev.to/facundola</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%2F4098669%2F96f2d4c7-74d2-49bf-94cd-c49eba8f368e.png</url>
      <title>DEV Community: Facun</title>
      <link>https://dev.to/facundola</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/facundola"/>
    <language>en</language>
    <item>
      <title>The agent rewrote my working page.tsx again</title>
      <dc:creator>Facun</dc:creator>
      <pubDate>Fri, 28 Aug 2026 09:31:39 +0000</pubDate>
      <link>https://dev.to/facundola/the-agent-rewrote-my-working-pagetsx-again-59a3</link>
      <guid>https://dev.to/facundola/the-agent-rewrote-my-working-pagetsx-again-59a3</guid>
      <description>&lt;p&gt;I timed it.&lt;/p&gt;

&lt;p&gt;Fourteen minutes. One prompt: disable the save button while the Server Action is pending.&lt;/p&gt;

&lt;p&gt;What I got back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;'use client'&lt;/code&gt; at the top of &lt;code&gt;app/(dashboard)/invoices/page.tsx&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;useEffect&lt;/code&gt; fetching &lt;code&gt;/api/invoices&lt;/code&gt; for data the server already had&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;as User&lt;/code&gt; on &lt;code&gt;res.json()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;a new &lt;code&gt;useInvoiceStore.ts&lt;/code&gt; nobody asked for&lt;/li&gt;
&lt;li&gt;the save button still not disabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original file was 78 lines, compiled, and rendered the list. The agent replaced it because a client event handler is illegal in a Server Component and the cheapest local move is "make the whole file a client." That move costs a waterfall, a cache miss, and an auth check that now lives wherever the fetch happens to run.&lt;/p&gt;

&lt;p&gt;I started counting the pattern in my own sessions over a week of after-hours work:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure&lt;/th&gt;
&lt;th&gt;Times I undid it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;use client lifted to the page&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;formData.get(id) as string / String(formData.get())&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edited components/ui/button.tsx to add a product variant&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Middleware redirect treated as authorization&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deleted a test because it failed after a rename&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;None of those are model-capability problems. They are missing constraints. Cursor will follow a 40-line &lt;code&gt;.mdc&lt;/code&gt; file with globs on &lt;code&gt;app/**/*.tsx&lt;/code&gt; more faithfully than it will follow a 2,000-word blog post you pasted into the prompt once.&lt;/p&gt;

&lt;p&gt;So I wrote the constraints down as files the agent actually loads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;architecture — RSC default, client at the leaf, no function props across the boundary, schema on searchParams / formData&lt;/li&gt;
&lt;li&gt;typescript — no any, parse unknown, branded ids, discriminated UI state&lt;/li&gt;
&lt;li&gt;ui — wrap shadcn, do not edit &lt;code&gt;components/ui&lt;/code&gt;, four states on every list&lt;/li&gt;
&lt;li&gt;testing — getByRole first, no page snapshots, Server Actions tested as functions&lt;/li&gt;
&lt;li&gt;git / PRs — no git add everything from root, conventional titles, &lt;code&gt;.env.example&lt;/code&gt; only&lt;/li&gt;
&lt;li&gt;security — secrets not in git, authz inside the action, no localStorage sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus six skills the agent can run on demand: plan before edit, do not rewrite working files, copy pass, a11y pass, PR description, launch checklist.&lt;/p&gt;

&lt;p&gt;Install is not a package. You copy the rules folder and AGENTS.md into the Next.js app. Sixty seconds. The point is not more prose — it is fewer sessions that end with &lt;code&gt;git checkout -- app&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you want the pack: &lt;a href="https://www.getly.store/product/cursor-agent-ship-kit-next-js-rules-that-actually-steer-the-agent" rel="noopener noreferrer"&gt;Cursor Agent Ship Kit&lt;/a&gt; (USD 19, personal license, refund via Getly).&lt;/p&gt;

&lt;p&gt;If you only want the habit: next time the agent wants to recreate a file that already works, the right patch is three lines on the existing Button, not a new folder.&lt;/p&gt;

</description>
      <category>cursor</category>
      <category>nextjs</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
