<?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: Sergey Shkuratov</title>
    <description>The latest articles on DEV Community by Sergey Shkuratov (@s_a_shkuratov).</description>
    <link>https://dev.to/s_a_shkuratov</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%2F3959622%2F42a6ac97-4a8f-494b-9d4a-1f49c95f54e6.jpg</url>
      <title>DEV Community: Sergey Shkuratov</title>
      <link>https://dev.to/s_a_shkuratov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/s_a_shkuratov"/>
    <language>en</language>
    <item>
      <title>Documentation is code: LLMs don’t actually read it — and honestly, neither do we</title>
      <dc:creator>Sergey Shkuratov</dc:creator>
      <pubDate>Tue, 02 Jun 2026 09:46:17 +0000</pubDate>
      <link>https://dev.to/s_a_shkuratov/documentation-is-code-llms-dont-actually-read-it-and-honestly-neither-do-we-1fl6</link>
      <guid>https://dev.to/s_a_shkuratov/documentation-is-code-llms-dont-actually-read-it-and-honestly-neither-do-we-1fl6</guid>
      <description>&lt;p&gt;I learned this the hard way: when an LLM says “it matches the docs”, it can still be wrong for a boring reason—it didn’t &lt;em&gt;read&lt;/em&gt; the part that matters.&lt;/p&gt;

&lt;p&gt;I’m building a small SaaS (checklists as a service). No users yet. Plenty of documentation already. And at some point my docs stopped being an asset and started turning into a liability.&lt;/p&gt;

&lt;p&gt;This is the story of how I rebuilt my documentation so that an LLM could actually &lt;strong&gt;read it end-to-end&lt;/strong&gt;—and how that restructure helped me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The moment I got scared: “silent misses”
&lt;/h2&gt;

&lt;p&gt;The docset grew. I kept asking the LLM to verify tasks against it.&lt;/p&gt;

&lt;p&gt;And then I noticed a pattern that felt worse than hallucinations.&lt;/p&gt;

&lt;p&gt;Not “the model invented stuff”, but “the model confidently said &lt;em&gt;it matches&lt;/em&gt;”—while quietly missing exceptions, prohibitions, and thresholds. Keyword scanning instead of reading.&lt;/p&gt;

&lt;p&gt;I called it &lt;strong&gt;silent drift&lt;/strong&gt;: code slowly moves away from conventions, while the invariants remain only in my head.&lt;/p&gt;

&lt;p&gt;In a project with roles, audit, and CI/CD security gates, that kind of drift isn’t “just messy docs”. It’s how you lose the ability to implement and review changes consistently.&lt;/p&gt;

&lt;h2&gt;
  
  
  I couldn’t do it manually (and I couldn’t delegate it fully)
&lt;/h2&gt;

&lt;p&gt;I knew I had to redo the documentation. But I also knew I couldn’t realistically do it all by hand.&lt;/p&gt;

&lt;p&gt;At the same time, I couldn’t just tell an LLM: “Rewrite everything according to approach X.” Not enough context, too easy to lose control.&lt;/p&gt;

&lt;p&gt;So I went with a third option: build a reliable process out of unreliable components—&lt;strong&gt;me + an LLM&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: I separated my docs into domains (and forced the model to actually read)
&lt;/h2&gt;

&lt;p&gt;First, I extracted &lt;strong&gt;domain areas&lt;/strong&gt; from the old documentation—the vocabulary I was using to describe the project and its parts. I tried to keep domains mutually independent (so the overall framework stays holdable in my head).&lt;/p&gt;

&lt;p&gt;Then I ran the same loop for each domain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I asked the LLM to &lt;strong&gt;read all old docs carefully&lt;/strong&gt; and extract requirements for that domain.&lt;/li&gt;
&lt;li&gt;I moved those requirements into a dedicated file and gave each one a &lt;strong&gt;project-unique ID&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I asked the LLM to reread everything and check &lt;strong&gt;internal consistency&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I fixed contradictions (sometimes by cross-checking the code).&lt;/li&gt;
&lt;li&gt;I repeated the consistency check (this caught small but nasty issues).&lt;/li&gt;
&lt;li&gt;I reviewed diffs manually to catch what was missing or implicitly assumed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This took ~4 days (about 4 hours/day). Exhausting, but still much faster than doing it without an LLM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: I hit a wall—because I mixed “requirements” with “verification”
&lt;/h2&gt;

&lt;p&gt;After the requirements pass, I wanted to extract scenarios (the thing that connects domains and requirements).&lt;/p&gt;

&lt;p&gt;And suddenly the model started to stumble and hallucinate again.&lt;/p&gt;

&lt;p&gt;The fix turned out to be painfully simple: my requirements were still “too thick” because they contained &lt;strong&gt;verification sections&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Verification text was useful, but it didn’t belong inside requirements files. It confused the extraction step.&lt;/p&gt;

&lt;p&gt;So I separated verification into its own files per domain. After that, scenario extraction became stable again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 (the main artifact): I built per-subsystem digests
&lt;/h2&gt;

&lt;p&gt;Even with cleaner docs, there was still one big problem:&lt;/p&gt;

&lt;p&gt;An LLM is much more likely to &lt;em&gt;actually read&lt;/em&gt; &lt;strong&gt;one document&lt;/strong&gt; than to wander through folders and do keyword search across many files.&lt;/p&gt;

&lt;p&gt;So I built a small, boring artifact:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;registry file&lt;/strong&gt; listing subsystems and the docs that belong to each&lt;/li&gt;
&lt;li&gt;a tiny &lt;strong&gt;builder script&lt;/strong&gt; that concatenates those files into a single digest per subsystem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, for each subsystem (authentication, access control, audit, security gates, plus a few project-specific ones), I have &lt;strong&gt;one consolidated document&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I also keep a short “selection rules” note for myself: which digests to feed into the agent for a given task (e.g., access control vs audit logic). The LLM can check conformance well, but I don’t expect it to reliably infer what to check via chains of implicit assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The payoff: the restructure wasn’t cosmetic
&lt;/h2&gt;

&lt;p&gt;After I rebuilt the registry and digests, I asked the LLM to check the whole codebase for conformance to each consolidated document.&lt;/p&gt;

&lt;p&gt;It found about &lt;strong&gt;15 bugs&lt;/strong&gt;. Some only manifested under specific conditions.&lt;/p&gt;

&lt;p&gt;At first, I was upset: how could this exist with so many tests?&lt;/p&gt;

&lt;p&gt;Then I realized: this was the clearest proof that the new documentation structure was doing real work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I’m taking from this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A big docset is not automatically verifiable.&lt;/li&gt;
&lt;li&gt;If you want LLM-assisted development to be stable, you need docs the model can &lt;strong&gt;read&lt;/strong&gt;, not just search.&lt;/li&gt;
&lt;li&gt;A tiny artifact (subsystem registry + digest builder) can become a point of leverage for your whole workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’ve dealt with docs/code drift (especially with LLMs in the loop), I’d love to hear what helped—and what failed.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
