<?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 Mohamed Motaweh on Medium]]></title>
        <description><![CDATA[Stories by Mohamed Motaweh on Medium]]></description>
        <link>https://medium.com/@mohamed.motaweh?source=rss-ce6c7666a211------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aBouezCHLsohm1mVSQPnVA.jpeg</url>
            <title>Stories by Mohamed Motaweh on Medium</title>
            <link>https://medium.com/@mohamed.motaweh?source=rss-ce6c7666a211------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:02:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamed.motaweh/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[Context Engineering: Manage Your AI Like a Developer, Not a Machine]]></title>
            <link>https://medium.com/@mohamed.motaweh/context-engineering-manage-your-ai-like-a-developer-not-a-machine-c49ce8a2037c?source=rss-ce6c7666a211------2</link>
            <guid isPermaLink="false">https://medium.com/p/c49ce8a2037c</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Mohamed Motaweh]]></dc:creator>
            <pubDate>Thu, 04 Dec 2025 00:34:09 GMT</pubDate>
            <atom:updated>2025-12-04T00:34:09.985Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://chatgpt.com/c/6912070a-89a0-8325-89fb-1e546509c29a#">last post</a>, I argued we should treat LLMs like <strong>junior developers</strong>.</p><p>This one explains <em>why</em> we should treat them as teammates in the first place, why planning matters and how <strong>context engineering</strong> makes that possible.</p><h3><strong>Why research and planning matter?</strong></h3><p>When you ask a person to do something and things don’t go as expected, what happens? They pause, think, and either make a decision or ask for clarification.</p><p>LLM agents work the same way, but unlike humans, they do not automatically know your intent. They need context, constraints, and a clear sense of your goals to make good decisions when the unexpected happens.</p><p>Imagine you’re at a restaurant and you order a pizza. The waiter heads to the kitchen and discovers they’re out of pizza dough. You’d expect them to return and ask what you’d like instead. You wouldn’t want them to bring you a burger just because “it’s food.”</p><p>This is why planning matters. The planning phase gives the agent space to research, reason, and align with your expectations before taking action. It helps prevent surprises and ensures the final output reflects what you actually intended.</p><h3>A Defender’s Story: Instructions ≠ Understanding</h3><p>Imagine dropping an AI agent into a match as a <strong>defender</strong>. It’s the agent’s first time on the pitch. It doesn’t know the flow of the game, the unwritten rules, or even what counts as “good” defending , all it has are the words you give it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vVVOjOwhNoAuZ2GHauP-7w.png" /><figcaption>Half Basketball court and Half Soccer Field/Football pitch</figcaption></figure><h3>Naive instructions</h3><blockquote>“Don’t let the ball cross you. Kick it to the other side. Pass to teammates.”</blockquote><p>With only this, the agent applies rules in a silo:</p><ul><li>If the goalkeeper already holds the ball, the agent still charges in to “kick it to the other side.”</li><li>Without context, it may not even be sure <strong>which sport</strong> is being played, so it might attempt actions that make sense in another game (like using hands, basketball-style).</li><li>It obeys verbs, not intent. So you get technically “correct” actions that are tactically absurd.</li></ul><h3>Slightly better, still brittle</h3><blockquote>“You’re playing football. Keep the ball away from our side. Pass to teammates.”</blockquote><p>Now the agent knows the sport, but still breaks in real scenarios:</p><ul><li>It doesn’t know how to handle restarts: fouls, throw-ins, corners, or when to take a penalty.</li><li>It can’t recognize game states: when to slow play down, when to build out, or when to press.</li><li>It lacks decision rules for ambiguous situations (who marks which attacker? when to commit?).</li></ul><h3>Context-rich setup (what actually works better)</h3><blockquote>“You’re a defender for Team X.</blockquote><blockquote>Responsibilities: protect our half, mark runners, win first/second balls, handle restarts (fouls, throw-ins, penalties if assigned), choose pass or hold based on pressure, and wait for the ball when we’re building out.</blockquote><blockquote>Objective: help us win (positive goal difference).</blockquote><blockquote>Strategy: we attack more”</blockquote><p>This version gives role, rules, typical situations, goals, and strategy. It turns a bot that chases verbs into a defender that can <em>reason</em>.</p><h4>The planning loop! harden context before execution</h4><p>Since you can’t pre-specify every scenario, planning is iterative. Treat the agent like a teammate you brief before the match:</p><ol><li><strong>Brainstorm &amp; surface assumptions.</strong> Ask what it thinks the role means; let it “think aloud.”</li><li><strong>Simulate edge cases.</strong> Goalkeeper possession, opponent press, being a player down, restarts.</li><li><strong>Specify fallbacks.</strong> When uncertain: play safe, hold the ball, or ask for clarification.</li><li><strong>Review &amp; correct.</strong> Check its mental model and fix inaccuracies.</li><li><strong>Lock the plan.</strong> Once aligned, move into execution mode.</li></ol><h4>Closing thought</h4><p>Instructions alone create activity; <strong>context engineering</strong> creates judgment. Planning the back-and-forth where the agent explores, reasons, and clarifies, is what turns brittle rule-followers into teammates who actually help you win.</p><h3>What Is Context Engineering?</h3><p>Context engineering is the practice of shaping the “mental environment” an AI agent operates in before it ever takes action. Instead of feeding the agent a list of commands, you define its role, objectives, constraints, domain rules, likely scenarios, and preferred decision patterns. It’s not about writing the perfect prompt, it’s about <em>onboarding and managing a teammate</em>. Just like a new hire or a new player, the agent needs orientation, expectations, and feedback loops to perform well. Context engineering builds that shared understanding up front so that when reality gets messy, the agent can act with judgment instead of blindly following verbs.</p><h3>From the Pitch to the Codebase: How I Onboard an AI to a Feature</h3><p>Onboarding an AI agent to a feature is less like “asking the LLM to write some code” and more like introducing a new teammate to a codebase they’ve never seen before. I follow a structured workflow, not because the AI needs ceremony, but because clarity upfront makes execution far more reliable.</p><h3>1. Seed Context</h3><p>Before the agent plans anything, it needs a mental map of the environment. I give it lightweight but meaningful background:</p><ul><li>The feature’s purpose</li><li>The subsystem we’re touching</li><li>Relevant architecture or design patterns</li><li>Important constraints (performance, security, legacy traps)</li></ul><p>This is onboarding, not a data dump. The goal is clarity, not volume.</p><h3>2. Assign Role (Optional)</h3><p>Sometimes the agent needs a point of view to reason effectively. So I anchor it with a role, e.g.:</p><ul><li>“You are a senior Node.js test engineer.”</li><li>“You are a backend architect for distributed job systems.”</li></ul><p>Role assignment focuses its decision-making and reduces meandering. Not always required, but extremely useful when the task has a dominant lens.</p><h3>3. Do Planning Before Code</h3><p>No one wants a teammate shipping code before thinking. Same idea here.</p><p>I ask the agent to outline:</p><ul><li>How it intends to design the feature</li><li>Data flow and API boundaries</li><li>Edge cases and failure modes</li><li>Testing strategy</li><li>Assumptions it’s making</li></ul><p>This surfaces misunderstandings early, before they turn into bad code.</p><h3>4. Let It Scout the Code</h3><p>During planning do we look at real files. I have the agent explore the repo and report back:</p><ul><li>Where relevant logic already lives</li><li>What patterns need to be followed</li><li>Which tests will need updates</li><li>Any inconsistencies or risks it notices</li></ul><p>This grounds the plan in reality. It’s the moment the agent goes from theorizing to understanding the space.</p><h3>5. Co-Write Acceptance Criteria</h3><p>Finally, we define the contract for success together:</p><ul><li>Functional requirements</li><li>Non-functional expectations</li><li>Edge cases</li><li>What “done” truly means</li></ul><p>This step aligns expectations and gives the agent a crisp target to execute against. When the criteria are clear, the code it produces is dramatically more stable and predictable.</p><h3>Experience Differences (and How to Scaffold Without Condescension)</h3><p>This structured process turns the AI from a code generator into an actual collaborator. It mirrors how we coach a defender on the pitch, give them context, teach the patterns, walk through situations, then let them play with confidence.</p><p>LLMs act like less-experienced engineers: fast, curious, adaptable; but missing your team’s context.</p><p>Don’t micromanage. <strong>Coach.</strong></p><ul><li><strong>Ask–Explain–Verify:</strong> state uncertainties, justify choices, self-check.</li><li><strong>Compare designs:</strong> ask for 2+ options with trade-offs.</li><li><strong>Edge-case sweeps:</strong> timezones, nils, retries, idempotency.</li><li><strong>Evidence over vibes:</strong> cite code paths and docs.</li><li><strong>Autonomy:</strong> explore freely, stop at review gates.</li></ul><h3>A Quick Note on “Junior”: Less Experience ≠ Less Intelligence</h3><p>When I say <em>“treat LLMs like junior developers,”</em> I don’t mean <em>“less smart.”</em></p><p>I mean <strong>less experienced in this project and domain</strong>.</p><p>In fact, many “junior” engineers, especially those new to AI, adapt faster than anyone. So “junior” here means <strong>low context, high potential.</strong><br>Treat LLMs as <strong>smart, adaptable teammates</strong> who just need onboarding, ground truth, and feedback loops to deliver safely.</p><h3>The Takeaway</h3><p><strong>Context engineering</strong> is just <strong>good engineering leadership applied to AI teammates.</strong></p><p>Onboard them deliberately. Plan together. Review tightly. Version your context.</p><p>Do that, and your agent stops acting like a machine that “does verbs” and starts acting like a developer who can reason, adapt, and ship; like a smart, fast-learning junior with a very high ceiling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c49ce8a2037c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Use LLMs to Code and Why You Should Treat Them Like Junior Developers]]></title>
            <link>https://medium.com/@mohamed.motaweh/how-i-use-llms-to-code-and-why-you-should-treat-them-like-junior-developers-6e285596977f?source=rss-ce6c7666a211------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e285596977f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Mohamed Motaweh]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 17:49:57 GMT</pubDate>
            <atom:updated>2025-10-27T16:08:22.503Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVrlmA5m0x430NY75n5CEg.png" /></figure><p>By now, almost every developer has their own <em>flavor</em> of using LLMs to code. Some treat them like autocomplete on steroids, others like full-on pair programmers.</p><p>Over the past year, I’ve experimented with many <strong>LLM agents</strong>:<strong> </strong>Claude Code, Codex, Cursor, and Factory.ai.</p><p>Through a lot of trial, error, and wasted tokens, I’ve developed a strategy that finally feels both efficient and sustainable. Interestingly, it aligns closely with how some <strong>LLM agent tools</strong> (like <a href="https://docs.factory.ai/cli/user-guides/implementing-large-features">Factory’s guide on implementing large features</a>) are starting to recommend working with LLMs.</p><p>I wanted to share that approach here, not as a perfect formula, but as a set of lessons learned from treating LLMs not as magic code machines, but as junior teammates who need structure, context, and direction.</p><h3>The Core Realization: LLMs Are Like Junior Developers</h3><p>Here’s the key insight that changed everything for me:</p><blockquote><em>💡 </em><strong><em>LLMs are like junior developers.</em></strong></blockquote><p>You can’t just throw them a vague feature request and expect a production-ready solution.<br>If you have to explain every detail of what you want in natural language, you’re basically spending the same amount of effort as writing the code yourself.</p><p>Early on, I made the mistake of giving LLMs open-ended prompts like:</p><blockquote><em>“Implement a user management module with role-based access and integrate it with the current API.”</em></blockquote><p>I’d get 1K lines of decent-looking code that <em>almost</em> worked but didn’t match my app’s architecture, coding conventions, or feature requirements. After a few rounds of “rewrite this, fix that, change this method name,” I’d realize I could’ve just written it faster myself.</p><p>That’s when I started treating LLMs the way I’d treat a new team member:</p><ul><li>Give them <strong>context</strong>, not just instructions.</li><li>Share <strong>acceptance criteria</strong> before they start coding.</li><li>Let them explore, make suggestions, and iterate but under direction.</li></ul><p>And most importantly:<br><strong><em>Never let an LLM start coding before you know exactly what success looks like.</em></strong></p><h3>My Practical Workflow</h3><p>After months of iteration, I’ve found a rhythm that works really well. I use three distinct modes depending on the size and complexity of the task.</p><h4>🧩 1. Small Tasks → Direct Implementation</h4><p>For tiny, well-scoped changes, I let the LLM handle it immediately.</p><p>Examples:</p><ul><li>“Change the API to return UUID instead of ID.”</li><li>“Add an option for users to change their name from the Settings tab.”</li></ul><p>In these cases, I already know exactly what needs to change. There’s little ambiguity, no architecture-level decision-making, and low risk.<br> It’s the equivalent of giving a junior dev a clear Jira ticket with one line of acceptance criteria.</p><p>The output is usually clean, correct, and quick to review.</p><h4>🧠 2. Medium Tasks → Plan Before You Code</h4><p>When the scope is larger — say, implementing a new settings module, refactoring an authentication flow, or adding caching logic, I switch into <strong>planning mode</strong>.</p><p>Here’s what that looks like:</p><ol><li>I describe what I want to build in plain language.</li><li>I share any initial acceptance criteria or constraints.</li><li>I ask the LLM to propose a solution, not code, just a <strong>plan</strong>.</li></ol><p>Then we iterate.<br>I critique the proposed approach, refine my criteria, and sometimes even ask the LLM to explore alternative designs or review similar open-source implementations.</p><p>This process is surprisingly powerful. It helps the model:</p><ul><li>Learn the <strong>structure</strong> of my codebase,</li><li>Understand my <strong>intentions</strong>, and</li><li>Align with my <strong>project’s best practices</strong>.</li></ul><p>Sometimes, the LLM even surprises me with a more elegant design than I initially imagined.</p><p>When I suspect its information might be outdated (for example, about iOS 26 APIs), I explicitly direct it to look up the web for updated practices or confirm compatibility.</p><p>Once we’re in agreement on the plan, then and only then, do I let it start coding.</p><h4>📋 3. Large Features → Structured Plans &amp; Tickets</h4><p>For big projects or multi-step features, I take the “planning” concept one step further.</p><p>Here’s what I do:</p><ul><li>Ask the LLM to produce a <strong>detailed implementation plan</strong> in Markdown.</li><li>Review and iterate on that plan until I’m confident it’s solid.</li><li>Sometimes, I feed that plan into <strong>Jira MCP</strong> to automatically create tickets for each subtask.</li></ul><p>If the task touches multiple systems, I also provide additional context such as:</p><ul><li><strong>PRDs / TRDs</strong>,</li><li><strong>DataDog traces</strong> for high-latency endpoints, or</li><li><strong>Architecture diagrams</strong> and performance metrics.</li></ul><p>This gives the LLM the kind of context a senior engineer would have and the resulting output often needs minimal editing.</p><h3>Why This Works</h3><p>This workflow balances <strong>control</strong> and <strong>creativity</strong>.</p><p>If you micro-manage the LLM too much, you lose the benefit of its pattern recognition and creative problem-solving.<br>If you give it too much freedom, you’ll waste time and tokens rewriting messy output.</p><p>Treating the model as a <em>junior dev</em> gives you the best of both worlds:</p><ul><li>It can explore ideas and optimize designs.</li><li>You stay in control of structure, quality, and direction.</li></ul><p>The LLM isn’t replacing your engineering thinking , it’s amplifying it.</p><h3>The Future of AI Coding Workflows</h3><p>Right now, this workflow still requires “manual babysitting.” But I don’t think it’ll stay that way for long.</p><p>As these coding assistants evolve, I expect:</p><ul><li>Better <strong>context retention</strong> across sessions,</li><li>Smarter <strong>feature planning assistants</strong>, and</li><li>Built-in <strong>best practice alignment</strong> based on project type or tech stack.</li></ul><p>In other words, what feels like a manual workflow today will likely become automated soon, with <strong>LLM agents</strong> that can understand your repo, goals, and standards out of the box.</p><h3>Final Thoughts</h3><p>This strategy isn’t perfect, but it’s been a huge productivity boost and it’s made me think differently about the future of software development.</p><p>Instead of asking:</p><blockquote><em>“Can the LLM build this for me?”</em></blockquote><p>I now ask:</p><blockquote><em>“How can I </em>collaborate<em> with the LLM to build this faster and better?”</em></blockquote><p>That mindset shift alone has saved me countless hours and a mountain of wasted tokens.</p><p>💬 <strong>I’d love to hear how others are approaching this.</strong><br>Do you treat LLMs more like tools, or like teammates?<br>What workflows or habits have helped you get consistent, high-quality results?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e285596977f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>