<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Golang on Mikhail Shogin</title><link>https://mshogin.com/tags/golang/</link><description>Recent content in Golang on Mikhail Shogin</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Mikhail Shogin</copyright><lastBuildDate>Mon, 05 Jan 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://mshogin.com/tags/golang/index.xml" rel="self" type="application/rss+xml"/><item><title>Spec-driven development: Reproduce a project from specs alone</title><link>https://mshogin.com/notes/archlint-reproduction/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://mshogin.com/notes/archlint-reproduction/</guid><description>&lt;p&gt;Ran an experiment: can you reproduce a project if you give AI only specifications without source code?&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Original project: &lt;a class="link" href="https://github.com/mshogin/archlint" target="_blank" rel="noopener"
&gt;archlint&lt;/a&gt; - a Go architecture analysis tool&lt;/li&gt;
&lt;li&gt;Input: &lt;strong&gt;10 specifications&lt;/strong&gt; (Markdown + PlantUML), totaling &lt;strong&gt;73 KB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Claude Code received an empty directory and specs&lt;/li&gt;
&lt;li&gt;Executor: Claude Code, started in an &lt;strong&gt;empty directory&lt;/strong&gt; and implemented the project from scratch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Specs covered all the basics: module init, Makefile, data model, Go-analyzer, Cobra CLI, &lt;code&gt;collect&lt;/code&gt;/&lt;code&gt;trace&lt;/code&gt; commands, tracer library, tracelint, and integration tests.&lt;/p&gt;
&lt;h2 id="time"&gt;Time
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;~20 minutes&lt;/strong&gt; from empty directory to working project.&lt;/p&gt;
&lt;h2 id="results"&gt;Results
&lt;/h2&gt;&lt;p&gt;Final assessment of the cloned repository:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Structural identity: 100%&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloning success: 85.5%&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Semantic equivalence: ~75%&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mutations: 23&lt;/strong&gt; (3 critical, 8 medium, 12 minor)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Interesting detail: the clone turned out &lt;strong&gt;shorter&lt;/strong&gt; than the original - 1,845 lines of Go vs 2,159 (-14.5%) with the same number of &lt;code&gt;.go&lt;/code&gt; files (13).&lt;/p&gt;
&lt;h2 id="mutations-that-actually-matter"&gt;Mutations that actually matter
&lt;/h2&gt;&lt;p&gt;Three &amp;ldquo;critical&amp;rdquo; mutations - exactly the places where the specification leaves room for interpretation (i.e., for creativity you didn&amp;rsquo;t order):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Sequence diagram building:&lt;/strong&gt; changed the algorithm for forming calls in the diagram (logic for call stack and write conditions).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tracerlint:&lt;/strong&gt; clone considers deprecated &lt;code&gt;Exit()&lt;/code&gt; call acceptable, while the original does not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GoAnalyzer:&lt;/strong&gt; added &lt;code&gt;baseDir&lt;/code&gt; and &lt;code&gt;modulePath&lt;/code&gt; fields - AI &amp;ldquo;improved&amp;rdquo; the model because the specs didn&amp;rsquo;t explicitly define the analyzer&amp;rsquo;s responsibility boundary (what to store inside, what to compute outside).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="takeaway"&gt;Takeaway
&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Spec-driven development works as a mechanism for reproducing the &amp;ldquo;functional core&amp;rdquo;.&lt;/strong&gt; 73 KB of specifications was enough to quickly restore structure and core functionality.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Critical deviations occur where the specification describes &amp;ldquo;what should be&amp;rdquo; but doesn&amp;rsquo;t define &amp;ldquo;how to verify it&amp;rdquo;.&lt;/strong&gt; For such places you need:
&lt;ul&gt;
&lt;li&gt;precise rules (invariants),&lt;/li&gt;
&lt;li&gt;input/output examples,&lt;/li&gt;
&lt;li&gt;golden tests (byte-by-byte/structural comparison),&lt;/li&gt;
&lt;li&gt;prohibition on &amp;ldquo;model extension&amp;rdquo; without an explicit spec item.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In short: AI can clone a project from specs quickly. But if there&amp;rsquo;s a gap in the specs - it will definitely squeeze in some &amp;ldquo;engineering optimization&amp;rdquo;. Sometimes useful. In critical places - usually not.&lt;/p&gt;
&lt;p&gt;Clone repository: &lt;a class="link" href="https://github.com/mshogin/archlint-reproduction" target="_blank" rel="noopener"
&gt;mshogin/archlint-reproduction&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>