<?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: Thales Souza</title>
    <description>The latest articles on DEV Community by Thales Souza (@thalesstackforge).</description>
    <link>https://dev.to/thalesstackforge</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%2F3717186%2F24e37f83-1616-4a2e-a355-300194337446.jpg</url>
      <title>DEV Community: Thales Souza</title>
      <link>https://dev.to/thalesstackforge</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thalesstackforge"/>
    <language>en</language>
    <item>
      <title>I was tired of AI forgetting my architecture decisions, so I built a transactional context manager for Git</title>
      <dc:creator>Thales Souza</dc:creator>
      <pubDate>Thu, 27 Aug 2026 11:38:08 +0000</pubDate>
      <link>https://dev.to/thalesstackforge/i-was-tired-of-ai-forgetting-my-architecture-decisions-so-i-built-a-transactional-context-manager-57dh</link>
      <guid>https://dev.to/thalesstackforge/i-was-tired-of-ai-forgetting-my-architecture-decisions-so-i-built-a-transactional-context-manager-57dh</guid>
      <description>&lt;p&gt;If you use Cursor, Claude Desktop, or ChatGPT to write software every day, you probably know this exact feeling:&lt;/p&gt;

&lt;p&gt;You spend 30 minutes carefully explaining your domain, why you chose a specific library, why you banned another one, and how your database schema is structured. &lt;/p&gt;

&lt;p&gt;Twenty prompts later, the LLM hallucinates a dependency you explicitly told it not to use, rewrites a core architecture pattern, or completely forgets an architectural decision you made yesterday.&lt;/p&gt;

&lt;p&gt;The problem isn't that current models are dumb. The problem is that &lt;strong&gt;LLMs are stateless compute, but we treat them as if they had persistent memory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vector databases (RAG) often bring noisy, out-of-context chunks. Copy-pasting massive &lt;code&gt;system_prompt.txt&lt;/code&gt; files burns your token budget and gets out of sync with your code in 3 days.&lt;/p&gt;

&lt;p&gt;I wanted a deterministic, version-controlled, and safe way to handle this. So I built &lt;strong&gt;PactX&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  The core philosophy: Git is the source of truth
&lt;/h3&gt;

&lt;p&gt;Instead of relying on AI vendor memory or messy floating markdown files, PactX creates a structured, human-readable directory in your repo: &lt;code&gt;.ai-context/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Inside, you keep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rules.md&lt;/code&gt; — Strict constraints (e.g., "Always use Java 21 records, never use Lombok").&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;state.md&lt;/code&gt; — Current milestone and roadmap.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;decisions/&lt;/code&gt; — Sequential ADRs (&lt;code&gt;DEC-001.md&lt;/code&gt;, &lt;code&gt;DEC-002.md&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;requirements.md&lt;/code&gt; — Business requirements tied bidirectionally to ADRs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;glossary.md&lt;/code&gt; &amp;amp; &lt;code&gt;discarded.md&lt;/code&gt; — Domain terms and rejected architectural paths.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this lives inside Git alongside your code. When a branch merges, the context merges. When you roll back a commit, your AI context rolls back with it.&lt;/p&gt;




&lt;h3&gt;
  
  
  How it actually works in a daily workflow
&lt;/h3&gt;

&lt;p&gt;PactX runs as a closed loop with two main commands:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Egress: &lt;code&gt;pactx pack&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;When you start a conversation with any AI, you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @trsthales/pactx pack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It takes your branch, recent commits, rules, requirements, and decisions, compresses them into a minimal payload (~400 tokens), and copies it straight to your clipboard. You paste it at the start of your chat, and the AI immediately knows the rules and current state.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Ingress: &lt;code&gt;pactx update&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;When the AI proposes a new architectural decision or updates a requirement, you don't edit markdown files manually. You run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @trsthales/pactx update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It accepts an incremental patch from the AI, shows you a full diff for review, and applies it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why we built a Write-Ahead Logging (WAL) engine for a CLI
&lt;/h3&gt;

&lt;p&gt;One of the worst things an AI tool can do is corrupt your repo or overwrite files partially if a script crashes halfway through.&lt;/p&gt;

&lt;p&gt;To prevent this, PactX doesn't just do &lt;code&gt;fs.writeFileSync&lt;/code&gt;. It has an internal &lt;strong&gt;Transaction Engine with Write-Ahead Logging (WAL)&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every context change writes a journal entry to &lt;code&gt;.pactx/transactions/&lt;/code&gt; in a &lt;code&gt;PREPARED&lt;/code&gt; state.&lt;/li&gt;
&lt;li&gt;Changes are written atomically via temp files and native renames.&lt;/li&gt;
&lt;li&gt;If your terminal dies or power goes out mid-operation, the next command detects the uncommitted transaction and either rolls it back cleanly or recovers.&lt;/li&gt;
&lt;li&gt;Security-wise, everything is jailed to the Git root using &lt;code&gt;fs.realpathSync.native&lt;/code&gt; to block symlink attacks and path traversal.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Native Model Context Protocol (MCP) Support
&lt;/h3&gt;

&lt;p&gt;If you use Claude Desktop or Cursor, you don't even need to copy and paste.&lt;/p&gt;

&lt;p&gt;PactX includes a native MCP server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pactx serve &lt;span class="nt"&gt;--mcp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once hooked into your &lt;code&gt;claude_desktop_config.json&lt;/code&gt; or Cursor settings, the AI can read your project context, check health rules, and propose architectural updates through tools in real-time, while still requiring your confirmation before applying anything to disk.&lt;/p&gt;




&lt;h3&gt;
  
  
  Try it out (Feedback wanted!)
&lt;/h3&gt;

&lt;p&gt;PactX is 100% open source (MIT), written in TypeScript, and currently has a suite of 140+ unit/integration tests.&lt;/p&gt;

&lt;p&gt;You can spin it up in your repo right now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @trsthales/pactx init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other useful commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pactx doctor&lt;/code&gt; — Audits your context for broken references or missing ADRs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pactx status --telemetry&lt;/code&gt; — Shows token footprint and context distribution.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;pactx rollback&lt;/code&gt; — Safely reverts the last applied context change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/trsthales/pactx" rel="noopener noreferrer"&gt;https://github.com/trsthales/pactx&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NPM:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@trsthales/pactx" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@trsthales/pactx&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to roast the code, open issues, or drop suggestions in the comments. I'd love to hear how you currently manage context drift in your own AI workflows.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>git</category>
      <category>llm</category>
    </item>
    <item>
      <title>Tired of having to configure the project every time?</title>
      <dc:creator>Thales Souza</dc:creator>
      <pubDate>Sun, 25 Jan 2026 09:10:07 +0000</pubDate>
      <link>https://dev.to/thalesstackforge/tired-of-having-to-configure-the-project-every-time-4201</link>
      <guid>https://dev.to/thalesstackforge/tired-of-having-to-configure-the-project-every-time-4201</guid>
      <description>&lt;p&gt;After spending 1-2 weeks configuring a project before actually starting it, I decided to create a SaaS builder. Initially, it was just CRUD operations, but recently I implemented a text-to-code functionality where the user writes the business logic and the implemented system in natural language. To organize my ideas, I've compiled some articles on a blog: &lt;a href="https://blog.thalesouza.com.br/" rel="noopener noreferrer"&gt;https://blog.thalesouza.com.br/&lt;/a&gt;. Tell me, what do you think about this time we spend just configuring projects?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
