<?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 Chamith Madusanka on Medium]]></title>
        <description><![CDATA[Stories by Chamith Madusanka on Medium]]></description>
        <link>https://medium.com/@chamith?source=rss-d3ecd1fb0c54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ka0eBpZtCAvDEXDg6IaChg.png</url>
            <title>Stories by Chamith Madusanka on Medium</title>
            <link>https://medium.com/@chamith?source=rss-d3ecd1fb0c54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 04:44:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chamith/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[Frontier Models Shouldn’t Do All the Work]]></title>
            <link>https://chamith.medium.com/frontier-models-shouldnt-do-all-the-work-d76e2951855e?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/d76e2951855e</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[agentic-coding]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cursor]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 05:42:59 GMT</pubDate>
            <atom:updated>2026-11-15T05:43:23.205Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been using a planner-worker setup for about a year. Cursor’s research confirmed it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xaum2ScEhSu2r57KGW_CQ.png" /></figure><p>For about the last year, I haven’t been using one model for everything. I run a planner-worker setup. On most of my tasks, a higher-end Claude model does the planning. Execution goes to Cursor Composer, or to a lower-tier Claude model.</p><p>The setup works for me. I was already working this way when I read Cursor’s research post on <a href="https://cursor.com/blog/agent-swarm-model-economics">agent swarms and the new model economics</a>. It didn’t change my workflow. It confirmed it — and it put hard numbers behind the part I cared about most: why splitting planning from execution works.</p><p>This isn’t about swarms of a thousand agents. It’s a simpler idea I use in day-to-day work: let an expensive, strong model plan, and let a cheaper, faster model execute.</p><h3>Planning and execution are different jobs</h3><p>Cursor describes two roles, organized around the way large tasks naturally break down.</p><p>Planner agents, powered by the smartest models, split a goal into pieces and delegate them. Worker agents, generally powered by faster and less expensive models, execute those pieces.</p><p>That is the model. The planner is responsible for judgment: what to build, how to decompose it, which trade-offs to make, and what “done” looks like. The worker is responsible for carrying out a narrower, more explicit piece of work.</p><p>When I ask one model to hold the whole problem and implement it at the same time, the work gets fuzzy. When I separate the two jobs, the plan gets sharper, and the execution has less to invent.</p><h3>Why the split holds up on quality</h3><p>Cursor’s explanation for this is about context, not just parallelism.</p><p>When a single agent takes on a complete task, it has to walk the entire tree itself — descending to each leaf while holding its ancestors, its current position, and the wider goal in context the whole time. That’s a good description of why long-running single agents drift. They can focus on the work in front of them and lose the bigger picture, or hold the bigger picture and do a worse job on the piece.</p><p>In a planner-worker setup, those pressures get pulled apart. As Cursor puts it, a planner never implements, so its context never fills with low-level detail. A worker never plans, so it can spend all its context on one narrow piece of work.</p><p>They suspect the ability to scale a swarm comes from this context efficiency more than from parallelism itself. And they note that this efficiency is present at every scale, which is why the same decomposition helps even on moderately sized tasks.</p><p>That last point matters for how I work. I’m not running a browser-from-scratch experiment. I’m working through ordinary engineering tasks. The same split still helps: the planner keeps the constraints and the design decisions, and the worker can go deep on one piece without re-deriving the whole plan.</p><p>There’s a second quality argument in the research, and it’s the one I keep coming back to. Few moments in a large task genuinely require frontier intelligence — the original decomposition, the design decisions, and certain trade-offs. Once a frontier planner has collapsed the ambiguity into a detailed, explicit instruction, less expensive models simply have to follow it.</p><p>In other words, quality doesn’t come from putting the most expensive model on every token. It comes from putting the strong model on the moments that actually need it, and making the instructions clear enough that a faster model can execute them well.</p><p>Cursor tested this directly. They varied which models did which jobs. In some runs, one model handled everything. In others, a frontier model planned while a fast, inexpensive model carried out the work. Every mix produced similar quality, but the costs varied enormously.</p><p>That’s the confirmation I was looking for. The cheaper model isn’t a compromise if the plan is good.</p><h3>The cost is in the work, not the plan</h3><p>The cost numbers in Cursor’s post are from a specific experiment — implementing the SQLite manual in Rust with a swarm, under a fixed time budget — not from a typical pull request. My day-to-day bills don’t look like that. But the shape of the spend is the part that generalizes.</p><p>Costs in those runs ranged from $1,339 for an Opus 4.8 planner with Composer 2.5 workers, to $10,565 when GPT-5.5 handled both roles.</p><p>The token data shows where the difference comes from. Across every run, workers carried at least 69% of the tokens, and over 90% in most. The dollars split differently, because planner tokens cost more. In the Opus 4.8 and Composer 2.5 mix, Opus-as-planner produced a small fraction of the tokens but roughly two-thirds of the cost, while Composer-as-worker handled the vast majority of the tokens for the remaining third of the cost.</p><p>Here’s the comparison that makes the economics obvious. In the run that used GPT-5.5 for both planners and workers, the workers alone cost $9,373. In the run where Opus 4.8 did the planning and Composer 2.5 did the work, the entire worker fleet cost $411.</p><p>That’s the argument in one pair of numbers. Most of the tokens are execution. If you spend frontier prices on that work, you pay frontier prices for the bulk of the job. If a strong planner collapses the ambiguity first, a cheaper model can do it for a fraction of the cost.</p><p>This matches what I see in day-to-day work, even without those exact figures. Planning is a smaller, more expensive slice. Execution is the long stretch. Using a higher-end Claude model to plan, and Composer or a lower-tier Claude model to execute, puts the spend where it actually changes the outcome.</p><h3>Speed follows the same split</h3><p>Cost is the headline in Cursor’s post. Speed is the practical reason I stuck with this setup.</p><p>The worker’s job is the part that takes time: writing the code, running the tests, iterating on the piece in front of it. If that work is done by a faster, less expensive model, the loop tightens. The planner can stay expensive, because it isn’t being asked to type out every file.</p><p>There’s a nuance worth keeping, though. A “better” planner is not automatically a cheaper or faster run. Cursor compared two hybrid setups. The Fable 5 planner ran up a slightly smaller planning bill than the Opus 4.8 planner, despite roughly twice the per-token price, because it used far fewer planning tokens. But the Fable run’s workers went through several times as many tokens, and the run as a whole came out substantially more expensive.</p><p>The planner doesn’t just cost money on its own tokens. It shapes how much work the workers have to do. A tighter, less ambiguous plan can reduce the execution bill. A plan that leaves more for the workers to figure out can erase the savings.</p><p>That’s another reason I keep a stronger model in the planner seat. The point isn’t to spend more on planning for its own sake. It’s to make execution cheaper, faster, and less wasteful.</p><h3>What this looks like on a task</h3><p>Say you’re adding a feature that touches an API, a few UI states, and a couple of edge cases around permissions.</p><p>The planner — in my case, usually a higher-end Claude model — doesn’t start by writing the implementation. It breaks the work down. What are the constraints? What should the contract look like? What should not change? Which pieces can be executed independently? What does a good result look like, and how should it be checked?</p><p>Then a worker — Cursor Composer, or a lower-tier Claude model — takes one of those pieces and implements it. It can spend its attention on the files in front of it, the tests, and the local details, because the plan has already made the important calls.</p><p>If the result is off, I take it back to the planner, tighten the instruction, and let a worker run again. The expensive model stays in the judgment seat. The faster model stays in the execution seat. That’s the loop. On most of my tasks, it’s enough. I don’t need a thousand concurrent agents to get value out of the same idea Cursor is describing at a much larger scale.</p><h3>The research is bigger than this. The lesson doesn’t have to be.</h3><p>Cursor’s post goes well beyond model mix. They rebuilt coordination for swarms that can move at a pace human teams never do, and they show that a better harness produced less thrash and tighter code than an earlier design, in every model configuration they tested.</p><p>That’s important research. It isn’t the part I’m writing about. The part that confirmed my own setup is narrower, and more transferable: planning and execution are different jobs, they benefit from different models, and the quality can hold while the cost and speed change dramatically. I was already working that way. The article gave me a clearer way to explain why.</p><h3>Takeaways</h3><ol><li>Don’t use one model for everything. Planning needs judgment. Execution needs throughput. Those are different jobs.</li><li>Put the strong, expensive model in the planner seat. That’s where decomposition, design decisions, and trade-offs actually require frontier intelligence.</li><li>Let a cheaper, faster model do the work. Once the plan is explicit, most of the tokens are just execution — and that’s where the cost and the time go.</li><li>A good plan is what makes the cheap model good enough. Similar quality across Cursor’s model mixes didn’t come from downgrading the whole system. It came from collapsing ambiguity before execution started.</li><li>Watch what the plan does to the workers. A cheaper planner isn’t a win if it leaves the worker spending several times as many tokens.</li></ol><h3>I was already working this way</h3><p>I didn’t wait for a research post to start splitting planning from execution. For about the last year, higher-end Claude models have been the planner, and Cursor Composer or lower-tier Claude models have been the workers. In my day-to-day work that setup holds up.</p><p>What Cursor’s research did was confirm it, with a much clearer picture of the economics. Most of the tokens are execution. Few of the decisions need a frontier model. If you keep those jobs together, you pay frontier prices for work a faster model could finish. If you split them, you get to keep the judgment and stop spending it on everything else.</p><p>The models will keep changing. The split is the part I’ll keep.</p><p>References: Wilson Lin, <a href="https://cursor.com/blog/agent-swarm-model-economics">Agent swarms and the new model economics</a>, Cursor, July 20, 2026.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d76e2951855e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Can Build Anything. Here’s What Developers Should Focus On]]></title>
            <link>https://chamith.medium.com/ai-can-build-anything-heres-what-developers-should-focus-on-e7314040d074?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7314040d074</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 03:05:26 GMT</pubDate>
            <atom:updated>2026-11-15T03:05:26.745Z</atom:updated>
            <content:encoded><![CDATA[<p>Judgment, orchestration, ownership, broad expertise, and curiosity: the skills that matter once writing code is the easy part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-QPs93LE0PfoqcEw3CSxw.png" /></figure><p>This is the question I’ve been circling in my own work. Not “which model is best,” but what actually matters once AI can implement almost anything you ask it to.</p><p>The tools will keep changing. The models will keep getting faster. What I think will hold up — whether you’re employed, looking for a job, or building something of your own — is a set of five skills.</p><h3>Judgment — knowing what not to build</h3><p>The first skill is judgment. You’ll also hear it described as taste. The idea is the same.</p><p>AI can implement a lot. It has ideas about how to implement something, what the best approach is, and even what to build. But the decision is still yours. Knowing what to build matters. Knowing what not to build matters more.</p><p>That’s harder than it sounds, because AI makes it tempting to build everything — another feature, another mode, another path. Shipping everything is not the same as shipping something valuable. A product that does too much often does less for the user.</p><p>The work is identifying requirements, constraints, and trade-offs, and making calls about all three. That doesn’t mean you stop using AI. Discuss your ideas with it. Discuss your constraints with it. Then you make the call.</p><p>If you want a way to frame the shift, it’s this: developers need to move up the abstraction ladder. The role starts to blend with product ownership — but a more technical kind of product ownership. You still have to see the technical constraints. You still have to decide. If your value is only reviewing what the model produced, you’re working at the layer AI is already strong at. Judgment is the layer above that.</p><h3>Orchestration — stop micromanaging tiny tasks</h3><p>The second skill is orchestration.</p><p>A lot of us started by sitting on one or two Claude Code or Codex sessions, micromanaging tiny isolated tasks and watching the model write code. That works for a while. It doesn’t scale.</p><p>A better pattern, in my view, is a root orchestrator per project — sometimes a few of them. That orchestrator might be a Claude Code or Codex session. It spins up other sessions, manages them, and gets relatively large tasks. How large depends on your experience and the model, and it will keep evolving. The orchestrator is responsible for getting the work implemented.</p><p>That sounds like the agents are doing everything. They aren’t. A lot of this still requires a human: defining the task and the outcome, enabling agents to work efficiently, giving them a way to self-verify, and checking the final work yourself. You should not blindly trust it. Then you decide, iterate, and polish until the quality is actually high.</p><p>The definition step comes first, and it’s not generic. Only you and your team know the constraints that apply to your project.</p><p>Say you’re building a new product. You want to scale almost to zero when traction is low, so you’re not paying huge sums before anyone shows up — and you also need to be able to scale up. You have requirements around reliability, performance, and security. Those are trade-offs, not a wishlist. Even with AI, you can’t have everything built perfectly. If you try, you add layers of complexity until you have a monster that’s hard to maintain — and may not offer the experience you wanted to give users.</p><p>The same thinking shows up at a lower level. Which dependencies do you want? More importantly, how many? With supply chain attacks, that’s not a trivial decision. Zero dependencies has trade-offs of its own. A low number is often the better call — especially if you can reach for a library that doesn’t pull in a pile of other libraries with it.</p><p>Projects are full of decisions like this. Agents don’t get you out of making them.</p><p>Once those decisions are in place, your job is to make sure agents can do theirs efficiently. That starts with rules and the right skills — but not too many. Let them roam freely, in a way that they still can’t harm you or the project: an isolated environment, and no access to a production database they could delete.</p><p>The orchestrator pattern itself is almost surprisingly simple: you tell a Claude Code instance that it is an orchestrator, that it should write down some rules for how to spin up other agents, and that it should do that. The hard part isn’t the prompt. It’s the practice. This way of working is new for all of us, and it will keep changing. The only way to get good at it is to do it, stay current, and keep experimenting.</p><h3>Verification without becoming the bottleneck</h3><p>Making the decisions isn’t enough. You also have to verify the work.</p><p>First, give agents a way to self-verify. That starts with running tests, including unit tests, and goes further. If they’re building a website, they should be able to spin up a browser, look at it, and catch a lot of issues themselves. You also need a setup that enforces strict linting, where agents have to fix lint errors by changing the code, not by loosening the rules.</p><p>Then, when an agent is done, you want a report. An artifact generated as deterministically as possible, so you can trust it — not something hallucinated or “optimized” by the model. It might include diagrams, tables, visualizations, screenshots, or videos of the work. The point is to decide whether you’re happy with the change without reading all the code.</p><p>This is the part that will make some engineers uncomfortable. Reading all the code just won’t work going forward. If you read everything, you become the bottleneck.</p><p>The reports and artifacts have to be good enough to judge whether the work was done the way you wanted, to understand how the codebase is structured, and to see whether problems are still being solved the way they should be. Those artifacts are what let you decide how to continue, what to change, and where to push back.</p><p>This is a skill, not a tool setting. Build demo projects. Push agents to their limits. Find out what works for you. You don’t have to do it all in a day. You do have to work toward it.</p><h3>Ownership — nobody cares that AI messed up</h3><p>Then comes the skill I think a lot of teams are avoiding: ownership.</p><p>Assume you can already work with agents, make the decisions, and verify the work. Then something goes wrong. Whose fault is it? Yours. Of course.</p><p>If you want to be the kind of developer companies hire — or you’re building your own product — you take ownership. You are responsible and accountable. Nobody cares that AI messed something up. You own it.</p><p>The alternative is not going to work. Developers who hand everything off to agents, don’t understand the result, and can’t explain or defend it are not the developers who will win. Not in a company, and most likely not on their own either. As a customer, I don’t care whether a bug came from a model or a human. I care that the product works, and that it’s the product I wanted.</p><p>Don’t just pass AI’s output along. Be a partner that operates at the same level as the work, or above it — and that takes ownership when it fails.</p><p>I’ve written before about this imbalance: AI gets credit for the speed, and you get the blame for the bugs. You can’t hold the model accountable — so you have to hold yourself accountable, on purpose. The people who do this will have an advantage in every environment. The people who don’t will look fast until the first incident.</p><h3>Broad expertise beats a single deep niche</h3><p>The skills above only work if you get good at them: defining requirements, making trade-off decisions, enabling agents to work efficiently, and verifying what they produce. These are new. We were not doing this a few years ago. Technical expertise still matters, though. You can’t understand constraints or make good technical decisions without it.</p><p>What I don’t buy is the idea that the winning strategy, for most developers, is to become a super-deep expert in one domain. There will still be niches, and demand for that kind of specialist. For most of us, I think the better move is to broaden your horizon.</p><p>AI-based learning makes that more realistic than it used to be — whether that’s a structured platform or simply working through a topic with ChatGPT. You may never be the world’s best expert on Docker. But you can build a deeper understanding of Docker, of frontend and backend, maybe of Rust or desktop applications, than you ever had before.</p><p>On top of that broad base, I think you need relatively deep expertise in one area: how to work efficiently with agents. That target will keep moving. Being able to adapt, and to understand what a change means for you, is a skill of its own.</p><p>The point of the breadth is not to know everything. It’s to make educated decisions. You can still nerd out and go deep on a topic. In my experience, though, a purely deep path is the more dangerous bet going forward. Broader knowledge works better.</p><h3>Curiosity is what makes the rest possible</h3><p>The last skill is curiosity.</p><p>All of this is moving quickly. That can be stressful and exhausting. I get that. Trying to meet it with a bit of curiosity — maybe even a bit of excitement — goes a long way. It’s difficult to be excited about something a lot of us are afraid of. That’s obvious, and it’s fine to admit it.</p><p>But AI can also be an enabler. It can unlock creativity that used to be too expensive to attempt. If you wanted to build a video game, it’s easier now than it’s ever been.</p><p>So build things on the side. Push agents to their limits. Try new models. Try a game, or 3D models, or video generation. Don’t only do the bare minimum your job requires. The side projects are not a distraction from the skills above — they’re how you practice them.</p><h3>Takeaways</h3><ol><li>Judgment is the skill underneath everything else. AI can propose and implement. You decide what gets built — and what doesn’t.</li><li>Stop micromanaging tiny agent tasks. Orchestrate larger work, but only after you’ve defined the outcome, the constraints, and the trade-offs.</li><li>Verification has to scale. Give agents ways to self-check, then review deterministic reports and artifacts. If you read every line, you become the bottleneck.</li><li>You own the result. Nobody cares that the model messed up.</li><li>Go broader, then go deep on working with agents. A single narrow specialty is a riskier bet for most developers than it used to be.</li><li>Stay curious on purpose. Side projects and experiments are how the other skills get honed.</li></ol><h3>The work is still yours</h3><p>None of this depends on picking the perfect tool. Claude Code, Codex, ChatGPT — those will change. The skills are more stable: make the call, set the system up so agents can work safely, verify without becoming the bottleneck, and own the outcome.</p><p>It’s a level playing field, and this is new for all of us. You don’t have to absorb it in a day. But these are the skills worth practicing. The implementation will keep getting faster. That doesn’t shrink the job. It moves it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7314040d074" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential React Query Patterns Every Developer Should Know]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://chamith.medium.com/essential-react-query-patterns-every-developer-should-know-8870e9ad391c?source=rss-d3ecd1fb0c54------2"><img src="https://cdn-images-1.medium.com/max/1500/0*I-CfA0MoujXtV4B0.jpg" width="1500"></a></p><p class="medium-feed-snippet">A comprehensive guide to building scalable, maintainable React applications with TanStack Query</p><p class="medium-feed-link"><a href="https://chamith.medium.com/essential-react-query-patterns-every-developer-should-know-8870e9ad391c?source=rss-d3ecd1fb0c54------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://chamith.medium.com/essential-react-query-patterns-every-developer-should-know-8870e9ad391c?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/8870e9ad391c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-query]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Tue, 05 May 2026 18:52:48 GMT</pubDate>
            <atom:updated>2026-05-05T18:52:48.832Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[React Query: Why passing signal to your fetcher isn't enough]]></title>
            <link>https://chamith.medium.com/react-query-why-passing-signal-to-your-fetcher-isnt-enough-6d606e6feda9?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d606e6feda9</guid>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-query]]></category>
            <category><![CDATA[fetch-api]]></category>
            <category><![CDATA[signal]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Sun, 03 May 2026 16:26:15 GMT</pubDate>
            <atom:updated>2026-05-03T16:26:15.710Z</atom:updated>
            <content:encoded><![CDATA[<p>The gap between useQuery and fetchQuery cancellation — and the one-line fix that closes it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xf_TyWTMyBOSwTXb.jpg" /></figure><p><strong>tl;dr</strong> — useQuery cancels stale requests automatically through its observer lifecycle. fetchQuery doesn&#39;t cancel anything unless you call cancelQueries explicitly. The signal is plumbing, not a trigger. It needs something to pull it.</p><p>If you’re using fetchQuery inside an imperative callback — AG Grid&#39;s getRows, a custom search-as-you-type handler, anything outside React&#39;s render flow — you probably need cancelQueries.</p><h3>The bug that led me here</h3><p>We have a server-side AG Grid rendering heterogeneous products. Columns are derived per page from the data in the response, so pagination changes column defs. Standard React Query setup, standard signal passing:</p><pre>const response = await queryClient.fetchQuery({<br>  queryKey: [&#39;products&#39;, searchParams],<br>  queryFn: ({ signal }) =&gt; api.getProducts(searchParams, signal),<br>  staleTime: 30_000,<br>});<br><br>setTotalCount(response.total);<br>setDistinctProductTypes(derivePTs(response.items));</pre><p>Works great until the user double-clicks “next page.” Here’s the race:</p><ol><li>getRows(page=2) fires. HTTP request out.</li><li>User clicks page 3 before the response arrives. getRows(page=3) fires. Second HTTP request out.</li><li>Page 3 response comes back first. State updated. Grid renders page 3 rows.</li><li>Page 2 response arrives late. State overwritten. Grid still shows page 3 rows — but columns now reflect page 2.</li></ol><p>Ghost columns. Missing columns. Refresh fixes it. Reproduction is timing-dependent. Classic.</p><h4>What about the signal?</h4><p>You’d reasonably assume that passing signal to your fetcher would prevent this. Here&#39;s the trap: the signal is plumbing, not a policy. It propagates an abort if something aborts it. Nothing in our code aborts it.</p><h4>Without a signal</h4><ul><li>HTTP request goes out.</li><li>Response comes back regardless of what the UI is doing.</li><li>Your await runs with whatever state the world is in now.</li></ul><h4>With a signal passed to fetch</h4><ul><li>HTTP request goes out.</li><li>If somebody calls controller.abort(), the fetch throws and never resolves.</li><li>Until abort happens, behavior is identical to the no-signal case.</li></ul><p>The signal is a handle. It gives the caller the ability to cancel. It does not cancel on its own.</p><h4>Who pulls the trigger?</h4><p>React Query creates an AbortController per query and passes its signal to your queryFn. The question is: when does RQ call abort() on that controller?</p><h3>useQuery — the observer lifecycle is the trigger</h3><p>useQuery registers an observer when a component mounts. When the query key changes, that observer unsubscribes. When the observer count drops to zero, React Query aborts the signal.</p><pre>function ProductList({ id }: { id: string }) {<br>  const { data } = useQuery({<br>    queryKey: [&#39;product&#39;, id],<br>    queryFn: ({ signal }) =&gt; api.getProduct(id, signal),<br>  });<br>}</pre><p>If id changes from &#39;a&#39; to &#39;b&#39;: the old observer unsubscribes, RQ aborts its signal, the HTTP request throws an AbortError, and a fresh fetch for &#39;b&#39; starts. Nothing to do — the lifecycle drives cancellation automatically.</p><p>One gotcha: if multiple components observe the same key, the query doesn’t cancel until all observers go away. Correct behavior, but it can surprise you.</p><h3>fetchQuery — no lifecycle, no trigger</h3><p>fetchQuery is imperative. There&#39;s no observer, no mount/unmount, no subscription count. React Query has no way to know when you&#39;re &quot;done&quot; with a given fetch.</p><p>So the signal just… sits there. Wired correctly, threaded through to fetch, ready for abort. But nothing ever calls controller.abort(). The plumbing is connected to a dead end. This is the gap.</p><h3>The fix: cancelQueries</h3><p>queryClient.cancelQueries({ queryKey }) walks the query cache, finds matching queries, and calls abort on their controllers. That&#39;s what pulls the trigger.</p><pre>getRows: async params =&gt; {<br>  // Abort any in-flight page fetches. Late responses would<br>  // overwrite state for the page that&#39;s actually visible.<br>  await queryClient.cancelQueries({ queryKey: [&#39;products&#39;] });<br>  <br>  let response;<br>  try {<br>    response = await queryClient.fetchQuery({<br>      queryKey: [&#39;products&#39;, searchParams],<br>      queryFn: ({ signal }) =&gt; api.getProducts(searchParams, signal),<br>      staleTime: 30_000,<br>    });<br>  } catch (error) {<br>    const name = (error as Error)?.name;<br>    if (<br>      name === &#39;AbortError&#39;    // native fetch<br>      || name === &#39;CanceledError&#39;  // axios<br>      || name === &#39;CancelledError&#39; // some RQ internals<br>    ) {<br>      // Superseded by a newer request. Nothing to do.<br>      return { data: [], totalCount: 0 };<br>    }<br>    throw error;<br>  }<br>  setTotalCount(response.total);<br>  setDistinctProductTypes(derivePTs(response.items));<br>  return { data: response.items, totalCount: response.total };<br>}</pre><p>Two things to notice:</p><ol><li>cancelQueries uses a prefix — [&#39;products&#39;], not the full specific key. This cancels any in-flight products fetch regardless of its searchParams.</li><li>The try/catch is mandatory. Depending on your HTTP library, the abort error has a different name. Checking all three spellings is cheap and safer than relying on any single library&#39;s convention.</li></ol><h3>Deciding which API you need</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*6uFJsdMB4_wxywIj-7yGeg.png" /></figure><p>If you can express your fetch as “queryKey derived from props/state,” use useQuery. You&#39;ll avoid the whole category of bug.</p><h3>Takeaways</h3><ol><li><strong>Signal ≠ cancellation.</strong> It’s plumbing. Something must trigger abort.</li><li><strong>useQuery triggers abort via the observer lifecycle.</strong> Component unmounts or query key changes → if nothing else is watching, abort fires.</li><li><strong>fetchQuery has no lifecycle.</strong> You must call cancelQueries yourself, or accept the race.</li><li><strong>Wrap imperative fetches</strong> (cancelQueries → fetchQuery → try/catch) to get race-free behavior from callback-driven data fetching.</li><li><strong>When possible, keep fetches in </strong><strong>useQuery.</strong> The automatic cancellation isn&#39;t a side benefit — it&#39;s one of the core reasons the hook exists.</li></ol><p>The fix is small. But until you see the gap, it’s easy to think “I passed signal, I’m good.” You’re not. The signal is a door. Something has to open it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d606e6feda9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Integrated Claude Code Into Our GitHub Workflow]]></title>
            <link>https://chamith.medium.com/how-we-integrated-claude-code-into-our-github-workflow-97a5db8bcb8e?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/97a5db8bcb8e</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github-workflow]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Sun, 01 Mar 2026 06:51:56 GMT</pubDate>
            <atom:updated>2026-03-02T19:36:57.694Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical guide to using Anthropic’s Claude Code as an AI-powered team member in your development workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42Ku3tn1Wp8ZU-EZ36RTUw.png" /></figure><p>As a software engineer working on a large-scale enterprise platform (Go + React + TypeScript + Terraform), I was looking for ways to reduce the friction in our daily development workflow. Code reviews were piling up, debugging CI failures ate into productive hours, and onboarding new team members to our codebase patterns took weeks.</p><p>Then we integrated <strong>Claude Code</strong> directly into our GitHub repository — and it fundamentally changed how our team operates.</p><p>The biggest game-changer? <strong>Small tasks no longer require checking out code locally.</strong> When a ticket comes in for a minor fix, a small refactor, a small feature — we simply mention @claude on the issue with a clear description. Claude picks it up, creates a branch, makes the fix, runs the tests, and opens a PR. All without any developer pulling the repo, switching branches, or spinning up a local dev environment. It&#39;s like having a teammate who handles the small stuff directly from the ticket queue while the rest of the team stays focused on complex work.</p><p>In this article, I’ll walk you through exactly how we set it up, the real benefits we’ve experienced, and the lessons we learned along the way.</p><h3>What Is Claude GitHub Integration?</h3><p>Anthropic offers an official GitHub Action called anthropics/claude-code-action that lets you bring Claude directly into your GitHub issues and pull requests. Instead of context-switching to a separate AI chat tool, you simply mention @claude in a comment, and Claude responds — with full access to your codebase.</p><p>Think of it as adding an always-available senior engineer to your team who:</p><ul><li>Reads and understands your entire codebase</li><li>Can make code changes, create commits, and open PRs</li><li>Runs your linting, testing, and build pipelines</li><li>Follows your project’s specific coding standards</li><li>Never gets tired of code reviews</li></ul><h3>Our Setup: Two Workflows, One Powerful System</h3><p>We designed our integration around <strong>two separate GitHub Actions workflows</strong>, each serving a distinct purpose.</p><h4>Workflow 1: The General-Purpose Assistant (claude.yml)</h4><p>This is our workhorse. It triggers when anyone mentions @claude in:</p><ul><li>Issue comments</li><li>Pull request comments</li><li>Pull request review comments</li><li>New issues (in the title or body)</li><li>Issues labeled with claude</li></ul><p>Here’s the core trigger configuration:</p><pre>name: Claude Code<br><br>on:<br>  issue_comment:<br>    types: [created]<br>  pull_request_review_comment:<br>    types: [created]<br>  issues:<br>    types: [opened, assigned, labeled]<br>  pull_request_review:<br>    types: [submitted]</pre><p>What makes this powerful is the <strong>conditional filtering</strong>. We ensure Claude only responds to human users — not to itself or other bots:</p><pre>if: |<br>  github.actor != &#39;claude[bot]&#39; &amp;&amp;<br>  github.actor != &#39;dependabot[bot]&#39; &amp;&amp;<br>  github.actor != &#39;github-actions[bot]&#39; &amp;&amp;<br>  (<br>    (github.event_name == &#39;issue_comment&#39; &amp;&amp;<br>     contains(github.event.comment.body, &#39;@claude&#39;)) ||<br>    ...<br>  )</pre><p>This prevents infinite loops where Claude triggers itself — a subtle but critical detail.</p><p><strong>Capabilities</strong>: This workflow gives Claude full read-write access. It can edit files, create commits (with verified signatures!), run make targets, execute tests, and build the project. We explicitly whitelist every allowed command:</p><pre>claude_args: |<br>  --model claude-opus-4-5-20251101<br>  --max-turns 30<br>  --allowedTools &quot;Bash(make build),Bash(make lint-backend),<br>    Bash(make test-be),Bash(go test ./...),<br>    Bash(git *),Read,Edit,Write,MultiEdit&quot;</pre><p>This <strong>allowlist approach</strong> is crucial for security — Claude can only run commands we’ve pre-approved.</p><h4>Workflow 2: The Dedicated Code Reviewer (claude-review.yml)</h4><p>Our second workflow is specifically designed for structured code reviews. It triggers in two ways:</p><ol><li><strong>Comment </strong><strong>@claude-review on any PR</strong> — instant AI code review</li><li><strong>Manual trigger from GitHub Actions UI</strong> — input a PR number and go</li></ol><p>The key difference? <strong>This workflow is read-only.</strong> Claude cannot modify files — it can only read code, run lints and tests, and provide feedback:</p><pre># Read-only tools: No Edit, Write, MultiEdit<br>--allowedTools &quot;Bash(git diff *),Bash(git log *),<br>  Bash(make lint-backend),Bash(make test-be),Read&quot;</pre><p>The review follows project-specific guidelines defined in a custom skill file, covering everything from TypeScript type safety to Go error handling patterns to database migration safety.</p><h3>The Secret Sauce: Custom Skills and CLAUDE.md</h3><p>The integration alone is useful, but what makes it truly powerful for our team is <strong>project-specific customization</strong>.</p><h4>The CLAUDE.md File</h4><p>This is your project’s “brain dump” for Claude. It’s a markdown file at the repository root that Claude reads automatically on every invocation. Ours includes:</p><ul><li><strong>Architecture overview</strong> — technology stack, layered architecture, module structure</li><li><strong>Naming conventions</strong> — Go, TypeScript, database, and file naming patterns</li><li><strong>Code change workflow</strong> — the exact sequence (format -&gt; lint -&gt; test) Claude must follow</li><li><strong>API conventions</strong> — REST patterns, error handling, controller patterns</li><li><strong>Testing patterns</strong> — table-driven Go tests, React Testing Library conventions</li><li><strong>Security restrictions</strong> — what Claude must never do</li></ul><p>This means Claude doesn’t just write generic code — it writes code that <strong>matches your team’s patterns</strong>.</p><h4>Custom Skills</h4><p>We created two custom skills in .claude/skills/:</p><p><strong>code-review</strong> — A comprehensive review checklist covering:</p><ul><li>TypeScript type safety (no any types, proper imports)</li><li>React component patterns (functional components, proper memoization)</li><li>Zustand state management conventions</li><li>React Query data fetching patterns</li><li>Ant Design form patterns</li><li>Go error handling and interface injection</li><li>Database migration safety</li></ul><p><strong>lint-fix</strong> — An automated lint-fixing workflow that knows:</p><ul><li>Run formatters before linters</li><li>Fix remaining issues following our specific rules</li><li>Verify everything passes before considering the task complete</li></ul><p>Here’s what your review skills look like in practice. These are just the basics — you can customize and define your own guidelines based on your project’s needs:</p><pre># Code Review Skill</pre><pre>Review the current changes and provide constructive feedback.</pre><pre>## TypeScript<br>- No `any` types - use proper interfaces/types<br>- Type imports must use `type` keyword<br>- Props interfaces prefixed with component name</pre><pre>## React Components<br>- Functional components only (arrow functions preferred)<br>- Use `useMemo` for expensive computations<br>- No array index as keys in lists</pre><pre>## Go Code<br>- All errors must be handled appropriately<br>- Interface injection - thin controllers, thick services<br>- Test coverage for new functionality</pre><pre>## General<br>- No hardcoded secrets or credentials<br>- Follow existing patterns in the codebase<br>- No over-engineering</pre><h3>Real-World Usage Examples</h3><p>Here’s how our team actually uses this day-to-day:</p><h4>1. Implementing Features via Issues</h4><pre>@claude Please implement a new API endpoint for fetching user<br>preferences. Follow the existing patterns in the codebase.</pre><p>Claude will explore the codebase, find similar endpoints, create the controller/service/repository following our established patterns, write tests, and run the linter — all in one interaction.</p><h4>2. Debugging CI Failures</h4><pre>@claude The CI build is failing. Can you check the error logs<br>and suggest a fix?</pre><p>Claude reads the CI logs, identifies the root cause, and either fixes it directly or provides a clear explanation.</p><h4>3. Code Review on Demand</h4><pre>@claude-review</pre><p>One comment on a PR, and Claude delivers a structured review with specific file paths, line numbers, and actionable feedback — following our team’s exact coding standards.</p><h3>The Environment Setup That Makes It Work</h3><p>One detail that’s easy to overlook: <strong>Claude needs the right tools installed in the CI environment.</strong> Our workflow sets up:</p><ul><li><strong>Node.js 22</strong> with pnpm and dependency caching</li><li><strong>Go 1.24</strong> with module and build caching</li><li><strong>golangci-lint</strong> for backend linting</li><li><strong>Nx caching</strong> for frontend build performance</li><li><strong>Frontend dependencies</strong> via pnpm install --frozen-lockfile</li></ul><p>This level of environment preparation ensures Claude can actually build, test, and lint the project — not just read files.</p><p><strong>Setting proper guardrails is very important here. Your claude.md should include all the steps that need to be executed after making a change. For example, Claude should run proper formatting and linting according to the rules defined in our codebase. It should also run tests to detect any breaking changes.</strong></p><h3>Security: Guardrails That Matter</h3><p>We take security seriously. Here’s how we’ve locked things down:</p><h4>Explicit Tool Allowlisting</h4><p>Claude can <strong>only</strong> run commands we’ve pre-approved. No rm -rf, no curl, no Docker commands. Every Bash command is explicitly listed.</p><h4>Repository Restrictions</h4><p>Our CLAUDE.md defines hard restrictions:</p><ul><li><strong>No</strong> modifying workflow files or CI/CD configurations</li><li><strong>No</strong> installing new dependencies without approval</li><li><strong>No</strong> modifying .env files or secrets</li><li><strong>No</strong> pushing directly to main or develop</li><li><strong>No</strong> destructive commands</li><li><strong>No</strong> exposing environment variables</li></ul><h4>Branch Protection</h4><p>Claude creates PRs — it never pushes directly to protected branches. At least one human approval is required before merging.</p><h4>Read-Only Reviews</h4><p>Our review workflow intentionally strips write permissions. Claude can analyze but cannot modify.</p><h4>Commit Signing</h4><p>All commits created by Claude are cryptographically signed:</p><pre>use_commit_signing: true</pre><p>This provides a clear audit trail of AI-generated changes.</p><h3>Benefits We’ve Experienced</h3><p>After months of using this integration, here’s what’s changed:</p><h4>1. Faster Code Reviews</h4><p>What used to take 30–60 minutes of a senior engineer’s time now gets an initial pass in under 5 minutes. Human reviewers can focus on architecture and business logic while Claude catches style issues, missing error handling, and pattern violations.</p><h4>2. Consistent Code Quality</h4><p>Claude enforces our patterns every single time.</p><h4>3. Lower Barrier for New Contributors</h4><p>New team members can ask Claude questions directly in issues or PRs. “How does the authentication middleware work?” gets a thorough, contextual answer — not a generic Stack Overflow link.</p><h4>4. Less Context-Switching</h4><p>Instead of leaving GitHub to chat with an AI, our developers stay in their workflow. The AI comes to them, in the exact context where they need help.</p><h4>5. Automated Tedious Work</h4><p>Linting fixes, formatting corrections, boilerplate code generation — Claude handles the mechanical work so humans can focus on creative problem-solving.</p><h3>Lessons Learned</h3><h4>Start with Read-Only</h4><p>We recommend starting with a review-only workflow before enabling write access. This lets your team build trust in Claude’s understanding of your codebase.</p><h4>Invest in CLAUDE.md</h4><p>The quality of Claude’s output is directly proportional to the quality of your project documentation. A well-written CLAUDE.md is the single highest-ROI investment you can make.</p><h4>Be Specific with Allowed Tools</h4><p>Don’t give Claude blanket access to everything. Whitelist the specific commands it needs. This is both a security measure and a guardrail against unexpected behavior.</p><h4>Use Custom Skills</h4><p>Generic AI is useful. AI that knows your team’s specific TypeScript patterns, your Go error handling conventions, and your database migration rules is <strong>transformative</strong>.</p><h4>Set Reasonable Timeouts</h4><p>We use 15 minutes for general tasks and 10 minutes for reviews. This prevents runaway workflows while giving Claude enough time to do thorough work.</p><h3>Getting Started: The Minimum Viable Setup</h3><p>If you want to try this yourself, here’s what you need:</p><ol><li><strong>Install the Claude GitHub App</strong> on your repository</li><li><strong>Add </strong><strong>CLAUDE_CODE_OAUTH_TOKEN</strong> to your repository secrets (requires a Claude Pro/Max subscription)</li><li><strong>Create </strong><strong>.github/workflows/claude.yml</strong> with the anthropics/claude-code-action@v1 action</li><li><strong>Create </strong><strong>CLAUDE.md</strong> at your repository root with your project&#39;s conventions</li><li><strong>Set up branch protection</strong> on main — require at least one human approval</li><li><strong>Comment </strong><strong>@claude on an issue</strong> and watch the magic happen</li></ol><h3>Final Thoughts</h3><p>Integrating Claude into our GitHub workflow wasn’t just about adding an AI tool — it was about rethinking how we collaborate as a team. Claude handles the repetitive, pattern-matching work that used to eat into our creative hours. It enforces consistency without being rigid. It’s available 24/7 without burning out.</p><p>Is it a replacement for human engineers? Not even close. But as a force multiplier? It’s the best addition to our development workflow in years.</p><p>The code review bot that actually understands your codebase. The pair programmer that never needs a coffee break. The team member who read every line of your CLAUDE.md and actually follows it.</p><p>That’s Claude on GitHub.</p><h3>The Complete Setup Files</h3><p>I’ve published our complete workflow files and custom skills as a GitHub Gist so you can use them as a starting point for your own setup: <br> The gist includes four files:</p><ul><li>claude.yml — General-purpose assistant with full read-write access — <a href="https://gist.github.com/chambits/0410c196c5ff9e7d17ee5c6b0e5e916e">https://gist.github.com/chambits/0410c196c5ff9e7d17ee5c6b0e5e916e</a></li><li>claude-review.yml — Read-only code reviewer for structured PR reviews — <a href="https://gist.github.com/chambits/2015876c228fedb372c5fe50fcf7f811">https://gist.github.com/chambits/2015876c228fedb372c5fe50fcf7f811</a></li><li>code-review-SKILL.md — Custom review guidelines (TypeScript, React, Go, migrations) — <a href="https://gist.github.com/chambits/a1047c08404bf3ab9cd22080e0ae5fc6">https://gist.github.com/chambits/a1047c08404bf3ab9cd22080e0ae5fc6</a></li><li>lint-fix-SKILL.md — Automated format-then-lint workflow — <a href="https://gist.github.com/chambits/9757bd3c583927e627229ba493245ef7">https://gist.github.com/chambits/9757bd3c583927e627229ba493245ef7</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97a5db8bcb8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Is Your New Teammate — And You Can’t Hold It Accountable]]></title>
            <link>https://chamith.medium.com/ai-is-your-new-teammate-and-you-cant-hold-it-accountable-df80b4093df8?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/df80b4093df8</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 17:45:07 GMT</pubDate>
            <atom:updated>2026-02-13T17:45:07.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6tG8C6IgiBXOsKPC" /></figure><p>Imagine you get a new teammate. They’re fast. Impressively fast. They can scaffold an entire service in minutes, write boilerplate you’d spend an afternoon on, and produce code that looks clean at first glance.</p><p>But there’s a catch. They don’t attend standups. They don’t understand why the system is built the way it is. They don’t know about the edge case that took your team down at 2 AM last quarter. And when their code breaks in production — and it will — they won’t be the one paged.</p><p>You will.</p><p>This is the reality of working with AI coding tools in 2026. Not the demo reel version where everything flows seamlessly. The actual, day-to-day experience where AI generates code that <em>you</em> are responsible for, but didn’t fully write and might not fully understand.</p><h4>The Review Burden Nobody Talks About</h4><p>When a human teammate submits a pull request, there’s a shared context. They sat in the same planning meetings. They know the codebase conventions. If something looks off, you can ask them why they made that choice and get a reason rooted in understanding.</p><p>AI-generated code doesn’t come with that context. It comes with confidence. Every output looks polished, well-structured, and plausible. But plausible isn’t the same as correct, and polished isn’t the same as production-ready.</p><p>So now your job as a reviewer has fundamentally changed. You’re not checking a colleague’s reasoning — you’re reverse-engineering intent from output. You’re asking yourself: does this actually solve the problem, or does it just look like it does? Does this fit into our system, or is it a technically correct solution to a slightly different problem? Are there subtle bugs hiding behind the clean formatting?</p><p>This kind of review is harder and more draining than reviewing human code. With a teammate, you can trust their understanding and focus on the logic. With AI, you have to verify the understanding itself — every time.</p><h4>False Velocity</h4><p>Here’s where it gets insidious. Your manager sees that a feature was “implemented” in an hour. The PR is up. The code looks solid. From the outside, it’s a productivity miracle.</p><p>What they don’t see is the three hours you spent afterward: tracing through the generated code to make sure it actually handles the auth flow correctly, catching that it used an approach that conflicts with how the rest of the system manages state, rewriting the error handling because the AI defaulted to generic patterns instead of the custom ones your team uses, and testing edge cases the AI never thought about because it doesn’t know your users.</p><p>The code was generated in minutes. Making it <em>yours</em> — making it something you’d stake your name on in production — took the rest of the day.</p><p>But the story that gets told upward is the first part. “We shipped it in an hour.” And now that becomes the new baseline expectation.</p><h4>The Blame Asymmetry</h4><p>Here’s the dynamic that makes this genuinely unfair: AI gets credit for the speed, and you get the blame for the bugs.</p><p>When things go well, the narrative is that AI-assisted development is transforming productivity. When things go wrong — when the generated code causes an incident, when the edge case slips through, when the architecture doesn’t hold — that’s on you. You reviewed it. You merged it. Your name is on the commit.</p><p>With a human teammate, there’s shared accountability. If they write buggy code and you miss it in review, that’s a conversation between two professionals who both own the outcome. With AI, there’s no other professional. There’s just you and a tool that’s already moved on to the next prompt.</p><p>You can’t put AI on a performance improvement plan. You can’t have a retro where it commits to doing better. You can’t build trust with it over time based on past reliability. Every interaction starts from zero, and every output requires the same level of scrutiny as the first.</p><h4>The Context Gap</h4><p>A good teammate gets better over time. They learn the codebase, absorb the team’s conventions, understand why certain decisions were made. After six months, you trust them differently than you did on day one. That trust is earned through shared context — having been through deployments, incidents, and design debates together.</p><p>AI doesn’t accumulate context in the same way. You can feed it documentation and codebase snippets, but it doesn’t <em>know</em> your system. It doesn’t remember the migration you did last quarter that left certain tables in a transitional state. It doesn’t know that the API contract with the partner team is informally different from what the docs say. It doesn’t know that the “simple” refactor your manager is suggesting was already attempted and abandoned because of a dependency nobody documented.</p><p>So every time you use AI, you’re working with the fastest, most confident junior developer who joined the team this morning. They’ll produce impressive output. But the burden of making sure it actually fits falls entirely on you.</p><h4>What This Actually Means for Your Day</h4><p>The practical reality is this: AI hasn’t reduced your workload. It’s shifted it. Less time writing code from scratch, more time reviewing, integrating, verifying, and explaining.</p><p>And that shift comes with a communication problem. The work of reviewing AI output is invisible. Writing code is visible — there are commits, PRs, lines changed. But the work of catching what the AI got wrong, understanding what it produced, and ensuring it fits the broader system doesn’t show up in any metric.</p><p>If you’re not deliberate about making this work visible, it disappears. And when it disappears, the expectation becomes that AI did the work and you just pressed a button.</p><h4>Working With AI, Not For It</h4><p>None of this means you should stop using AI tools. They’re useful, and they’re not going away. But the framing matters.</p><p>When AI generates code, treat the review with the same seriousness you’d give to code from a contractor who doesn’t know your system. Read every line. Question every choice. Don’t let the speed of generation pressure you into rushing the verification.</p><p>When your manager assumes AI-driven timelines, make the full picture visible. “The generation took twenty minutes. The review, integration, and testing took the rest of the day. Here’s what I caught.” You’d do the same if a human teammate’s quick fix turned out to need significant rework.</p><p>And most importantly, don’t let AI replace the work that builds your own understanding. The developers who will navigate this era best aren’t the ones who delegate the most to AI. They’re the ones who use AI while still building the deep context that lets them know when AI is wrong — because AI won’t tell you when it’s wrong. That’s still your job.</p><p>It always was.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df80b4093df8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Code Auditor to System Designer]]></title>
            <link>https://chamith.medium.com/from-code-auditor-to-system-designer-13c86e95a8dd?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/13c86e95a8dd</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 19:36:51 GMT</pubDate>
            <atom:updated>2026-01-10T19:36:51.344Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How AI is Reshaping the Engineering Role</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QbLmkfkwzmIobf_Xev0aA.png" /></figure><p><em>The paradigm shift that’s separating senior engineers from the rest</em></p><p>The conversation around AI’s impact on software engineering is reaching a critical inflection point. While many engineers worry about AI reducing their role to mere code reviewers, a quieter revolution is happening among those who see AI as a catalyst for elevation rather than replacement. The question isn’t whether AI will change engineering — it already has. The real question is: which type of engineer will you become?</p><h3>The Great Divide: Two Approaches to AI in Engineering</h3><p>A fascinating split is emerging in the engineering community, revealing fundamentally different mindsets about how to work with AI. On one side, you have engineers who approach AI with the mentality of “<strong><em>AI writes code that I review.</em></strong>” These developers have essentially relegated themselves to the role of code auditor — scrutinizing syntax, checking for bugs, and validating AI-generated output.</p><p>On the other side, you have engineers who think in terms of “<strong><em>AI executes plans that I design</em></strong>.” This second group has fundamentally reframed their relationship with AI. They’re not waiting for AI to produce code that needs inspection. Instead, they’re spending their cognitive energy on architecture, edge cases, business logic, and system design — the areas where human judgment and domain expertise create the most value.</p><p>The difference might seem subtle, but it’s profound. The first group is stuck in a reactive posture, while the second has moved into a proactive, strategic role. The first group is fighting to remain relevant in implementation details, while the second is ascending to the level where AI cannot easily follow: complex system thinking and business context.</p><h4>Why ‘Auditor Mode’ is a Trap</h4><p>The code auditor role creates a dangerous illusion of control. Engineers in this mode believe they’re adding value by catching AI mistakes and ensuring code quality. While these activities are necessary, they represent the <em>lowest-leverage</em> use of an engineer’s expertise.</p><p>Consider this: If your primary value proposition is reviewing AI-generated code, you’re competing on the same playing field where AI excels — pattern recognition, syntax validation, and catching common errors. AI models are already quite good at these tasks and will only improve. More importantly, you’re trapped in a race to the bottom, where your role becomes increasingly commoditized with each new AI capability.</p><p>The auditor mindset also creates a psychological trap. It reinforces the fear that AI is coming for your job, because from this perspective, it is. When your role centers on validating implementation details, every improvement in AI code generation feels like a threat rather than an opportunity.</p><h4>The System Designer Advantage</h4><p>Engineers who position themselves as system designers are playing a completely different game. They understand that AI’s real value isn’t in writing code — it’s in <strong>accelerating implementation</strong> of well-designed systems. This shift enables them to operate at a higher level of abstraction and impact.</p><p>System designers spend their time on activities that AI cannot easily replicate:</p><p><strong>Understanding business context and translating it into technical requirements</strong> — AI can write code based on specifications, but it cannot synthesize implicit organizational knowledge, political constraints, or strategic business objectives into coherent system requirements.</p><p><strong>Architecting scalable, maintainable systems</strong> — While AI can suggest architectural patterns, it lacks the long-term thinking required to anticipate how systems will evolve, where bottlenecks will emerge, or how technical decisions will compound over years.</p><p><strong>Identifying and solving edge cases</strong> — AI is trained on common patterns, which makes it excellent for standard scenarios but blind to unusual edge cases that emerge from specific business contexts or user behaviors.</p><p><strong>Making strategic technical trade-offs</strong> — Every technical decision involves trade-offs between competing priorities — performance vs. simplicity, flexibility vs. speed, cost vs. reliability. These decisions require judgment that’s informed by organizational priorities and resource constraints.</p><p>When engineers focus on these higher-order concerns, AI becomes a powerful multiplier. The implementation phase, which used to consume 60–70% of engineering time, can now be dramatically compressed. This creates a virtuous cycle: faster implementation means more iterations, more iterations mean better systems, and better systems mean more business impact.</p><h3>The Velocity Paradox</h3><p>Here’s where things get interesting: The opportunity isn’t just to verify syntax faster — it’s to design systems at higher velocity because implementation itself becomes faster. This creates a fundamental shift in what’s possible.</p><p>In traditional software development, the cost of implementation acts as a natural governor on system complexity. You can’t afford to build systems that are too ambitious or experiment with radical architectural ideas because the implementation cost is prohibitive. AI changes this calculus entirely.</p><p>With dramatically reduced implementation costs, engineers can:</p><p>• Prototype multiple architectural approaches instead of committing to one upfront</p><p>• Build more sophisticated systems that would have been infeasible before</p><p>• Iterate faster on user feedback, closing the gap between design and reality</p><p>• Experiment with novel technical approaches without massive time investment</p><p>This velocity paradox reveals a crucial insight: as implementation gets faster, the <em>bottleneck shifts entirely to design and architecture</em>. The engineers who thrive in this environment are those who can think at the system level and make sound architectural decisions quickly.</p><h3>Senior vs. Junior: Navigating the Shift</h3><p>Perhaps the most fascinating aspect of this transition is how differently senior and junior engineers are adapting to this new paradigm. The patterns that emerge reveal important lessons about navigating technological disruption.</p><h4>The Senior Engineer Advantage</h4><p>Senior engineers who embrace the system designer role are experiencing a renaissance. They possess exactly the skills that become more valuable in an AI-augmented world:</p><p><strong>Pattern recognition across domains</strong> — Years of experience give them an intuitive sense of what works, what fails, and why. They can spot potential issues in system designs long before they manifest.</p><p><strong>Deep technical judgment</strong> — They understand not just how systems work, but why certain architectural decisions lead to long-term success or failure.</p><p><strong>Organizational context</strong> — They know how to navigate organizational complexity, understand stakeholder needs, and design systems that work within real-world constraints.</p><p>However, some senior engineers struggle with the transition. Those who built their identity around implementation speed or coding prowess find themselves uncomfortable in a world where these skills matter less. The key for senior engineers is recognizing that their value has always been in their judgment and experience — AI just makes this more obvious.</p><h4>The Junior Engineer Challenge</h4><p>Junior engineers face a more complex challenge. Traditionally, implementation work served as a training ground where they built intuition about system behavior, learned to anticipate problems, and developed debugging skills. If AI handles most implementation, how do junior engineers develop these crucial capabilities?</p><p>The answer lies in deliberate practice with intentionality. Junior engineers who succeed in this new environment:</p><p>• Use AI to explore more complex problems earlier in their career, accelerating their learning</p><p>• Focus on understanding <em>why</em> AI generates certain solutions, building mental models</p><p>• Deliberately work on system design even when they could just implement features</p><p>• Seek feedback on their architectural thinking, not just their code</p><p>The risk for junior engineers is becoming too dependent on AI without building foundational understanding. The opportunity is reaching system-level thinking much faster than previous generations of engineers.</p><h3>Practical Steps for Making the Shift</h3><p>Understanding the shift from code auditor to system designer is one thing; actually making that transition requires deliberate practice and new habits. Here’s how to start:</p><h4>1. Start with ‘Why’ Before ‘How’</h4><p>Before diving into implementation, spend time on problem definition. Ask yourself: What business problem are we solving? What are the constraints? What are the success criteria? This forces you into design thinking before implementation thinking.</p><h4>2. Design the System, Then the Code</h4><p>Create detailed architectural documents before writing code. Map out data flow, identify integration points, consider failure modes, and plan for scalability. Use AI to validate your designs and spot gaps in your thinking, but don’t let AI do the thinking for you.</p><h4>3. Focus on Interfaces and Contracts</h4><p>Define clean interfaces between system components before implementing them. This forces you to think about abstraction boundaries and system decomposition — crucial skills for system designers. Let AI handle implementation details within those interfaces.</p><h4>4. Hunt for Edge Cases Early</h4><p>Make edge case analysis part of your design process. Before implementation, brainstorm unusual scenarios, error conditions, and boundary cases. This is where human creativity outshines AI pattern-matching.</p><h4>5. Review AI Output for System Implications</h4><p>When reviewing AI-generated code, shift your focus from syntax to system-level concerns. Ask: How does this affect system reliability? What are the performance implications? How will this interact with other components? What happens when this fails?</p><h4>6. Build Your Architectural Vocabulary</h4><p>Study system design patterns, architectural principles, and trade-offs. The better your mental models, the more effectively you can guide AI and the faster you can evaluate design options.</p><h3>The Future Belongs to Architects</h3><p>We’re witnessing a fundamental reordering of engineering skills. Implementation expertise — once the defining characteristic of a great engineer — is being commoditized. System design expertise is becoming the new differentiator.</p><p>This doesn’t mean implementation skills are worthless. You still need to understand how systems work at a deep level to design them effectively. But the value chain is inverting. Instead of building expertise by implementing many systems, engineers now need to develop architectural thinking first and use implementation as a tool for validating their designs.</p><p>The engineers who thrive in this new paradigm will be those who can:</p><p>• Think at multiple levels of abstraction simultaneously</p><p>• Translate business problems into elegant technical solutions</p><p>• Anticipate how systems will evolve and fail</p><p>• Navigate complex trade-offs with wisdom gained from experience</p><p>• Communicate technical concepts to diverse stakeholders</p><p>The choice is yours. You can remain in auditor mode, reviewing AI-generated code and hoping your syntax expertise remains valuable. Or you can elevate yourself to system designer, using AI as a powerful tool that amplifies your architectural vision.</p><p>The former path leads to commoditization and anxiety. The latter leads to greater impact, faster innovation, and genuine irreplaceability. AI isn’t shrinking the engineering role — it’s revealing what the engineering role always should have been: designing systems, solving hard problems, and creating lasting value.</p><p>The future belongs to architects. The only question is whether you’re ready to become one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13c86e95a8dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ React Bites #2: Conditional Hooks in React]]></title>
            <link>https://levelup.gitconnected.com/react-bites-2-conditional-hooks-in-react-f3503a99a863?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3503a99a863</guid>
            <category><![CDATA[react-components]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 09:29:55 GMT</pubDate>
            <atom:updated>2025-12-30T03:55:20.445Z</atom:updated>
            <content:encoded><![CDATA[<p>The Component Extraction Pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpjZKdWvjW_aEfRlY6nhaA.png" /></figure><p>React’s Rules of Hooks are strict: hooks must be called in the same order on every render. But what happens when your application logic genuinely requires conditional data fetching based on previous data?</p><p>Here’s a pattern that elegantly solves this problem while staying within React’s constraints.</p><h3>The Problem</h3><p>Imagine you’re building a product details page for an e-commerce site. You first need to fetch the product data, but the product might not exist (invalid ID, deleted product, etc.). If there’s no product, you want to show a “not found” message.</p><p>However, if the product <em>does</em> exist, you need to fetch additional data — like customer reviews and related products — which requires more data-fetching hooks.</p><p>Here’s what the naive approach looks like:</p><pre>function ProductDetails({ productId }: { productId: string }) {<br>  // First query - fetching the product<br>  const product = useSuspenseQuery({<br>    queryKey: [&#39;product&#39;, productId],<br>    queryFn: () =&gt; fetchProduct(productId)<br>  });<br><br>  // Product might be null from the backend<br>  if (!product) {<br>    return &lt;div&gt;Product not found&lt;/div&gt;;<br>  }<br><br>  // ❌ ERROR: Cannot call hooks conditionally!<br>  const reviews = useSuspenseQuery({<br>    queryKey: [&#39;reviews&#39;, product.id],<br>    queryFn: () =&gt; fetchReviews(product.id)<br>  });<br><br>  const relatedProducts = useSuspenseQuery({<br>    queryKey: [&#39;related&#39;, product.category],<br>    queryFn: () =&gt; fetchRelatedProducts(product.category)<br>  });<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{product.name}&lt;/h1&gt;<br>      &lt;p&gt;${product.price}&lt;/p&gt;<br>      &lt;ReviewList reviews={reviews} /&gt;<br>      &lt;RelatedProducts products={relatedProducts} /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>React immediately throws an error: <strong>“React Hook is called conditionally. React Hooks must be called in the exact same order in every component render.”</strong></p><p>The issue is that after the early return when product is null, the reviews and relatedProducts hooks won&#39;t be called. On subsequent renders when the product exists, they <em>will</em> be called. This violates the Rules of Hooks.</p><h3>The Solution: Component Extraction</h3><p>The solution leverages a fundamental principle: <strong>while you can’t render hooks conditionally, you can render components conditionally</strong> — even if those components contain hooks.</p><p>Here’s the refactored version:</p><pre>function ProductDetails({ productId }: { productId: string }) {<br>  // First query - fetching the product<br>  const product = useSuspenseQuery({<br>    queryKey: [&#39;product&#39;, productId],<br>    queryFn: () =&gt; fetchProduct(productId)<br>  });<br><br>  // Early return if no product<br>  if (!product) {<br>    return &lt;div&gt;Product not found&lt;/div&gt;;<br>  }<br><br>  // ✅ Conditionally render a component (not hooks!)<br>  return &lt;ProductDetailsContent product={product} /&gt;;<br>}<br><br>// Separate component that ALWAYS receives a defined product<br>function ProductDetailsContent({ product }: { product: Product }) {<br>  // These hooks are now unconditionally called within this component<br>  const reviews = useSuspenseQuery({<br>    queryKey: [&#39;reviews&#39;, product.id],<br>    queryFn: () =&gt; fetchReviews(product.id)<br>  });<br><br>  const relatedProducts = useSuspenseQuery({<br>    queryKey: [&#39;related&#39;, product.category],<br>    queryFn: () =&gt; fetchRelatedProducts(product.category)<br>  });<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{product.name}&lt;/h1&gt;<br>      &lt;p&gt;${product.price}&lt;/p&gt;<br>      &lt;p&gt;{product.description}&lt;/p&gt;<br>      &lt;ReviewList reviews={reviews} /&gt;<br>      &lt;RelatedProducts products={relatedProducts} /&gt;<br>    &lt;/div&gt;<br>  );<br>}Why This Works</pre><h3>Why This Works</h3><p>The key insight is understanding React’s rendering model:</p><ol><li><strong>ProductDetails renders first</strong> and calls its hook (useSuspenseQuery for the product)</li><li><strong>If </strong><strong>product is null</strong>, ProductDetails returns the &quot;not found&quot; message—no child components render</li><li><strong>If </strong><strong>product exists</strong>, ProductDetails returns &lt;ProductDetailsContent /&gt;</li><li><strong>ProductDetailsContent then renders</strong> and calls <em>its</em> hooks (reviews and related products)</li></ol><p>Within each individual component, hooks are always called in the same order:</p><ul><li>ProductDetails always calls exactly one hook</li><li>ProductDetailsContent always calls exactly two hooks (when it renders)</li></ul><p>The conditional behavior happens at the <em>component</em> level, not the <em>hook</em> level.</p><h3>Type Safety Bonus</h3><p>Notice how ProductDetailsContent is typed:</p><pre>function ProductDetailsContent({ product }: { product: Product })</pre><p>The product prop is typed as Product, not Product | null. This provides excellent type safety—within this component, TypeScript knows that product is always defined. You don&#39;t need any null checks or optional chaining when accessing product.id, product.category, or other properties.</p><p>This makes your code more maintainable and prevents an entire class of runtime errors.</p><h3>When to Use This Pattern</h3><p>This pattern is valuable whenever you have:</p><ol><li><strong>Dependent data fetching</strong>: You need to fetch data B based on data A, but data A might not exist</li><li><strong>Conditional feature access</strong>: You only fetch premium features if the user has access</li><li><strong>Multi-step wizards</strong>: Each step requires different data based on previous selections</li><li><strong>Dynamic content loading</strong>: Show basic content first, fetch detailed content only when available</li></ol><h3>Common Variations</h3><h4>Multiple Conditional Data Sources</h4><pre>function ShoppingCart() {<br>  const cart = useSuspenseQuery(cartQuery);<br><br>  if (cart.items.length === 0) {<br>    return &lt;EmptyCart /&gt;;<br>  }<br><br>  return &lt;CartWithItems cart={cart} /&gt;;<br>}<br><br>function CartWithItems({ cart }: { cart: Cart }) {<br>  // Only fetch shipping options if there are items<br>  const shippingOptions = useSuspenseQuery(<br>    shippingQuery(cart.items)<br>  );<br>  <br>  const inventory = useSuspenseQuery(<br>    inventoryQuery(cart.items.map(i =&gt; i.productId))<br>  );<br>  <br>  // All these hooks run unconditionally within this component<br>  return (<br>    &lt;div&gt;<br>      &lt;CartItems items={cart.items} inventory={inventory} /&gt;<br>      &lt;ShippingSelector options={shippingOptions} /&gt;<br>      &lt;CheckoutButton /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Nested Conditional Components</h3><pre>function OrderPage({ orderId }: { orderId: string }) {<br>  const order = useSuspenseQuery(orderQuery(orderId));<br><br>  if (!order) {<br>    return &lt;OrderNotFound /&gt;;<br>  }<br><br>  return &lt;OrderDetails order={order} /&gt;;<br>}<br><br>function OrderDetails({ order }: { order: Order }) {<br>  const customer = useSuspenseQuery(customerQuery(order.customerId));<br><br>  // Only fetch tracking if order has been shipped<br>  if (order.status !== &#39;shipped&#39;) {<br>    return &lt;OrderSummary order={order} customer={customer} /&gt;;<br>  }<br><br>  return &lt;ShippedOrderDetails order={order} customer={customer} /&gt;;<br>}<br><br>function ShippedOrderDetails({ order, customer }: Props) {<br>  // Tracking data is only fetched for shipped orders<br>  const tracking = useSuspenseQuery(trackingQuery(order.trackingNumber));<br>  <br>  return (<br>    &lt;div&gt;<br>      &lt;OrderSummary order={order} customer={customer} /&gt;<br>      &lt;TrackingInfo tracking={tracking} /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Permission-Based Rendering</h3><pre>function Dashboard() {<br>  const session = useSuspenseQuery(sessionQuery);<br><br>  if (!session.isAuthenticated) {<br>    return &lt;LoginPrompt /&gt;;<br>  }<br><br>  return &lt;AuthenticatedDashboard user={session.user} /&gt;;<br>}<br><br>function AuthenticatedDashboard({ user }: { user: User }) {<br>  const notifications = useSuspenseQuery(notificationsQuery(user.id));<br>  const activities = useSuspenseQuery(activitiesQuery(user.id));<br><br>  if (user.role === &#39;admin&#39;) {<br>    return &lt;AdminDashboard user={user} notifications={notifications} /&gt;;<br>  }<br><br>  return (<br>    &lt;UserDashboard <br>      user={user} <br>      notifications={notifications}<br>      activities={activities}<br>    /&gt;<br>  );<br>}<br><br>function AdminDashboard({ user, notifications }: Props) {<br>  // Admin-only data fetching<br>  const analytics = useSuspenseQuery(analyticsQuery);<br>  const allUsers = useSuspenseQuery(usersQuery);<br>  <br>  return (<br>    &lt;div&gt;<br>      &lt;NotificationBell notifications={notifications} /&gt;<br>      &lt;AnalyticsDashboard data={analytics} /&gt;<br>      &lt;UserManagement users={allUsers} /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>The Underlying Principle</h3><p>This pattern works because of a fundamental aspect of React’s architecture: <strong>components are the unit of composition, not hooks</strong>.</p><p>React’s reconciliation algorithm works at the component level. When you conditionally render a component, React knows to:</p><ul><li>Mount the component (and its hooks) when it appears</li><li>Unmount the component (and clean up its hooks) when it disappears</li><li>Re-render the component when its props change</li></ul><p>This is exactly what React is designed to handle. The Rules of Hooks exist to ensure predictable behavior <em>within</em> a single component’s render cycle, not across the component tree.</p><h3>Performance Considerations</h3><p>An added benefit of this pattern is performance optimization. By extracting conditional data fetching into separate components, you create natural boundaries for React’s rendering:</p><pre>function ProductPage({ productId }: { productId: string }) {<br>  const product = useSuspenseQuery(productQuery(productId));<br><br>  if (!product) return &lt;NotFound /&gt;;<br><br>  return (<br>    &lt;&gt;<br>      &lt;ProductHeader product={product} /&gt;<br>      &lt;ProductDetailsContent product={product} /&gt; {/* Expensive queries */}<br>    &lt;/&gt;<br>  );<br>}</pre><p>If you later want to add loading states or skeleton screens, you can wrap just the expensive component:</p><pre>&lt;Suspense fallback={&lt;DetailsSkeleton /&gt;}&gt;<br>  &lt;ProductDetailsContent product={product} /&gt;<br>&lt;/Suspense&gt;</pre><p>This gives you fine-grained control over loading UX without restructuring your data fetching logic.</p><h3>Key Takeaways</h3><ol><li><strong>You can’t call hooks conditionally</strong> within a single component</li><li><strong>You can render components conditionally</strong>, even if they contain hooks</li><li><strong>Extract conditional logic into separate components</strong> to work around hook restrictions</li><li><strong>Type your extracted components</strong> to guarantee data exists, improving type safety</li><li><strong>This creates natural performance boundaries</strong> for suspense and loading states</li><li><strong>This pattern is fundamental</strong> to building complex React applications with conditional data requirements</li></ol><p>The next time you encounter “Cannot call a hook conditionally,” remember: you’re not trying to make hooks conditional — you’re making <em>components</em> conditional. This shift in thinking is key to mastering React’s composition model and building scalable, maintainable applications</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3503a99a863" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/react-bites-2-conditional-hooks-in-react-f3503a99a863">🍪 React Bites #2: Conditional Hooks in React</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn to Trust Your Tech Team: Why Micromanagement Kills Innovation]]></title>
            <link>https://chamith.medium.com/learn-to-trust-your-tech-team-why-micromanagement-kills-innovation-e68f0fd9f8c2?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/e68f0fd9f8c2</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[micromana]]></category>
            <category><![CDATA[tech-leadership]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 08:25:39 GMT</pubDate>
            <atom:updated>2025-12-23T08:27:33.031Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Delegate Effectively and Give Your Engineers the Freedom to Experiment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*j_N20RpjslKYg5-A.jpg" /></figure><p>The tech industry moves at breakneck speed. What worked yesterday might be obsolete tomorrow. Yet many engineering leaders still cling to outdated management styles that stifle creativity and slow down delivery. The message is clear: if you want to build high-performing tech teams, you need to stop micromanaging and start trusting.</p><h3>The Cost of Micromanagement in Tech</h3><p>Fresh engineering graduates and experienced developers alike are entering an industry transformed by rapid technological change. AI tools, cloud-native architectures, and evolving frameworks mean that the half-life of technical knowledge is shrinking. Despite this, some leaders try to control every technical decision, review every pull request, and dictate every architectural choice.</p><p>The result? Burnout, attrition, and teams that never reach their potential.</p><p>Brilliant engineers thrive under trust-based leadership, while others stagnate under controlling managers. The difference isn’t talent; it’s environment.</p><h3>Essential Qualities for Modern Tech Leaders</h3><h3>Energy: Fuel Your Team’s Momentum</h3><p>Do you bring enthusiasm to sprint planning? Does your presence energize standups? Are you excited about solving complex technical challenges? This isn’t about being hyperactive — it’s about genuine passion for building great software. Energy is contagious and sets the tone for your entire engineering team. When you’re passionate about the work, your team feels it.</p><h3>Curiosity: Stay Technically Relevant</h3><p>In tech, curiosity isn’t optional — it’s survival. Without it, you’ll become technically obsolete fast. Be a voracious learner. Experiment with new frameworks. Read technical papers. Attend conferences. Join developer communities. In a field where new languages, tools, and paradigms emerge constantly, staying curious keeps you relevant and earns your team’s respect.</p><h3>Agility: Embrace Change, Not Just Plan for It</h3><p>Agile isn’t just a methodology — it’s a mindset. The rigid waterfall approaches of the past won’t cut it when requirements shift mid-sprint or a new security vulnerability emerges. Be ready to pivot. Encourage experimentation. Accept that the initial technical design might evolve. Your job isn’t to predict the future perfectly; it’s to build a team that can adapt quickly.</p><h3>Resilience: Create a Safe Space to Fail</h3><p>Code breaks. Deployments fail. Estimates are wrong. That’s software development. Resilience means bouncing back from production incidents and learning from them. More importantly, it means building psychological safety so your engineers can take calculated risks without fear of blame. The best innovations often come from experiments that initially failed.</p><h3>Trust: The Foundation of High-Performance Teams</h3><p>Don’t micromanage your engineers. Trust them to choose the right tools, design the architecture, and solve problems creatively. This doesn’t mean abandoning oversight — it means delegating effectively. Set clear goals, provide context, and then get out of the way. Give your team the freedom to fail, learn, and iterate. Only through trust can you truly delegate and scale your impact.</p><h3>Empathy: Understand Your Engineers’ Motivations</h3><p>What drives your developers? Some crave technical challenges. Others want work-life balance. Some are motivated by learning opportunities, others by impact. Understanding these individual motivations — and the unique challenges each team member faces — is key to building a cohesive, productive team. Professional and personal circumstances affect performance. Empathy helps you support your team holistically.</p><h3>Conviction: Stand Behind Your Technical Decisions</h3><p>I’ve seen tech leaders without strong convictions — they shift with every stakeholder opinion and agree with whoever spoke last. This creates instability and erodes team confidence. While collaboration is essential, don’t be stubborn, but do have conviction. Take a stand on technical architecture, defend your team’s estimates, and push back on unrealistic deadlines when necessary.</p><h3>Humor: The Most Underrated Leadership Tool</h3><p>Humor relieves tension during crunch time. It breaks down barriers in code reviews. It makes retrospectives more honest. From personal experience and countless incident post-mortems, I can say humor is one of the most underrated skills in tech leadership. A well-timed joke during a production outage can keep the team focused and reduce panic.</p><h3>The Bottom Line for Tech Leaders</h3><p>In our fast-changing world, technical domain knowledge alone isn’t enough. You need to be agile, continuously refresh your skills, and adapt to new paradigms. But more than anything, you need to trust your engineers and give them autonomy.</p><p>The micromanager checking every commit message will never build the kind of team that ships innovative products. The leader who trusts their team, provides clear direction, and creates space for experimentation will.</p><p>Learn to let go. Your team is more capable than you think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e68f0fd9f8c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Codebases Agent-Ready]]></title>
            <link>https://chamith.medium.com/making-codebases-agent-ready-61d3fa963009?source=rss-d3ecd1fb0c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/61d3fa963009</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[google-gemini-ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <dc:creator><![CDATA[Chamith Madusanka]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 20:38:54 GMT</pubDate>
            <atom:updated>2025-12-23T04:18:59.208Z</atom:updated>
            <content:encoded><![CDATA[<p>The Real Key to AI Productivity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X9ESM3TRUwo7a5T5" /></figure><p>The landscape of software development is undergoing a fundamental transformation. As AI coding agents become increasingly sophisticated, the bottleneck to their effectiveness isn’t the agents themselves — it’s the organizations trying to use them.</p><h3>The Verification Revolution</h3><p><strong>Andre Karpathy</strong> recently highlighted a crucial insight:</p><blockquote>The frontier of AI-solvable problems is determined by our ability to specify objectives and verify solutions</blockquote><p>This marks a shift from traditional software development, which relies purely on specification (“the algorithm does this, input is X, output is Y”), to automation through verification.</p><p>Software development sits at the perfect intersection of verifiability. It’s why coding agents are the most advanced autonomous systems in the world today. The groundwork laid over decades — unit tests, end-to-end tests, linters, documentation, CI/CD pipelines — provides the verification infrastructure that makes this possible.</p><h3>The Hidden Organizational Gap</h3><p>Here’s the uncomfortable truth: most software organizations operate at 50–60% validation coverage, and that’s fine for human developers. Humans compensate for gaps in automated validation through manual testing, tribal knowledge, and intuition. We tolerate flaky builds, incomplete test coverage, and loosely enforced coding standards because humans are remarkably adaptable.</p><p>But AI agents aren’t.</p><p>When you introduce coding agents into an environment with weak validation, their capabilities collapse. The same codebase that a senior engineer navigates effortlessly becomes a minefield for an agent that relies on explicit verification criteria.</p><h3>The New Development Loop</h3><p>The traditional software development cycle — understand, design, code, test — transforms in an agent-driven environment:</p><ol><li><strong>Specify constraints</strong> and validation criteria</li><li><strong>Generate solutions</strong> that meet those constraints</li><li><strong>Verify</strong> through automated validation and human review</li><li><strong>Iterate</strong> based on feedback</li></ol><p>This specification-driven approach is already emerging across the industry. Tools are introducing “spec modes” and “plan modes” that orient developers around defining what should be built and how it should be validated, rather than building it directly.</p><h3>Eight Pillars of Validation</h3><p>Organizations that excel with AI agents have invested in comprehensive validation across multiple dimensions:</p><ul><li><strong>Formatting validation</strong>: Linters that enforce consistent, high-quality code</li><li><strong>Testing infrastructure</strong>: Comprehensive test suites with high coverage</li><li><strong>Documentation</strong>: OpenAPI specs, agent.md files, architectural decision records</li><li><strong>Type safety</strong>: Strong typing and interface definitions</li><li><strong>CI/CD pipelines</strong>: Automated build and deployment validation</li><li><strong>Code review automation</strong>: Systematic checks for common issues</li><li><strong>Performance benchmarks</strong>: Automated detection of regressions</li><li><strong>Security scanning</strong>: Automated vulnerability detection</li></ul><p>The question isn’t just “Do you have a linter?” but “Is your linter so opinionated that an AI agent will consistently produce senior-level code?”</p><h3>The Compounding Advantage</h3><p>Here’s where it gets interesting: better validation doesn’t just make agents more effective — it creates a compounding feedback loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHf6u2tetm8WU2v4Pweiqg.png" /></figure><p>This cycle accelerates organizational velocity in ways that weren’t possible before. One opinionated engineer who defines rigorous validation criteria can now scale their expertise across the entire organization through agents that enforce those standards.</p><h3>From OpEx to Environment Investment</h3><p>Traditionally, scaling engineering output meant hiring more people. The mental model was straightforward: more engineers = more output.</p><p>With AI agents, there’s a new lever: investing in the development environment itself. Enhancing validation infrastructure enables both human developers and AI agents to be dramatically more productive. The return on this investment compounds as agents both leverage and improve the validation ecosystem.</p><h3>The Real 10x Multiplier</h3><p>Most organizations are debating which coding agent to adopt, spending 45 days comparing benchmarks to find a tool that’s 10% more accurate on SWE-bench.</p><p>This misses the point.</p><p>The real multiplier doesn’t come from picking the perfect tool — it comes from building an organization where <strong>any</strong> good agent can succeed. When you have rigorous validation, you can:</p><ul><li>Let developers choose their preferred tools</li><li>Run multiple agents in parallel</li><li>Decompose large projects into agent-executable subtasks</li><li>Automatically validate and merge low-risk changes</li><li>Achieve true continuous deployment</li></ul><h3>The Path to Autonomous Development</h3><p>Imagine this workflow: A customer reports a bug. Within minutes, a ticket is automatically created and triaged. An AI agent picks it up, implements a fix, runs the full test suite, and submits a pull request. A developer reviews the change in 10 minutes, approves it, and the fix is deployed to production — all within an hour or two.</p><p>This isn’t science fiction. It’s technically feasible today. The limiting factor isn’t agent capability — it’s organizational validation infrastructure.</p><h3>Making the Investment</h3><p>The uncomfortable reality is that AI won’t magically grant you 5–10x productivity gains. You have to build the foundation:</p><ol><li><strong>Audit your validation coverage</strong> across all eight pillars</li><li><strong>Identify gaps</strong> where agents struggle but humans compensate</li><li><strong>Use agents to enhance validation</strong> — they can generate tests, improve linters, and identify validation gaps</li><li><strong>Measure systematically</strong> — track where agents succeed and fail</li><li><strong>Create feedback loops</strong> — better validation enables better agents enables better validation</li></ol><p>Organizations that make this investment now will join the top 1–5% in engineering velocity. Those that don’t will wonder why their expensive AI tools aren’t delivering the promised productivity gains.</p><h3>The Bottom Line</h3><p>Software developers aren’t being replaced — their role is evolving. The future belongs to engineers who curate the environment where software is built, who set constraints, who build automation, and who introduce systematic rigor into their development processes.</p><p>The most successful organizations won’t be those with the best AI tools. They’ll be those that built the best environment for AI tools to succeed in.</p><p>The investment is yours to make. The competitive advantage is yours to capture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61d3fa963009" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>