<?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 Raccoon Runtime on Medium]]></title>
        <description><![CDATA[Stories by Raccoon Runtime on Medium]]></description>
        <link>https://medium.com/@nidhi.14t?source=rss-876cf8d2eca6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BUWRcsWJezGqLTRskgJ_XA.png</url>
            <title>Stories by Raccoon Runtime on Medium</title>
            <link>https://medium.com/@nidhi.14t?source=rss-876cf8d2eca6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:24:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nidhi.14t/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[What Senior Engineers Should Know Before Trusting an Agent Skill]]></title>
            <link>https://medium.com/@nidhi.14t/what-senior-engineers-should-know-before-trusting-an-agent-skill-bfd748c3105a?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfd748c3105a</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 02:31:48 GMT</pubDate>
            <atom:updated>2026-11-27T02:31:48.827Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What the research, plus guidance from Anthropic, OpenAI, and Google, says about when skills help and when they hurt</em></p><p>If you work with an AI coding agent, you probably rely on skills every day, whether you wrote them yourself, installed them from a repo, or got them built into your tool. Anthropic released the format in late 2025, and it’s since been adopted by OpenAI Codex, Microsoft’s Agent Framework, Cursor and GitHub Copilot.</p><p>But adding a skill isn’t automatically a win. A 2026 study tested 98 public skills on real coding tasks. Each task was run twice, once with the skill and once without, to see if the skill made a difference. Most skills made no measurable difference, and a few did worse than nothing: they cut performance by up to 17 points.</p><p>Here’s what the teams who built skills, at Anthropic, OpenAI and Google, and the latest research say about when to reach for one, when not to, and how to check that yours is helping.</p><h3>1. A quick recap</h3><p>Skills exist because of <strong>context rot</strong>. Chroma’s 2025 research found that models get less reliable as their context grows, even on simple tasks. So instead of putting everything in the prompt, a skill packages the know-how for one kind of task into a folder the agent opens only when it needs it. The examples here use a skill for adding AWS Lambda endpoints, shown in full in section 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHf_TzykA5fZWupfkLNYPQ.png" /><figcaption>A skill is just a folder, and only SKILL.md is required</figcaption></figure><p>SKILL.md has two parts. The frontmatter at the top holds a name and a description, and that&#39;s all the agent sees until it needs more. The body below holds the actual instructions.</p><p>The other folders are optional. Scripts are worth calling out: the agent can run a script as a tool and just use its output, without reading the code into context. Anthropic’s PDF skill does this with a script that extracts form fields, so neither the script nor the PDF has to be loaded.</p><p>The agent reads a skill in levels, a design called <strong>progressive disclosure</strong>, and only goes deeper when the task calls for it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJYXxOUx7TGvqz9bLPEq0w.png" /></figure><p>This is why you can install dozens of skills without filling up the context window. Each one costs about 100 tokens until it’s needed. And because Level 3 files load only on demand, a skill can bundle as much reference material as you like.</p><p>It also explains how skills fit next to AGENTS.md. AGENTS.md is always loaded, so it&#39;s for rules that apply to every task: your stack, conventions, hard limits. Skills are for know-how that only matters some of the time.</p><h3>2. The research: most skills don’t help</h3><p>Here’s the fuller picture from that study, <strong>SWE-Skills-Bench</strong>:</p><ul><li><strong>Adding skills barely moved the overall score.</strong> The average pass rate went from 76.6% to 76.9%.</li><li><strong>The best skills added 17.7 points,</strong> mostly by providing steps the agent would otherwise skip.</li><li><strong>The worst cost up to 17.0 points.</strong> The agent followed the skill’s own templates and ignored what the task actually asked for.</li></ul><p>A second 2026 study looked at <em>how</em> skills go wrong and found 307 skill-caused failures. The surprise was where they came from. It usually wasn’t an irrelevant skill loading by accident. It was a relevant-looking skill steering the agent to build something wrong or leave a piece out. The most common cost problem was “excessive procedure”: optional checks in a skill turning into mandatory extra work on every run.</p><p>The lesson isn’t to avoid skills. It’s that a skill is code you’re adding to your agent, so test it like code.</p><h3>3. When to use a skill, and when not to</h3><p>The research points to a simple rule: a skill helps when it gives the agent something it wouldn’t otherwise have or do. If the agent already handles the task well, a skill adds nothing but tokens and risk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LBlXS3iID_KaCzvqKmCfiQ.png" /><figcaption>Should this be a skill? Three questions first</figcaption></figure><p><strong>Use a skill when:</strong></p><ul><li><strong>The task repeats, but not on every task.</strong> Migrations, release notes, adding an endpoint. If it applies to every task, it belongs in AGENTS.md.</li><li><strong>The agent keeps skipping steps.</strong> That’s where the best skills in SWE-Skills-Bench earned their gains.</li><li><strong>The know-how is specific to your team.</strong> Your conventions, your deployment process, how you write IAM policies. The model can’t have learned these in training.</li><li><strong>Part of the job must be exact.</strong> Put that part in a script, so the agent runs it instead of improvising.</li></ul><p><strong>Don’t use a skill when:</strong></p><ul><li><strong>The agent already does the task well.</strong> Try it without a skill first.</li><li><strong>The rule applies everywhere.</strong> “Use strict TypeScript” or “never commit secrets” belongs in AGENTS.mdor in a hook if it must never be broken.</li><li><strong>The agent needs live data or to call a service.</strong> That’s a tool, such as an MCP server. A skill can explain how to use the tool, but it can’t replace it.</li><li><strong>Your skill would fight the task.</strong> The most harmful skills in the research pushed their own templates over what the task asked for. Write guidance with clear limits, not a fixed recipe for every case.</li><li><strong>Your checklist is really optional.</strong> Researchers found skills turning optional checks into mandatory work on every run. Mark optional steps as optional, or leave them out.</li><li><strong>Nobody will keep it up to date.</strong> A skill that describes an API is only as current as its last edit. Give each skill an owner.</li></ul><h3>4. Writing a skill that helps</h3><p>Here’s a skill for a task many backend teams repeat: adding a new API endpoint backed by an AWS Lambda function.</p><pre>add-lambda-endpoint/<br>  SKILL.md<br>  references/iam.md<br>  scripts/check-endpoint.sh<br>  assets/handler-template.ts</pre><pre>---<br>name: add-lambda-endpoint<br>description: Use when adding a new HTTP API endpoint backed by an AWS Lambda function. Not for changing existing endpoints.<br>---<br><br># Adding a Lambda endpoint<br><br>1. Create the handler in src/handlers/&lt;name&gt;.ts, starting from assets/handler-template.ts.<br>2. Register the route in infra/api.ts. One route per handler.<br>3. Grant only the IAM permissions the function needs. Follow references/iam.md.<br>4. Add a unit test next to the handler.<br>5. Run scripts/check-endpoint.sh &lt;name&gt; before saying the task is done.</pre><p>Ask the agent to “add a GET /orders/{id} endpoint,” and it matches the description, loads these five steps, and opens iam.md only when it reaches step 3. On any other task, all it carries is the two-line description.</p><p>The skill folder goes wherever your tool looks for skills, such as .claude/skills/ for Claude Code or .codex/skills/ for Codex.</p><p><strong>What makes a skill work</strong></p><p>The advice from Anthropic and OpenAI lines up closely:</p><ul><li><strong>Spend the most time on the description.</strong> It’s the only part the agent sees up front, so it decides whether the skill loads at all. Say when to use it and when not to.</li><li><strong>Keep </strong><strong>SKILL.md short.</strong> Move details into referenced files the agent opens only when needed.</li><li><strong>Use scripts for steps that must be exact.</strong> Running a script is cheaper and more reliable than having the model work it out each time. Anthropic notes the agent can run a script without loading it into context at all.</li><li><strong>Feed mistakes back in.</strong> When the agent goes off track, add what it should have done to the skill.</li></ul><blockquote><em>A skill can include code the agent will run. Anthropic recommends installing skills only from trusted sources, and reading any third-party skill before you use it.</em></blockquote><h3>5. How to tell if your skill works</h3><p>OpenAI’s guide to testing skills with evals gives a simple recipe:</p><ol><li><strong>Decide what success means before writing the skill.</strong> Check four things: the outcome (did it work?), the process (did it use the skill and follow the steps?), the style (does it follow your conventions?), and efficiency (no wasted commands or tokens).</li><li><strong>Write 10 to 20 test prompts.</strong> Include ones that should trigger the skill, and at least one that shouldn’t. That “negative control” catches a skill loading when it isn’t wanted.</li><li><strong>Score with code where you can.</strong> Did npm install run? Does the file exist? These checks are fast and exact.</li><li><strong>Use a rubric for the rest.</strong> For qualities code can’t check, have a model grade the result against a short written rubric.</li><li><strong>Rerun on every change</strong> to the skill, and turn every manual fix into a new test case.</li></ol><p>For the Lambda skill above, a minimal test set might be: “add a GET /orders/{id} endpoint” (should trigger), “add a POST /refunds endpoint” (should trigger), and “rename the orders table” (should not). The checks: the handler file exists, the route is registered, the test passes, and the IAM policy grants no wildcard permissions.</p><p>Google holds its own skills to the same bar. Authors of its official skills must submit evaluation prompts and scoring rubrics, and every new skill is tested internally before launch.</p><p>Skills are one of the most useful ways to work with AI agents. Just treat each one like any other code your team ships: don’t trust it until you’ve seen it help.</p><p><em>If this was useful, follow me for more on AI coding agents, cloud and backend engineering.</em></p><h3>Sources</h3><ul><li><a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills">Equipping agents for the real world with Agent Skills</a>, Anthropic, October 2025</li><li><a href="https://research.trychroma.com/context-rot">Context Rot: How Increasing Input Tokens Impacts LLM Performance</a>, Chroma, July 2025</li><li><a href="https://developers.openai.com/blog/eval-skills">Testing Agent Skills Systematically with Evals</a>, OpenAI, January 2026</li><li><a href="https://cloud.google.com/blog/topics/developers-practitioners/behind-the-scenes-how-we-build-test-and-scale-google-agent-skills">Behind the scenes: How we build, test, and scale Google Agent Skills</a>, Google Cloud, August 2026</li><li><a href="https://arxiv.org/abs/2603.15401">SWE-Skills-Bench: Do agent skills actually help in real-world software engineering?</a>, arXiv, 2026</li><li><a href="https://arxiv.org/abs/2608.11888">Agent skills can be harmful: An empirical study of skill-induced failures in LLM agents</a>, arXiv, 2026</li><li><a href="https://agentskills.io/">Agent Skills specification</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfd748c3105a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your SDLC Wasn’t Built for AI Agents. Google’s Agentic Engineering Playbook Is.]]></title>
            <link>https://dispatch.jsipe.com/your-sdlc-wasnt-built-for-ai-agents-google-s-agentic-engineering-playbook-is-8674ea3d866b?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8674ea3d866b</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 03:28:45 GMT</pubDate>
            <atom:updated>2026-11-24T03:28:45.048Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A visual walkthrough of Google’s whitepaper, The New SDLC With Vibe Coding</em></p><p><em>This is my summary of the paper and my take on it. You can read the full version for free on </em><a href="https://www.kaggle.com/whitepaper-the-new-SDLC-with-vibe-coding"><em>Kaggle</em></a><em>.</em></p><p>In my everyday work, I coordinate with other developers, and we all use AI coding agents. Writing code got fast. Coordinating it did not. Every developer prompts differently; the code looks fine in a demo, and the review and integration work lands on the team later. That’s what drew me to this paper. It names the problem clearly and lays out a lifecycle that fixes it.</p><p>Most of us now code by describing what we want and letting an AI write it. Google’s new whitepaper, <em>The New SDLC With Vibe Coding</em> by Addy Osmani, Shubham Saboo and Sokratis Kartakis, asks a simple question: if that’s how code gets written now, what should the rest of the software lifecycle look like?</p><p>The paper opens with how fast this has happened. It cites figures that, as of early 2026, 85% of professional developers use AI coding agents regularly, 51% use them daily, and about 41% of new code is AI-generated.</p><p>Its answer fits in one line: the paper’s own closing sentence:</p><blockquote><strong><em>“Generation is solved. Verification, judgment, and direction are the new craft.”</em></strong></blockquote><p>Vibe coding is fine for prototypes. For anything your team ships, the paper’s answer is agentic engineering, with a lifecycle built around it. Here’s what that lifecycle looks like, and the mistakes the paper warns teams about along the way.</p><h3>1. Vibe coding and agentic engineering are two ends of one line</h3><p>Andrej Karpathy coined “vibe coding” in February 2025: prompt in plain English, accept the output without reading it closely, and paste any errors back in. The term spread so fast it started to mean any AI-assisted coding at all. So Karpathy later added “agentic engineering” for the disciplined end.</p><p>The paper puts both on a spectrum, with a middle step it calls structured AI-assisted coding:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxmMLOAV-HhhTucwJ2Hkcg.png" /></figure><p>Which one fits depends on the stakes. A weekend prototype can be pure vibe coding. A production payments API can’t.</p><p>What moves you along the line is <strong>verification</strong>. Tests check the deterministic parts. Evals check the non-deterministic parts: which tools the agent chose, the path it took, and the quality of its answer.</p><blockquote><em>The paper says that without both tests and evals, it’s still vibe coding, however sophisticated your prompts are.</em></blockquote><h3>2. Context matters more than clever prompts</h3><p>The paper calls context engineering “the bridge” between vibe coding and agentic engineering. What the agent knows shapes the output more than how cleverly you phrase the ask.</p><p>It sorts context into six types: <strong>instructions</strong>, <strong>knowledge</strong>, <strong>memory</strong> (this session and the project over time), <strong>examples</strong>, <strong>tools,</strong> and <strong>guardrails</strong>. Then it splits them by when they load:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25zdVGOZvZNdcE8FSgyHmw.png" /><figcaption>Where you draw the line between the two is an architecture decision: review it and version it like code.</figcaption></figure><p>The paper’s preferred pattern for dynamic context is <strong>Agent Skills</strong>: small packages of know-how the agent loads only when a task needs them. At startup, the agent sees just a short description. The full instructions load when a task matches, and heavy reference material loads only if it’s needed.</p><p>A useful test from the paper: what would a new team member need to know to do good work here? That’s what belongs in context.</p><p>Here’s what that looks like on a typical TypeScript and Node project.</p><p><strong>Static: a short </strong><strong>AGENTS.md.</strong> It loads on every turn, so keep it to rules that always apply.</p><pre># AGENTS.md<br>- Stack: React, TypeScript, Node.js, PostgreSQL<br>- Run `npm test` before saying a task is done<br>- Never edit files in /generated<br>- Use the shared logger, not console.log<br>- Ask before adding a new dependency</pre><p><strong>Dynamic: a skill for a task you only do sometimes.</strong> It sits in your tool’s skills folder (for example, .claude/skills/) and loads only when needed.</p><pre>---<br>name: db-migration<br>description: Use when creating or changing a database migration.<br>---<br>1. Create the file with `npm run migrate:new &lt;name&gt;`.<br>2. Every migration needs a matching down migration.<br>3. Never drop a column in the same release that stops using it.<br>4. Follow examples/add-column.sql for naming and style.</pre><p>At startup, the agent sees only the one-line description. Ask it to “add a status column to orders,” and it matches the skill, loads the four steps, and opens the example file only if it needs to. On every other task, those instructions cost nothing.</p><h3>3. The new SDLC: fast in the middle, slow at the edges</h3><p><strong>This is the heart of the paper, and where the old lifecycle stops fitting.</strong></p><p>It was built for a world where writing code was the slow part. AI compresses implementation dramatically. But requirements, architecture, and verification still move at human speed, because they need judgment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7gM0zI9TVB0H_lFa-sFuw.png" /><figcaption>The paper expects compression to spread into specs, review and deployment within about a year.</figcaption></figure><p>Here’s what changes in each phase:</p><ol><li><strong>Requirements and planning.</strong> Becomes a conversation with the AI. It drafts user stories, finds edge cases, proposes API schemas, and builds a prototype from the spec.</li><li><strong>Design and architecture.</strong> Stays the most human phase. Trade-offs depend on business context the model can’t see. You make the structural decisions and write them down; the AI implements them and enforces conventions.</li><li><strong>Implementation.</strong> Agents write features and multi-file changes. Your job moves from writing code to reviewing, guiding, and verifying it.</li><li><strong>Testing and QA.</strong> Tests and evals become the main way you tell the agent what “correct” means. Check both the output and the trajectory, the steps it took to get there.</li><li><strong>Code review and deployment.</strong> AI does a first pass for bugs, style, security, and performance. Humans still judge the design.</li><li><strong>Maintenance.</strong> Agents can work through legacy code and do the migrations and API upgrades teams kept putting off.</li></ol><blockquote>In the paper’s words: “The productivity gains are real: industry surveys report 25 to 39% productivity improvements, with some tasks seeing larger gains. A study by METR found that experienced developers using AI assistants actually took 19% longer on certain tasks, largely because of the time spent verifying, debugging, and correcting AI output.” That study used early-2025 tools. METR’s February 2026 follow-up found developers are likely faster with AI now, though it couldn’t measure by how much.</blockquote><blockquote><strong><em>Watch out:</em></strong><em> The paper warns that a fluent answer that skipped its checks is more dangerous than one with a visible error. The visible error gets caught.</em></blockquote><h3>4. You’re building the factory, not the code</h3><p>The paper’s “factory model” says your main output is no longer code. It’s the system that produces code: specs and context, agents, tests and quality gates, feedback loops that send failures back to the agent, and guardrails. You give agents success criteria, not step-by-step instructions.</p><p>The machinery around the model has a name: the <strong>harness</strong>.</p><p>Agent = Model + Harness. Most failures live in the harness</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PHHNpq30k8I5ciWjwC_UMQ.png" /></figure><p>The model comes from a provider. The harness is yours. The paper shows how it maps onto the SDLC:</p><ol><li><strong>Planning:</strong> you configure it. Write the rule files, set the architecture constraints, decide which tools the agent may use.</li><li><strong>Implementation:</strong> you run it. Generated code runs in a sandbox, and file reads and searches go through the harness’s tools.</li><li><strong>Testing:</strong> it closes the loop. Test failures are caught and sent back to the model to try again.</li><li><strong>Review and deployment:</strong> you observe it. Hooks block risky actions, like a commit with a hard-coded password. Traces show cost, latency, and why the agent made a decision.</li></ol><p>The harness has a big effect. On the Terminal Bench 2.0 benchmark, one team moved a coding agent from outside the top 30 into the top 5 by changing only the harness. A LangChain study gained 13.7 points the same way, with the model unchanged.</p><blockquote><em>Don’t blame the model first. The paper puts it bluntly: “Most agent failures, examined honestly, are configuration failures.” Look for a missing tool, a vague rule, a missing guardrail or a noisy context window.</em></blockquote><h3>5. Your role: from conductor to orchestrator</h3><p>The paper finds coding agents in three places, often used together:</p><ul><li><strong>In the editor:</strong> inline completion and chat, keeping you in flow (GitHub Copilot, Cursor, Windsurf).</li><li><strong>In the terminal:</strong> agents that edit many files, run tests, and iterate (Claude Code, Codex CLI, Cline). The paper says this is where “serious vibe coding” happens today.</li><li><strong>In the background:</strong> cloud agents that run for hours and hand back a pull request (Google Jules, Copilot agent mode, Cursor background agents).</li></ul><p>How you work with them falls into two modes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FGv7rd1jWrwaOmWebzxaw.png" /></figure><p>Neither mode is better. Pick by the task. But orchestrating takes different skills: writing a spec clear enough to hand off, breaking work into the right-sized pieces, and judging results quickly.</p><blockquote><strong>The 80% problem.</strong> Agents get you about 80% of a feature fast. The last 20%, edge cases, error handling and integration, needs context the model usually doesn’t have. The paper notes AI errors have moved from syntax mistakes to wrong assumptions about the business. Those are harder to catch because the code looks right and may pass basic tests.</blockquote><h3>6. The real cost: speed now, debt later</h3><p>The paper tells leaders to measure total cost of ownership, not velocity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*erk9-ZoMzQthKDMsk36BnQ.png" /><figcaption>Vibe coding starts cheap and gets expensive. Agentic engineering is the reverse. Conceptual sketch after Figure 9 of the paper. Not to scale.</figcaption></figure><p>Vibe coding looks cheap: a subscription and some casual prompts. The paper names three costs that pile up after that:</p><ul><li><strong>Token burn.</strong> Big unstructured files go into context, and the model keeps fixing its own unchecked mistakes. Few things work on the first try.</li><li><strong>Maintenance tax.</strong> Ad-hoc code has no consistent structure. Months later, someone spends days working out what it does.</li><li><strong>Security fixes.</strong> Without automated checks, vulnerabilities get generated as fast as features, and fixing them in production costs far more than catching them in design.</li></ul><p>Agentic engineering flips this. You pay up front for API schemas, tests and structured context. After that, each feature costs less.</p><p>The paper also gives two ways to cut the bill:</p><ul><li><strong>Send less context.</strong> A short, precise AGENTS.md plus skills that load on demand gets more right on the first try.</li><li><strong>Route by difficulty.</strong> Use large models for requirements, architecture, and first implementation. Use smaller, cheaper ones for test generation, code review, and CI monitoring.</li></ul><blockquote>Sending a 100,000-token repo with every prompt is, in the paper’s words, financially unviable at scale.</blockquote><h3>7. The playbook: where to start</h3><p>The paper ends with practical steps for three audiences. A short version:</p><p><strong>If you’re a developer</strong></p><ol><li>Create an AGENTS.md (or your tool&#39;s equivalent) with about ten lines: your stack, conventions, hard rules, and workflow. Add a rule every time the agent gets something wrong.</li><li>Write tests and evals <em>before</em> you generate code. They’re your contract with the AI.</li><li>Review every line that ships. Check that imports are real packages and that error handling covers real failures.</li><li>Keep your core skills sharp: debugging, system design, performance.</li></ol><p><strong>If you lead a team</strong></p><ol><li>Treat AGENTS.mdprompts, evals, and skills as code: reviewed, versioned, owned.</li><li>Set the bar at the eval, not the demo. No agent ships into a shared workflow without eval coverage.</li><li>Make the line between prototype and production explicit. In the paper’s words, teams that keep it blurry “produce prototypes that ship by accident.”</li></ol><p><strong>If you run an organization</strong></p><ol><li>Build the basics before scaling: evals in CI, traces of every run, scoped permissions per agent, security review for generated code.</li><li>Adopt open standards: MCP for tools, A2A for agent-to-agent hand-offs.</li><li>Hire for judgment: specification, evaluation, architecture and review.</li></ol><h3>The takeaway</h3><p>The whole playbook comes down to three principles:</p><ol><li><strong>Structure scales, vibes don’t.</strong> Vibe coding is great for exploring. Software your company depends on needs specs, tests, guardrails and human oversight of the architecture.</li><li><strong>AI amplifies your engineering culture.</strong> Teams with good tests and careful reviews catch AI mistakes early and get real speed. Teams without them just ship their problems faster.</li><li><strong>The human role is changing, not shrinking.</strong> The value moves from writing code to designing the system that writes it.</li></ol><p>As the paper puts it: “The gap between ‘it seems to work’ and ‘it works correctly under all conditions’ is where production outages, security vulnerabilities, and maintenance nightmares live.”</p><p><em>If this was useful, follow me for more on AI coding agents, cloud and backend engineering.</em></p><h3>Sources</h3><ul><li><a href="https://www.kaggle.com/whitepaper-the-new-SDLC-with-vibe-coding">The New SDLC With Vibe Coding</a>, Addy Osmani, Shubham Saboo and Sokratis Kartakis, Google, 2026</li><li><a href="https://addyosmani.com/blog/new-sdlc-vibe-coding/">The New Software Lifecycle</a>, Addy Osmani’s summary of the paper</li><li><a href="https://metr.org/blog/2026-02-24-uplift-update/">We are Changing our Developer Productivity Experiment Design</a>, METR, February 2026</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8674ea3d866b" width="1" height="1" alt=""><hr><p><a href="https://dispatch.jsipe.com/your-sdlc-wasnt-built-for-ai-agents-google-s-agentic-engineering-playbook-is-8674ea3d866b">Your SDLC Wasn’t Built for AI Agents. Google’s Agentic Engineering Playbook Is.</a> was originally published in <a href="https://dispatch.jsipe.com/">Dispatch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Backend Doesn’t Need a Public IP: CloudFront + Internal ALB for Frontend and API Users]]></title>
            <link>https://aws.plainenglish.io/your-backend-doesnt-need-a-public-ip-cloudfront-internal-alb-for-frontend-and-api-users-6610d7dc63de?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6610d7dc63de</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 02:55:59 GMT</pubDate>
            <atom:updated>2026-11-22T03:04:08.712Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I locked down a Node.js backend with </em><strong><em>CloudFront</em></strong><em>, </em><strong><em>WAF,</em></strong><em> and a private </em><strong><em>VPC</em></strong><em>, without breaking the frontend or the APIs.</em></p><p>One of the first backends I shipped was a Node.js app on an EC2 instance with a public IP, a DNS record pointing straight at it, and a security group I thought was tight enough. It worked, and for years I didn’t think about it.</p><p>What changed my mind was the logs. Every so often there were requests that never came through the domain at all. These weren’t targeted attacks, just bots sweeping every public IP and trying the app port to see what answered. None of it got anywhere, but it taught me a simple lesson: “a server with a public address will be found”, and every open port is something you now have to defend.</p><p>Before, hiding a backend behind a CDN meant workarounds: secret headers, IP allow-lists, and a load balancer that was still public. AWS now has a cleaner answer.</p><p>If I were setting up that backend today, this is what I’d build:</p><ul><li>The backend has <strong>no public IP and no public load balancer</strong>.</li><li>My React frontend still calls https://abc.com like before.</li><li>External API users still call https://abc.com with their API keys like before.</li><li>Everything passes through CloudFront and AWS WAF first.</li></ul><p>The piece that makes this clean is <strong>CloudFront VPC origins</strong>, a feature AWS released in November 2024. This article walks through the questions I had along the way, the setup, what WAF actually costs, and the limits I had to check before committing.</p><h3>Where I started</h3><p>My setup was common, and it worked:</p><ul><li><strong>Frontend:</strong> a React build on S3, served through CloudFront.</li><li><strong>Backend:</strong> a Node.js API on EC2 with abc.com pointing at it in DNS.</li><li><strong>Two kinds of callers:</strong> the React app in users’ browsers, and other services that call the API directly with their own keys.</li></ul><p>The problem was the backend. It had a public address, so anyone scanning IP ranges could reach it, skip the domain entirely, and hit open ports. Security groups and app-level checks helped, but the server was still sitting on the internet waiting to be poked.</p><p>I wanted three things: no public IP on the backend, no change for my frontend or API customers, and a firewall in front of everything.</p><h3>Where I ended up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1e_oHhgUbFMBF6Ya0g3kCQ.jpeg" /><figcaption>Diagram: <em>One public entry point. Everything behind CloudFront is private.</em></figcaption></figure><p>Browsers and API clients both resolve abc.com to CloudFront. CloudFront sends static files to S3 and /api/* through a VPC origin to an internal ALB. Nothing inside the VPC is reachable from the internet.</p><h3>The three questions I had</h3><h3>1. “If the backend is private, what URL does my frontend call?”</h3><p>The same one: https://abc.com. Nothing changes in the frontend code.</p><p>What changes is where abc.com points. Today it points at the EC2 instance. After the change, it points at a CloudFront distribution (something like d111111abcdef8.cloudfront.net). CloudFront is public, so browsers can reach it. CloudFront then forwards the request privately into the VPC.</p><p>The browser never knows the backend moved.</p><h3>2. “But abc.com is already set up for my EC2 instance. Do I have to reconfigure it?”</h3><p>Yes, but it’s one DNS record. If you use Route 53, you replace the A record that holds the EC2 IP with an <strong>Alias</strong> record pointing to the CloudFront distribution. With another DNS provider, use a CNAME (or ALIAS/ANAME for a root domain).</p><p>You also need an ACM certificate for abc.com in <strong>us-east-1</strong>, because CloudFront only reads certificates from that region. Attach it to the distribution and add abc.com as an alternate domain name.</p><h3>3. “My API is also called directly by other services. Does that still work?”</h3><p>Yes. CloudFront isn’t only for websites. It forwards any HTTPS request, whether it comes from your React app or from a customer’s server calling your API with a key. Both call https://abc.comand CloudFront passes along:</p><ul><li>every HTTP method (GET, POST, PUT, PATCH, DELETE)</li><li>headers like Authorization and X-API-Key</li><li>query strings and JSON bodies</li></ul><p>So frontend users and API users share one front door, and both get checked by the same WAF rules.</p><h3>Won’t turning off caching for the API slow down my frontend?</h3><p>No. Caching is set per path (or per distribution), not for everything at once.</p><p>API responses should not be cached, so the API route uses the managed CachingDisabled policy. The frontend&#39;s JS, CSS and images should be cached hard. CloudFront handles both through <strong>behaviors</strong>, which are path-based rules.</p><p><strong>Option A: one domain, two behaviors</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3kWGpmcLdIVQLdai8oDWA.png" /><figcaption>Behaviors table: <em>Two behaviors: cache the frontend, pass the API through</em></figcaption></figure><p>AllViewerExceptHostHeader forwards all headers, cookies and query strings to Node.js, except the Host header. That matters because the ALB expects its own host name, not abc.com.</p><p><strong>Option B: two subdomains</strong></p><ul><li>app.abc.com → a distribution for the React app, cached</li><li>api.abc.com → a distribution with the VPC origin and WAF, not cached</li></ul><p>I like Option B when external API customers are involved. It gives the API its own WAF rules, logs and rate limits, and API customers get a clear URL that doesn’t change if the frontend moves.</p><h3>The setup, step by step</h3><p>I did this in an order that kept the old path working until the new one was tested.</p><ol><li><strong>Put an internal ALB in front of Node.js.</strong> Create an Application Load Balancer with scheme <em>internal</em>, in private subnets. Point its target group at your instances on the app port (for me, 3000). CloudFront can target an EC2 instance directly, but an ALB makes health checks, port mapping and zero-downtime deploys much easier.</li><li><strong>Request an ACM certificate in us-east-1</strong> for abc.com (or api.abc.com). Validate it through DNS.</li><li><strong>Create the VPC origin.</strong> In the CloudFront console, go to <em>VPC origins</em> and create one that points at the internal ALB’s ARN. Creation takes a few minutes.</li><li><strong>Allow CloudFront into the ALB’s security group.</strong> AWS creates a service-managed security group for VPC origins in your VPC. Allow inbound traffic from that group on your listener port, and nothing else.</li><li><strong>Create the distribution.</strong> Add abc.com as an alternate domain name, attach the certificate, and set up the behaviors from the table above.</li><li><strong>Test before switching DNS.</strong> Call the *.cloudfront.net domain with curl, including an Authorization header and a POST body. Check that Node.js receives everything it expects.</li><li><strong>Switch DNS.</strong> Point abc.com at the distribution with a Route 53 Alias record (or CNAME elsewhere).</li><li><strong>Close the old door.</strong> Once traffic is flowing through CloudFront, remove public IPs from the instances, move them to private subnets, and remove the old public inbound rules (including port 3000).</li></ol><blockquote>One thing to plan for: a private subnet has no route to the internet, so anything your app <em>starts</em> itself, like calling Stripe, sending email through SES or reading from S3, will fail after the move. A <strong>NAT gateway</strong> fixes this by giving private instances outbound-only internet access. If your app only talks to AWS services, <strong>VPC endpoints</strong> can do the same job without a NAT gateway.</blockquote><h3>Do you still need WAF? (Yes, and it isn’t free)</h3><p>CloudFront includes <strong>AWS Shield Standard</strong> at no extra cost. It absorbs network-level DDoS attacks. It does not read HTTP requests, so it won’t stop SQL injection, scrapers, or someone brute-forcing your login endpoint.</p><p>That’s <strong>AWS WAF</strong>, and it’s a paid add-on. With real users and steady traffic, I treat it as required.</p><h3>A lean starter rule set</h3><p>Create the web ACL in the CloudFront (Global / us-east-1) scope and add:</p><ol><li><strong>A rate-based rule.</strong> Blocks any single IP that sends more than N requests in 5 minutes. Pick N from your real traffic: look at how many calls one heavy user makes, then add headroom. API customers running batch jobs may need a higher limit, or their own rule keyed on API key.</li><li><strong>Core rule set</strong> (AWSManagedRulesCommonRuleSet): common OWASP-style attacks like XSS and path traversal.</li><li><strong>Known bad inputs</strong> (AWSManagedRulesKnownBadInputsRuleSet): exploit patterns such as Log4j probes.</li><li><strong>SQL database</strong> (AWSManagedRulesSQLiRuleSet), if Node.js talks to Postgres or MySQL.</li></ol><p>These four together use about 1,100 of the 1,500 WCUs (capacity units) included in standard pricing.</p><p><strong>Start in Count mode.</strong> For the first day or two, set rules to Count instead of Block. Check the sampled requests for false positives. Rich text, base64 uploads and large JSON bodies sometimes trip the core rule set. Exclude the specific rule that misfires, then switch to Block.</p><h3>What it costs</h3><p>AWS-managed rule groups count as one rule each for billing, at $1/month per rule. Example for 5 million requests a month, using AWS WAF pricing as of November 2026:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLY8Omq-G2OB6Ggx7spbRQ.png" /><figcaption>WAF costs</figcaption></figure><p>That’s before logging and before paid add-ons like Bot Control. Check the <a href="https://aws.amazon.com/waf/pricing/">AWS WAF pricing page</a> for current rates.</p><h3>Limits to check before you commit</h3><p>VPC origins don’t fit every backend. Check these against your API first:</p><ul><li><strong>No WebSockets.</strong> VPC origins don’t support WebSockets. If your app uses wss:// for live updates, that traffic needs another path.</li><li><strong>No gRPC</strong>, and no Lambda@Edge on origin request or origin response events.</li><li><strong>Some load balancers can’t be origins:</strong> Gateway Load Balancers, and Network Load Balancers with TLS listeners. An NLB also needs a security group attached.</li><li><strong>Response timeout.</strong> CloudFront waits 30 seconds for the origin by default. You can raise it, but long values need a quota request. Slow report exports or long-polling endpoints may hit this.</li><li><strong>Region.</strong> VPC origins work in AWS commercial regions only.</li></ul><h3>When a public ALB + WAF still makes sense</h3><p>If any of these describe your API, skip CloudFront for that part and use an internet-facing ALB with WAF attached:</p><ul><li>you depend on WebSockets or gRPC</li><li>some requests regularly run longer than a few minutes</li></ul><p>The instances still sit in private subnets. Only the ALB is public. With WAF attached to the ALB, it’s a solid setup, just with one more public endpoint to think about.</p><h3>How this compares to other common setups</h3><p>VPC origins are the newest of three common setups. The other two are still widely used, so it helps to see them side by side:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVplVC0ylZ7cFcGX-E3ILQ.png" /><figcaption>Comparison table</figcaption></figure><p>The first row follows a simple principle: compute and load balancers live in private subnets, and the only thing on the internet is the edge.</p><h3>Before you go</h3><p>If your backend still has a public IP, bots already have its number. Time to go unlisted and let CloudFront take the calls.</p><p>If this helped, follow me for more practical cloud and backend write-ups like this one.</p><h3>Sources</h3><ul><li><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-vpc-origins.html">Restrict access with VPC origins — Amazon CloudFront Developer Guide</a></li><li><a href="https://aws.amazon.com/about-aws/whats-new/2025/11/amazon-cloudfront-cross-account-vpc-origins">Amazon CloudFront announces cross-account support for VPC origins (Nov 2025)</a></li><li><a href="https://www.repost.aws/knowledge-center/cloudfront-custom-origin-response">How do I increase the response and keep-alive timeout for my CloudFront custom or VPC origin? — AWS re:Post</a></li><li><a href="https://aws.amazon.com/waf/pricing">AWS WAF pricing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6610d7dc63de" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/your-backend-doesnt-need-a-public-ip-cloudfront-internal-alb-for-frontend-and-api-users-6610d7dc63de">Your Backend Doesn’t Need a Public IP: CloudFront + Internal ALB for Frontend and API Users</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anthropic Just Changed 8 Things in the Claude API. Some Will Break Your Code.]]></title>
            <link>https://medium.com/@nidhi.14t/anthropic-just-changed-8-things-in-the-claude-api-some-will-break-your-code-5b4045db846f?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b4045db846f</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 12:55:13 GMT</pubDate>
            <atom:updated>2026-11-09T12:55:13.181Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two Claude features stop working on November 30.</em></p><p><em>Here’s what changed and what to fix.</em></p><p>Anthropic released Claude Opus 5.5 on September 22. Since then, it has shipped a lot more.</p><p>Some updates save you money. Some will break your code. Two features shut down on November 30.</p><p>I read Anthropic’s release notes from September 22 to November 5. Here are the 10 changes that affect code you’re running today. For each one, I explain what changed and what you should do.</p><h3>1. Haiku 5.5 is 10x cheaper</h3><p>Anthropic released Haiku 5.5 on October 7. It’s the small, fast Claude model.</p><p>It costs $0.10 per million input tokens and $0.50 per million output tokens. Haiku 4.5 cost $1 and $5.</p><p>It can also read much more at once: 1 million tokens. Haiku 4.5 could read 200,000.</p><p>There’s one catch. If your prompt is over 100,000 tokens, the price goes up to $0.50 and $2.50.</p><p>Use it for simple jobs. Sorting messages. Pulling data out of text. Small helper agents.</p><h3>2. Haiku 5.5 can break your old code</h3><p>Don’t just change the model name. Haiku 5.5 rejects some settings that Haiku 4.5 accepted.</p><p>These now return a 400 error:</p><ul><li>temperature, top_p, top_k</li><li>budget_tokens</li><li>prefill (writing the start of Claude’s answer for it)</li></ul><p>It also counts tokens differently. The same text now uses more tokens. Check your cost estimates.</p><pre>// Before: Haiku 4.5<br>await client.messages.create({<br>  model: &quot;claude-haiku-4-5&quot;,<br>  temperature: 0,<br>  max_tokens: 1024,<br>  messages,<br>});<br><br>// After: Haiku 5.5 (no temperature)<br>await client.messages.create({<br>  model: &quot;claude-haiku-5-5&quot;,<br>  max_tokens: 1024,<br>  messages,<br>});</pre><h3>3. New SDK versions have breaking changes</h3><p>On October 21, Anthropic released a new API version: 2026-10-21.</p><p>New major SDK versions came with it. Python is now 2.0.0. TypeScript is now 1.0.0. Go, Java, C#, PHP, Ruby and the ant CLI also got new major versions.</p><p>These versions have breaking changes. The license also changed from MIT to Apache 2.0.</p><p>My advice: pin your current version. Read the migration guide first. Upgrade when you’re ready, not by accident.</p><h3>4. Message threads make agents faster</h3><p>Right now, an agent sends the full chat history on every turn. That gets slow as the chat grows.</p><p>With message threads, Anthropic’s server keeps the history. You only send the new messages.</p><p>Smaller requests mean faster replies. It’s in beta since November 2. Turn it on with the message-threads-2026-08-12 header.</p><p>One warning. A thread expires after 5 minutes with no requests. If your agent waits for a person, keep your own copy of the history.</p><h3>5. Requests can be 4x bigger</h3><p>On October 28, the limit for one request went from 32 MB to 128 MB. This is on Anthropic’s own API.</p><p>You may not need to split big PDFs anymore.</p><h3>6. Better tracking for cost and speed</h3><ul><li><strong>OpenTelemetry export:</strong> Anthropic can now export Claude API tracing data to monitoring platforms like Datadog or Grafana. See how long model calls and tool executions take, alongside your application’s existing performance traces. Supports Python, TypeScript, Go, Java, and more. Configure it in the Claude Console.</li><li><strong>Usage and Cost Analytics API:</strong> Programmatically track how many tokens you’re using and how much you’re spending, broken down by model, workspace, API key, or user. Useful for identifying where AI costs are coming from.</li></ul><p>Together, these features make it easier to monitor Claude’s performance and costs alongside the rest of your application.</p><h3>7. New security controls</h3><ul><li><strong>IP allowlist:</strong> only accept API calls from IP addresses you trust. You can add up to 1,000.</li><li><strong>Web fetch controls:</strong> admins can turn off web fetch. Or they can allow only certain websites.</li><li><strong>User profiles:</strong> tag each request with the customer it’s for. If one customer breaks the rules, Anthropic can block just that customer. Not your whole account.</li></ul><p>That last one is big if you run a SaaS app with many customers.</p><h3>8. New apps for Claude users</h3><p>On October 21, Anthropic opened a preview of <strong>Claude Duet</strong>. It’s an app where Claude works for you in the background.</p><p>It checks your connected apps and gets work ready. It asks you first before it sends, pays, signs or deletes anything. For now, it’s only for US Pro and Max users, through a waitlist.</p><h3>What this means</h3><p>The pattern is simple. Claude is getting cheaper and faster. But you get fewer settings to tweak.</p><p>So your job changes. You spend less time tuning the model. You spend more time on the system around it: what it remembers, what it costs, and when a person has to approve.</p><p>Thanks for reading! If this helped, share it with someone who builds with Claude. Questions? Drop a comment. Follow me for more updates like this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b4045db846f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Coding Agents on Real Systems: What They Miss and What I Do Instead]]></title>
            <link>https://medium.com/@nidhi.14t/ai-coding-agents-on-real-systems-what-they-miss-and-what-i-do-instead-0ea6d21cc641?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ea6d21cc641</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Sun, 31 May 2026 20:42:31 GMT</pubDate>
            <atom:updated>2026-05-31T20:42:31.974Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve used Claude Code, Copilot, and Codex extensively across my projects. On a prototype, they’re genuinely fast; You describe what you want, you get working code, you move on. The problem starts when the code isn’t a prototype. When it serves real, high-volume traffic. When the users behind it are real customers whose needs don’t line up with each other, the “obvious” general solution is rarely right for all of them.</p><p>After enough of these projects, the pattern is clear. AI coding agents are excellent <em>local</em> executors and poor <em>global</em> reasoners. They optimize the change in front of them. They don’t hold the system in their head. On a prototype, that gap doesn’t show. On a real system, the gap <em>is</em> the job.</p><p>Here’s what that looks like in practice, and what I do about it.</p><h3>It patches where you point, not where the problem is</h3><p>Ask an agent to stop showing a value on a screen, and it will hide that value in the UI. It usually won’t go to the backend model and the API (it <em>can</em>, if you ask, the point is it doesn’t by default), and stop sending the value in the first place, which is what the actual request was.</p><p>This isn’t laziness; it’s mechanical. The model produces the smallest locally-plausible diff that literally satisfies your words, and it often hasn’t even loaded the layers where the real fix lives. So you get the change at the layer you happened to point at.</p><p>The reason this matters on a real system: hiding a value in the UI doesn’t remove it. The data still travels to the client and sits in the browser’s network tab, readable by anyone. The agent’s “fix” is a data-exposure bug. What looked like a styling tweak shipped a vulnerability.</p><p>The same instinct shows up in refactors. Ask an agent to rename a widely-used function or change its signature, and it’ll update the definition and the few call sites it happens to have loaded:</p><pre>// you ask it to rename `getUser` to `fetchUser` and add a param<br>export function fetchUser(id: string, opts: FetchOpts) { /* ... */ }<br><br>// it updates the 4 call sites in the files it touched<br>fetchUser(id, { cache: true });<br><br>// and leaves the other 20 across the codebase still calling the old name<br>getUser(id); // broken, or quietly resolving to a stale duplicate</pre><p>Now you either have a broken build or, worse, two versions of the same thing coexisting. A human engineer treats “rename this” as “update every reference.” The agent treats it as “make the change compile in what I can see.” It doesn’t reason about global consistency because it wasn’t working from the global picture. Tooling that searches the whole repo first has made this better. <em>This is also where the tool matters, not just the model. I’ve watched Copilot leave dead references behind after a rename, its inline and chat modes work from a narrow window around the file you’re in, not the whole repo, so anything outside that window gets missed. Claude Code’s agentic mode is noticeably better here: it greps the codebase and tends to catch the stragglers Copilot leaves. Better, not solved, on a large repo, it still misses enough that I verify the rename myself rather than trust it.</em></p><h3>It doesn’t have architectural judgment, so it borrows yours at random</h3><p>This one looks like two opposite complaints until you see what’s underneath.</p><p>First case: I asked for a report-generation feature. The agent didn’t ask a single question about expected load, request volume, memory footprint, processing time, or cost. It reached straight for a Lambda function — because Lambda was already heavily used in the codebase and started building. But report generation is heavy compute on a 15-minute timeout-bound, memory-capped runtime. The right move was to ask the questions first and then propose something built for the workload, like ECS, Fargate, or a batch job. The agent didn’t get there<strong> </strong>because it pattern-matched to the most common thing it saw.</p><p>Second case, same week: a scheduled task. The codebase uses NestJS with@nestjs/schedule @Cron is the established convention. The agent ignored it and wrote its own timer:</p><pre>// the codebase convention<br>@Cron(&#39;0 * * * *&#39;)<br>handleHourly() { /* ... */ }</pre><pre>// what the agent wrote instead<br>setInterval(() =&gt; { /* ... */ }, 60 * 60 * 1000);</pre><p>That setInterval has no dependency injection, drifts over time, dies silently on an unhandled error, and is the real-systems killer. The convention exists precisely to avoid all of that.</p><p>So, in one case, the agent clings to an existing pattern where it shouldn’t, and in the other, it ignores an existing pattern it should have followed. The unifying problem isn’t “reuses too much” or “reinvents too much.” It’s that the agent has no stable model of <em>when</em> a convention should be followed versus questioned. It anchors to whatever happens to be salient in the slice of code it loaded, not to what’s correct. Judgment about the right level of abstraction is exactly what it has to be perfected, and exactly what a good engineer is for.</p><h3>It’s blind to state and rollout</h3><p>Agents treat code as text. Real systems are state plus code, deployed to running infrastructure that’s serving live traffic right now.</p><p>So they consistently underweight the things that have nothing to do with whether the code compiles: database migrations and their ordering, data already in flight, backward-compatible API versioning, what a rollback does, and whether the change is safe to deploy gradually. Ask for a schema change, and you’ll get a clean migration that’s correct in isolation and would lock a large table or break older clients mid-deploy. The agent isn’t wrong about the code. It’s missing the entire dimension the code lives in.</p><h3>It builds for one customer, not your customer base</h3><p>This is the one that hurts most when your users are real and different from each other. The agent solves for a single happy path. It picks the most representative case it can infer and builds cleanly for that.</p><p>But on a real product, the variance between customers <em>is</em> the requirement. Per-tenant configuration, feature flags, the customer on a legacy plan, the one with 100x the data volume, and the integration that behaves differently for two accounts. None of that is visible in the code the agent reads, so none of it shows up in the solution. You get something that works beautifully in the demo and breaks for the third customer who doesn’t match the assumed shape.</p><h3>It’s confident and unverified</h3><p>Everything above is delivered with total fluency. The code is well-named, it compiles, and it reads like something a competent engineer wrote. What it usually hasn’t done is run under anything resembling production conditions. “Looks correct” and “correct under load” are different claims, and the agent makes the first one<strong> </strong>with the tone of the second.</p><h3>How to keep the engineer alive</h3><p>The mistake is treating the agent as a junior who’ll grow into the judgment. It won’t, structurally — it doesn’t hold the system in its head between sessions. So the job shifts. You stop being the person who writes the code and become the person who supplies the judgment that the agent can’t. Concretely:</p><p><strong>Encode your standing judgment once, not per prompt.</strong> Better prompts help, but you’ll retype them forever. Put the rules where the agent reads them every time a CLAUDE.md or equivalent rules file: &quot;Heavy or long-running compute goes to ECS/Fargate, not Lambda. Never hide data client-side; remove it at the source. Flag any DB migration for review.&quot; This turns judgment you&#39;d repeat into the context the agent operates inside.</p><p><strong>Make it trace before it changes.</strong> Front-load the step it skips: “Before editing, find every usage and show me the data flow.” “Propose two approaches with their tradeoffs before writing any code.” For anything non-trivial, “What load, cost, and failure modes should I be thinking about?” You’re forcing the agent to surface the questions a good engineer asks first.</p><p><strong>Review the diff like a senior reviewer, not a rubber stamp.</strong> The output is fluent enough to lull you. Read it as if a sharp junior wrote it confidently: where’s the half-finished migration, the missing convention, the unhandled multi-instance case, the customer it forgot. The fluency is the trap, so the review is where you earn back the correctness.</p><p><strong>Keep the global reasoning for yourself.</strong> Load, cost, blast radius, rollout safety, the variance across your actual customers — this is the work the agent can’t do, and it’s also the work that decides whether a real system survives. Don’t delegate it. Use the agent for the local execution, it’s genuinely fast at, and spend your attention on the whole that it can’t see.</p><p><strong>Interrogate the work after it’s done.</strong> The agent can reason about the blind spots, but it just won’t volunteer them. So ask, in a separate pass: “What breaks if this runs on four instances?” “What happens to in-flight data during this migration?” “Which customer configuration does this assume, and what does the long tail do?” These questions pull out exactly the reasoning that the earlier sections were missing, because the model is capable of it when pointed at it. This is less “work around the limit” than “extract the part it’s holding back.”</p><p>The uncomfortable part is that this raises the bar rather than lowering it. To direct these tools well on a real system, you have to know what good looks like more precisely than ever, because the agent will confidently hand you something that isn’t it, and you’re the only one in the loop who can tell. The skill that matters now isn’t writing the code. It’s knowing what should have been written.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ea6d21cc641" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Claude Code habits separating fast engineers from the rest]]></title>
            <link>https://medium.com/@nidhi.14t/claude-code-habits-separating-fast-engineers-from-the-rest-5b2f1ce2a536?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b2f1ce2a536</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Mon, 18 May 2026 04:10:22 GMT</pubDate>
            <atom:updated>2026-05-18T04:16:37.667Z</atom:updated>
            <content:encoded><![CDATA[<p>In February 2025, Anthropic shipped Claude Code. By November, it was doing $1B 💵 💵 in annualized revenue. Not because of marketing, because engineers kept not going back to what they had before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*ZY9eaaSoK0CSF4vKOBNMpQ.gif" /></figure><p>Claude Code runs in your terminal. It reads your actual files, runs your actual commands, and works through problems end-to-end. It’s not autocomplete. It’s not a chat window you paste code into. It’s closer to having a second engineer in the repo, one who doesn’t need context repeated three times and doesn’t care that it’s 11 pm.</p><p>But autonomy comes with a learning curve. The engineers who get the most out of Claude Code aren’t the ones who prompt hardest; they’re the ones who understand <em>how it works</em> and build their workflow around that understanding.</p><p>This guide covers the patterns that matter.</p><p>What Claude Code actually is</p><p>Think of it as a very capable engineer who lives in your terminal. You describe what you want in natural language; Claude explores your project structure, reads relevant files, writes code, runs tests, and iterates all, without you having to babysit every step.</p><p>The key distinction from a browser-based chatbot: Claude Code has direct access to your local filesystem. It sees your project structure, understands your dependencies, modifies scripts, and observes the output. You’re not exchanging messages with a smart person across the internet; you’re pair-programming with someone sitting right next to you.</p><blockquote><strong><em>“Claude Code wins when you need reasoning. When you want the AI to understand why your code is structured a certain way, plan before executing, and explain its decisions.”</em></strong></blockquote><p>It integrates with VS Code, Cursor, and Windsurf via an extension. You can also run it in a dedicated terminal — and for serious work, that’s the setup worth investing in.</p><h3>Getting started in 3 steps</h3><ol><li><strong>Install Claude Code</strong></li></ol><pre>// Install via npm: <br>// You&#39;ll need a Claude account - Pro, Team, or <br>// Max plans all include access. Then run claude in any project directory <br>// to start a session.<br>npm install -g @anthropic-ai/claude-code</pre><p><strong>2. Set up your terminal properly</strong></p><p>This is where you’ll live. Consider Ghostty (a GPU-accelerated terminal) and Zellij (a terminal multiplexer with split-pane views). Run Claude Code on the left, watch your files on the right — it changes how you iterate.</p><blockquote>Why Ghostty helps with Claude Code</blockquote><p>The advantage of using Ghostty is that Claude Code often prints large outputs: file scans, command logs, test results, diffs, error stacks, and multi-step plans. Ghostty uses GPU acceleration and is designed for fast rendering, so scrolling through long Claude sessions can feel smoother than in a basic terminal.</p><p>Claude Code is interactive. It uses prompts, keyboard input, colors, terminal formatting, and command output. Ghostty aims to be a highly compliant, feature-rich terminal emulator and supports many modern terminal sequences. That can reduce weird display issues compared with older terminals.</p><p><a href="https://ghostty.org/">Ghostty</a></p><blockquote>Why Zellij helps with Claude Code</blockquote><p>The biggest benefit is <strong>workspace organization</strong>.</p><p>Claude Code usually works best when you keep multiple things visible:</p><pre>Pane 1: claude<br>Pane 2: npm run dev<br>Pane 3: npm test<br>Pane 4: git diff / logs</pre><p>With plain terminal tabs, you keep switching back and forth. With Zellij, you can keep Claude Code, test output, server logs, and Git status in one organized terminal workspace.</p><p><a href="https://zellij.dev/">Zellij</a></p><blockquote>Quick Reference: Common Commands</blockquote><pre>/clear          Reset context. Use between tasks.<br>/model          Switch models mid-session (opus, sonnet)<br>/install-github-app  Enable automatic PR reviews<br>Shift+Tab       Cycle: Normal → Plan → Auto-Accept mode<br>!command        Run shell command, output lands in context</pre><p><strong>3. Create your CLAUDE.md file</strong></p><p>This is the single most important setup step. Claude reads this file at the start of every session; it’s how you teach Claude your project’s conventions, constraints, and non-negotiables. More on this below.</p><h3>The one constraint that explains everything</h3><p>Almost every best practice for Claude Code flows from a single constraint: the context window fills up fast, and performance degrades as it fills.</p><p>Claude’s context window holds your entire conversation — every message, every file it reads, every command output. A single debugging session or codebase exploration can consume tens of thousands of tokens. As the window fills, Claude may start forgetting earlier instructions or making more mistakes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*s3b5UTi4xdbehNCnmSqgyQ.gif" /></figure><blockquote>The context window is your most important resource<br><br>Think of it like RAM. Long sessions degrade. <br>If you&#39;ve been going back and forth for 20+ turns with lots of code output, <br>performance at turn 30 is noticeably worse than at turn 3.<br><br>The fix: use /clear often. Every time you start a new task, <br>clear the chat. It feels like losing progress, but you&#39;ll get better <br>results starting fresh with a focused prompt.</blockquote><p>This also means: don’t load your entire CLAUDE.md with every piece of documentation you’ve ever written. Keep it under 200 lines. The most important rules go at the top — Claude pays more attention to content at the beginning.</p><h3>CLAUDE.md: give Claude a memory</h3><p>Every new Claude Code conversation starts with zero context about your project. Without guidance, Claude will guess at conventions, make assumptions about architecture, and potentially write code that doesn’t match your patterns.</p><p>CLAUDE.md solves this. It’s a file Claude reads at the start of every conversation — persistent instructions that teach it your project’s rules. You can have one global file ~/.claude/CLAUDE.md and a project-specific one at the root of each repo. Both load: global first, then project-specific.</p><pre># Project: Payments API<br><br>## Hard rules<br>- Never commit secrets or API keys<br>- All endpoints require auth middleware<br>- Use PostgreSQL transactions for financial ops<br>- Test coverage required for any new service method<br><br>## Stack<br>- Node.js 20 / Express / TypeScript<br>- PostgreSQL 16 via Prisma ORM<br>- Jest for testing<br><br>## Conventions<br>- Error handling: always use the AppError class<br>- Responses: use the ResponseHelper wrapper<br>- Controllers stay thin — business logic goes in services<br>- Create model first before starting implmentation</pre><h3>Plan before you build — every time</h3><p>The single most expensive mistake with Claude Code is letting it start coding before you’ve agreed on what to build. Claude is fast -it can write 200 lines in seconds -but if those 200 lines solve the wrong problem, you’ve lost more time than you saved.</p><p>Use Plan Mode. Press Shift+Tab to cycle between Normal, Auto-Accept, and Plan permission modes. In Plan Mode, Claude proposes an approach and explains its reasoning before touching a single file. You get to redirect before anything is built.</p><h4>🎯 The Interview Prompt</h4><p>For larger features, ask Claude to interview you first: <em>“I want to build X. Ask me questions about requirements, edge cases, and tradeoffs. Then write a spec to SPEC.md.”</em> Start a fresh session to execute the spec.</p><h4>📄 <strong>Write plans to files</strong></h4><p>Ask Claude to save its plan to plan.md and use it as a checklist. This lets you audit each phase, start fresh sessions without losing the plan, and track progress across long implementations.</p><p>🙅‍♀️ <strong>Skip plan mode for small tasks<br></strong>If you can describe the change in one sentence, do it directly. Plan mode overhead is real — reserve it for multi-file changes, unfamiliar code, and architectural decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Ky2hNtlxmOD5DmX2CMhUOQ.gif" /></figure><h3><strong>Run parallel sessions</strong></h3><p>One of the most powerful (and underused) features is that you can run multiple Claude sessions simultaneously. Each gets its own context window, working in isolation. This is where Claude Code genuinely changes how fast you can ship.</p><p><strong>How to parallelize</strong></p><p>Git worktrees — run separate CLI sessions in isolated git checkouts so edits don’t collide. One session works on the feature; another reviews, tests, or works on something entirely different.</p><p>Writer/Reviewer pattern — use one Claude to write code and a second (fresh session) to review it. The reviewer won’t be biased toward code it just wrote, so the feedback is sharper.</p><p>Test/Implement split. — Have one Claude write tests, then another write code to pass them. It’s TDD at agent speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*jpY_FxBwqUK1LH8bSH1o2g.gif" /><figcaption>Multiple agents at work</figcaption></figure><blockquote>Tip: Agent teams</blockquote><blockquote>Enable with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS. A team lead distributes work to multiple subagents, each with their own context and a shared task list. Start with 3–5 teammates on 5–6 tasks each. Don’t assign tasks that modify the same files — concurrent edits cause overwrites.</blockquote><p><strong>The tips that actually change the daily workflow</strong></p><blockquote>QUEUE YOUR PROMPTS</blockquote><p>You can type multiple prompts while Claude is still working, and it will process them intelligently in sequence. Claude is smart enough to know when it needs your feedback before running the next queued message — it won’t blindly proceed if a decision is required. No more coming back to find it’s been idle for 20 minutes.</p><blockquote>USE /CLEAR AGGRESSIVELY</blockquote><p>Different task? /clear first. Sessions degrade because accumulated context from earlier work drowns out your current instructions. Five seconds to clear and write a focused starting prompt saves you from 30 minutes of diminishing returns.</p><blockquote>WRITE STATE TO FILES MID-SESSION</blockquote><p>Halfway through a long session, ask Claude: <em>“Write a summary of what we’ve done so far and what’s left to progress.md.”</em> Then start a fresh session and say: <em>“Read progress.md and continue from where we left off.”</em> Full context budget, all relevant information preserved.</p><blockquote>USE THE BASH SHORTHAND</blockquote><p><strong>Type ! before any shell command</strong> to run it immediately: !git status, !npm test. The command and its output land in context, so Claude can see the result and act on it — without breaking your flow.</p><blockquote>INSTALL THE GITHUB APP</blockquote><p>Run /install-github-app inside a session. After that, Claude automatically reviews your pull requests. As AI tools increase your PR volume, this becomes genuinely useful — free review coverage on every push.</p><blockquote>REMOTE CONTROL FROM YOUR PHONE</blockquote><p>Claude also provides an option to run Claude remote-control to start a session, then connect from claude.ai/code or the Claude iOS/Android app. The session runs locally on your machine; the phone is just a window into it. In my personal experience till now, it’s not very reliable for long-running tasks, but it&#39;s a good-to-know feature, and hopefully, it will keep improving.</p><p>The engineers who get the most out of Claude Code are the ones who bring the clearest thinking to the session. They write detailed specs. They articulate constraints upfront. They know when to step in and redirect — and when to let Claude run.</p><p>That’s not a new skill. It’s the same skill good engineering managers have always needed. Claude Code just makes it load-bearing in a new context.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b2f1ce2a536" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Server Meltdowns: Handle traffic spikes with AWS SQS + Lambda]]></title>
            <link>https://medium.com/@nidhi.14t/stop-server-meltdowns-handle-traffic-spikes-with-aws-sqs-lambda-7b7b88ed7f7f?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b7b88ed7f7f</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 21:19:07 GMT</pubDate>
            <atom:updated>2026-02-07T21:19:07.463Z</atom:updated>
            <content:encoded><![CDATA[<p>When your API gets hammered by lots of requests at the same time, the classic synchronous pattern (client waits → server processes → server responds) quickly becomes a bottleneck.</p><p>Even with autoscaling, heavy processing plus burst traffic can overwhelm your app instances, starve your database connections, and cause timeouts.</p><p>This is for the use cases where you don’t need to process everything instantly but need to handle multiple request load. So,</p><p><strong>Acknowledge the request immediately</strong>, <strong>process it in the background</strong>, and <strong>deliver the final result to a webhook</strong> provided in the original request.</p><p>So I built an <strong>asynchronous processing pipeline</strong> using:</p><ul><li><strong>Node.js API on AWS Elastic Beanstalk</strong> (fast request intake)</li><li><strong>Amazon SQS</strong> (burst buffer/queue)</li><li><strong>AWS Lambda</strong> (background workers triggered by SQS)</li><li><strong>Amazon S3</strong> (stores generated CSV output)</li><li><strong>PostgreSQL</strong> (tracks jobs, status, metadata)</li><li><strong>Webhook callback</strong> (returns a <strong>pre-signed S3 URL</strong> so the client can download results)</li></ul><p>For testing the callback end-to-end, I used <strong>webhook.site</strong> to instantly inspect the webhook requests.</p><p>This article walks through the architecture, why SQS was necessary, the request/callback contracts, and the <strong>IAM permissions and triggers</strong> required so everything works reliably at scale.</p><h3>The Problem: Bursty Traffic + Heavy Workloads</h3><p>The incoming POST request contains:</p><ul><li><strong>Customers requesting huge amounts of data like IoT sensor data to </strong>analyze machine operational data (vibration, temperature, speed) to predict maintenance needs before failure.</li><li>a <strong>webhook URL</strong> (where the client wants the final results)</li><li>optional webhook auth (username and password)</li></ul><p>Processing may involve enrichment, aggregations, transformations, CSV generation, and persistence — work that can be slow or resource-intensive. Under heavy burst traffic, processing in the API layer can lead to:</p><ul><li>long response times and timeouts</li><li>overloaded Beanstalk instances (CPU/memory)</li><li>connection pool exhaustion (Postgres)</li><li>cascading failures when traffic spikes</li></ul><p>Instead of “scale the server and pray,” the answer is to <strong>decouple intake from processing</strong>.</p><h3>The Solution: Async-by-Design (200 OK Now, Results Later)</h3><h3>What the client sees</h3><ol><li>Client sends a request with the requested identifier + webhook details.</li><li>API responds immediately with <strong>HTTP 200 OK</strong> (or <strong>202 Accepted</strong>), confirming the job is queued.</li><li>Later, once processing is complete, the system POSTs results to the provided webhook.</li></ol><h3>What your backend does</h3><ul><li><strong>Elastic Beanstalk Node.js API</strong> validates the request, creates a job record in <strong>Postgres</strong>, and publishes a message to <strong>SQS</strong></li><li><strong>Lambda</strong> is triggered by SQS, processes the job, generates a CSV, and uploads it to <strong>S3</strong></li><li>Lambda generates a <strong>pre-signed S3 URL</strong> and sends it to the webhook</li></ul><p><strong>Why SQS matters here:</strong> it absorbs spikes. Your app deployed on the Beanstalk/EC2/ECS remains responsive even when requests arrive simultaneously at rates that your server cannot process synchronously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jFUj2QJ8dntf2A6J1FaTBw.jpeg" /></figure><h3>Request + Response Contracts</h3><h4>API Request (POST)</h4><pre>{<br>  &quot;machines&quot;: [<br>    { &quot;id&quot;: &quot;m-001&quot;, &quot;os&quot;: &quot;linux&quot;, &quot;ip&quot;: &quot;10.0.1.10&quot; },<br>    { &quot;id&quot;: &quot;m-002&quot;, &quot;os&quot;: &quot;windows&quot;, &quot;ip&quot;: &quot;10.0.1.11&quot; }<br>  ],<br>  &quot;webhook&quot;: {<br>    &quot;url&quot;: &quot;https://webhook.site/your-id&quot;,<br>    &quot;username&quot;: &quot;optional-user&quot;,<br>    &quot;password&quot;: &quot;optional-pass&quot;<br>  }<br>}</pre><p>Immediate API Response (200 OK)</p><pre>{<br>  &quot;status&quot;: &quot;accepted&quot;,<br>  &quot;confirmationId&quot;: &quot;xyz123&quot;,<br>  &quot;message&quot;: &quot;Request received and will be processed asynchronously.&quot;<br>}</pre><p>Webhook Callback Payload (sent later)</p><pre>{<br>  &quot;confirmationId&quot;: &quot;xyz123&quot;,<br>  &quot;status&quot;: &quot;completed&quot;,<br>  &quot;csvUrl&quot;: &quot;https://s3.amazonaws.com/your-bucket/reports/job_01J_\uyhXYZ.csv?...signature...&quot;,<br>  &quot;expiresInSeconds&quot;: 3600,<br>  &quot;meta&quot;: {js<br>    &quot;rowCount&quot;: 1234,<br>    &quot;generatedAt&quot;: &quot;2025-12-06T18:42:10Z&quot;<br>  }<br>}</pre><pre>{<br>  &quot;confirmationId&quot;: &quot;xyz123&quot;,<br>  &quot;status&quot;: &quot;failed&quot;,<br>  &quot;error&quot;: {<br>    &quot;code&quot;: &quot;PROCESSING_ERROR&quot;,<br>    &quot;message&quot;: &quot;Failed to generate report.&quot;<br>  }<br>}</pre><h3>What Runs Where?</h3><h4>1) Elastic Beanstalk/EC2/ECS - Node.js API (intake layer)</h4><p>Best kept lightweight:</p><ul><li>validate request schema</li><li>create confirmationId</li><li>insert job record in Postgres (status = queued)</li><li>push message to SQS: includes confirmationId + webhook + machine payload (or pointer)</li><li>return HTTP response immediately</li></ul><p><strong>Beanstalk scaling benefit:</strong> it scales for <em>request handling</em>, not heavy computation. Your API becomes stable during bursts because it isn’t doing the expensive work.</p><h4>2) Lambda (worker layer)</h4><p>Each SQS message triggers processing:</p><ul><li>parse message (confirmationId, machine data, webhook)</li><li>do processing</li><li>generate CSV (in-memory stream or /tmp file in Lambda)</li><li>upload to S3: reports/&lt;confirmationId&gt;.csv</li><li>update Postgres (status, s3Key, rowCount, timestamps)</li><li>create pre-signed S3 URL and POST to webhook</li><li>If username/password exist, send Basic Auth</li></ul><h4>3) AWS Setup (Queues, Triggers, Buckets)</h4><h4>a<em>) SQS Queue</em></h4><ul><li><em>Queue: </em><em>machine-processing-queue</em></li><li><em>maxReceiveCount: 3–5</em></li></ul><p><em>Key settings:</em></p><ul><li><strong><em>Visibility timeout</em></strong><em> &gt; max Lambda processing time</em></li><li><em>Batch size: start small (1–5) if jobs are heavy</em></li><li><em>Consider reserved concurrency on Lambda to protect Postgres from being flooded by too many workers at once</em></li></ul><h4><em>b) Lambda Trigger (Event Source Mapping)</em></h4><p><em>Configure Lambda to poll SQS:</em></p><ul><li><em>Event source: </em><em>machine-processing-queue</em></li><li><em>Batch size set based on workload</em></li><li><em>Optional: enable </em><strong><em>partial batch response</em></strong><em> if you want resilience on per-message failures</em></li></ul><h4><em>c) S3 bucket</em></h4><p><em>Store CSV output and generate a presigned url.</em></p><ul><li><em>s3://YOUR_BUCKET/reports/&lt;confirmationd&gt;.csv</em></li><li><em>Provide necessary IAM roles to Lambda, SQS, and the S3 bucket</em></li></ul><h3>Operational Tips That Make This Production-Ready</h3><p>A few battle-tested additions that pay off quickly:</p><ul><li><strong>Idempotency:</strong> Use confirmationId as an idempotency key so replays/retries don’t generate duplicate objects.</li><li><strong>DLQ monitoring:</strong> Alert on DLQ depth &gt; 0.</li><li><strong>Webhook retry strategy:</strong> If webhook fails (timeouts / 5xx), retry with exponential backoff and cap attempts. Store attempt count + last response in Postgres.</li><li><strong>Don’t enqueue huge payloads:</strong> SQS has message size limits, send only the information needed to invoke the lambda.</li><li><strong>Throttle Lambda concurrency:</strong> Protect Postgres from being overwhelmed by too many simultaneous workers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*DP0msBkKFPjTN7X6NaHPOA.gif" /></figure><h3>Conclusion</h3><p>By moving heavy work out of the request/response path, you get a system that is both <strong>responsive</strong> and <strong>scalable</strong> under burst traffic:</p><ul><li>Main server(beanstalk/ec2/ecs) stays snappy because it only accepts + enqueues</li><li>SQS smooths spikes and provides retries + DLQ safety</li><li>Lambda scales processing based on queue depth</li><li>S3 stores your CSV output reliably</li><li>Pre-signed URLs make result delivery secure and simple</li><li>Webhooks eliminate polling and keep clients informed automatically</li><li>Postgres ties it all together with durable job tracking</li></ul><p>So there you have it: a battle-tested pattern that turns unpredictable traffic into a solved problem. Until next time :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*SY4MT5jZbUr1Exhno4Pe3Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b7b88ed7f7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Basics: How to Answer the 3 Most Common Node.js Questions like a Senior Engineer]]></title>
            <link>https://medium.com/@nidhi.14t/beyond-the-basics-how-to-answer-the-3-most-common-node-js-questions-like-a-senior-engineer-d9c9292f4f4a?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9c9292f4f4a</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[event-loop]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[node-js-performance]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 20:05:57 GMT</pubDate>
            <atom:updated>2026-01-11T20:05:57.647Z</atom:updated>
            <content:encoded><![CDATA[<p>After 20+ Node.js interviews on both sides of the table, I’ve noticed a pattern: the simplest questions separate beginners from experts.</p><p>When I started my career, I gave the standard answers straight from the documents, and they worked. But to crack Senior Engineer roles, you need to show more than your familiarity with the docs. You need to demonstrate that you understand how Node.js behaves under pressure, and that you’ve felt the pain of a blocked Event Loop in production.</p><p>In this article, I break down the three questions I encountered most frequently across those 20+ interviews and how to answer them with the depth and nuance expected of an expert.</p><h3>The Interview Question: Is Node.js Single-Threaded or Multi-Threaded?</h3><p>On the surface, this question is a ‘yes/no’ binary. But the interviewer isn’t looking for a binary answer; they are looking to see if you understand the boundary between your JavaScript code and the underlying system. To stand out, you must start with the common truth, then peel back the layers to show how the runtime actually manages the heavy lifting.</p><p>The most professional way to answer this is to start with the standard definition and then transition into the architectural reality. This prevents you from sounding “technically correct but confusing” from the start.</p><h4>The Short Answer (The Baseline)</h4><p>By default, <strong>Node.js is single-threaded for JavaScript execution.</strong> This means your code and the variables you assign run on one main thread called the <strong>Event Loop</strong>.</p><h4>The “Expert” Depth: Why it’s actually both.</h4><p>While JavaScript runs on one thread, Node.js leverages multi-threading <strong>for specific blocking operations</strong>. It achieves this through two main mechanisms: <strong>Libuv’s Thread Pool</strong> and <strong>Worker Threads</strong>.</p><p><strong>The Invisible Workers: Libuv</strong></p><p>Node.js uses a C library called <strong>Libuv</strong> to handle <strong>asynchronous I/O operations</strong>.</p><p>When you perform a “blocking” task like reading a file from a disk (fs.readFile) or hashing a password (crypto.pbkdf2), Node doesn&#39;t stop the Event Loop. Instead, it hands those tasks off to Libuv’s internal <strong>Thread Pool</strong> (which has 4 threads by default, configurable via UV_THREADPOOL_SIZE).</p><p>While these threads are doing the heavy lifting in the background, the main thread is free to handle new incoming HTTP requests. Once the file is read or the password is hashed, the worker thread signals the Event Loop, and your callback is executed.</p><p><strong>Experiment: The 4-Thread Default</strong></p><pre>import crypto from &#39;crypto&#39;;<br><br>// Doing CPU intensive I/O operations<br>for (let i = 1; i &lt;= 5; i++) {<br>  const start = Date.now();<br><br>  crypto.pbkdf2(&quot;password&quot;, &quot;salt&quot;, 100000, 512, &quot;sha512&quot;, (err, key) =&gt; {<br>    const duration = Date.now() - start;<br>    console.log(`Hash completed in ${duration}ms`);<br>  });<br>}<br><br>**Output:**<br><br>Hash completed in 828ms<br>Hash completed in 833ms<br>Hash completed in 841ms<br>Hash completed in 844ms<br>Hash completed in 1572ms //Almost exactly double!</pre><p>Notice how the first 4 operations complete almost simultaneously? That’s because each one gets its own thread from the pool.</p><p>The 5th operation takes roughly <strong>twice as long</strong> because it has to wait for the second “round” of thread pool execution.</p><p><strong>Increasing the Thread Pool Size</strong></p><p>You can increase the thread pool size using the <strong>UV_THREADPOOL_SIZE</strong> environment variable. <strong>Important:</strong> This must be set before Node.js starts.</p><pre># Linux/Mac<br>UV_THREADPOOL_SIZE=8 node app.js</pre><p><strong>2. The Manual Workers: </strong><strong>worker_threads</strong></p><p>The <strong>worker_threads</strong> module allows you to explicitly create new threads for CPU-intensive tasks that would otherwise block the main Event Loop.</p><pre>import { Worker } from &quot;worker_threads&quot;;<br><br>console.log(&quot;Main thread: Starting heavy computation...&quot;);<br><br>// Create a new worker thread<br>const worker = new Worker(&quot;./worker.js&quot;);<br><br>// Listen for messages from the worker<br>worker.on(&quot;message&quot;, (result) =&gt; {<br>  console.log(`Main thread: Received result: ${result}`);<br>});<br>worker.on(&quot;error&quot;, (error) =&gt; {<br>  console.error(`Worker error: ${error}`);<br>});<br>worker.on(&quot;exit&quot;, (code) =&gt; {<br>  console.log(`Worker exited with code: ${code}`);<br>});<br><br>// Main thread continues working<br>console.log(&quot;Main thread: Continuing with other tasks...&quot;);<br><br><br>**worker.js** (Worker Thread)<br><br>import { parentPort } from &#39;worker_threads&#39;;<br><br>// Simulate CPU-intensive task<br>function fibonacci(n) {<br>  if (n &lt;= 1) return n;<br>  return fibonacci(n - 1) + fibonacci(n - 2);<br>}<br><br>// Perform heavy calculation<br>const result = fibonacci(40);<br><br>// Send result back to main thread<br>parentPort.postMessage(result);</pre><p>Notice how the main thread doesn’t block; it continues executing while the worker handles the expensive computation.</p><h3>Question 2: What is the difference between process.nextTick() and setImmediate()?</h3><p>This question is a favorite for interviewers because the nomenclature is famously misleading. Most developers assume <strong>setImmediate()</strong> is faster because of its name, while <strong>process.nextTick()</strong> sounds like it should wait for the next loop iteration. However, their actual behavior is the opposite of what their names suggest.</p><h4>The Basic Answer</h4><p>Both functions are used to schedule a callback to run asynchronously, but they execute at different times:</p><ul><li>process.nextTick() runs <strong>immediately</strong> after the current operation finishes, before the Event Loop continues to the next phase.</li><li>setImmediate() runs in the <strong>Check phase</strong> of the Event Loop (after the Poll phase).</li></ul><h4>The Expert Answer: Understanding of Node.js Event Loop</h4><p>To answer like a senior engineer, you need to know how the event loop works.</p><p>The Node.js Event Loop is the mechanism that enables Node.js to handle thousands of concurrent operations, despite JavaScript being a single-threaded language. It continuously cycles through six phases, processing callbacks in a specific order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*g1rO0iZB4_cvwzMku8jp3Q.jpeg" /><figcaption>Event Loop</figcaption></figure><blockquote>One complete cycle through all six phases of the event loop (including the special priority queues between phases) is called a tick. This is why `process.nextTick()` is so confusingly named — it doesn’t run on the <em>*next*</em> tick, it runs <em>*before*</em> the next phase of the <em>*current*</em> tick.</blockquote><p>As you can see from the above diagram, after every phase, the execution order is:</p><p><strong><em>Phase 1</em> → [nextTick callbacks → Promise callbacks] → <em>Phase 2</em> → [nextTick callbacks → Promise callbacks] -&gt; <em>Phase 3…<br>…. and so on till Phase 6 and repeat</em></strong>.</p><h4>The Six Phases</h4><blockquote><strong>1. Timers</strong>: Executes callbacks scheduled by setTimeout() and setInterval(). Note that timers specify a threshold after which callbacks can execute, not an exact time.</blockquote><blockquote><strong>2. Pending Callbacks: </strong>Handles I/O callbacks that were deferred from the previous iteration, such as TCP errors.</blockquote><blockquote><strong>3. Idle, Prepare: </strong>Used internally by Node.js. Developers don’t interact with this phase directly.</blockquote><blockquote><strong>4. Poll: </strong>The most critical phase. Here, Node.js retrieves new I/O events and executes their callbacks. If no timers are scheduled, the event loop will wait here for incoming connections or data.</blockquote><blockquote><strong>5. Check: </strong>Executes setImmediate() callbacks immediately after the poll phase completes.</blockquote><blockquote><strong>6. Close Callbacks: </strong>Handles cleanup operations like socket.on(&#39;close&#39;).</blockquote><h4>Special Priority Queues</h4><blockquote>Between each phase transition, Node.js checks two special queues:</blockquote><blockquote><strong>process.nextTick(): </strong>Highest priority. Executes immediately after the current operation, before any phase begins.</blockquote><blockquote><strong>Promises:</strong> Execute after nextTick callbacks but before the next event loop phase.</blockquote><p>A senior engineer should always mention the risk of <strong>I/O Starvation</strong>. Because process.nextTick() executes as soon as possible, calling it recursively can block the Event Loop entirely, preventing it from ever reaching the I/O or Timer phases. setImmediate(), on the other hand, is safer because it yields to the event loop phases.</p><h4>Despite the confusing names, <strong>process.nextTick() is actually more immediate than setImmediate()</strong>.</h4><p>| A note from node.js/org regarding process.nextTick() and setImmediate.<br>“In essence, the names should be swapped. process.nextTick() fires more immediately thansetImmediate(), but this is an artifact of the past which is unlikely to change.”</p><h3>Question 3:“Don’t Block the Event Loop” What does it mean and Why Does It Matter?</h3><p>Now that you understand how the event loop works and the difference between nextTick and setImmediate, let’s talk about the golden rule of Node.js: <strong>**never block the event loop**</strong>. This is where theory meets production reality. Understanding event loop phases is academic until you’ve watched your server mysteriously stop responding at 2 AM because someone used a synchronous operation.</p><p>A malicious client can submit “evil input” that blocks your threads, creating a Denial of Service (DoS) attack.</p><p>How Blocking Actually Happens:<br>Unlike Apache, where each client gets its own thread, Node.js handles many clients with a few threads. If a thread blocks handling one client’s request, then pending client requests may not get a turn until the thread finishes its callback or task.</p><pre>import express from &#39;express&#39;;<br>const app = express();<br><br>// Simple health check endpoint<br>app.get(&#39;/health&#39;, (req, res) =&gt; {<br>  res.json({ status: &#39;ok&#39; });<br>});<br><br>// Endpoint that blocks the Event Loop<br>app.get(&quot;/process&quot;, (req, res) =&gt; {<br>  fs.readFileSync(&quot;./bigfile.log&quot;, &quot;utf8&quot;); // blocks<br>  res.json({ status: &quot;done&quot; });<br>});<br><br>app.listen(3000);</pre><p><strong>What happens:</strong></p><ol><li>Client A hits /process - starts 10-second computation</li><li>Client B hits /health during this time, <strong>gets no response</strong></li><li>Client C hits /health - <strong>also waits</strong></li><li>After 10 seconds, all three requests are finally complete</li></ol><p>Your monitoring tool shows: Server is running, CPU at 100%, but not responding to requests. In Kubernetes, this triggers pod restarts because health checks fail.</p><h3>Common Ways to Block the Event Loop</h3><p>1. Synchronous File Operations</p><pre>import fs from &quot;fs&quot;;<br><br>// ❌ BAD: Blocks Event Loop<br>const data = fs.readFileSync(&quot;large-file.txt&quot;); // blocks<br>console.log(&quot;sync bytes:&quot;, data.length);<br><br>// ✅ GOOD: Non-blocking (async)<br>fs.readFile(&quot;large-file.txt&quot;, (err, data) =&gt; {<br>  if (err) {<br>    console.error(err);<br>    return;<br>  }<br>  console.log(&quot;async bytes:&quot;, data.length);<br>});</pre><p>2. Complex JSON Operations on Large Data</p><pre>// ❌ BAD: Can block for seconds on large payloads<br>app.post(&#39;/data&#39;, (req, res) =&gt; {<br>  const parsed = JSON.parse(req.body.largeJsonString); // 50MB JSON = blocked!<br>  res.json({ success: true });<br>});<br><br>// ✅ GOOD: Use streaming parser for large data<br>import JSONStream from &#39;JSONStream&#39;;</pre><p>3. The Hidden Killer: ReDoS (Regular Expression DoS)</p><p>A vulnerable regular expression is one on which your regular expression engine might take exponential time, exposing you to catastrophic performance degradation.</p><h4>How ReDoS takes down production</h4><p>A typical failure mode looks like this:</p><ol><li>You add a regex-based validation rule (email, URL, markdown, etc.).</li><li>An attacker (or an accidental bad input) sends a string designed to trigger worst-case backtracking.</li><li>The regex engine burns CPU trying millions of combinations before it can decide “no match”.</li><li>While that happens, the <strong>event loop can’t serve other requests</strong> → p99 latency spikes → health checks fail → autoscaling/pod restarts kick in.</li></ol><p>This is why ReDoS is so dangerous: it’s <strong>cheap to trigger</strong> and <strong>expensive to compute</strong>.</p><pre>// ❌ VULNERABLE: O(2^n) complexity!<br>const emailRegex = /^([a-zA-Z0-9_.+-]+)+@([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)$/;<br><br>app.post(&#39;/validate-email&#39;, (req, res) =&gt; {<br>  const email = req.body.email;<br>  <br>  // Malicious input: &quot;aaaaaaaaaaaaaaaaaaaaaaaaa@&quot;<br>  const isValid = emailRegex.test(email);<br>  <br>  res.json({ valid: isValid });<br>});</pre><p>The Attack:</p><pre>// Normal email<br>emailRegex.test(&#39;user@example.com&#39;);<br><br>// Malicious email with extra dots<br>emailRegex.test(&#39;user....................@example&#39;);</pre><p>Each extra character <strong>doubles</strong> the processing time. An exponential number of trips means that if the engine requires x trips to determine a match, it will need 2*x trips if we add only one more character to the input string.</p><p><strong>Fix:</strong></p><pre>// ✅ SAFE: Use a simpler, validated regex or library<br>import validator from &quot;validator&quot;;<br>const isValid = validator.isEmail(email);</pre><p>4. Synchronous Crypto Operations</p><pre><br>import crypto from &quot;crypto&quot;;<br><br>// ❌ BAD: Blocks the event loop while deriving the key<br>const syncHash = crypto.pbkdf2Sync(&quot;password&quot;, &quot;salt&quot;, 100000, 64, &quot;sha512&quot;);<br>console.log(&quot;sync:&quot;, syncHash.toString(&quot;hex&quot;).slice(0, 16) + &quot;...&quot;);<br><br>// ✅ GOOD: Non-blocking (runs in libuv threadpool)<br>crypto.pbkdf2(&quot;password&quot;, &quot;salt&quot;, 100000, 64, &quot;sha512&quot;, (err, derivedKey) =&gt; {<br>  if (err) {<br>    console.error(err);<br>    return;<br>  }<br>  console.log(&quot;async:&quot;, derivedKey.toString(&quot;hex&quot;).slice(0, 16) + &quot;...&quot;);<br>});</pre><h4>How to Avoid Blocking</h4><p>1. Think About Computational Complexity</p><p>If your callback takes a constant number of steps no matter what its arguments are, then you’ll always give every pending client a fair turn. If your callback takes a different number of steps depending on its arguments, then you should think about how long the arguments might be.</p><pre>// ✅ O(1) - Always safe<br>app.get(&#39;/user/:id&#39;, (req, res) =&gt; {<br>  const user = cache.get(req.params.id); // Constant time<br>  res.json(user);<br>});<br><br>// ⚠️ O(n) - Safe if n is bounded<br>app.get(&#39;/users&#39;, (req, res) =&gt; {<br>  const limit = Math.min(req.query.limit || 10, 100); // Bound it!<br>  const users = db.getUsers(limit);<br>  res.json(users);<br>});<br><br>// ❌ O(n²) - Dangerous without limits<br>app.post(&#39;/process&#39;, (req, res) =&gt; {<br>  const items = req.body.items; // Could be 1 million items!<br>  const result = items.map(item =&gt; <br>    items.filter(other =&gt; other.related === item.id) // Nested loop!<br>  );<br>  res.json(result);<br>});</pre><p>2. Break Up Long Operations</p><pre>// ❌ BAD: Process 100k items at once<br>function processItems(items, callback) {<br>  items.forEach(item =&gt; {<br>    // Heavy processing<br>  });<br>  callback();<br>}<br><br>// ✅ GOOD: Process in batches, yielding between<br>function processItems(items, callback) {<br>  let index = 0;<br>  const batchSize = 100;<br>  <br>  function processBatch() {<br>    const batch = items.slice(index, index + batchSize);<br>    <br>    batch.forEach(item =&gt; {<br>      // Heavy processing<br>    });<br>    <br>    index += batchSize;<br>    <br>    if (index &lt; items.length) {<br>      setImmediate(processBatch); // Yield to event loop<br>    } else {<br>      callback();<br>    }<br>  }<br>  <br>  processBatch();<br>}</pre><p>3. Use Worker Threads for CPU-Intensive Tasks</p><pre>// For truly CPU-bound work, offload to worker threads<br>import { Worker } from &#39;worker_threads&#39;;<br><br>app.post(&#39;/encrypt-large-file&#39;, (req, res) =&gt; {<br>  const worker = new Worker(&#39;./encrypt-worker.js&#39;, {<br>    workerData: req.body.file<br>  });<br>  <br>  worker.on(&#39;message&#39;, (encrypted) =&gt; {<br>    res.json({ encrypted });<br>  });<br>  <br>  // Main thread stays responsive!<br>});</pre><p>4. Monitor Event Loop Lag</p><pre>// Use libraries to detect blocking<br>import blocked from &#39;blocked-at&#39;;<br><br>blocked((time, stack) =&gt; {<br>  console.log(`Event Loop blocked for ${time}ms`);<br>  console.log(&#39;Stack trace:&#39;, stack);<br>}, { threshold: 100 }); // Alert if blocked &gt; 100ms</pre><h3>Industry Best Practices</h3><p><strong>✅ DO:</strong></p><ul><li>Use async versions of all APIs (fs.readFile not fs.readFileSync)</li><li>Set limits on array sizes, loop iterations, and data processing</li><li>Validate regex patterns for ReDoS vulnerabilities</li><li>Monitor event loop lag in production</li><li>Use streaming for large datasets</li><li>Break up long operations with setImmediate()</li></ul><p><strong>❌ DON’T:</strong></p><ul><li>Use synchronous APIs in request handlers</li><li>Process unbounded user input</li><li>Use complex regex without testing performance</li><li>Perform heavy computation in the main thread</li><li>Trust that “async” means “non-blocking” (Promises can still block!)</li></ul><p>The Subtle Truth About Promises</p><pre>// ⚠️ COMMON MISCONCEPTION: Promises don&#39;t automatically make things non-blocking!<br><br>// This STILL blocks the Event Loop!<br>async function heavyTask() {<br>  return new Promise((resolve) =&gt; {<br>    const end = Date.now() + 30000;<br>    while (Date.now() &lt; end) {<br>      // 30 seconds of blocking computation<br>    }<br>    resolve(&#39;Done&#39;);<br>  });<br>}<br><br>// The Promise wrapper doesn&#39;t help - the CPU is still busy!<br>app.get(&#39;/task&#39;, async (req, res) =&gt; {<br>  const result = await heavyTask(); // Blocks for 30 seconds<br>  res.send(result);<br>});</pre><p>Promises provide syntax for async code, but they don’t magically make synchronous operations non-blocking. You need actual async I/O or worker threads.</p><h3>Key Takeaway</h3><p><strong>Every operation in your Node.js application should complete in single-digit milliseconds.</strong> If it doesn’t, either make it async, break it into chunks, or move it to a worker thread. In production, one blocked Event Loop can take down your entire service.</p><p>So remember, in the beginning, when I said I’d cover 3 questions? The Event Loop turned out to be quite the rabbit hole. :D <br>But that’s ok, some concepts deserve the spotlight. The Event Loop is one of those foundational topics that, once you <em>really</em> get it, everything else in Node.js starts making sense.</p><p>Thanks for sticking with me through this deep dive!! Until next time! ★</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9c9292f4f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure your service on Cloud Run with GCP API Gateway and Firebase security]]></title>
            <link>https://medium.com/@nidhi.14t/secure-your-service-on-cloud-run-with-gcp-api-gateway-and-firebase-security-0ecd15584eaa?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ecd15584eaa</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[google-cloud-run]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Sat, 11 Oct 2025 18:24:19 GMT</pubDate>
            <atom:updated>2025-10-11T21:30:56.852Z</atom:updated>
            <content:encoded><![CDATA[<p>Before you burn time, here are <strong>cases where GCP API Gateway is not a fit</strong>:</p><ol><li>Your Cloud Run service uses <strong>Internal ingress</strong> (VPC-only) and <strong>must not</strong> be exposed to the public internet at all.</li></ol><p>2. Your service <strong>cannot</strong> accept direct internet traffic. (even via gateway).<br>“<strong>All</strong>” should be selected in the Ingress Control of the cloud-run service.<br>Note: Using this architecture, access is limited through the IAM role, which serves as the main security boundary.</p><p>3. You require OpenAPI 3 today. <strong>API Gateway supports OpenAPI 2</strong> (Swagger 2.0) only, so you’ll need to convert an OAS3 spec to OAS2.</p><p>If you’re still in, let’s build a secure path:</p><ul><li><strong>Frontend (Firebase) → API Gateway → Cloud Run</strong> with Firebase Authentication</li></ul><h3>Reference architecture (high-level)</h3><p><strong>Components</strong></p><ul><li><strong>Firebase Authentication</strong> for user sign-in</li><li><strong>Cloud Run (backend)</strong></li><li><strong>API Gateway</strong> (OpenAPI 2 spec) in front of your <strong>Cloud Run</strong> backend</li><li><strong>Cloud Run (frontend)</strong> with Firebase Integration (you can also just use Firebase)</li></ul><h3>Use case</h3><blockquote><em>Send requests from the browser with Firebase Auth, hit API Gateway, and invoke Cloud Run backend.</em></blockquote><p><strong>Flow</strong></p><ol><li>User signs in on the web app (Firebase client SDK).</li></ol><p>2. Browser calls API Gateway with the Firebase ID token in Authorization: Bearer &lt;id_token&gt;.</p><p>3. API Gateway validates the token against your Firebase project issuer + JWKS.</p><p>4. Gateway forwards to Cloud Run backend(with x-google-backend) only if auth passes.</p><p>5. Cloud Run backend enforces business authorization (add any extra authorization related to user UID on Cloud Run)</p><p>To activate the API Gateway service, below is a sample YAML file to deploy</p><p>api-config-v1.yaml</p><pre>swagger: &quot;2.0&quot;<br>info:<br>  title: API Gateway for cloud run<br>  description: API Gateway to secure Cloud Run API server<br>  version: 1.0.0<br>schemes:<br>  - https<br>produces:<br>  - application/json<br>paths:<br>  /api/login:<br>    post:<br>      tags:<br>        - Authentication<br>      security:<br>        - firebase: []<br>      summary: User Login<br>      operationId: login<br>      consumes:<br>        - application/json<br>      produces:<br>        - application/json<br>      x-google-backend:<br>        address: https://SERVICE_HOSTNAME/PATH<br>        jwt_audience: &quot;https://SERVICE_HOSTNAME&quot;<br>      parameters:<br>        - in: body<br>          name: user cred<br>          description: user cred<br>          schema:<br>            type: object<br>      responses:<br>        204:<br>          description: No content<br>        200:<br>          description: Successful login<br>        403:<br>          description: Invalid login<br>        415:<br>          description: If used other than application/json content-type<br>        500:<br>          description: Unspecified server error<br>    options:<br>      summary: CORS pre-flight<br>      operationId: corsRequestLogin<br>      x-google-backend:<br>        address: https://SERVICE_HOSTNAME/PATH<br>        jwt_audience: &quot;https://SERVICE_HOSTNAME&quot;<br>      responses:<br>        &quot;204&quot;:<br>          description: cors<br>          headers:<br>            Access-Control-Allow-Origin:<br>              type: string<br>              default: &quot;https://&lt;YOUR-FRONTEND-DOMAIN&gt;&quot;<br>            Access-Control-Allow-Methods:<br>              type: string<br>              default: &quot;POST, OPTIONS&quot;<br>            Access-Control-Allow-Headers:<br>              type: string<br>              default: &quot;Authorization, Content-Type&quot;<br>securityDefinitions:<br>  firebase:<br>    authorizationUrl: &quot;&quot;<br>    flow: &quot;implicit&quot;<br>    type: &quot;oauth2&quot;<br>    x-google-issuer: &quot;https://securetoken.google.com/PROJECT_ID&quot;<br>    x-google-jwks_uri: &quot;https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com&quot;<br>    x-google-audiences: &quot;PROJECT_ID&quot;</pre><p>A sample address example “https://customer-backend-ze6knpll6q-uc.a.run.app/api/login” where api/login is the path</p><p>A sample jwt_audience: <a href="https://customer-backend-ze6knpll6q-uc.a.run.app/">https://customer-backend-ze6knpll6q-uc.a.run.app</a><br>For Cloud Run, the jwt_audience is “https://SERVICE_HOSTNAME&quot;</p><p>Here, customer-backend is the backend server deployed on Cloud Run</p><p>Include options for all routes to avoid any CORS issues.</p><p>API Gateway will send the authentication result in the X-Apigateway-Api-Userinfo to the backend API. It is recommended to use this header instead of the original Authorization header.</p><p>Below are commands to create and deploy the gateway</p><p>First, enable the API gateway from the console or the command line, then run the commands below</p><p>Install Google Cloud CLI: <a href="https://cloud.google.com/sdk/docs/install-sdk">https://cloud.google.com/sdk/docs/install-sdk</a></p><pre># Create the gateway<br>gcloud api-gateway gateways create &lt;GATEWAY_ID&gt; \<br>  --api=&lt;API_ID&gt; \<br>  --api-config=&lt;CONFIG_ID&gt; \<br>  --location=us-central1<br><br># If Cloud Run backend is PRIVATE: grant invoker to the gateway&#39;s managed SA<br># (Replace with the SA email you find via &#39;describe&#39;)<br>gcloud run services add-iam-policy-binding &lt;CLOUD_RUN_SERVICE&gt; \<br>  --member=&quot;serviceAccount:&lt;GATEWAY_SA_EMAIL&gt;&quot; \<br>  --role=&quot;roles/run.invoker&quot; \<br>  --region=us-central1<br><br># Get gateway URL<br>gcloud api-gateway gateways describe &lt;GATEWAY_ID&gt; --location=us-central1 \<br>  --format=&quot;value(defaultHostname)&quot;<br><br>--------------------------------------------------------------<br># Enable required services (once)<br>gcloud services enable apigateway.googleapis.com servicemanagement.googleapis.com servicecontrol.googleapis.com run.googleapis.com<br><br># Create API<br>gcloud api-gateway apis create &lt;API_ID&gt;<br><br># Create API config from your OpenAPI 2 yaml<br>gcloud api-gateway api-configs create CONFIG_ID --api=API_ID<br>--openapi-spec=API_DEFINITION<br><br># CONFIG_ID specifies the ID of the new API config.<br># API_ID specifies the ID of the API Gateway API associated with this API config. If the API does not already exist then this command creates it.<br># API_DEFINITION specifies the name of the OpenAPI spec containing the API definition.<br><br># Below is an example safter substituting values, use your values<br>gcloud api-gateway api-configs create api-config <br>--api=backend-api-config --openapi-spec=api-config.yaml<br><br># Find Service Account for API Gateway<br>gcloud api-gateway gateways describe &lt;GATEWAY_ID&gt; --location=us-central1<br><br># Bind invoker to THAT service account (email ends with @apigateway.gserviceaccount.com)<br>gcloud run services add-iam-policy-binding &lt;CLOUD_RUN_SERVICE&gt; \<br>  --member=&quot;serviceAccount:&lt;GATEWAY_SA_EMAIL&gt;&quot; \<br>  --role=&quot;roles/run.invoker&quot; \<br>  --region=us-central1<br><br># Create Gateway in API Gateway and Map the API with OpenAPI Config<br>gcloud api-gateway gateways create &lt;GATEWAY_ID&gt; --api=API_ID <br>--api-config=API_CONFIG.yaml --location=&lt;LOCATION&gt; --project=&lt;PROJECT ID&gt;<br><br># Test if it worked:<br># Get Gateway ID:<br>gcloud api-gateway gateways list<br><br># Get Gateway URL:<br>gcloud api-gateway gateways describe &lt;GATEWAY_ID&gt; --location=us-central1<br><br># If you need to update your API_CONFIG.yaml<br># Create new api config spec file api-config-v2<br>gcloud api-gateway gateways update &lt;GATEWAY_ID&gt;\<br>  --api=customer-backend \<br>  --api-config=api-config-v2 \<br>  --location=us-central1<br><br>gcloud api-gateway gateways update apigateway-backend --api=&lt;API_ID&gt; --api-config=API_CONFIG_V2.yaml<br>--location=&lt;LOCATION&gt;</pre><ul><li>API_ID specifies the ID of the API Gateway API associated with this API config. If the API does not already exist, then this command creates it.</li><li>API_CONFIG: specifies the name of the OpenAPI spec containing the API definition, like the API spec api-config-v1.yaml file above.</li></ul><p>Now, let’s integrate Firebase into your client service deployed on Cloud Run. You can also deploy the client on Firebase and talk to the backend server via API Gateway; you don’t have to deploy your client on Cloud Run. The example below for integration assumes you have also deployed your client on Cloud Run.</p><p>Using <a href="https://cloud.google.com/run/docs/">Cloud Run</a>, you can deploy an application packaged in a container image. Then, using Firebase Hosting, you can direct HTTPS requests to trigger your containerized app.</p><p>Firebase integration (in React deployed on Cloud Run)</p><p>Install Firebase in your client app</p><pre>npm i firebase</pre><p>In your client root folder, create firebaseConfig.ts</p><pre>import { initializeApp } from &quot;firebase/app&quot;;<br>import { getAuth } from &#39;firebase/auth&#39;;<br><br>// Web app&#39;s Firebase configuration gb-1<br>const firebaseConfig = {<br> apiKey: &quot;YOUR_API_KEY&quot;,<br> authDomain: &quot;your-project.firebaseapp.com&quot;, // get this from firebase console<br> projectId: &quot;YOUR_PROJECT_ID&quot;<br>};<br><br>// Initialize Firebase<br>const app = initializeApp(firebaseConfig);<br><br>const auth = getAuth(app);<br><br>export { auth };</pre><p>You can get the API key for your project from the Firebase console. It would be something like: “AIcaSyBlIwBFH4oupb4rKg6GLYtVDulFc8qVIVs”</p><p>Example value for authDomain: new-ui.myportals.com (custom domain) or my-project.firebaseapp.com (default URL created by Firebase when you enable hosting for your project)</p><p>firebase.json is used for integrating Firebase to your Cloud Run client service “helloworld-client”:</p><p>Deploy below config file to your firebase project</p><pre>&quot;hosting&quot;: {<br>  // ...<br>  &quot;rewrites&quot;: [ <br>  {<br>    &quot;source&quot;: &quot;/**&quot;,<br>    &quot;run&quot;: {<br>      &quot;serviceId&quot;: &quot;helloworld-client&quot;, // your Cloud Run service name<br>      &quot;region&quot;: &quot;us-central1&quot;, // your Cloud Run region<br>    }<br>  } <br>  ]<br>}</pre><pre>firebase deploy --only hosting</pre><p>With this rewrite, all calls on your Hosting domain are <strong>proxied</strong> to the helloworld-client Cloud Run service</p><p>Create src/firebase.ts (or .js) with your config from the Firebase Console:</p><pre>import { getAuth, signInWithEmailAndPassword } from &quot;firebase/auth&quot;;<br><br>const API_BASE = &quot;https://backend-api-gateway-dgswnfnjl.uc.gateway.dev&quot;<br><br>async function loginAndCall(email: string, password: string) {<br>  const auth = getAuth();<br>  const { user } = await signInWithEmailAndPassword(auth, email, password);<br><br>  // Firebase ID token<br>  const idToken = await user.getIdToken(/* forceRefresh */ true);<br><br>  const res = await fetch(`${API_BASE}/api/login`, {<br>    method: &quot;POST&quot;,<br>    headers: {<br>      &quot;Authorization&quot;: `Bearer ${idToken}`,<br>      &quot;Content-Type&quot;: &quot;application/json&quot;<br>    },<br>    body: JSON.stringify({})<br>  });<br><br>  if (!res.ok) throw new Error(`Login failed: ${res.status}`);<br>  return res.json().catch(() =&gt; ({})); // if 204, ignore body<br>}</pre><p>So that’s it, you should be able to securely send a request from Firebase securely to your Cloud Run backend.</p><p>Next up, we’ll add <strong>Cloud Storage</strong> for media (private buckets + short-lived signed URLs) and wire in <strong>MongoDB Atlas</strong> using <strong>Secret Manager</strong> for credentials and <strong>private connectivity</strong> (VPC peering or PSC) so your data never rides the public internet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ecd15584eaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing FHIR Access with OAuth 2.0 for server-to-server authentication]]></title>
            <link>https://medium.com/@nidhi.14t/securing-fhir-access-with-oauth-2-0-for-server-to-server-authentication-12f5b0e923bb?source=rss-876cf8d2eca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/12f5b0e923bb</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[fhir]]></category>
            <category><![CDATA[fhir-integration]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[smartonfhir]]></category>
            <dc:creator><![CDATA[Raccoon Runtime]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 19:40:45 GMT</pubDate>
            <atom:updated>2023-07-26T19:40:45.478Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong> <br>OAuth 2.0 is a widely used authorization framework for securing API access, and it plays a crucial role in granting applications access to Fast Healthcare Interoperability Resources (FHIR) servers. This guide will walk you through the process of registering your application, obtaining authorization, and accessing FHIR resources using two types of authorization methods — Client Credential Grant and Public Private Asymmetric Authorization.</p><p><strong>Register your Application:</strong></p><ul><li>Register your application with the Healthcare Repository developer portal. This involves providing information about your application, such as its name, redirect URIs, and the scopes you are requesting access to.<br>In case of Public-Private Key authorization, you will also need to provide Public Key while registering.</li></ul><p>After registration, you will receive:</p><ul><li><strong>For Client Credential Grant:</strong> client_Id and client_secret</li><li><strong>For Public-Private Key Authorization:</strong> client_id and a private key used for signing JWTs (the public-private pair you generated).</li></ul><p><strong>Request Authorization:</strong></p><ul><li>Your application initiates the authorization process by redirecting the user to the authorization endpoint of the FHIR server.</li><li>The request includes the desired scopes (permissions) that your application needs to access specific FHIR resources.</li><li>Here I will demonstrate authorization using Client Credential Grant using client_Id and client_secret and Public Private Asymmetric Key Authorization</li></ul><p>Let’s talk about our first flow, <strong>Client Credential Grant</strong>.</p><p>Here on registering with the Healthcare repository you are provided with a <strong>Client Id</strong> and <strong>Client Secret. </strong>You use this client Id and secret when sending requests from your application and in response you get an access token. Use this access token along with your requests to get the desired response from the repository. Below is a step by step guide on how to do Client Credential Authentication.</p><p><strong>Step 1:</strong> Register Your Application After registering your application with the Healthcare Repository, you receive a Client ID and Client Secret.</p><p><strong>Step 2:</strong> Obtain Access Token Using the Client Credential Grant, your application can obtain an access token directly from the authorization server by sending a POST request with the Client ID and Client Secret.</p><pre>POST /token HTTP/1.1<br>Host: fhir.healthcarerepository.com<br>Content-Type: application/x-www-form-urlencoded<br>grant_type=client_credentials<br>client_id=abc123<br>client_secret=xyz456</pre><p>Below is a sample response to the above request:</p><pre>{<br> &quot;access_token&quot;: &quot;accesstoken123&quot;,<br> &quot;token_type&quot;: &quot;Bearer&quot;,<br> &quot;expires_in&quot;: 3600,<br> &quot;scope&quot;: &quot;Patient.read Patient.search&quot;<br>}</pre><p>Step 3: <strong>Access FHIR Resources</strong> Now that you have obtained the access token, you can use it to access FHIR resources from the Healthcare Repository. For example, let’s retrieve patient information using the access token:</p><p>Request</p><pre>GET /Patient/123456 HTTP/1.1<br>Host: fhir.healthcarerepository.com<br>Authorization: Bearer accesstoken123</pre><p>Below is a Sample response:</p><pre>{<br> &quot;resourceType&quot;: &quot;Patient&quot;,<br> &quot;id&quot;: &quot;123456&quot;,<br> &quot;name&quot;: [<br> {<br> &quot;given&quot;: &quot;John&quot;,<br> &quot;family&quot;: &quot;Doe&quot;<br> }<br> ],<br> &quot;gender&quot;: &quot;male&quot;,<br> &quot;birthDate&quot;: &quot;1990–01–01&quot;,<br> &quot;address&quot;: [<br> {<br> &quot;line&quot;: [&quot;123 Main Street&quot;],<br> &quot;city&quot;: &quot;New York&quot;,<br> &quot;state&quot;: &quot;NY&quot;,<br> &quot;postalCode&quot;: &quot;10001&quot;<br> }<br> ],<br> &quot;identifier&quot;: [<br> {<br> &quot;system&quot;: &quot;http://example.com/patient-id&quot;,<br> &quot;value&quot;: &quot;PAT12345&quot;<br> }<br> ]<br>}</pre><p>Now for the second authorization method, <strong>Public Private Asymmetric Key Authorization</strong> we can use JWT.</p><p>To create a Public-Private Key Pair for the JWT signature, you can use tools like OpenSSL or Windows PowerShell. The public key is then registered on the FHIR repository when registering your application with the healthcare repository as described above.</p><p>To construct a JWT, you need to include specific headers and claims in its payload. The headers contain the algorithm for JWT authentication (e.g., RS256, RS384) and other details. The claims include issuer (iss), subject (sub), audience (aud), unique identifier (jti), expiration time (exp), and more.</p><p>After constructing the header and payload, they are base64 URL encoded and combined with a period separating them. The JWT is then cryptographically signed using the private key to generate a signature. The full JWT is constructed by concatenating the base64 URL encoded header, payload, and signature parts. The resulting JWT can be used for secure authentication and authorization in OAuth 2.0 workflows with FHIR on a Healthcare Repository.</p><p>Below is Step by Step process for Public Private Asymmetric Key Authorization (JWT):</p><p><strong>Step 1:</strong> Create a Public-Private Key Pair: Generate a Public-Private Key Pair for JWT signature using tools like OpenSSL or Windows PowerShell. Register the public key on the FHIR repository during application registration.</p><p><strong>Step 2: </strong>Construct a JWT: Include specific headers and claims in the JWT payload, such as issuer (iss), subject (sub), audience (aud), unique identifier (jti), expiration time (exp), and more.</p><p><strong>Step 3: </strong>Sign the JWT: Base64 URL encode and concatenate the header and payload, then cryptographically sign the JWT using the private key to generate a signature.</p><p><strong>Step 4: </strong>Access FHIR Resources: Use the constructed JWT as a Bearer token to authenticate and authorize your application’s web service calls to access FHIR resources.</p><p>Here’s an example JWT payload:</p><pre>Here&#39;s an example JWT payload:{<br> &quot;iss&quot;: &quot;d45049c3–3441–40ef-ab4d-b9cd86a17225&quot;, <br> &quot;sub&quot;: &quot;d45049c3–3441–40ef-ab4d-b9cd86a17225&quot;,<br> &quot;aud&quot;: &quot;https://fhir.example.com/fhir-oauth/oauth2/token&quot;,<br> &quot;jti&quot;: &quot;f9eaafba-2e49–11ea-8880–5ce0c5aee679&quot;,<br> &quot;exp&quot;: 1583524402,<br> &quot;nbf&quot;: 1583524102,<br> &quot;iat&quot;: 1583524102<br>}</pre><p>Note*: Check the expiration, nbf, and iat expected values from the relevant API documentation provided by the healthcare repository you are requesting access to. Usually, iss and sub is the client_id provided when registering your application.</p><p><strong>Conclusion:</strong> Securing FHIR access with OAuth 2.0 is vital for protecting healthcare data. The Client Credential Grant provides direct access, while Public Private Asymmetric Key Authorization enhances security with JWTs. Following API guidelines ensures proper token construction. By adopting robust security measures, we safeguard patient data and foster innovation in healthcare, creating a safer and interconnected healthcare ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12f5b0e923bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>