<?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: Victor Piles</title>
    <description>The latest articles on DEV Community by Victor Piles (@vict00r99).</description>
    <link>https://dev.to/vict00r99</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%2F3771575%2F2114d6c7-d15d-42cb-953d-f3b75b7e3982.png</url>
      <title>DEV Community: Victor Piles</title>
      <link>https://dev.to/vict00r99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vict00r99"/>
    <language>en</language>
    <item>
      <title>Stop Getting Different Code Every Time You Ask AI — Use a Spec Pattern</title>
      <dc:creator>Victor Piles</dc:creator>
      <pubDate>Sat, 14 Feb 2026 16:54:15 +0000</pubDate>
      <link>https://dev.to/vict00r99/stop-getting-different-code-every-time-you-ask-ai-use-a-spec-pattern-mk8</link>
      <guid>https://dev.to/vict00r99/stop-getting-different-code-every-time-you-ask-ai-use-a-spec-pattern-mk8</guid>
      <description>&lt;p&gt;Every time I ask AI to "write a function to validate coupons," I get a different result. Different function names, different return types, different edge cases handled. Three developers, three AI tools, three incompatible implementations.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Runestone&lt;/strong&gt; — an open-source specification pattern called RUNE that acts as a contract between what you want and what AI generates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;Instead of describing what you want in plain English and hoping for the best, you write a short spec:&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;RUNE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;validate_coupon&lt;/span&gt;

&lt;span class="na"&gt;SIGNATURE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
  &lt;span class="s"&gt;def validate_coupon(code: str, coupons: list[dict], date: str) -&amp;gt; tuple[bool, str]&lt;/span&gt;

&lt;span class="na"&gt;BEHAVIOR&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WHEN code is empty THEN return (False, "Coupon code cannot be empty")&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WHEN code not found (case-insensitive) THEN return (False, "Not found")&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WHEN coupon has expired THEN return (False, "Expired")&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;OTHERWISE return (True, matching_coupon)&lt;/span&gt;

&lt;span class="na"&gt;TESTS&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;validate_coupon('SAVE10',&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;[...],&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;'2025-01-15')[0]&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;==&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;True"&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;validate_coupon('',&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;[],&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;'2025-01-15')[0]&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;==&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;False"&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;validate_coupon('OLD',&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;[...],&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;'2025-01-15')[0]&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;==&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;False"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Give this to any AI tool — Claude, ChatGPT, Cursor, Copilot... and the generated code has the &lt;strong&gt;same behavior&lt;/strong&gt;. Same signature. Same edge cases. Same error messages. Same tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it includes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A pattern (not a framework) that works as YAML files or Markdown sections&lt;/li&gt;
&lt;li&gt;7 skills you can load into any AI tool:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Writer&lt;/strong&gt; — create specs and implement code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validator&lt;/strong&gt; — check spec completeness&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refiner&lt;/strong&gt; — suggest improvements&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Generator&lt;/strong&gt; — generate real test files from specs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diff&lt;/strong&gt; — detect drift between spec and code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From Code&lt;/strong&gt; — reverse-engineer specs from existing functions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Lang&lt;/strong&gt; — same spec, multiple languages&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Works with any programming language&lt;/li&gt;

&lt;li&gt;No installation, no runtime, no dependencies&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it doesn't do
&lt;/h2&gt;

&lt;p&gt;It doesn't generate identical code character-by-character. Variable names and internal style may vary between AI tools. What stays consistent is the &lt;strong&gt;behavior&lt;/strong&gt;: same inputs, same outputs, same edge case handling, same error messages. The tests from the spec pass regardless of which AI generated the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Copy &lt;code&gt;skills/rune-writer.md&lt;/code&gt; into your AI tool&lt;/li&gt;
&lt;li&gt;Describe a function you need&lt;/li&gt;
&lt;li&gt;Get a RUNE spec&lt;/li&gt;
&lt;li&gt;Implement from the spec&lt;/li&gt;
&lt;li&gt;Do it again with a different AI tool — compare the results&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/vict00r99/Rune-stone" rel="noopener noreferrer"&gt;https://github.com/vict00r99/Rune-stone&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback. What would make this useful for your workflow?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
