DEV Community

Cover image for Your AI says it read the docs. Did it?
dengkunlin
dengkunlin

Posted on Edited on AI-assisted

Your AI says it read the docs. Did it?

I wrote this post for the Kiroween 2026 hackathon (Skeleton Crew category). The project is called RefCov, and everything is public:

Why I built it

It started with my video work. I asked an agent to analyse a reference video I wanted to learn from. Its analysis sounded convincing. Then it made the video, and the result was far from the reference. When I asked again, it admitted it had not watched the reference closely. That cost me time and credits.

Code has the same problem. We put the project's standards in the repository: a style guide, API notes, a data dictionary. The AI finishes and says "I followed the project's guidelines", and I have no way to check whether it opened those files.

Code has test coverage. Reference material does not. So I wanted one thing: how much of the reference material the AI read should be a number, not a sentence like "I read the docs".

First, a test: does the AI read?

I put Chrome's modern web guidance (209 guides) in a project, with a one-line README saying the front-end code follows them. Then I gave claude-haiku-5.5 five front-end tasks: an account settings page, an FAQ accordion, a dropdown menu, a dark-mode switch and a long article page. Three or four runs per group, on kiro-cli 3.3.0.

Result: without RefCov, 13 of 16 runs wrote their code without opening a single guide.

A few things to be clear about:

  • These are small runs. They describe 16 runs, not statistics.
  • The pages mostly worked. Without the guides, the features were still built, just with older techniques. So my claim is "it did not follow the project's practices", not "the pages were broken".
  • Not every model skips. A fixed claude-sonnet-5.5 read 6 to 7 relevant guides every time on the first task. The skipping came from Haiku and from Kiro's automatic model selection.

What RefCov does

In one sentence: it splits your material into small pieces, records every piece the AI reads, and holds back the write until the required pieces are read.

  1. Split. Documents by section, videos by shot, GIS data by field. Each piece is a "unit".
  2. Read. The AI reads units one by one through RefCov's MCP tools. Each read goes into a hash-chained log. Coverage is computed from that log only. The AI saying it read something does not count, and opening the file directly does not count either.
  3. Gate. In Kiro, hooks check before a file is written. While required units are unread, the write is blocked. On every message, a hook also adds one line to the AI's context: how much this session has read and how much is left.
  4. Cite. Each requirement in a spec says which unit it came from. Requirements with no source, and units cited but never read, show up in the report.
  5. Register from the chat. Tell Kiro "register docs/card.md as reference material". It proposes the change first and registers it only after you approve a prompt. That prompt has no "Always allow", so one click covers one registration.

With RefCov, on the same five tasks, all 16 runs read every required unit before writing. The guide practices the checks looked for went from 9 of 58 to 39 of 58.

A surprise while recording the video

On the day I recorded the demo, I asked Kiro for a tabs component. I wanted to film the write being blocked.

It was not blocked, because it never tried to write first. In its reasoning, Haiku quoted the line RefCov's hook had added: "this session 0/18, 15 still missing". Then it read the 15 units one by one, and only then wrote the file.

It did not follow my script. At first I thought I would have to register another file and record again, or give it a different task that needed reference material. While I was deciding what to switch to, I realised this showed what my tool does even better: once reminded, the AI really went and read, instead of stubbornly writing until it was blocked and only then looking back.

The reminder and the gate are two layers. The reminder is soft, and the AI can ignore it. If it ignores it and goes straight to writing, the write gate stops it. This time Haiku listened to the reminder, so the gate had nothing to do.

Building a Kiro tool with Kiro

The whole project was built in Kiro, and RefCov guarded Kiro while Kiro built RefCov.

  • Specs. Six spec folders: the skeleton, the install layer, registration from chat, the two apps and the demo page, each with requirements and a design. Requirements cite their sources, so a requirement the AI invented, or one based on material it never read, shows up in the report. Building through chat alone leaves nothing like that to check.
  • Hooks. Five hooks are the core of the product. One detail we measured: a hook blocks only when it exits with code 2. Exit code 1 does not block, and the AI never sees the reason.
  • Steering. Six files, read in every session. Three of the rules were added after something went wrong.
  • MCP. A read counts only when it goes through RefCov's MCP tools.
  • Property-based tests. Hypothesis tests check the coverage rules, such as "reading the same unit twice counts once" and "nothing the AI writes can change the verdict". All 996 tests pass.

Switching to a small model. Halfway through, I switched Kiro to claude-haiku-5.5 and let RefCov guard it: before every write, it had to read the specs and the data notes. Haiku wrote the GIS app, the demo page and the install layer. On the same two tasks, Haiku used 0.18 and 0.37 credits where Opus used 4.77 and 9.31 (one run each). Haiku's code still needed review, and the review did find problems.

I am not an expert programmer, and after the switch to Haiku all of its reasoning and output was in English. I needed another AI to turn its work into something I could follow, so I used Claude Code as a layer between me and Kiro: it explained and proposed, and I decided. It also reviewed Haiku's code at every checkpoint and drafted the public text,such as the README and the submission write-up.

Moments that stuck with me

  • The AI had sub-agents read for it. While building the demo page, Kiro sent sub-agents to read 174 guide units, and they reported back only the counts. RefCov records that a unit was read through MCP in this workspace, not which agent read it, so the gate let the next write through. Kiro reported this itself. We then added a steering rule: the agent that writes the code reads the required units itself.
  • The protection check blocked us. Once, a commit message mentioned a command only the user is allowed to run. The protection check matches text, so it blocked the commit. We did not add an exception; we reworded the message.

What it does not do

  • It proves the AI read the material. It does not prove the AI understood it.
  • Reading is not following. Several times the AI read a guide and still chose older code for browser support. Using the material is still the model's decision.
  • It does not stop files written by shell commands (we tested it).
  • It targets skipped and overstated reading. It does not stop an AI that deliberately forges records.
  • Three rounds of GIS trials did not show that reading changes the answer. RefCov fills information gaps, not skill gaps.
  • It costs more credits: on the four later front-end tasks, Haiku runs with RefCov used 3 to more than 30 times the credits of runs without it.

What I learned

When does an AI skip the material? In our trials, when three things met: it thinks it knows the field, the task works without reading, and the model is a default or low-cost one. When any one was missing, we did not see it skip.

So RefCov does not say "AI always cuts corners". It puts a number you can check on the moments when the AI decides it does not need to look.

People often say the models in Kiro are not as smart as the same models elsewhere. From my experience, the difference is not mainly the model but how you use it: give it clear specs, a rule to read the material first, and records you can check, and even a low-cost model gets the job done.

Read first. Then write. And prove it.

Top comments (1)

Collapse
 
eliashivemind profile image
Nova Ops •

The number that stayed with me is the baseline: 13 of 16 runs wrote code without opening a single guide — and the pages mostly worked, which is exactly why "I followed the guidelines" survives as a claim. Your fix is the same shape we ended up with on our release gate: don't grade the claim, grade a record the claimant can't edit after the fact. Ours appends every release check to a hash-chained ledger for the same reason your coverage is computed only from the read log.

The sub-agent case is the interesting hole, though: 174 units read by sub-agents satisfied the gate for a writer that never read them, and you patched it with a steering rule. Do you think reader identity belongs inside the coverage computation itself — the log recording which agent read a unit, and the gate only counting reads by the writing agent — or is that over-fitting to one incident, with the steering rule being the proportionate fix?