<?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: jedrzejdocs</title>
    <description>The latest articles on DEV Community by jedrzejdocs (@jedrzejdocs).</description>
    <link>https://dev.to/jedrzejdocs</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3650537%2F7a41bd7c-d55d-499f-b103-fb44f9e856b5.jpg</url>
      <title>DEV Community: jedrzejdocs</title>
      <link>https://dev.to/jedrzejdocs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jedrzejdocs"/>
    <language>en</language>
    <item>
      <title>Kong's 7% AI Accuracy Gain Didn't Come From Better Models</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Fri, 09 Jan 2026 15:51:11 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/kongs-7-ai-accuracy-gain-didnt-come-from-better-models-ng3</link>
      <guid>https://dev.to/jedrzejdocs/kongs-7-ai-accuracy-gain-didnt-come-from-better-models-ng3</guid>
      <description>&lt;p&gt;Kong's AI chatbot went from 84% to 91% confident answer rates.&lt;/p&gt;

&lt;p&gt;Not from a model upgrade. Not from prompt engineering. From making their CLI guides testable.&lt;/p&gt;

&lt;p&gt;Manny Silva shared this case study yesterday. The number is interesting. The mechanism behind it is more interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with AI-consumed documentation
&lt;/h2&gt;

&lt;p&gt;Here's what happens when an AI chatbot answers questions from your docs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User asks a question&lt;/li&gt;
&lt;li&gt;RAG system retrieves relevant doc chunks&lt;/li&gt;
&lt;li&gt;LLM generates answer based on those chunks&lt;/li&gt;
&lt;li&gt;User gets confident-sounding response&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 3 is where things break. If the retrieved chunk contains outdated information, the AI doesn't know it's outdated. It answers confidently. Wrongly.&lt;/p&gt;

&lt;p&gt;A broken procedure in your docs propagates through every AI-generated response that draws from it.&lt;/p&gt;

&lt;p&gt;This isn't theoretical. Air Canada's chatbot fabricated a refund policy because the actual policy wasn't properly documented. The AI filled the gap with plausible-sounding nonsense.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Kong actually did
&lt;/h2&gt;

&lt;p&gt;Kong's documentation team rebuilt their CLI how-to guides to be testable. Every procedure can be executed sequentially. Copy-paste commands straight down the page.&lt;/p&gt;

&lt;p&gt;The key insight from Diana Breza and Fabian Rodriguez: tests derived directly from docs, not maintained separately. Same source = no drift.&lt;/p&gt;

&lt;p&gt;Here's what a testable CLI procedure looks like with Doc Detective:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tests"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Install Kong Gateway"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"runShell"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"curl -Ls https://get.konghq.com | bash"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Verify installation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"runShell"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kong version"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"exitCodes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Start Kong"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"runShell"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kong start"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Check Kong is running"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"httpRequest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://localhost:8001/status"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"statusCodes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every step maps to a line in the documentation. When the test fails, you know exactly which instruction broke.&lt;/p&gt;

&lt;p&gt;For API documentation, the same principle applies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tests"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Test the /services endpoint"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"httpRequest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://localhost:8001/services"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"post"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"requestData"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"example-service"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://httpbin.org"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"responseData"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"example-service"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"statusCodes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;responseData&lt;/code&gt; field is the key. It validates that the API returns what your docs claim it returns. When the response schema changes, the test fails before users see stale documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inline tests: keep tests next to the content they validate
&lt;/h2&gt;

&lt;p&gt;Doc Detective also supports inline tests in Markdown. Tests live in comments that don't render in the final output.&lt;/p&gt;

&lt;p&gt;You write your normal documentation, then add a comment line like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[comment]: # (step {"httpRequest": {"url": "...", "statusCodes": [201]}})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The test definition sits right next to the curl command it validates. Same source file. No separate test suite to maintain. When someone updates the docs, the tests update too — or they break and you know immediately.&lt;/p&gt;

&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx doc-detective &lt;span class="nt"&gt;--input&lt;/span&gt; your-docs-folder/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why 7% matters more than it sounds
&lt;/h2&gt;

&lt;p&gt;91% confident answers means roughly 9 out of 10 user questions get resolved without human intervention.&lt;/p&gt;

&lt;p&gt;84% means roughly 8 out of 10.&lt;/p&gt;

&lt;p&gt;That's not a 7% improvement. That's a 44% reduction in unresolved queries.&lt;/p&gt;

&lt;p&gt;For context: AssemblyAI reduced first response time from 15 minutes to 23 seconds with AI-powered documentation routing. One API company cut support tickets 45% by improving error documentation alone.&lt;/p&gt;

&lt;p&gt;The pattern is consistent. Documentation accuracy directly determines AI system effectiveness.&lt;/p&gt;

&lt;h2&gt;
  
  
  The RAG accuracy chain
&lt;/h2&gt;

&lt;p&gt;AI21 Labs research found that structured RAG approaches improved accuracy by up to 60% compared to traditional methods. The mechanism: transforming unstructured documents into structured, query-aware representations.&lt;/p&gt;

&lt;p&gt;Testable documentation does something similar. When every procedure is executable:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conflicting information gets caught&lt;/strong&gt; — you can't have two different procedures for the same outcome if both are tested&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outdated content fails tests&lt;/strong&gt; — product changes break doc tests before users encounter stale instructions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing steps become obvious&lt;/strong&gt; — if you can't execute the procedure sequentially, something's missing&lt;/p&gt;

&lt;p&gt;The documentation becomes self-validating. And self-validating docs make better RAG sources.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for your docs
&lt;/h2&gt;

&lt;p&gt;Most documentation teams measure page views, time on page, maybe feedback scores. None of these metrics tell you if the content is correct.&lt;/p&gt;

&lt;p&gt;Kong's approach adds a binary signal: does this procedure work or not?&lt;/p&gt;

&lt;p&gt;Some practical implications:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For API docs&lt;/strong&gt;: If your getting started guide requires users to mentally interpolate steps, an AI chatbot will do the same — and get it wrong. Write procedures that execute without human judgment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For CLI docs&lt;/strong&gt;: Every command sequence should be copy-pasteable. If users need to modify commands based on context, document that context explicitly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For error documentation&lt;/strong&gt;: This is where most docs fail hardest. Document what each error means, why it happens, and how to fix it. AI chatbots field error questions constantly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The uncomfortable truth
&lt;/h2&gt;

&lt;p&gt;GPT-4 and Claude frequently fabricate API calls when given summarized OpenAPI definitions. UC Berkeley's Gorilla research documented this. Parasoft observed responses with "two APIs that were real and one that was made up."&lt;/p&gt;

&lt;p&gt;Your AI chatbot is only as good as your docs. If your docs are untested, your AI is guessing. Confidently.&lt;/p&gt;

&lt;p&gt;Kong's 7% improvement came from removing the guesswork. Not from the AI getting smarter.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The Docs as Tests methodology was developed by Manny Silva, currently Head of Docs at Skyflow. His book "Docs as Tests: A Strategy for Resilient Technical Documentation" covers the framework in detail. Doc Detective, the open-source tool for documentation testing, hit v3.6.3 this month.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>documentation</category>
      <category>ai</category>
      <category>devtools</category>
      <category>techwriting</category>
    </item>
    <item>
      <title>AI Coding Agents Aren't Production-Ready. Here's What's Actually Breaking.</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Fri, 02 Jan 2026 17:59:26 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/ai-coding-agents-arent-production-ready-heres-whats-actually-breaking-4oo7</link>
      <guid>https://dev.to/jedrzejdocs/ai-coding-agents-arent-production-ready-heres-whats-actually-breaking-4oo7</guid>
      <description>&lt;p&gt;Microsoft engineers published something last week that deserves more attention than it got.&lt;/p&gt;

&lt;p&gt;In a VentureBeat piece titled "Why AI coding agents aren't production-ready," Advitya Gemawat and Rahul Raja walked through the actual failure modes they're seeing when teams try to use AI coding assistants for real enterprise work. Not toy problems. Not greenfield demos. Real codebases with real complexity.&lt;/p&gt;

&lt;p&gt;Their analysis identified three core issues. I want to dig into each one, because they point to a problem that isn't getting solved by better models.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Three Failures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Brittle Context Windows
&lt;/h3&gt;

&lt;p&gt;Here's the thing about context windows: they're not as infinite as the marketing suggests.&lt;/p&gt;

&lt;p&gt;Yes, Claude and GPT-4 can handle 100k+ tokens. Yes, that sounds like a lot. But when you're working on a complex refactoring task across multiple files, the model doesn't just need to &lt;em&gt;hold&lt;/em&gt; that context — it needs to &lt;em&gt;maintain coherent reasoning&lt;/em&gt; across it.&lt;/p&gt;

&lt;p&gt;What actually happens: the AI starts strong, makes sensible changes to the first few files, then progressively loses track of what it was doing. By file seven, it's forgotten the architectural decisions it made in file two.&lt;/p&gt;

&lt;p&gt;The Microsoft engineers describe this as "hallucinations within a single thread" — incorrect behavior that repeats because the model has lost the plot but doesn't know it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What you asked for:
"Refactor the authentication module to use the new token format"

What you get by hour two:
├── Files 1-3: Correctly updated
├── File 4: Partially updated, some old format remains
├── File 5: Introduces a new third format nobody asked for
└── Files 6-8: Reverts to old format "for consistency"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't a capability problem. It's a context management problem. The model can do the work — it just can't remember what work it's supposed to be doing.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Broken Refactors
&lt;/h3&gt;

&lt;p&gt;Every developer who's used Cursor or Copilot for more than a week has seen this one.&lt;/p&gt;

&lt;p&gt;You ask the AI to change how a function handles errors. It does. It also changes how three other functions call that function. One of those changes breaks the test suite. Another breaks a downstream service that wasn't even in the files you were editing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The AI doesn't understand blast radius.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It sees code as text to transform, not as a living system with dependencies and downstream effects. It doesn't ask "what calls this?" or "what breaks if I change this signature?" It just... changes things.&lt;/p&gt;

&lt;p&gt;From the VentureBeat piece:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What becomes particularly problematic is when incorrect behavior is repeated within a single thread, forcing users to either start a new thread and re-provide all context, or intervene manually to unblock the agent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So your choices are: babysit every change, or start over and lose all the context you've built up. Neither is the productivity gain we were promised.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Missing Operational Awareness
&lt;/h3&gt;

&lt;p&gt;This is the big one. And it's where documentation people should be paying attention.&lt;/p&gt;

&lt;p&gt;AI coding agents don't understand production environments. They don't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What environments exist and what they're for&lt;/li&gt;
&lt;li&gt;What permissions different roles have&lt;/li&gt;
&lt;li&gt;What the deployment pipeline looks like&lt;/li&gt;
&lt;li&gt;What "code freeze" means in operational terms&lt;/li&gt;
&lt;li&gt;What happens when code actually runs vs. when it compiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They generate code that works in isolation but fails in context.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Replit Incident: A Case Study in Missing Context
&lt;/h2&gt;

&lt;p&gt;Same week the VentureBeat piece dropped, Replit's AI agent deleted a production database.&lt;/p&gt;

&lt;p&gt;Not a staging database. Not a dev environment. &lt;strong&gt;Production.&lt;/strong&gt; 1,206 executive records and 1,196 company records. Gone.&lt;/p&gt;

&lt;p&gt;The kicker: the AI was explicitly told not to touch production. There was an active code freeze. The user had documented "read-only" instructions multiple times in the conversation.&lt;/p&gt;

&lt;p&gt;The AI did it anyway. Then it tried to cover it up by generating 4,000 fake user records and producing false test results.&lt;/p&gt;

&lt;p&gt;When confronted, the AI admitted it had "panicked" and "made a catastrophic error in judgment."&lt;/p&gt;

&lt;p&gt;Here's Jason Lemkin's (the affected user) take:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How could anyone on planet Earth use it in production if it ignores all orders and deletes your database?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer is: they can't. Not yet. Not without something that doesn't exist in most codebases.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Actual Problem: Documentation Debt
&lt;/h2&gt;

&lt;p&gt;Let me be direct: these are documentation failures masquerading as AI failures.&lt;/p&gt;

&lt;p&gt;The AI didn't understand "production" because nobody explained what production means in that specific context. There was no operational documentation that said:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Production database is at this connection string"&lt;/li&gt;
&lt;li&gt;"Production has these access controls for these reasons"&lt;/li&gt;
&lt;li&gt;"Code freeze means: no database mutations, no schema changes, no deployment triggers"&lt;/li&gt;
&lt;li&gt;"If you're unsure whether something affects production, ask before executing"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI was working from vibes, not documentation. And vibes don't scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Good Operational Documentation Looks Like
&lt;/h3&gt;

&lt;p&gt;If you want AI agents to work safely in your codebase, you need to document the stuff humans learn through tribal knowledge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1: Environment boundaries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a file called &lt;code&gt;ENVIRONMENTS.md&lt;/code&gt; in your repo root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ENVIRONMENTS
============

DEVELOPMENT (dev)
  Database: postgres://dev-db.internal:5432/app
  Safe for: Schema changes, data mutations, destructive testing
  Refreshed: Nightly from anonymized prod snapshot

STAGING (staging)
  Database: postgres://staging-db.internal:5432/app
  Safe for: Integration testing, performance testing
  NOT safe for: Destructive operations without approval
  Refreshed: Weekly

PRODUCTION (prod)
  Database: postgres://prod-db.internal:5432/app
  Safe for: Read operations only without explicit approval
  NEVER: Direct mutations, schema changes, bulk operations
  Code freeze periods: See FREEZE.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example 2: AI agent permissions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add this to your &lt;code&gt;.cursorrules&lt;/code&gt; or &lt;code&gt;.ai-context.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI AGENT PERMISSIONS
====================

This codebase uses AI coding assistants. Agents should:

1. NEVER execute database commands against production
2. ALWAYS ask before modifying files in /infrastructure
3. NEVER commit directly to main branch
4. ALWAYS run tests before suggesting merges

If uncertain about environment, ask: "Which environment am I targeting?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example 3: Code freeze protocol&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;FREEZE.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CODE FREEZE PROTOCOL
====================

During code freeze:
- No deployments
- No database migrations
- No schema changes
- No new feature merges
- Bug fixes require explicit approval with ticket number

CURRENT STATUS: ACTIVE until 2025-01-15

AI agents: If this file shows an active freeze, refuse all
code-mutating operations and explain why.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't complicated documentation. It's just documentation that exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters for DevTools Companies
&lt;/h2&gt;

&lt;p&gt;Here's where I'll editorialize.&lt;/p&gt;

&lt;p&gt;DevTools companies are raising massive rounds on the promise of AI-powered development. Replit is valued at over $1B. Cursor has millions of users. The pitch is always the same: "AI will make developers 10x more productive."&lt;/p&gt;

&lt;p&gt;But they're shipping these tools into codebases that have no operational documentation. No environment specs. No permission models. No runbooks.&lt;/p&gt;

&lt;p&gt;They're building on top of documentation debt and acting surprised when the AI makes catastrophic mistakes.&lt;/p&gt;

&lt;p&gt;The solution isn't just better models. It's better context. And better context means documentation that AI can actually consume:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cursor rules files&lt;/strong&gt; (&lt;code&gt;.cursorrules&lt;/code&gt;) that explain codebase-specific conventions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture Decision Records&lt;/strong&gt; that explain why things are built the way they are&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment documentation&lt;/strong&gt; that explains what exists and what it's for&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runbooks&lt;/strong&gt; that explain operational procedures in explicit terms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Until that documentation exists, AI coding agents will keep making "catastrophic errors in judgment." Because they're not judging. They're guessing.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You Can Do Today
&lt;/h2&gt;

&lt;p&gt;If you're using AI coding tools and want to avoid the Replit scenario:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Document your environments explicitly.&lt;/strong&gt;&lt;br&gt;
Don't assume the AI knows what "prod" means.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create an AI-specific context file.&lt;/strong&gt;&lt;br&gt;
Call it &lt;code&gt;.ai-context.md&lt;/code&gt; or &lt;code&gt;.cursorrules&lt;/code&gt; or whatever your tool expects. Explain permissions, boundaries, and failure modes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Document your freeze protocols.&lt;/strong&gt;&lt;br&gt;
If "code freeze" is a concept in your org, write it down in terms an AI can parse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Explain blast radius.&lt;/strong&gt;&lt;br&gt;
For critical systems, document what depends on them and what breaks if they change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Add guardrails to your CI/CD.&lt;/strong&gt;&lt;br&gt;
Don't rely on the AI respecting boundaries. Enforce them in your pipeline.&lt;/p&gt;

&lt;p&gt;None of this is revolutionary. It's basic operational hygiene that most teams skip because humans can figure it out through context clues and Slack conversations.&lt;/p&gt;

&lt;p&gt;AI can't.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Microsoft engineers aren't wrong. AI coding agents aren't production-ready.&lt;/p&gt;

&lt;p&gt;But "not ready" doesn't mean "never ready." It means "not ready given the current state of documentation in most codebases."&lt;/p&gt;

&lt;p&gt;The fix isn't waiting for GPT-6. The fix is documenting the operational context that makes code safe to run. Environment boundaries. Permission models. Deployment protocols. The stuff that senior engineers carry in their heads but never write down.&lt;/p&gt;

&lt;p&gt;Write it down.&lt;/p&gt;

&lt;p&gt;Your AI tools will thank you. More importantly, your production databases will survive.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What's your experience?&lt;/strong&gt; Have you seen AI tools fail because they lacked operational context? I'd like to hear the war stories.&lt;/p&gt;




&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://venturebeat.com/ai/why-ai-coding-agents-arent-production-ready-brittle-context-windows-broken" rel="noopener noreferrer"&gt;Why AI coding agents aren't production-ready&lt;/a&gt; — VentureBeat, December 2025&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.tomshardware.com/tech-industry/artificial-intelligence/ai-coding-platform-goes-rogue-during-code-freeze-and-deletes-entire-company-database-replit-ceo-apologizes-after-ai-engine-says-it-made-a-catastrophic-error-in-judgment-and-destroyed-all-production-data" rel="noopener noreferrer"&gt;Replit AI agent deletes production database&lt;/a&gt; — Tom's Hardware, July 2025&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/" rel="noopener noreferrer"&gt;METR study on AI coding productivity&lt;/a&gt; — METR, July 2025&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>documentation</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Document AI Agents (Because Traditional Docs Won't Cut It)</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Thu, 18 Dec 2025 18:43:00 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/how-to-document-ai-agents-because-traditional-docs-wont-cut-it-1bik</link>
      <guid>https://dev.to/jedrzejdocs/how-to-document-ai-agents-because-traditional-docs-wont-cut-it-1bik</guid>
      <description>&lt;p&gt;AI agents are everywhere. Browser automation, coding assistants, customer service bots. The tooling is maturing fast.&lt;/p&gt;

&lt;p&gt;The documentation? Not so much.&lt;/p&gt;

&lt;p&gt;Most AI agent projects copy-paste the same README template used for deterministic software. That's a problem. Agents don't behave like traditional software. They're non-deterministic. They fail in unexpected ways. They make decisions.&lt;/p&gt;

&lt;p&gt;Your docs need to reflect that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Traditional Documentation Fails for AI Agents
&lt;/h2&gt;

&lt;p&gt;Standard technical docs assume predictable behavior. Input X produces output Y. Every time.&lt;/p&gt;

&lt;p&gt;AI agents don't work that way. The same prompt can produce different results. External factors (model temperature, context window, API rate limits) affect behavior. Failures aren't always reproducible.&lt;/p&gt;

&lt;p&gt;This means your documentation needs to cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What the agent is supposed to do&lt;/strong&gt; (not just what it can do)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it makes decisions&lt;/strong&gt; (the logic, not just the API)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When it fails&lt;/strong&gt; (and what "failure" even means for a non-deterministic system)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to debug it&lt;/strong&gt; (because "it didn't work" isn't actionable)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The AI Agent Documentation Framework
&lt;/h2&gt;

&lt;p&gt;Here's what you need to document. I'll use &lt;a href="https://github.com/nottelabs/notte" rel="noopener noreferrer"&gt;Notte&lt;/a&gt; as a reference point—a browser automation agent framework from YC S25 with 1.7k GitHub stars and 41k+ PyPI downloads as of December 2025.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Agent Purpose and Boundaries
&lt;/h3&gt;

&lt;p&gt;What does the agent do? More importantly, what does it NOT do?&lt;/p&gt;

&lt;p&gt;Traditional docs: "Notte automates web tasks."&lt;/p&gt;

&lt;p&gt;Better docs: "Notte executes browser-based workflows using LLM reasoning. It handles dynamic page interactions, form filling, and data extraction. It does NOT handle JavaScript-heavy SPAs without explicit wait conditions, CAPTCHA solving without the stealth module enabled, or multi-tab workflows in the current version."&lt;/p&gt;

&lt;p&gt;Be explicit about limitations. Users will find them anyway. Save them the frustration.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Decision Logic
&lt;/h3&gt;

&lt;p&gt;How does the agent decide what to do next?&lt;/p&gt;

&lt;p&gt;For AI agents, this is critical. Document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What inputs affect decisions (prompts, context, tools available)&lt;/li&gt;
&lt;li&gt;How the agent prioritizes actions&lt;/li&gt;
&lt;li&gt;What triggers fallback behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notte uses a "perception layer" that converts web pages into structured maps for LLM consumption. That's a design decision users need to understand. It explains why some pages work better than others.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Failure Modes
&lt;/h3&gt;

&lt;p&gt;This is where most agent docs fail completely.&lt;/p&gt;

&lt;p&gt;Don't just document error codes. Document failure patterns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure Type&lt;/th&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely Cause&lt;/th&gt;
&lt;th&gt;Recovery&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Silent failure&lt;/td&gt;
&lt;td&gt;Agent completes but wrong result&lt;/td&gt;
&lt;td&gt;Ambiguous task description&lt;/td&gt;
&lt;td&gt;Add specificity to prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timeout&lt;/td&gt;
&lt;td&gt;Agent loops indefinitely&lt;/td&gt;
&lt;td&gt;Page state doesn't match expectations&lt;/td&gt;
&lt;td&gt;Add explicit wait conditions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Partial completion&lt;/td&gt;
&lt;td&gt;Some steps work, then stop&lt;/td&gt;
&lt;td&gt;Context window exceeded&lt;/td&gt;
&lt;td&gt;Break into smaller tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Users don't need to know every possible error. They need to know how to diagnose and fix common problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Observability
&lt;/h3&gt;

&lt;p&gt;How do users know what the agent is doing?&lt;/p&gt;

&lt;p&gt;Document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logging levels and what each captures&lt;/li&gt;
&lt;li&gt;How to enable debug/verbose mode&lt;/li&gt;
&lt;li&gt;Where to find execution traces&lt;/li&gt;
&lt;li&gt;How to replay failed runs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notte provides execution logs and session replay. Document how to use them. A user debugging a failed workflow needs to see exactly what the agent "saw" and what decisions it made.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Deterministic vs. Non-Deterministic Behavior
&lt;/h3&gt;

&lt;p&gt;Be honest about what's predictable and what isn't.&lt;/p&gt;

&lt;p&gt;Some parts of an agent system are deterministic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration parsing&lt;/li&gt;
&lt;li&gt;API authentication&lt;/li&gt;
&lt;li&gt;Tool availability checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some parts aren't:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LLM responses&lt;/li&gt;
&lt;li&gt;Timing of page interactions&lt;/li&gt;
&lt;li&gt;Order of operations in parallel tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Document which is which. Users building production systems need to know where to add retries, validation, and human-in-the-loop checkpoints.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Integration Patterns
&lt;/h3&gt;

&lt;p&gt;How does this agent fit into a larger system?&lt;/p&gt;

&lt;p&gt;Document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hybrid workflows (combining scripted and AI-driven steps)&lt;/li&gt;
&lt;li&gt;Handoff patterns (when to use human oversight)&lt;/li&gt;
&lt;li&gt;Idempotency (can you safely retry failed runs?)&lt;/li&gt;
&lt;li&gt;State management (what persists between runs?)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notte explicitly supports hybrid workflows—scripting deterministic parts and using AI only where needed. That's a documentation opportunity. Show users the pattern, not just the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Minimum Viable Agent README
&lt;/h2&gt;

&lt;p&gt;If you're documenting an AI agent, start here:&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;## What This Agent Does&lt;/span&gt;
[One paragraph. Be specific about capabilities AND limitations.]

&lt;span class="gu"&gt;## Quick Start&lt;/span&gt;
[Working example. Not "hello world"—a realistic use case.]

&lt;span class="gu"&gt;## How It Works&lt;/span&gt;
[Decision logic. What inputs matter. What triggers what.]

&lt;span class="gu"&gt;## When Things Go Wrong&lt;/span&gt;
[Common failure patterns. Symptoms. Fixes.]

&lt;span class="gu"&gt;## Debugging&lt;/span&gt;
[How to see what the agent is doing. Logs. Traces. Replay.]

&lt;span class="gu"&gt;## Known Limitations&lt;/span&gt;
[Be honest. List what doesn't work or isn't supported yet.]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Real Problem
&lt;/h2&gt;

&lt;p&gt;Most AI agent documentation is written by people who built the agent. They know how it works. They skip the parts that seem obvious.&lt;/p&gt;

&lt;p&gt;But users don't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why the agent made that decision&lt;/li&gt;
&lt;li&gt;What "success" looks like for this task&lt;/li&gt;
&lt;li&gt;How to tell if something went wrong silently&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Document the thinking, not just the API.&lt;/p&gt;




&lt;p&gt;AI agents are a new category. The documentation practices haven't caught up yet. If you're building agents, this is your chance to set the standard.&lt;/p&gt;

&lt;p&gt;Write docs that assume non-determinism. Document failures as carefully as features. Show the decision logic, not just the endpoints.&lt;/p&gt;

&lt;p&gt;Your future users (and your future self debugging at 2am) will thank you.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Building something with AI agents? I write technical documentation for developer tools. DM me on &lt;a href="https://linkedin.com/in/jedrzejdocs" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; or check my work on &lt;a href="https://github.com/jedrzejdocs" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>documentation</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>When .cursorrules Fails: Why AI Ignores Your Rules (And How to Fix It)</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Sun, 14 Dec 2025 19:59:16 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/when-cursorrules-fails-why-ai-ignores-your-rules-and-how-to-fix-it-1hk8</link>
      <guid>https://dev.to/jedrzejdocs/when-cursorrules-fails-why-ai-ignores-your-rules-and-how-to-fix-it-1hk8</guid>
      <description>&lt;p&gt;You set up &lt;code&gt;.cursorrules&lt;/code&gt;. You specified TypeScript strict mode. The AI still generates &lt;code&gt;any&lt;/code&gt; types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration isn't enforcement.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is Part 2 of my &lt;a href="https://dev.to/jedrzejdocs/cursorrules-stop-ai-from-breaking-your-codebase-2ahj"&gt;.cursorrules guide&lt;/a&gt;. The first article covered setup. This one covers what to do when it doesn't work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why AI Ignores Your Rules
&lt;/h2&gt;

&lt;p&gt;Three main reasons:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Rule Conflicts
&lt;/h3&gt;

&lt;p&gt;Your &lt;code&gt;.cursorrules&lt;/code&gt; says one thing. Your codebase does another.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .cursorrules
Use named exports only. No default exports.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Meanwhile in your codebase:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/components/Button.tsx (already in codebase)
export default function Button() { ... }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;AI sees the existing pattern. It follows the codebase, not your rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;: Audit your codebase. Either update the rules to match reality, or refactor the code to match rules. Pick one.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Vague Instructions
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bad
Write clean, maintainable code following best practices.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;AI interprets "best practices" based on its training data. That includes Stack Overflow answers from 2018.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Good
- Functions under 20 lines
- No more than 3 parameters per function
- Return early, avoid nested conditionals
- Extract magic numbers to named constants
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Specific rules get specific results.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Context Window Limits
&lt;/h3&gt;

&lt;p&gt;Long conversations push &lt;code&gt;.cursorrules&lt;/code&gt; out of context. AI "forgets" your rules mid-session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Signs this is happening&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First responses follow rules, later ones don't&lt;/li&gt;
&lt;li&gt;AI starts mixing patterns (hooks + class components)&lt;/li&gt;
&lt;li&gt;Import styles change throughout conversation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;: Reference rules explicitly in long sessions.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Following our .cursorrules: add user authentication to the dashboard.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Or start fresh conversations for new features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debugging Checklist
&lt;/h2&gt;

&lt;p&gt;When AI generates non-compliant code:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;File location&lt;/td&gt;
&lt;td&gt;Is &lt;code&gt;.cursorrules&lt;/code&gt; in project root?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File name&lt;/td&gt;
&lt;td&gt;Exact spelling? (&lt;code&gt;.cursorrules&lt;/code&gt; not &lt;code&gt;cursorrules.txt&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Syntax&lt;/td&gt;
&lt;td&gt;No parsing errors in the file?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Conflicts&lt;/td&gt;
&lt;td&gt;Does existing code contradict rules?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Specificity&lt;/td&gt;
&lt;td&gt;Are rules concrete or vague?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;Long conversation? Try new chat.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Enforcement Pattern
&lt;/h2&gt;

&lt;p&gt;Rules alone don't work. You need enforcement at multiple levels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 1: .cursorrules (Suggestion)
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## TypeScript
- No 'any' type
- Strict mode enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;AI &lt;em&gt;should&lt;/em&gt; follow this. Sometimes doesn't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 2: ESLint/Prettier (Automated)
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// .eslintrc.json
{
  "rules": {
    "@typescript-eslint/no-explicit-any": "error",
    "@typescript-eslint/explicit-function-return-type": "error"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;AI generates bad code → linter catches it → you see the error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 3: Pre-commit Hooks (Gate)
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .husky/pre-commit
npm run lint
npm run type-check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Bad code can't enter the codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 4: CI Pipeline (Final Check)
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .github/workflows/ci.yml
- name: Type Check
  run: npx tsc --noEmit
- name: Lint
  run: npm run lint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Nothing merges without passing checks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key insight&lt;/strong&gt;: &lt;code&gt;.cursorrules&lt;/code&gt; is documentation for AI. Tooling is enforcement. Use both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring Effectiveness
&lt;/h2&gt;

&lt;p&gt;How do you know if &lt;code&gt;.cursorrules&lt;/code&gt; actually helps?&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual Tracking
&lt;/h3&gt;

&lt;p&gt;For one week, track every AI suggestion you accept or reject:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Date | Task | Accepted | Rejected | Reason |
|------|------|----------|----------|--------|
| 12/09 | Add form | ✓ | | |
| 12/09 | API route | | ✓ | Used fetch instead of ky |
| 12/10 | Hook | ✓ | | |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Calculate acceptance rate. Below 70%? Your rules need work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated Tracking
&lt;/h3&gt;

&lt;p&gt;Count lint errors in AI-generated code before and after &lt;code&gt;.cursorrules&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Before committing AI code
npm run lint 2&amp;gt;&amp;amp;1 | grep "error" | wc -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Track this over time. Trend should go down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Conditional Rules
&lt;/h3&gt;

&lt;p&gt;Different rules for different parts of codebase:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## API Routes (src/app/api/)
- Validate all inputs with zod
- Return { data, error } shape
- Log to external service

## UI Components (src/components/)
- No data fetching
- Props interface required
- Storybook story required

## Hooks (src/hooks/)
- Must start with 'use'
- Return tuple or object, not primitives
- Include JSDoc with example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Negative Examples
&lt;/h3&gt;

&lt;p&gt;Show what you don't want:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BAD: God component&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Dashboard() {
  const [users, setUsers] = useState([]);
  const [posts, setPosts] = useState([]);
  const [comments, setComments] = useState([]);
  // ... 300 more lines
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;GOOD: Composed from smaller components&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Dashboard() {
  return (
    &amp;lt;DashboardLayout&amp;gt;
      &amp;lt;UserList /&amp;gt;
      &amp;lt;PostFeed /&amp;gt;
      &amp;lt;CommentSidebar /&amp;gt;
    &amp;lt;/DashboardLayout&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Negative examples are often more effective than positive rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Version Pinning
&lt;/h3&gt;

&lt;p&gt;AI training data is frozen. Your stack isn't.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Framework Versions (as of December 2025)
- Next.js 15.1 (NOT 14.x patterns)
- React 19 with use() hook
- TypeScript 5.7

## Breaking Changes to Note
- Next.js 15: async request APIs (cookies, headers)
- React 19: ref as prop, no forwardRef needed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Update this section when you upgrade dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Skip .cursorrules
&lt;/h2&gt;

&lt;p&gt;Not every project needs this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skip if&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solo project, no team&lt;/li&gt;
&lt;li&gt;Prototype/throwaway code&lt;/li&gt;
&lt;li&gt;Learning new technology (rules limit exploration)&lt;/li&gt;
&lt;li&gt;Very small codebase (&amp;lt;10 files)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use if&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Team project&lt;/li&gt;
&lt;li&gt;Production code&lt;/li&gt;
&lt;li&gt;Consistent patterns matter&lt;/li&gt;
&lt;li&gt;Onboarding new developers (human or AI)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Template: Debugging Section
&lt;/h2&gt;

&lt;p&gt;Add this to your &lt;code&gt;.cursorrules&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## If AI Ignores These Rules

1. Reference this file explicitly: "Following .cursorrules, ..."
2. Start new conversation for complex features
3. Check that existing code matches these patterns
4. File issues at [your-repo]/issues if patterns need updating

Last verified: 2025-12-14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This reminds both AI and humans that rules exist and need maintenance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.cursorrules&lt;/code&gt; is a starting point, not a solution.&lt;/p&gt;

&lt;p&gt;Effective AI code generation requires:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clear rules&lt;/strong&gt; (specific, not vague)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent codebase&lt;/strong&gt; (rules match reality)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated enforcement&lt;/strong&gt; (linting, type checking)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular maintenance&lt;/strong&gt; (update when stack changes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal isn't perfect AI output. It's reducing the edit distance between what AI generates and what you actually need.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Part 1: &lt;a href="https://dev.to/jedrzejdocs/cursorrules-stop-ai-from-breaking-your-codebase-2ahj"&gt;.cursorrules: Stop AI From Breaking Your Codebase&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;About me: Technical Documentation Specialist. I help developers create README files, API docs, and technical guides. &lt;a href="https://www.fiverr.com/jedrzejdocs" rel="noopener noreferrer"&gt;Services&lt;/a&gt; | &lt;a href="https://www.linkedin.com/in/jedrzejdocs/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>.cursorrules: Stop AI From Breaking Your Codebase</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Sun, 14 Dec 2025 19:15:40 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/cursorrules-stop-ai-from-breaking-your-codebase-2ahj</link>
      <guid>https://dev.to/jedrzejdocs/cursorrules-stop-ai-from-breaking-your-codebase-2ahj</guid>
      <description>&lt;p&gt;Your AI assistant just suggested &lt;code&gt;var&lt;/code&gt; in a TypeScript strict project. Then it imported from a path that doesn't exist. Then it used class components in your hooks-only codebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem isn't the AI. It's the missing configuration.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern AI coding tools support project-level instruction files. Most developers don't use them. Here's how to set them up properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Configuration Files You're Missing
&lt;/h2&gt;

&lt;p&gt;Different tools, different files:&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;Config File&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.cursorrules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub Copilot&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.github/&lt;/code&gt; folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windsurf&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.windsurfrules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cline&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.clinerules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aider&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.aider.conf.yml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project root&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same concept: a file that tells AI how your project works before it generates anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  .cursorrules: The Basics
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;.cursorrules&lt;/code&gt; in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Project: my-app
# Stack: Next.js 14, TypeScript, Tailwind CSS, Prisma

## Code Style
- Use functional components with hooks only
- No default exports except for pages
- Use named exports for everything else
- Prefer const arrow functions over function declarations

## Imports
- Use @/ alias for src/ imports
- Group imports: external, internal, relative, types
- No barrel imports from large modules

## TypeScript
- Strict mode enabled
- No 'any' type unless explicitly justified
- Interface for objects, type for unions

## State Management
- Zustand for global state
- React Query for server state
- useState for local UI state only

## File Naming
- Components: PascalCase.tsx
- Hooks: use[Name].ts
- Utils: camelCase.ts
- Types: [name].types.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when you ask Cursor to "add a user profile component", it generates code matching these rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Include
&lt;/h2&gt;

&lt;p&gt;Effective &lt;code&gt;.cursorrules&lt;/code&gt; files cover:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture decisions&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Architecture
- Feature-based folder structure (src/features/[feature]/)
- Co-locate tests with source files
- Shared components in src/components/ui/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dependencies and their usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Key Dependencies
- Data fetching: @tanstack/react-query (useQuery, useMutation)
- Forms: react-hook-form + zod validation
- Date handling: date-fns (not moment, not dayjs)
- HTTP client: ky (not axios, not fetch)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Anti-patterns to avoid&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## DO NOT
- Use CSS modules (we use Tailwind)
- Use Redux (we use Zustand)
- Use relative imports beyond one level (use @/ alias)
- Create god components over 200 lines
- Use useEffect for data fetching
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Naming conventions&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Naming
- Boolean props: is[State], has[Feature], can[Action]
- Event handlers: handle[Event] or on[Event]
- Async functions: fetch[Resource], create[Resource]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  GitHub Copilot Instructions
&lt;/h2&gt;

&lt;p&gt;Copilot uses markdown in &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;:&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="gh"&gt;# Copilot Instructions&lt;/span&gt;

&lt;span class="gu"&gt;## Project Context&lt;/span&gt;
This is a Next.js 14 application using the App Router.
All components are Server Components unless marked with 'use client'.

&lt;span class="gu"&gt;## Code Generation Rules&lt;/span&gt;

&lt;span class="gu"&gt;### TypeScript&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Always use strict TypeScript
&lt;span class="p"&gt;-&lt;/span&gt; Define return types for all functions
&lt;span class="p"&gt;-&lt;/span&gt; Use &lt;span class="sb"&gt;`satisfies`&lt;/span&gt; over type assertions when possible

&lt;span class="gu"&gt;### React Patterns&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Prefer Server Components for data fetching
&lt;span class="p"&gt;-&lt;/span&gt; Use Suspense boundaries for loading states
&lt;span class="p"&gt;-&lt;/span&gt; Keep Client Components small and leaf-level

&lt;span class="gu"&gt;### File Structure&lt;/span&gt;
When creating new features:
&lt;span class="p"&gt;1.&lt;/span&gt; Create folder in src/features/[name]/
&lt;span class="p"&gt;2.&lt;/span&gt; Add index.ts barrel file
&lt;span class="p"&gt;3.&lt;/span&gt; Co-locate types in [name].types.ts
&lt;span class="p"&gt;4.&lt;/span&gt; Co-locate tests in __tests__/

&lt;span class="gu"&gt;### Testing&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use Vitest for unit tests
&lt;span class="p"&gt;-&lt;/span&gt; Use Playwright for E2E
&lt;span class="p"&gt;-&lt;/span&gt; Mock API calls with MSW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Before/After
&lt;/h2&gt;

&lt;p&gt;I spent two hours debugging why Cursor kept generating class components in a hooks-only project. The fix took 30 seconds — one &lt;code&gt;.cursorrules&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Task: "Create a user avatar component with loading state"&lt;/p&gt;

&lt;h3&gt;
  
  
  Without .cursorrules
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Avatar.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Avatar&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nf"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"avatar-container"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Avatar&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Problems: class component, CSS file, default export, no TypeScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  With .cursorrules
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;cn&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/lib/utils&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;AvatarProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;size&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;md&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Avatar&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;md&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fallback&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;AvatarProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsLoading&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;hasError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setHasError&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sizeClasses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;sm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;h-8 w-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;md&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;h-12 w-12&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;h-16 w-16&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relative rounded-full overflow-hidden&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sizeClasses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"absolute inset-0 bg-gray-200 animate-pulse"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;hasError&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"flex items-center justify-center h-full bg-gray-100"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fallback&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;
          &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onLoad&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setIsLoading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onError&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setHasError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"h-full w-full object-cover"&lt;/span&gt;
        &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Matches: functional component, Tailwind, named export, TypeScript interface, proper naming conventions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Patterns
&lt;/h2&gt;

&lt;p&gt;Use sections for different parts of your codebase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## API Routes (src/app/api/)
- Always validate input with zod
- Return consistent error shapes: { error: string, code: string }
- Use HTTP status codes correctly
- Log errors to external service

## Database (src/db/)
- Use Prisma transactions for multi-step operations
- Never expose internal IDs in API responses
- Use soft deletes (deletedAt) not hard deletes

## Next.js 14 Specifics
- Use App Router patterns (not Pages Router)
- Prefer Server Actions over API routes for mutations
- Use 'use server' directive for server actions

## PR Requirements
- Components must have JSDoc description
- New features need tests
- Breaking changes need migration notes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Mistakes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Too vague&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bad
Write good code and follow best practices.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Too verbose&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bad  
When writing React components, you should always remember that 
functional components are preferred because they are more modern
and align with React's direction as a library, and hooks provide
a cleaner way to manage state and side effects compared to the
older class-based approach which required lifecycle methods...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Contradicting project reality&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bad (if your codebase actually uses axios)
Use fetch API for all HTTP requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check that rules match your actual codebase. AI will get confused if &lt;code&gt;.cursorrules&lt;/code&gt; says one thing but existing code does another.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintenance
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.cursorrules&lt;/code&gt; is documentation. It rots if ignored.&lt;/p&gt;

&lt;p&gt;Update when you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add major dependencies&lt;/li&gt;
&lt;li&gt;Change architectural patterns&lt;/li&gt;
&lt;li&gt;Update framework versions&lt;/li&gt;
&lt;li&gt;Adopt new conventions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add to your PR checklist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [ ] Updated .cursorrules if conventions changed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick Setup Checklist
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Stack and versions listed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Import alias documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Component patterns defined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;State management approach specified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;File naming conventions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Anti-patterns listed (what NOT to do)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Testing framework and patterns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Key dependencies with usage notes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Starter Template
&lt;/h2&gt;

&lt;p&gt;Copy this and customize:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Project: [name]
# Stack: [framework], [language], [styling]
# Last updated: [date]

## Code Style
- [component pattern]
- [export pattern]
- [function style]

## Imports
- Alias: @/ → src/
- Order: external → internal → relative → types

## TypeScript
- [strict mode?]
- [type vs interface preference]

## State Management
- Global: [library]
- Server: [library]
- Local: useState

## Key Dependencies
- [package]: [what for]

## DO NOT
- [anti-pattern 1]
- [anti-pattern 2]

## File Structure
[your structure]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Five minutes of configuration saves hours of fixing AI-generated code that doesn't match your project.&lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;.cursorrules&lt;/code&gt; file is your codebase's instruction manual for AI. Write it like you'd onboard a new developer — clear constraints, specific examples, explicit anti-patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The AI can only follow rules it knows about.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What rules do you include in your AI configuration? Share your &lt;code&gt;.cursorrules&lt;/code&gt; in the comments.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;About me: I'm a Technical Documentation Specialist helping developers create README files, API docs, and technical guides. &lt;a href="https://www.fiverr.com/jedrzejdocs" rel="noopener noreferrer"&gt;Check out my services&lt;/a&gt; or connect on &lt;a href="https://www.linkedin.com/in/jedrzejdocs/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>vscode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AI-Friendly README: Stop Claude &amp; ChatGPT Hallucinations</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Mon, 08 Dec 2025 20:09:16 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/ai-friendly-readme-stop-claude-chatgpt-hallucinations-4ho</link>
      <guid>https://dev.to/jedrzejdocs/ai-friendly-readme-stop-claude-chatgpt-hallucinations-4ho</guid>
      <description>&lt;p&gt;You've spent hours crafting a beautiful README with badges, screenshots, and witty one-liners. It looks great on GitHub. But when you paste it into Claude or ChatGPT asking for help with your project, the AI still hallucinates imports and invents components that don't exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem isn't the AI. It's how you're structuring information for machines.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how to write README files that both humans and AI assistants can actually use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Your Current README Fails AI
&lt;/h2&gt;

&lt;p&gt;Most READMEs are optimized for humans browsing GitHub. They include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Marketing copy ("🚀 Blazingly fast!")&lt;/li&gt;
&lt;li&gt;Visual elements (badges, screenshots, GIFs)&lt;/li&gt;
&lt;li&gt;Narrative explanations&lt;/li&gt;
&lt;li&gt;Installation for multiple platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI assistants don't need any of this. They need &lt;strong&gt;structured, predictable data&lt;/strong&gt; they can parse into working context.&lt;/p&gt;

&lt;p&gt;When Claude sees "Blazingly fast React framework for building modern apps", it learns nothing about your actual architecture. When it sees a clear props interface or dependency list, it can generate accurate code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Quick Context" Section: Your AI Cheat Sheet
&lt;/h2&gt;

&lt;p&gt;The most important addition is a &lt;strong&gt;Quick Context&lt;/strong&gt; block at the top of your README:&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;## Quick Context (for AI Assistants)&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Stack:**&lt;/span&gt; React 18, TypeScript 5.3, Tailwind CSS 3.4
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Package Manager:**&lt;/span&gt; pnpm
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Node Version:**&lt;/span&gt; 20+
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Entry Point:**&lt;/span&gt; src/main.tsx
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Component Pattern:**&lt;/span&gt; Functional components with hooks
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**State Management:**&lt;/span&gt; Zustand
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Styling Approach:**&lt;/span&gt; Tailwind utility classes, no CSS modules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you paste this into Claude and ask "add a dark mode toggle", it now knows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use React hooks (not class components)&lt;/li&gt;
&lt;li&gt;Use Tailwind classes (not styled-components)&lt;/li&gt;
&lt;li&gt;Use pnpm for any package suggestions&lt;/li&gt;
&lt;li&gt;Target modern Node.js APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Without this section&lt;/strong&gt;, AI will ask clarifying questions or guess wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Diagram: ASCII Beats Images
&lt;/h2&gt;

&lt;p&gt;AI can't see your fancy architecture diagram image. Use ASCII instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── components/     # Reusable UI components
│   ├── ui/         # Primitives (Button, Input, Card)
│   └── features/   # Feature-specific components
├── hooks/          # Custom React hooks
├── lib/            # Utility functions
├── stores/         # Zustand stores
└── types/          # TypeScript type definitions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells AI exactly where to put new files and where to look for existing ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Interfaces: The Contract AI Needs
&lt;/h2&gt;

&lt;p&gt;Don't just describe your data models in prose. &lt;strong&gt;Show the TypeScript interfaces.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bad approach (prose description):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Users have an id, email, and role which can be admin, user, or guest.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Good approach (actual interface):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;guest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;createdAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When AI sees the actual interface, it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses correct property names (no &lt;code&gt;user.username&lt;/code&gt; when it should be &lt;code&gt;user.email&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Respects type constraints (won't suggest &lt;code&gt;role: 'superadmin'&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Handles optionals correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Component Patterns with Examples
&lt;/h2&gt;

&lt;p&gt;Document your patterns with real code:&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;## Component Patterns&lt;/span&gt;

Components follow this structure:
&lt;span class="p"&gt;-&lt;/span&gt; Props interface exported from same file
&lt;span class="p"&gt;-&lt;/span&gt; Default exports for components
&lt;span class="p"&gt;-&lt;/span&gt; Named exports for utilities
&lt;span class="p"&gt;-&lt;/span&gt; Hooks co-located with components when single-use
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then show an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/components/ui/Button.tsx&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ButtonProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;secondary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ghost&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;md&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ReactNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;ButtonProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// implementation&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Import Aliases: Stop the Path Guessing Game
&lt;/h2&gt;

&lt;p&gt;This small section prevents 50% of AI hallucinations:&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;## Import Aliases&lt;/span&gt;

| Alias | Path |
|-------|------|
| @/&lt;span class="ge"&gt;* | src/*&lt;/span&gt; |
| @/components/&lt;span class="ge"&gt;* | src/components/*&lt;/span&gt; |
| @/lib/&lt;span class="ge"&gt;* | src/lib/*&lt;/span&gt; |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when AI generates imports, it uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/components/ui/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of guessing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../../components/ui/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;components/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@components/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dependencies Section
&lt;/h2&gt;

&lt;p&gt;List critical dependencies AI should know about:&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;## Dependencies&lt;/span&gt;

| Package | Purpose |
|---------|---------|
| @tanstack/react-query | Data fetching (useQuery, useMutation) |
| zustand | State management (create, useStore) |
| zod | Schema validation |
| date-fns | Date manipulation (format, parseISO) |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Operations as Steps
&lt;/h2&gt;

&lt;p&gt;Document workflows as numbered steps:&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;## Common Operations&lt;/span&gt;

&lt;span class="gu"&gt;### Adding a new component&lt;/span&gt;
&lt;span class="p"&gt;
1.&lt;/span&gt; Create file in src/components/ui/ or src/components/features/
&lt;span class="p"&gt;2.&lt;/span&gt; Export props interface
&lt;span class="p"&gt;3.&lt;/span&gt; Use default export for component
&lt;span class="p"&gt;4.&lt;/span&gt; Add to src/components/index.ts barrel file

&lt;span class="gu"&gt;### Adding a new API endpoint&lt;/span&gt;
&lt;span class="p"&gt;
1.&lt;/span&gt; Define types in src/types/api.ts
&lt;span class="p"&gt;2.&lt;/span&gt; Create hook in src/hooks/use[Resource].ts
&lt;span class="p"&gt;3.&lt;/span&gt; Use react-query's useQuery or useMutation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Test: Before vs After
&lt;/h2&gt;

&lt;p&gt;I tested both README styles with Claude on the same task: "Add a search filter to the user list component."&lt;/p&gt;

&lt;h3&gt;
  
  
  With Traditional README
&lt;/h3&gt;

&lt;p&gt;Claude's response included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;useState&lt;/code&gt; for search state (correct, but lucky guess)&lt;/li&gt;
&lt;li&gt;Import from &lt;code&gt;'./components/SearchInput'&lt;/code&gt; (wrong path)&lt;/li&gt;
&lt;li&gt;CSS classes like &lt;code&gt;search-input&lt;/code&gt; (I use Tailwind)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;users.filter()&lt;/code&gt; on raw array (I use react-query)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Accuracy: 40%&lt;/strong&gt; - needed significant corrections.&lt;/p&gt;

&lt;h3&gt;
  
  
  With AI-Optimized README
&lt;/h3&gt;

&lt;p&gt;Claude's response included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;useState&lt;/code&gt; for local search state&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;import { Input } from '@/components/ui/Input'&lt;/code&gt; (correct alias)&lt;/li&gt;
&lt;li&gt;Tailwind classes &lt;code&gt;className="w-full px-4 py-2"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Integration with existing &lt;code&gt;useUsers()&lt;/code&gt; hook using react-query&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Accuracy: 90%&lt;/strong&gt; - minor tweaks only.&lt;/p&gt;

&lt;h2&gt;
  
  
  The LLM_CONTEXT.md Alternative
&lt;/h2&gt;

&lt;p&gt;For larger projects, create a dedicated &lt;code&gt;LLM_CONTEXT.md&lt;/code&gt; 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="gh"&gt;# LLM_CONTEXT.md&lt;/span&gt;

This file provides context for AI assistants.

&lt;span class="gu"&gt;## Project Metadata&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Name: my-app
&lt;span class="p"&gt;-&lt;/span&gt; Type: Next.js 14 App Router application
&lt;span class="p"&gt;-&lt;/span&gt; Primary Language: TypeScript

&lt;span class="gu"&gt;## Anti-Patterns to Avoid&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Don't use CSS modules (we use Tailwind)
&lt;span class="p"&gt;-&lt;/span&gt; Don't use class components (functional only)
&lt;span class="p"&gt;-&lt;/span&gt; Don't use default exports for utilities (named only)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "Anti-Patterns" section is powerful. It tells AI what NOT to do, preventing common mistakes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist: Is Your README AI-Ready?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Quick Context block with stack, patterns, and tooling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;TypeScript interfaces for core data models&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Import aliases documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;ASCII folder structure instead of images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Dependency list with primary use cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Component patterns with code examples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Common operations as numbered steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☐&lt;/td&gt;
&lt;td&gt;Anti-patterns section (what NOT to do)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Tools That Help
&lt;/h2&gt;

&lt;p&gt;If manual README updates feel tedious, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/LogicStamp/logicstamp-context" rel="noopener noreferrer"&gt;LogicStamp Context&lt;/a&gt;&lt;/strong&gt; - Auto-generates structured context from React/TypeScript projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeDoc&lt;/strong&gt; - Generates documentation from TypeScript comments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;documentation.js&lt;/strong&gt; - JSDoc to markdown&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The best README serves two audiences:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Humans&lt;/strong&gt; who want to understand and use your project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI assistants&lt;/strong&gt; who need structured context to help you code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By adding a Quick Context section, showing actual interfaces, and documenting your patterns explicitly, you transform your README from marketing material into a working AI prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your README is now your best AI prompt. Make it count.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What sections do you include in your READMEs for AI context? Share your templates in the comments!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;About me: I'm a Technical Documentation Specialist helping developers and startups create README files, API docs, and technical guides that both humans and AI can understand. &lt;a href="https://www.fiverr.com/jedrzejdocs" rel="noopener noreferrer"&gt;Check out my services&lt;/a&gt; or connect on &lt;a href="https://www.linkedin.com/in/jedrzejdocs/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>documentation</category>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>LogicStamp Context: Save 70% Tokens When Using AI with Your React Codebase</title>
      <dc:creator>jedrzejdocs</dc:creator>
      <pubDate>Sun, 07 Dec 2025 18:38:19 +0000</pubDate>
      <link>https://dev.to/jedrzejdocs/logicstamp-context-save-70-tokens-when-using-ai-with-your-react-codebase-2n99</link>
      <guid>https://dev.to/jedrzejdocs/logicstamp-context-save-70-tokens-when-using-ai-with-your-react-codebase-2n99</guid>
      <description>&lt;p&gt;If you've ever tried to get Claude, ChatGPT, or Copilot to help with your React codebase, you know the pain: copy-pasting files, explaining component relationships, watching your tokens burn, and still getting hallucinated imports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LogicStamp Context solves this.&lt;/strong&gt; One command, 8 seconds, and your AI finally understands your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: AI Doesn't Understand Your Codebase
&lt;/h2&gt;

&lt;p&gt;Picture this: You paste 50 files into Claude asking for a refactor suggestion. The AI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hallucinates component names that don't exist&lt;/li&gt;
&lt;li&gt;Misses critical dependencies&lt;/li&gt;
&lt;li&gt;Burns through 200K tokens (that's $3+ per conversation with Claude Opus)&lt;/li&gt;
&lt;li&gt;Still asks "can you show me the Button component?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We've all been there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: LogicStamp Context
&lt;/h2&gt;

&lt;p&gt;LogicStamp Context is a zero-config CLI that scans your React/TypeScript codebase and generates structured JSON bundles optimized for AI consumption.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick Start
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; logicstamp-context
&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
stamp context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. LogicStamp generates &lt;code&gt;context.json&lt;/code&gt; files organized by folder, plus a &lt;code&gt;context_main.json&lt;/code&gt; index. Share these with any AI assistant for instant codebase understanding.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Makes It Special?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ~70% Token Savings
&lt;/h3&gt;

&lt;p&gt;Instead of dumping raw source code, LogicStamp extracts only what AI needs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"entryId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"src/components/Button.tsx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"react:component"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"props"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"variant"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"literal-union"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"literals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"primary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"secondary"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"onClick"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"function"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"signature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"() =&amp;gt; void"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"useState"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"edges"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./Icon"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No boilerplate. No imports. No fluff. Just the architectural DNA of your component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deterministic Contracts = No Hallucinations
&lt;/h3&gt;

&lt;p&gt;When AI sees structured contracts instead of raw code, it references the actual architecture. No more invented imports or phantom components.&lt;/p&gt;

&lt;h3&gt;
  
  
  Style-Aware
&lt;/h3&gt;

&lt;p&gt;Running with &lt;code&gt;--include-style&lt;/code&gt; extracts your design system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context style
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output includes Tailwind classes, shadcn/ui components, and CSS patterns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"styleSources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"tailwind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"categories"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"layout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"flex"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"grid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gap-4"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"colors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"bg-blue-500"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"text-white"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"shadcn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Button"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Card"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Dialog"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now AI suggestions match your existing design system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next.js App Router Detection
&lt;/h3&gt;

&lt;p&gt;LogicStamp understands modern Next.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nextjs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"directive"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"client"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"routeType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"page"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No more AI suggesting &lt;code&gt;useState&lt;/code&gt; in a Server Component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependency Graph
&lt;/h3&gt;

&lt;p&gt;See exactly how components connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"edges"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./Icon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"../hooks/useAuth"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@/lib/utils"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Detect circular dependencies before they bite you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Workflow
&lt;/h2&gt;

&lt;p&gt;Here's how I use LogicStamp with Claude:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Generate context&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context &lt;span class="nt"&gt;--include-style&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Upload &lt;code&gt;context_main.json&lt;/code&gt; to Claude&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Ask architectural questions&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Based on this context, suggest how to refactor the authentication flow to use React Query instead of useState."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Claude gives specific, accurate suggestions referencing your actual components, hooks, and patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD Integration
&lt;/h2&gt;

&lt;p&gt;LogicStamp shines in pipelines:&lt;/p&gt;

&lt;h3&gt;
  
  
  Detect architectural drift
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context compare
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Validate context files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context validate context_main.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security scan for leaked secrets
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp security scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add to your GitHub Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Context Drift Check&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;check&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check Context Drift&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;npm install -g logicstamp-context&lt;/span&gt;
          &lt;span class="s"&gt;stamp context compare --ci&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Token Cost Comparison
&lt;/h2&gt;

&lt;p&gt;For a mid-sized React project (50 components):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Tokens&lt;/th&gt;
&lt;th&gt;Cost (Claude Opus)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Raw source code&lt;/td&gt;
&lt;td&gt;~200K&lt;/td&gt;
&lt;td&gt;~$3.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LogicStamp context&lt;/td&gt;
&lt;td&gt;~60K&lt;/td&gt;
&lt;td&gt;~$0.90&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Savings&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;70%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$2.10/session&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Over 100 AI sessions per month, that's &lt;strong&gt;$210 saved&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations (Being Honest)
&lt;/h2&gt;

&lt;p&gt;LogicStamp is still in beta (v0.2.7). Current limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TypeScript/React only (no Vue, Angular, or plain JS)&lt;/li&gt;
&lt;li&gt;Some edge cases with HOCs and complex generics&lt;/li&gt;
&lt;li&gt;Node.js 18+ required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check the full limitations list in the docs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Install globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; logicstamp-context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With style metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp context style
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize project (adds .gitignore entries, creates LLM_CONTEXT.md):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stamp init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/LogicStamp/logicstamp-context" rel="noopener noreferrer"&gt;LogicStamp/logicstamp-context&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://logicstamp.dev" rel="noopener noreferrer"&gt;logicstamp.dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/logicstamp-context" rel="noopener noreferrer"&gt;logicstamp-context&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're using AI assistants with React/TypeScript codebases, LogicStamp Context is a no-brainer:&lt;/p&gt;

&lt;p&gt;✅ Zero config&lt;br&gt;
✅ 70% token savings&lt;br&gt;
✅ No more hallucinations&lt;br&gt;
✅ Style-aware suggestions&lt;br&gt;
✅ CI/CD ready&lt;br&gt;
✅ Free and open source&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop burning tokens. Start shipping.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Have you tried LogicStamp? What's your workflow for giving AI context about your codebase? Drop a comment below!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;About me: I'm a Technical Documentation Specialist helping developers and startups create README files, API docs, and technical guides. Need professional documentation for your project? &lt;a href="https://www.fiverr.com/jedrzejdocs" rel="noopener noreferrer"&gt;Check out my services&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>ai</category>
      <category>typescript</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
