<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amir Abaris on Medium]]></title>
        <description><![CDATA[Stories by Amir Abaris on Medium]]></description>
        <link>https://medium.com/@thisisamirabaris?source=rss-2d0a0c47f350------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SWhuJEaxe_d1W33t</url>
            <title>Stories by Amir Abaris on Medium</title>
            <link>https://medium.com/@thisisamirabaris?source=rss-2d0a0c47f350------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:40:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thisisamirabaris/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Built an Open Source Webhook Toolkit With AI, and Then Real Reality Hit]]></title>
            <link>https://medium.com/@thisisamirabaris/i-built-an-open-source-webhook-toolkit-with-ai-and-then-real-reality-hit-76f35f65d1dc?source=rss-2d0a0c47f350------2</link>
            <guid isPermaLink="false">https://medium.com/p/76f35f65d1dc</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Amir Abaris]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 09:55:08 GMT</pubDate>
            <atom:updated>2026-11-07T09:55:08.389Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>What building webhook-kit taught me about code generation, security audits, and the real hard part of open source: visibility.</strong></h4><p>A few weeks ago, I set out to solve a recurring headache: handling webhook verification cleanly across different runtimes. Most official SDKs are heavy, tie you to Node.js, and pull in hundreds of dependencies. All I wanted was a lean, zero-dependency library using the standard Web Cryptography API that could run on Node, Cloudflare Workers, Next.js, or Fastify without breaking a sweat.</p><p>That is how @amirabaris/webhook-kit was born.</p><p>I decided to build it using modern agentic workflows. It was one of the fastest development sprints I have ever had, but it also exposed two big truths that we do not talk about enough: AI will write code that looks finished when it is actually fragile, and building the software is only twenty percent of the open source equation.</p><p>Here is what actually happened during the build.</p><h3>pstack and T3 Code</h3><p>To get the project off the ground, I used potato stack (pstack) alongside T3 Code.</p><p>If you have spent any time working with AI coding tools, you know the biggest failure mode is context drift. Agents forget what they decided ten minutes ago, invent weird patterns, or overcomplicate basic tasks.</p><p>pstack kept the agent grounded. It gave the process guardrails, clear roles, and focused reasoning budgets so the assistant was not wandering off into the weeds. Pair that with T3 Code, and the developer experience felt genuinely seamless. The feedback loop was fast, terminal management was painless, and orchestrating tasks felt natural rather than like wrestling with an IDE extension.</p><p>Using this setup, the boilerplate, initial provider bindings for Stripe, GitHub, and Shopify, and the build setup were up in record time.</p><p>Then I actually reviewed the structure.</p><h3>The Messy Directory Problem (and How Review Fixed It)</h3><p>One of the first red flags appeared right in the file tree.</p><p>AI agents have a bad habit of taking the path of least resistance. When you ask them to build features quickly, they dump everything into giant files. Within a few iterations, src/ turned into a flat dumping ground. I ended up with a 500-line handler.ts, a 600-line stripe.ts, and a 450-line store.ts. Everything was crammed together: type definitions, signature parsers, verification algorithms, and utility helpers.</p><p>It worked and the tests passed, but it was an architectural mess. Left unchecked, the codebase would have become impossible to maintain.</p><p>This is where human code review became essential. The agent did not realize the structure was bad because the compiler was happy. I had to step in as the reviewer, diagnose the sprawl, and give the agent clear architectural feedback. I instructed it to break the flat files into dedicated feature directories: src/handler/, src/providers/github/, src/providers/stripe/, and src/store/, separating types, signature parsing, verification functions, and common helpers.</p><p>The agent handled the heavy lifting of splitting files and updating imports smoothly once I pointed out the problem. But without that human review, the project would have stayed a tangled collection of monolithic files.</p><h3>Why Human Code Review Saved the Security Model</h3><p>Bad file organization is annoying, but subtle security bugs will kill a project.</p><p>Because webhook-kit deals with cryptographic verification and replay attack prevention, correctness is non-negotiable. If a signature check leaks timing information, or if two identical requests can slip through at the same millisecond, your library fails at its only job.</p><p>When I started doing deep, line-by-line security reviews on the generated code, I found critical gaps:</p><p>First, the replay store had classic Time-of-Check to Time-of-Use (TOCTOU) race conditions. The agent had written a simple check-then-set logic. In a high-throughput environment, two concurrent requests with the same event ID could pass the check simultaneously before either wrote to storage. Through code review, I identified the concurrency risk and had the agent rewrite the store to enforce atomic operations with setNx semantics.</p><p>Second, the timestamp tolerance and parsing logic had edge cases that could allow forged timestamps or cause subtle timing leaks. I had to push for stricter constant-time signature comparisons and explicit memory bounds on cache sizes so malicious actors could not exhaust memory with bogus headers.</p><p>AI can write the code once you tell it what to do, but it does not do threat modeling on its own. That responsibility still sits squarely on the human reviewer.</p><h3>The Real Wall: The Visibility Problem</h3><p>After refactoring the directories, patching the security vulnerabilities, adding full dual-package ESM and CJS support, and publishing v0.1.2, I had a finished product I was proud of. It is lightweight, secure, and fast.</p><p>Then came the silence.</p><p>This is the part nobody warns you about when you start building open source. As software engineers, our comfort zone is technical problem solving. We know how to write algorithms, fix race conditions, configure TypeScript build pipelines, and write tests. We feel productive when we are typing in our terminals.</p><p>Once the repository is public and the package is on npm, that comfort zone vanishes.</p><p>What do you do next? How do you get developers to notice a new utility when giant corporations have established libraries? Where do you share it without feeling like spam? How do you build an audience from zero?</p><p>I know I am not the only developer who feels this way. Many of us can build complex systems in a weekend, but we freeze when it comes to distribution. We assume that if we build something good, people will naturally find it. In reality, discoverability is a completely different skill, and it is usually much harder than writing the code itself.</p><h3>Moving Forward</h3><p>Building @amirabaris/webhook-kit was a fantastic technical experience. It proved that AI agents can dramatically accelerate library development, provided you treat their output with healthy skepticism and subject it to rigorous code review.</p><p>Now, my focus has to shift toward the other half of open source: talking about it, writing about the lessons learned, and figuring out how to connect with developers who actually need it.</p><p>If you are an engineer sitting on a finished side project wondering what comes next, you are not alone. Building it was step one. Figuring out how to show it to the world is the real puzzle, and that journey starts right here.</p><p>If you want to check out the codebase, look at how the verification logic is structured, or try it in your own project, you can find the repository here:</p><p><a href="https://github.com/AmirAbaris/webhook-kit">https://github.com/AmirAbaris/webhook-kit</a></p><p>Feedback, issues, and stars are always welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76f35f65d1dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Secret Sauce to Clean React Forms: A Custom Hook Approach]]></title>
            <link>https://medium.com/@thisisamirabaris/the-secret-sauce-to-clean-react-forms-a-custom-hook-approach-3e667a0380ab?source=rss-2d0a0c47f350------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e667a0380ab</guid>
            <category><![CDATA[react-hook-form]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[zod]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[custom-hook]]></category>
            <dc:creator><![CDATA[Amir Abaris]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 12:00:39 GMT</pubDate>
            <atom:updated>2025-09-12T12:00:39.677Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbVER24pT0hWoer--z60rg.png" /></figure><p>I’ve always admired those co-workers who somehow leave behind components so clean it feels like they live in an alternate universe. Meanwhile, in React, keeping a component clean feels like a daily battle. One day everything reads perfectly, and two days later it mutates into a spaghetti monster so tangled even Italians would refuse to claim it.</p><p>Back when I first started with React, I never separated logic out of my components. If I had a form, say on a sign-in page, everything lived inside that same file — state, handlers, validation, you name it. At first, it was fine. The code was short, readable, and I thought, why complicate things?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bDo72FMNh-wMysH6SLR3A.png" /></figure><p>Looks clean, right? So what’s the point of changing it when it works and reads fine?</p><p>The problem is, code never stays small. Features keep piling on. One input today, another validation tomorrow, then a new API call, then error handling, and before you know it, that once-simple component has mutated into a monster no developer dares to read without coffee and a prayer.</p><p>This is what real-world applications do to your code: they grow. And if you don’t plan ahead, readability gets buried under feature creep. That’s where separation of concerns and custom hooks come in like a hero.</p><p>The rule of thumb? Keep your components dumb — just passing data in and out — and let the heavy lifting (form state, validation, side-effects) live inside a dedicated custom hook. Oh, and remember: most hooks are client-side only. You can’t call them in server components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rHK2zjuSAggT8XrUFHCMQ.png" /></figure><p>Now compare this version. Another dev can look at the hook, see its state, values, and functions, and instantly understand how the form works — instead of digging through spaghetti inside the component itself.</p><p>#react</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e667a0380ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>