<?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: Alexei Pogrebtsov</title>
    <description>The latest articles on DEV Community by Alexei Pogrebtsov (@alexei_pogrebtsov_5480860).</description>
    <link>https://dev.to/alexei_pogrebtsov_5480860</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269926%2Fc909543d-64d4-4a17-9ff1-1c16f1fbf2db.jpg</url>
      <title>DEV Community: Alexei Pogrebtsov</title>
      <link>https://dev.to/alexei_pogrebtsov_5480860</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexei_pogrebtsov_5480860"/>
    <language>en</language>
    <item>
      <title>Spec-first with coding agents: where the reasoning goes missing</title>
      <dc:creator>Alexei Pogrebtsov</dc:creator>
      <pubDate>Sat, 28 Nov 2026 05:03:59 +0000</pubDate>
      <link>https://dev.to/alexei_pogrebtsov_5480860/spec-first-with-coding-agents-where-the-reasoning-goes-missing-39</link>
      <guid>https://dev.to/alexei_pogrebtsov_5480860/spec-first-with-coding-agents-where-the-reasoning-goes-missing-39</guid>
      <description>&lt;p&gt;&lt;em&gt;What I learned adopting spec-first development with coding agents, and why I ended up building a tool for the part the frameworks leave to you.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The request I kept typing
&lt;/h2&gt;

&lt;p&gt;For months, many of my sessions with a coding agent started the same way: "Search our previous sessions for everything we discussed earlier and what we decided."&lt;/p&gt;

&lt;p&gt;The discussion had happened. The agent had asked good questions, and I had answered them. But it was all buried in a long scroll of reasoning and tool calls, in a session that had ended. Asking the agent to dig it out was faster than scrolling back myself.&lt;/p&gt;

&lt;p&gt;I've built several products spec-first: with the Superpowers skills for Claude Code, with Wayfinder, and with no framework at all. The way of working is the same. I don't ask the agent for code. I ask for a design, then a spec, then a plan. I read and accept each one, and then the agent writes the code. To change the code, I change the spec.&lt;/p&gt;

&lt;p&gt;It works. The agent's guesses land in a document I read before any code exists. Two weeks later, I still know why the project is the way it is.&lt;/p&gt;

&lt;p&gt;But it bothered me that, to find an earlier discussion, I had to ask the agent to search old sessions for it. Most of the decisions did end up in the documents. What didn't was the discussion behind them: the options we weighed, and why I chose one. That stayed in old sessions, and I was using the agent as an archaeologist of my own reasoning.&lt;/p&gt;

&lt;p&gt;The method was fine. The place I practised it wasn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The frameworks, and what they leave out
&lt;/h2&gt;

&lt;p&gt;The flow is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;design → spec → plan → tasks → implement
   ▲                              │
   └──── change the spec ◄────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each step is a Markdown document. A person reviews each one before the next step starts. The agent writes; the person decides.&lt;/p&gt;

&lt;p&gt;Left alone, agents skip all this and go from prompt to code. So a set of frameworks teaches them the flow, with rules, templates and commands. The two I've used most:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/obra/superpowers" rel="noopener noreferrer"&gt;Superpowers&lt;/a&gt;&lt;/strong&gt;, a library of skills for Claude Code. It brainstorms a design by asking questions one at a time, breaks it into small tasks, and works through them test first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.aihero.dev/skills-wayfinder" rel="noopener noreferrer"&gt;Wayfinder&lt;/a&gt;&lt;/strong&gt;, which turns vague requirements into specs through rounds of questions ("grilling sessions") before anything is planned.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;Spec Kit&lt;/a&gt; and &lt;a href="https://github.com/Fission-AI/OpenSpec" rel="noopener noreferrer"&gt;OpenSpec&lt;/a&gt; are also popular. Spec Kit walks the agent from a project &lt;em&gt;constitution&lt;/em&gt; to a spec, plan and tasks. OpenSpec keeps the current specs apart from proposed changes, and merges a change in when it's done.&lt;/p&gt;

&lt;p&gt;They share a shape: folders of Markdown, document types, statuses. And they're full of questions: brainstorming, grilling, clarifying. The frameworks know the questions are where the value is.&lt;/p&gt;

&lt;p&gt;What none of them change is how &lt;em&gt;you&lt;/em&gt; read those documents, answer the questions and decide. That still happens in a chat window and a code editor. That's where things go missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four ways it goes missing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The questions scroll away
&lt;/h3&gt;

&lt;p&gt;A good spec-first agent asks a lot. A question at the spec stage is a bug not written later. Agents have even got good at asking. Here I asked Claude Code, in a plain terminal, for a design doc on syncing a small notes app across devices, and to ask me its open questions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo2rfcfs0x6z6ppx4l13d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo2rfcfs0x6z6ppx4l13d.png" alt="Claude Code's question form (Backend, Accounts, Conflicts, Encryption) under a 208-line design doc collapsed to &amp;quot;+199 lines&amp;quot;" width="800" height="777"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The questions are tidy: four tabs, options, a recommendation. But look above them. The design doc they're about is 208 lines, shown as nine and "+199 lines". I'm asked to choose a backend for a document I haven't read, away from the passage that explains the trade-off. And once I submit, the questions and my answers become a few lines in the scroll, under everything that comes next.&lt;/p&gt;

&lt;p&gt;The answers have it worse. They live in your messages, not in the spec. A good agent writes the decision into the document. The reasons rarely make it: which options you weighed, what you ruled out and why. When the session ends or gets compacted, they're gone. The next agent, or you in a month, sees the decision but not why, and either trusts it blindly or argues it all over again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nobody can see where a document stands
&lt;/h3&gt;

&lt;p&gt;The frameworks write statuses: &lt;code&gt;proposed&lt;/code&gt;, &lt;code&gt;accepted&lt;/code&gt;, &lt;code&gt;superseded&lt;/code&gt;. Your editor doesn't show them. Twenty ADRs look like twenty file names. To find the ones waiting on you, you open each.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reviewing means editing
&lt;/h3&gt;

&lt;p&gt;An editor's Markdown preview has nowhere to put a comment. So you edit the file: a &lt;code&gt;TODO&lt;/code&gt;, a quote, an HTML comment. Then the agent reads your comment as part of the document. Sometimes it acts on it. Sometimes it keeps it, rewords it, or turns it into a requirement.&lt;/p&gt;

&lt;p&gt;Pull request review is better, but it starts when the document is in a PR. Most specs are reviewed long before that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Everything changed, again
&lt;/h3&gt;

&lt;p&gt;Agents don't patch documents; they regenerate them. After a round, the spec you read yesterday is a different file. Which sections changed? Did it take your note, or quietly drop the passage you commented on? You re-read the whole thing, or you stop reading carefully. Neither is review.&lt;/p&gt;

&lt;h2&gt;
  
  
  One rule
&lt;/h2&gt;

&lt;p&gt;Put together, these point to one rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Decisions belong in the documents. The conversation about a passage&lt;br&gt;
belongs next to that passage.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The chat is fine for "run the tests". It's the wrong place for "should retries stop at five or ten?", because that answer has to outlive the session.&lt;/p&gt;

&lt;p&gt;You can follow the rule with discipline alone: have the agent write each open question into the spec, answer it there, and record the decision before going on. I did, for a while. It's tiring, and the document fills with scaffolding. So I built a small tool to carry that discipline for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I tried: a reviewer's desk
&lt;/h2&gt;

&lt;p&gt;The tool is Folio. It started as a plain Markdown viewer and grew one problem at a time. I pictured a newspaper: the agents are reporters, filing drafts faster than anyone can read them. I'm the editor, who marks them up, sends them back and decides what runs. I was missing the editor's desk.&lt;/p&gt;

&lt;p&gt;Here's what I tried, in the order I hit the problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  A reader that doesn't edit
&lt;/h3&gt;

&lt;p&gt;Folio never writes to the documents it opens. Highlights and notes live in its own folder, outside the repository. The agent can't mistake a review for content, and nothing about reviewing shows up in a diff.&lt;/p&gt;

&lt;p&gt;It also shows where each document stands. It reads the status the frameworks already write and shows it in the folder tree, with filters. "All proposed ADRs" is one click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy961viv06vljleshq6h0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy961viv06vljleshq6h0.png" alt="Status in the documents tree" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What changed since I read it
&lt;/h3&gt;

&lt;p&gt;Folio remembers which version of each document I last read. Changed documents are marked, and each names the sections that changed. After a round, I read those sections, not the whole spec.&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing the loop
&lt;/h3&gt;

&lt;p&gt;My first "send feedback" was a button that copied my notes as Markdown, each with its passage, file and line, to paste into the agent. Better than retyping quotes. But nothing came back except a changed file. Had it taken every note? Which ones did it disagree with?&lt;/p&gt;

&lt;p&gt;So Folio got an MCP server. The agent fetches my notes, revises the documents, and replies to each note in Folio, on its passage. The thread records the decision and outlives the session. In a review loop, the agent waits: I click &lt;strong&gt;Send&lt;/strong&gt;, it revises and answers, and waits again.&lt;/p&gt;

&lt;p&gt;Approval stays with me. Folio doesn't edit files, not even a status line, so a note on the whole document carries my verdict ("Accepted, once retries are capped"), and the agent applies it.&lt;/p&gt;

&lt;p&gt;The last step was one window. I'd ruled out a chat panel in a reading tool. Then I saw I didn't want a chat. I wanted my own agent, with my own settings and plugins, next to the documents. So Folio has an agent panel: a terminal with Claude Code, beside the documents. It changed the feel of the work more than I expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  The agent's questions, on the passage
&lt;/h3&gt;

&lt;p&gt;This is the problem I started with. It came last, because it needed everything above.&lt;/p&gt;

&lt;p&gt;The agent now puts its questions in Folio as notes, each on the passage it's about. A question gets an answer in words. A decision comes with options, the proposed one first, and I pick one with a click. Here's the same request as in the terminal above, sent from Folio's agent panel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F37jz85wxgraijfioiz6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F37jz85wxgraijfioiz6f.png" alt="The sync spec in Folio: the agent's questions in the Marks list, one open on its passage, the agent waiting for my notes" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The agent wrote the same kind of doc and put each question where it belongs. One sits on "Tombstones are purged on the server after 90 days": &lt;em&gt;Is 90 days OK? A device that stays offline longer than this could bring a deleted note back.&lt;/em&gt; I read the passage and the question together, and answer there.&lt;/p&gt;

&lt;p&gt;The questions don't scroll away, because they were never in the chat. The reasons don't vanish with the session: the thread stays on the passage, and the answer becomes a sentence in the spec. Of everything here, this changed my work the most.&lt;/p&gt;

&lt;p&gt;Implementation came next. The first time I took a spec all the way to code, the agent's questions were about files I couldn't see, and I was back in the IDE. Now its questions go on the plan or spec passage they concern, quoting the code, and it ticks each task in the plan as it's done. Code reaches me as evidence, never as files to read. Code review still happens in the editor or the pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  One project, end to end
&lt;/h2&gt;

&lt;p&gt;To test the whole loop, I built a small browser game, Lantern Drift: you steer a paper lantern across a pond at night, collecting fireflies to keep its flame alive. The rule: I wouldn't open the code.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/ec4ytxoAFIU" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the agent panel, I asked for a spec and an ADR.&lt;/li&gt;
&lt;li&gt;Both appeared with the agent's questions on their passages.&lt;/li&gt;
&lt;li&gt;I picked options, answered questions, and accepted the spec with one request: implement it.&lt;/li&gt;
&lt;li&gt;The agent recorded each answer, built the game, and asked on the spec when it hit something the spec didn't say.&lt;/li&gt;
&lt;li&gt;It opened the game, and I played until the lantern went out.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every decision about the game is in the spec or the ADR. To change the game, I change the spec.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's still hard
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The terminal is still there.&lt;/strong&gt; Approving a command, a failed build, starting the project: all of that happens in the agent's terminal. You can steer a project without reading its code, but not without some comfort in a terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long sessions still lose detail.&lt;/strong&gt; The fix isn't a better chat; it's shorter sessions, with the plan in a file as the handoff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's one person's desk.&lt;/strong&gt; My notes are mine. A spec reviewed by three people needs their threads in one place, and today that's the pull request, late in the process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The gate is only as good as the attention.&lt;/strong&gt; Agents write faster than people read. Reading only what changed helps; it doesn't replace reading.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Over to you
&lt;/h2&gt;

&lt;p&gt;I keep the conversation beside the document, so the spec stays clean.&lt;br&gt;
Others keep decision logs in the repository, versioned and shared. Maybe the frameworks should ask their questions in the documents themselves.&lt;/p&gt;

&lt;p&gt;So I'd like to know: &lt;strong&gt;when your agent asks you a question during design, where does your answer end up, and could a new session find it next week?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Folio is free and open source: &lt;a href="https://crazzybot.github.io/folio/" rel="noopener noreferrer"&gt;crazzybot.github.io/folio&lt;/a&gt;. This article was reviewed in it, with the agent's questions on its passages.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>claudecode</category>
    </item>
  </channel>
</rss>
