<?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: alexdrimbe</title>
    <description>The latest articles on DEV Community by alexdrimbe (@alexdrimbe).</description>
    <link>https://dev.to/alexdrimbe</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%2F120392%2F63726dcc-9db3-43f3-bd6e-9da3e257aa11.png</url>
      <title>DEV Community: alexdrimbe</title>
      <link>https://dev.to/alexdrimbe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexdrimbe"/>
    <language>en</language>
    <item>
      <title>Business Logic Is the Real Product (So I Built logicrepo)</title>
      <dc:creator>alexdrimbe</dc:creator>
      <pubDate>Sat, 03 Jan 2026 22:18:37 +0000</pubDate>
      <link>https://dev.to/alexdrimbe/business-logic-is-the-real-product-so-i-built-logicrepo-23bj</link>
      <guid>https://dev.to/alexdrimbe/business-logic-is-the-real-product-so-i-built-logicrepo-23bj</guid>
      <description>&lt;p&gt;If you’ve ever shipped a bug caused by a business rule nobody could explain, this post is for you.&lt;/p&gt;

&lt;p&gt;A pricing rule breaks in production.&lt;br&gt;&lt;br&gt;
Customers are affected.&lt;br&gt;&lt;br&gt;
Everyone is scrambling.&lt;/p&gt;

&lt;p&gt;Then comes the worst question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who changed this… and why?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sometimes the logic is buried in a service layer.&lt;br&gt;&lt;br&gt;
Sometimes it’s split across validators and feature flags.&lt;br&gt;&lt;br&gt;
Sometimes it lives in a Confluence doc nobody trusts anymore.&lt;/p&gt;

&lt;p&gt;This isn’t a tooling problem.&lt;br&gt;&lt;br&gt;
It’s a structure problem.&lt;/p&gt;
&lt;h2&gt;
  
  
  Business Logic Has No First-Class Home
&lt;/h2&gt;

&lt;p&gt;In most codebases, business logic is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mixed with framework and infrastructure code&lt;/li&gt;
&lt;li&gt;Hard to review in isolation&lt;/li&gt;
&lt;li&gt;Poorly tested (or tested indirectly)&lt;/li&gt;
&lt;li&gt;Documented separately — if at all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When reviewing a PR, you often see how something was implemented, but not what rule actually changed.&lt;/p&gt;

&lt;p&gt;That’s dangerous, because business logic is the real product.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why This Matters More in the Age of AI
&lt;/h2&gt;

&lt;p&gt;AI can generate controllers, services, and validators.&lt;/p&gt;

&lt;p&gt;What it can’t generate is domain intent.&lt;/p&gt;

&lt;p&gt;Business logic encodes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pricing decisions&lt;/li&gt;
&lt;li&gt;Eligibility criteria&lt;/li&gt;
&lt;li&gt;Risk constraints&lt;/li&gt;
&lt;li&gt;Product strategy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As code generation becomes cheaper, clarity of intent becomes more valuable — not less.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Idea: Separate Intent From Implementation
&lt;/h2&gt;

&lt;p&gt;I wanted business rules to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explicit&lt;/li&gt;
&lt;li&gt;Versioned&lt;/li&gt;
&lt;li&gt;Tested&lt;/li&gt;
&lt;li&gt;Reviewable&lt;/li&gt;
&lt;li&gt;Framework-agnostic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That led to &lt;code&gt;logicrepo&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Is &lt;code&gt;logicrepo&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;logicrepo&lt;/code&gt; is a simple CLI that lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define business rules in YAML&lt;/li&gt;
&lt;li&gt;Write tests for those rules&lt;/li&gt;
&lt;li&gt;Validate them in CI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No runtime magic.&lt;br&gt;&lt;br&gt;
No framework lock-in.&lt;br&gt;&lt;br&gt;
Just rules, clearly expressed.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example (simplified)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rules:
  discount:
    when:
      user.plan: "pro"
    then:
      apply_discount: 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Tests focus on intent, not implementation details.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why YAML?
&lt;/h2&gt;

&lt;p&gt;Not because it’s trendy.&lt;/p&gt;

&lt;p&gt;YAML is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Human-readable&lt;/li&gt;
&lt;li&gt;Easy to diff in PRs&lt;/li&gt;
&lt;li&gt;Reviewable by non-engineers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a rule changes, PMs and domain experts can actually understand what changed — not just that something changed.&lt;/p&gt;
&lt;h2&gt;
  
  
  CI as a Guardrail
&lt;/h2&gt;

&lt;p&gt;Running it is intentionally boring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx logicrepo check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it locally.&lt;br&gt;&lt;br&gt;
Run it in CI.&lt;/p&gt;

&lt;p&gt;If a business rule breaks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The build fails&lt;/li&gt;
&lt;li&gt;The change is visible&lt;/li&gt;
&lt;li&gt;The intent is documented&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No more silent logic drift.&lt;/p&gt;

&lt;h2&gt;
  
  
  This Is Not a Rules Engine
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;logicrepo&lt;/code&gt; does not execute your business logic at runtime.&lt;/p&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A source of truth&lt;/li&gt;
&lt;li&gt;A contract&lt;/li&gt;
&lt;li&gt;A specification for business rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your application can consume it, or simply validate itself against it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx logicrepo check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub:&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/alexdrimbe/logicrepo" rel="noopener noreferrer"&gt;https://github.com/alexdrimbe/logicrepo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d love to hear your thoughts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where does your business logic live today?&lt;/li&gt;
&lt;li&gt;Have you been burned by logic drift before?&lt;/li&gt;
&lt;li&gt;Would something like this help your team?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>testing</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
