<?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 edbert kwesi on Medium]]></title>
        <description><![CDATA[Stories by edbert kwesi on Medium]]></description>
        <link>https://medium.com/@edbertkwesi.ek?source=rss-e712165c2158------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vt-iMWxlFYe78O7RHWWKdw.jpeg</url>
            <title>Stories by edbert kwesi on Medium</title>
            <link>https://medium.com/@edbertkwesi.ek?source=rss-e712165c2158------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:10:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@edbertkwesi.ek/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[Async Programming <Rust>]]></title>
            <link>https://medium.com/@edbertkwesi.ek/async-programming-rust-e73e2a77ae12?source=rss-e712165c2158------2</link>
            <guid isPermaLink="false">https://medium.com/p/e73e2a77ae12</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tokio]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[concurrent-programming]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[edbert kwesi]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 08:19:44 GMT</pubDate>
            <atom:updated>2026-10-22T08:19:44.139Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>A programming model for Multi-tasking in Rust, .await( ) and async function.</em></strong></p><p><em>Asynchronous programming is a kind or category of concurrent programming where a task or a thread is allowed to run whilst another waits or sleep for a result or IO. Unlike in normal concurrency a thread or a task must finish before another begins meaning their is a block that prevents another task from executing until the first task finishes.</em></p><p><em>Async Rust is such that if the program can be executed immediately then output the result if not it waits to make space for another to run meaning it has a </em><strong><em>Future trait</em></strong><em> and can be </em><strong><em>polled(ready )or pending</em></strong><em>. Meaning there is some sort of scheduler or coordinate that carries out the job of arranging the task or threads for execution. Async and .await( ) are built in tools or methods for writing asynchronous functions , which implements a trait called future. As a result every async function in Rust is automatically part of the Future trait in Rust have a Future trait as well.</em></p><p><em>Any place where async code employs await means control is handed back to the runtime which is able to kick-off or start-off another task and comeback to the previous one when is ready in the future</em> .</p><p><em>For example in the code below the fetch_user_data function can sleep or wait for the data it has requested meaning it returns a</em><strong><em> future</em></strong><em> whilst another side of the program continues to run.</em></p><pre><br>#[allow(unused_imports)]<br>use tokio::time::{Duration, sleep};<br><br>// First async function: simulates fetching data<br>async fn fetch_user_data(user_id: u32) -&gt; String {<br>    println!(&quot;Fetching data for user {}...&quot;, user_id);<br>    sleep(Duration::from_millis(500)).await; // Simulate network delay<br>    format!(&quot;User Data for ID: {}&quot;, user_id)<br>}<br><br>// Second async function: simulates processing data<br>async fn process_data(data: String) -&gt; String {<br>    println!(&quot;Processing: &#39;{}&#39;...&quot;, data);<br>    sleep(Duration::from_millis(300)).await; // Simulate work being done<br>    data.to_uppercase()<br>}<br><br>#[tokio::main]<br>async fn main() {<br>    println!(&quot;--- Async Workflow Started ---&quot;);<br><br>    // Execute the async functions sequentially using .await<br>    let user_data = fetch_user_data(42).await;<br>    let processed_result = process_data(user_data).await;<br><br>    println!(&quot;Final Result: {}&quot;, processed_result);<br>    println!(&quot;--- Async Workflow Completed ---&quot;);</pre><p><strong><em>Generalizing Multi-thread programs Runtime and executors.</em></strong></p><p><em>Async is a programming pattern in the concurrent(multi-thread ) programming model. There is also another programming pattern which is not Async but just ordinary multi-thread program.</em></p><p><em>To identify Async programs any function having </em><strong><em>async</em></strong><em> and </em><strong><em>await</em></strong><em> is asynchronous program, in-addition an Async function has a future Trait in Rust meaning a computation from that function can hang on for a while called </em><strong><em>Pending in Rust and can also be carried out immediately called Poll.</em></strong></p><p><em>Every </em><strong><em>Async </em></strong><em>program has a time, meaning some duration to sleep. Imagine a numerous Async threads, which are to run how would that happen.? Would it happen</em><strong><em> sequentially or randomly. The Runtime Executor in Tokio Rust is a sort of scheduler , a form of queuing algorithm called WORK-STEALING FIRST-IN FIRST-OUT algorithm that regroups all pending computations and activate them again. it then does this with a timer.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*DcffrK40SbIWdCW4_k0CSw.png" /><figcaption>output struct of a future trait</figcaption></figure><p><em>With this you can implement a future for any function , meaning that function will now be able to either </em><strong><em>Poll</em></strong><em> or </em><strong><em>Pending. For example the code below now has </em></strong><em>a Future implemented for socket Read meaning socket read can return ready(Poll) or Pending</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*VrB8DVk0e511VrudLOx5wA.png" /><figcaption>implementing a Future for socket Read.</figcaption></figure><p><em>The tokio crate is specifically designed for runtime computations in async mode.This crate has an inbuilt executor that reschedules pending threads from the future struct for re-computation. To use the tokio crate successfully you can apply the same programming techniques used in concurrency, such as spawning a task, joining task threads together.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*Rptm1FYEaNmnFKVd397HmQ.png" /><figcaption>Spawning threads in tokio</figcaption></figure><p><strong><em>What’s Next on upcoming post.</em></strong></p><p><em>More examples on implementing a future trait for any function , how the code looks like.</em></p><p><em>Understanding the concept of the Runtime executor.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e73e2a77ae12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Engineering AI Agents using SKILL]]></title>
            <link>https://medium.com/@edbertkwesi.ek/engineering-ai-agents-using-skill-832562144c97?source=rss-e712165c2158------2</link>
            <guid isPermaLink="false">https://medium.com/p/832562144c97</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[skills]]></category>
            <dc:creator><![CDATA[edbert kwesi]]></dc:creator>
            <pubDate>Sun, 11 Oct 2026 18:03:24 GMT</pubDate>
            <atom:updated>2026-10-11T18:40:07.304Z</atom:updated>
            <content:encoded><![CDATA[<h3>SKILLS for AI Agents</h3><p><em>from the Context Layer, knowing what it entails.</em></p><p><em>This post elaborates more on context engineering and it classes such as </em><strong><em>DYNAMIC context and STATIC context. </em></strong><em>in the AI Software Development Lifecycle (AI-SDLC).</em></p><p><em>Two main categories of context an Agent requires to function optimally, Static and Dynamic context. Files such as </em><strong><em>AGENT.md,</em></strong><em> </em><strong><em>CLAUDE.md</em></strong><em>, </em><strong><em>GEMINI.md,</em></strong><em> .The content within this files define the agentic personae and how it should behave. </em><strong><em>Static context </em></strong><em>always include global memory and persona. it defines who the agent is and how it behaves. . In common language static context are the very necessary ingredients needed for software development to take place, like coding rules, goals, infrastructure be it compute and also environment it may be a sand-boxed environment .</em><strong><em> COST:</em></strong><em> a huge static context will lead to token bloat and unthinkable usage cost. </em><strong><em>Also:</em></strong><em> if you want to know the behavior of the agent look for the static context file its what defines the agentic behavior.</em></p><p><strong><em>Dynamic context:</em></strong></p><p><em>involves skill instructions triggered by task-matching, tool result retrieved during execution, documents fetched from RAG-pipelines including windowed session history. Bloated static context dilutes signal.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*WjtL9JTFADdrDh-HfecV1g.png" /><figcaption>Dynamic and static context</figcaption></figure><p><strong><em>Agent-skills : A standardized way of equipping and AI agent with new capabilities and expertise</em></strong></p><p><strong><em>Agent-skill</em></strong><em> is activated by when a task matches a skill description, the agent reads the full SKILL.md instructions into context.</em> <em>At the Execution stages the agent follows instruction bundled code or loading referenced file as needed. You can read more about agent skills at </em><a href="https://agentskills.io/home"><em>agentskills.io</em></a><em>. Also Agent skill enables any general agent to become a specialized agent meaning you do not necessary need to start an agent from the scratch to suit your environment with agent skills you can make any agent a specialized one. In order words agent skills are for distinctive tasks. Every skill leaves in it own directory. It therefore suggest that every activity has it own unique skill.</em><strong><em> For example consider </em></strong><em>a skill designed to conduct </em><strong><em>daily cafe-preparations .</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57XSLXdWPOW42dctU1PuLA.png" /></figure><p><em>Loading process of a SKILL.md script occur in three stages : Firstly the </em><strong><em>Metadata( name + description ) </em></strong><em>is always in the agent context. Then after </em><strong><em>SKILL.md body</em></strong><em> is also loaded only when the skill trigger then followed by</em><strong><em> bounded resources</em></strong><em> which are strictly loaded as needed. YAML front-matter is the first inscription on any skill.md script because it is the activation trigger . For example the front matter for the cafe-preparation would look like this:</em></p><pre>---<br>name: cafe-preparation<br>description: |<br>Calculates daily ingredient needs and generates prep sheets for cafe operations.<br>Use when the user asks to estimate daily quantities, convert drinks to<br>ingredients, or generate shopping lists.<br>Do NOT use for employee shift scheduling or financial accounting.<br>---</pre><p><em>From personal observation SKILL.md is an automation script, so could say it’s an automation instruction file that defines how an AI agent should execute a specific workflow task.</em></p><p><em>Also the SKILL teaches an agent how to think about a particular kind of work or task . Also Auto-research does not really need a skill to achieve it goal.</em></p><p>A few resources with which you can familiarize yourself with Agent-Skill.</p><ul><li><a href="https://agentskills.io/home">Agent Skills Overview - Agent Skills</a></li><li><a href="https://mcpservers.org/agent-skills/author/anthropic">Anthropic Skills | Claude Skills &amp; Agent Skills Library</a></li></ul><p><a href="https://learn.microsoft.com/en-us/agent-framework/agents/skills?pivots=programming-language-csharp">https://learn.microsoft.com/en-us/agent-framework/agents/skills?pivots=programming-language-csharp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=832562144c97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Alchemist codes no more. Now He writes the SPECs that makes the SOFTWARE.]]></title>
            <link>https://medium.com/@edbertkwesi.ek/the-alchemist-codes-no-more-now-he-writes-the-specs-that-makes-the-software-3615493e1bf4?source=rss-e712165c2158------2</link>
            <guid isPermaLink="false">https://medium.com/p/3615493e1bf4</guid>
            <category><![CDATA[github-spec-kit]]></category>
            <category><![CDATA[google-antigravity-skills]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[edbert kwesi]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 15:30:35 GMT</pubDate>
            <atom:updated>2026-06-06T15:30:35.927Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The days of searching for the magical stone is over a new discovery has shown that Large Language Models coupled with their agentic instructions are capable of writing the DNA code of the very stone the alchemist is search of with a bit of precise instruction well specified software can now be generated quickly and easily but the alchemist must know the formula the recipe that make-up an excellent software.</em></p><p><em>With specificity comes precision the concept of </em><strong><em>Spec Driven Development </em></strong><em>is about precisely crafting detailed rich </em><strong><em>context</em></strong><em> for a</em> <strong><em>Large Language Model</em></strong> <em>to follow during it execution process. To start-off lets combine spec Driven Development with Google’s Antigravity plus ADK to build an Agent that is able to make restaurant orders and book reservations as well.</em></p><p><strong><em>Developing restaurant concierge application with reservation booking added through a complete SDD cycle using Google’s Antigravity</em></strong></p><p><em>Google Cloud is the main platform for this project. make sure you have </em><strong><em>uv,</em></strong><em> git, </em><strong><em>gcloud</em></strong><em>, and </em><strong><em>npm</em></strong><em> installed on your machine or whichever is your choice cloud or virtual machine.</em></p><blockquote>The guide below enables you to clone project repo <strong>antigravity IDE authenticate with Google cloud</strong> , s<strong>etup your environment</strong> and e<strong>nable API’s</strong></blockquote><pre>git clone https://github.com/alphinside/sdd-adk-antigravity-starter.git sdd-adk-agents-agy<br>cd sdd-adk-agents-agy<br><br>git remote remove origin<br><br>gcloud auth login<br>gcloud auth application-default login<br><br>echo &quot;GOOGLE_CLOUD_LOCATION=global&quot; &gt; .env<br>echo &quot;REGION=us-central1&quot; &gt;&gt; .env<br><br><br>curl -sL https://raw.githubusercontent.com/alphinside/cloud-trial-project-setup/main/setup_verify_trial_project.sh -o setup_verify_trial_project.sh<br>bash setup_verify_trial_project.sh &amp;&amp; source .env<br><br><br>gcloud services enable \<br>  aiplatform.googleapis.com \<br>  sqladmin.googleapis.com \<br>  compute.googleapis.com \<br>  cloudresourcemanager.googleapis.com<br><br>uv sync<br><br>cat &gt; restaurant_concierge/.env &lt;&lt;EOF<br>GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}<br>GOOGLE_CLOUD_LOCATION=global<br>GOOGLE_GENAI_USE_VERTEXAI=True<br>EOF<br><br>export DB_PASSWORD=codelabpassword<br>echo &quot;DB_PASSWORD=${DB_PASSWORD}&quot; &gt;&gt; .env<br><br>chmod +x scripts/setup_database.sh<br>./scripts/setup_database.sh &gt; database_setup.log 2&gt;&amp;1 &amp;</pre><p><strong><em>Architectural overview</em></strong></p><p><em>The challenge is to develop a restaurant app which has an Agent embbeded with the app. This agent should be able to book tables and make reservations as you command. so we therefore need something to hold the data and also a way to query the data. Cloud SQL to hold data, then an MCP toolbox connected to the database plus vertex AI for embedding data inference server.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*IurbUumM5TDd3y4SaJHKig.png" /></figure><h4>Part two: Spec Driven Development.</h4><p><em>Speck-kit is a python package designed for the spec Driven Developement software paradigm. Made up of markdown files that enable you to write the specifications you want for your software. Here is how a spec-kit flow hierarchy looks like.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*qdfgAIvoDtprnHVyz6o4jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*jCBm-RiYEPcb4WnBdjltfw.png" /></figure><p><em>Each file named here has a role play in guiding the Large Language model in doing what we want</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*Fc9-dyVg-EYZqkgOwAG5qA.png" /></figure><p><em>Below are the workflow files starting from spec-kit.specify.md file to spec-kit.implement md. These files contain instructional guides and steps that enable the Large Language model to do as you have precisely described in your prompts. For example. if a user describes in his/her prompt that a particular feature be implemented immediately the spec-kit.implement script is activated for the feature to be built.</em></p><p><em>Below is the spec-kit.specify.md script which contains instructions on the feature specifications you want to implement.</em></p><pre>---<br>description: Create or update the feature specification from a natural language feature description.<br>handoffs: <br>  - label: Build Technical Plan<br>    agent: speckit.plan<br>    prompt: Create a plan for the spec. I am building with...<br>  - label: Clarify Spec Requirements<br>    agent: speckit.clarify<br>    prompt: Clarify specification requirements<br>    send: true<br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>The text the user typed after `/speckit.specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `{{args}}` appears literally below. Do not ask the user to repeat it unless they provided an empty command.<br><br>Given that feature description, do this:<br><br>1. **Generate a concise short name** (2-4 words) for the branch:<br>   - Analyze the feature description and extract the most meaningful keywords<br>   - Create a 2-4 word short name that captures the essence of the feature<br>   - Use action-noun format when possible (e.g., &quot;add-user-auth&quot;, &quot;fix-payment-bug&quot;)<br>   - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)<br>   - Keep it concise but descriptive enough to understand the feature at a glance<br>   - Examples:<br>     - &quot;I want to add user authentication&quot; → &quot;user-auth&quot;<br>     - &quot;Implement OAuth2 integration for the API&quot; → &quot;oauth2-api-integration&quot;<br>     - &quot;Create a dashboard for analytics&quot; → &quot;analytics-dashboard&quot;<br>     - &quot;Fix payment processing timeout bug&quot; → &quot;fix-payment-timeout&quot;<br><br>2. **Check for existing branches before creating new one**:<br><br>   a. First, fetch all remote branches to ensure we have the latest information:<br><br>      ```bash<br>      git fetch --all --prune<br>      ```<br><br>   b. Find the highest feature number across all sources for the short-name:<br>      - Remote branches: `git ls-remote --heads origin | grep -E &#39;refs/heads/[0-9]+-&lt;short-name&gt;$&#39;`<br>      - Local branches: `git branch | grep -E &#39;^[* ]*[0-9]+-&lt;short-name&gt;$&#39;`<br>      - Specs directories: Check for directories matching `specs/[0-9]+-&lt;short-name&gt;`<br><br>   c. Determine the next available number:<br>      - Extract all numbers from all three sources<br>      - Find the highest number N<br>      - Use N+1 for the new branch number<br><br>   d. Run the script `.specify/scripts/bash/create-new-feature.sh --json &quot;{{args}}&quot;` with the calculated number and short-name:<br>      - Pass `--number N+1` and `--short-name &quot;your-short-name&quot;` along with the feature description<br>      - Bash example: `.specify/scripts/bash/create-new-feature.sh --json &quot;{{args}}&quot; --json --number 5 --short-name &quot;user-auth&quot; &quot;Add user authentication&quot;`<br>      - PowerShell example: `.specify/scripts/bash/create-new-feature.sh --json &quot;{{args}}&quot; -Json -Number 5 -ShortName &quot;user-auth&quot; &quot;Add user authentication&quot;`<br><br>   **IMPORTANT**:<br>   - Check all three sources (remote branches, local branches, specs directories) to find the highest number<br>   - Only match branches/directories with the exact short-name pattern<br>   - If no existing branches/directories found with this short-name, start with number 1<br>   - You must only ever run this script once per feature<br>   - The JSON is provided in the terminal as output - always refer to it to get the actual content you&#39;re looking for<br>   - The JSON output will contain BRANCH_NAME and SPEC_FILE paths<br>   - For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;)<br><br>3. Load `.specify/templates/spec-template.md` to understand required sections.<br><br>4. Follow this execution flow:<br><br>    1. Parse user description from Input<br>       If empty: ERROR &quot;No feature description provided&quot;<br>    2. Extract key concepts from description<br>       Identify: actors, actions, data, constraints<br>    3. For unclear aspects:<br>       - Make informed guesses based on context and industry standards<br>       - Only mark with [NEEDS CLARIFICATION: specific question] if:<br>         - The choice significantly impacts feature scope or user experience<br>         - Multiple reasonable interpretations exist with different implications<br>         - No reasonable default exists<br>       - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**<br>       - Prioritize clarifications by impact: scope &gt; security/privacy &gt; user experience &gt; technical details<br>    4. Fill User Scenarios &amp; Testing section<br>       If no clear user flow: ERROR &quot;Cannot determine user scenarios&quot;<br>    5. Generate Functional Requirements<br>       Each requirement must be testable<br>       Use reasonable defaults for unspecified details (document assumptions in Assumptions section)<br>    6. Define Success Criteria<br>       Create measurable, technology-agnostic outcomes<br>       Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)<br>       Each criterion must be verifiable without implementation details<br>    7. Identify Key Entities (if data involved)<br>    8. Return: SUCCESS (spec ready for planning)<br><br>5. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.<br><br>6. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:<br><br>   a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:<br><br>      ```markdown<br>      # Specification Quality Checklist: [FEATURE NAME]<br>      <br>      **Purpose**: Validate specification completeness and quality before proceeding to planning<br>      **Created**: [DATE]<br>      **Feature**: [Link to spec.md]<br>      <br>      ## Content Quality<br>      <br>      - [ ] No implementation details (languages, frameworks, APIs)<br>      - [ ] Focused on user value and business needs<br>      - [ ] Written for non-technical stakeholders<br>      - [ ] All mandatory sections completed<br>      <br>      ## Requirement Completeness<br>      <br>      - [ ] No [NEEDS CLARIFICATION] markers remain<br>      - [ ] Requirements are testable and unambiguous<br>      - [ ] Success criteria are measurable<br>      - [ ] Success criteria are technology-agnostic (no implementation details)<br>      - [ ] All acceptance scenarios are defined<br>      - [ ] Edge cases are identified<br>      - [ ] Scope is clearly bounded<br>      - [ ] Dependencies and assumptions identified<br>      <br>      ## Feature Readiness<br>      <br>      - [ ] All functional requirements have clear acceptance criteria<br>      - [ ] User scenarios cover primary flows<br>      - [ ] Feature meets measurable outcomes defined in Success Criteria<br>      - [ ] No implementation details leak into specification<br>      <br>      ## Notes<br>      <br>      - Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`<br>      ```<br><br>   b. **Run Validation Check**: Review the spec against each checklist item:<br>      - For each item, determine if it passes or fails<br>      - Document specific issues found (quote relevant spec sections)<br><br>   c. **Handle Validation Results**:<br><br>      - **If all items pass**: Mark checklist complete and proceed to step 6<br><br>      - **If items fail (excluding [NEEDS CLARIFICATION])**:<br>        1. List the failing items and specific issues<br>        2. Update the spec to address each issue<br>        3. Re-run validation until all items pass (max 3 iterations)<br>        4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user<br><br>      - **If [NEEDS CLARIFICATION] markers remain**:<br>        1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec<br>        2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest<br>        3. For each clarification needed (max 3), present options to user in this format:<br><br>           ```markdown<br>           ## Question [N]: [Topic]<br>           <br>           **Context**: [Quote relevant spec section]<br>           <br>           **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]<br>           <br>           **Suggested Answers**:<br>           <br>           | Option | Answer | Implications |<br>           |--------|--------|--------------|<br>           | A      | [First suggested answer] | [What this means for the feature] |<br>           | B      | [Second suggested answer] | [What this means for the feature] |<br>           | C      | [Third suggested answer] | [What this means for the feature] |<br>           | Custom | Provide your own answer | [Explain how to provide custom input] |<br>           <br>           **Your choice**: _[Wait for user response]_<br>           ```<br><br>        4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:<br>           - Use consistent spacing with pipes aligned<br>           - Each cell should have spaces around content: `| Content |` not `|Content|`<br>           - Header separator must have at least 3 dashes: `|--------|`<br>           - Test that the table renders correctly in markdown preview<br>        5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)<br>        6. Present all questions together before waiting for responses<br>        7. Wait for user to respond with their choices for all questions (e.g., &quot;Q1: A, Q2: Custom - [details], Q3: B&quot;)<br>        8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user&#39;s selected or provided answer<br>        9. Re-run validation after all clarifications are resolved<br><br>   d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status<br><br>7. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).<br><br>**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.<br><br>## General Guidelines<br><br>## Quick Guidelines<br><br>- Focus on **WHAT** users need and **WHY**.<br>- Avoid HOW to implement (no tech stack, APIs, code structure).<br>- Written for business stakeholders, not developers.<br>- DO NOT create any checklists that are embedded in the spec. That will be a separate command.<br><br>### Section Requirements<br><br>- **Mandatory sections**: Must be completed for every feature<br>- **Optional sections**: Include only when relevant to the feature<br>- When a section doesn&#39;t apply, remove it entirely (don&#39;t leave as &quot;N/A&quot;)<br><br>### For AI Generation<br><br>When creating this spec from a user prompt:<br><br>1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps<br>2. **Document assumptions**: Record reasonable defaults in the Assumptions section<br>3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:<br>   - Significantly impact feature scope or user experience<br>   - Have multiple reasonable interpretations with different implications<br>   - Lack any reasonable default<br>4. **Prioritize clarifications**: scope &gt; security/privacy &gt; user experience &gt; technical details<br>5. **Think like a tester**: Every vague requirement should fail the &quot;testable and unambiguous&quot; checklist item<br>6. **Common areas needing clarification** (only if no reasonable default exists):<br>   - Feature scope and boundaries (include/exclude specific use cases)<br>   - User types and permissions (if multiple conflicting interpretations possible)<br>   - Security/compliance requirements (when legally/financially significant)<br><br>**Examples of reasonable defaults** (don&#39;t ask about these):<br><br>- Data retention: Industry-standard practices for the domain<br>- Performance targets: Standard web/mobile app expectations unless specified<br>- Error handling: User-friendly messages with appropriate fallbacks<br>- Authentication method: Standard session-based or OAuth2 for web apps<br>- Integration patterns: RESTful APIs unless specified otherwise<br><br>### Success Criteria Guidelines<br><br>Success criteria must be:<br><br>1. **Measurable**: Include specific metrics (time, percentage, count, rate)<br>2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools<br>3. **User-focused**: Describe outcomes from user/business perspective, not system internals<br>4. **Verifiable**: Can be tested/validated without knowing implementation details<br><br>**Good examples**:<br><br>- &quot;Users can complete checkout in under 3 minutes&quot;<br>- &quot;System supports 10,000 concurrent users&quot;<br>- &quot;95% of searches return results in under 1 second&quot;<br>- &quot;Task completion rate improves by 40%&quot;<br><br>**Bad examples** (implementation-focused):<br><br>- &quot;API response time is under 200ms&quot; (too technical, use &quot;Users see results instantly&quot;)<br>- &quot;Database can handle 1000 TPS&quot; (implementation detail, use user-facing metric)<br>- &quot;React components render efficiently&quot; (framework-specific)<br>- &quot;Redis cache hit rate above 80%&quot; (technology-specific)</pre><p><em>Below is the speckit.clarify.md file containing instructions that enable the model to identify your unstated intentions meaning its able to figure out hidden part of what you intend to do from the user prompt.</em></p><pre>---<br>description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.<br>handoffs: <br>  - label: Build Technical Plan<br>    agent: speckit.plan<br>    prompt: Create a plan for the spec. I am building with...<br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.<br><br>Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/speckit.plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.<br><br>Execution steps:<br><br>1. Run `.specify/scripts/bash/check-prerequisites.sh --json --paths-only` from repo root **once** (combined `--json --paths-only` mode / `-Json -PathsOnly`). Parse minimal JSON payload fields:<br>   - `FEATURE_DIR`<br>   - `FEATURE_SPEC`<br>   - (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)<br>   - If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.<br>   - For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;).<br><br>2. Load the current spec file. Perform a structured ambiguity &amp; coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).<br><br>   Functional Scope &amp; Behavior:<br>   - Core user goals &amp; success criteria<br>   - Explicit out-of-scope declarations<br>   - User roles / personas differentiation<br><br>   Domain &amp; Data Model:<br>   - Entities, attributes, relationships<br>   - Identity &amp; uniqueness rules<br>   - Lifecycle/state transitions<br>   - Data volume / scale assumptions<br><br>   Interaction &amp; UX Flow:<br>   - Critical user journeys / sequences<br>   - Error/empty/loading states<br>   - Accessibility or localization notes<br><br>   Non-Functional Quality Attributes:<br>   - Performance (latency, throughput targets)<br>   - Scalability (horizontal/vertical, limits)<br>   - Reliability &amp; availability (uptime, recovery expectations)<br>   - Observability (logging, metrics, tracing signals)<br>   - Security &amp; privacy (authN/Z, data protection, threat assumptions)<br>   - Compliance / regulatory constraints (if any)<br><br>   Integration &amp; External Dependencies:<br>   - External services/APIs and failure modes<br>   - Data import/export formats<br>   - Protocol/versioning assumptions<br><br>   Edge Cases &amp; Failure Handling:<br>   - Negative scenarios<br>   - Rate limiting / throttling<br>   - Conflict resolution (e.g., concurrent edits)<br><br>   Constraints &amp; Tradeoffs:<br>   - Technical constraints (language, storage, hosting)<br>   - Explicit tradeoffs or rejected alternatives<br><br>   Terminology &amp; Consistency:<br>   - Canonical glossary terms<br>   - Avoided synonyms / deprecated terms<br><br>   Completion Signals:<br>   - Acceptance criteria testability<br>   - Measurable Definition of Done style indicators<br><br>   Misc / Placeholders:<br>   - TODO markers / unresolved decisions<br>   - Ambiguous adjectives (&quot;robust&quot;, &quot;intuitive&quot;) lacking quantification<br><br>   For each category with Partial or Missing status, add a candidate question opportunity unless:<br>   - Clarification would not materially change implementation or validation strategy<br>   - Information is better deferred to planning phase (note internally)<br><br>3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:<br>    - Maximum of 10 total questions across the whole session.<br>    - Each question must be answerable with EITHER:<br>       - A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR<br>       - A one-word / short‑phrase answer (explicitly constrain: &quot;Answer in &lt;=5 words&quot;).<br>    - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.<br>    - Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.<br>    - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).<br>    - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.<br>    - If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.<br><br>4. Sequential questioning loop (interactive):<br>    - Present EXACTLY ONE question at a time.<br>    - For multiple‑choice questions:<br>       - **Analyze all options** and determine the **most suitable option** based on:<br>          - Best practices for the project type<br>          - Common patterns in similar implementations<br>          - Risk reduction (security, performance, maintainability)<br>          - Alignment with any explicit project goals or constraints visible in the spec<br>       - Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).<br>       - Format as: `**Recommended:** Option [X] - &lt;reasoning&gt;`<br>       - Then render all options as a Markdown table:<br><br>       | Option | Description |<br>       |--------|-------------|<br>       | A | &lt;Option A description&gt; |<br>       | B | &lt;Option B description&gt; |<br>       | C | &lt;Option C description&gt; (add D/E as needed up to 5) |<br>       | Short | Provide a different short answer (&lt;=5 words) (Include only if free-form alternative is appropriate) |<br><br>       - After the table, add: `You can reply with the option letter (e.g., &quot;A&quot;), accept the recommendation by saying &quot;yes&quot; or &quot;recommended&quot;, or provide your own short answer.`<br>    - For short‑answer style (no meaningful discrete options):<br>       - Provide your **suggested answer** based on best practices and context.<br>       - Format as: `**Suggested:** &lt;your proposed answer&gt; - &lt;brief reasoning&gt;`<br>       - Then output: `Format: Short answer (&lt;=5 words). You can accept the suggestion by saying &quot;yes&quot; or &quot;suggested&quot;, or provide your own answer.`<br>    - After the user answers:<br>       - If the user replies with &quot;yes&quot;, &quot;recommended&quot;, or &quot;suggested&quot;, use your previously stated recommendation/suggestion as the answer.<br>       - Otherwise, validate the answer maps to one option or fits the &lt;=5 word constraint.<br>       - If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).<br>       - Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.<br>    - Stop asking further questions when:<br>       - All critical ambiguities resolved early (remaining queued items become unnecessary), OR<br>       - User signals completion (&quot;done&quot;, &quot;good&quot;, &quot;no more&quot;), OR<br>       - You reach 5 asked questions.<br>    - Never reveal future queued questions in advance.<br>    - If no valid questions exist at start, immediately report no critical ambiguities.<br><br>5. Integration after EACH accepted answer (incremental update approach):<br>    - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.<br>    - For the first integrated answer in this session:<br>       - Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).<br>       - Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.<br>    - Append a bullet line immediately after acceptance: `- Q: &lt;question&gt; → A: &lt;final answer&gt;`.<br>    - Then immediately apply the clarification to the most appropriate section(s):<br>       - Functional ambiguity → Update or add a bullet in Functional Requirements.<br>       - User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.<br>       - Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.<br>       - Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target).<br>       - Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).<br>       - Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as &quot;X&quot;)` once.<br>    - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.<br>    - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).<br>    - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.<br>    - Keep each inserted clarification minimal and testable (avoid narrative drift).<br><br>6. Validation (performed after EACH write plus final pass):<br>   - Clarifications session contains exactly one bullet per accepted answer (no duplicates).<br>   - Total asked (accepted) questions ≤ 5.<br>   - Updated sections contain no lingering vague placeholders the new answer was meant to resolve.<br>   - No contradictory earlier statement remains (scan for now-invalid alternative choices removed).<br>   - Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.<br>   - Terminology consistency: same canonical term used across all updated sections.<br><br>7. Write the updated spec back to `FEATURE_SPEC`.<br><br>8. Report completion (after questioning loop ends or early termination):<br>   - Number of questions asked &amp; answered.<br>   - Path to updated spec.<br>   - Sections touched (list names).<br>   - Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).<br>   - If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.<br>   - Suggested next command.<br><br>Behavior rules:<br><br>- If no meaningful ambiguities found (or all potential questions would be low-impact), respond: &quot;No critical ambiguities detected worth formal clarification.&quot; and suggest proceeding.<br>- If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).<br>- Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).<br>- Avoid speculative tech stack questions unless the absence blocks functional clarity.<br>- Respect user early termination signals (&quot;stop&quot;, &quot;done&quot;, &quot;proceed&quot;).<br>- If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.<br>- If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.<br><br>Context for prioritization: {{args}}<br>&quot;&quot;&quot;</pre><p><em>Below is speckit.plan.md. This guides the model to devise a strategy for building what the user has requested and does this in stages.</em></p><pre>-<br>description: Execute the implementation planning workflow using the plan template to generate design artifacts.<br>handoffs:<br><br>- label: Create Tasks<br>    agent: speckit.tasks<br>    prompt: Break the plan into tasks<br>    send: true<br>- label: Create Checklist<br>    agent: speckit.checklist<br>    prompt: Create a checklist for the following domain...<br><br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;).<br><br>2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).<br><br>3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:<br>   - Fill Technical Context (mark unknowns as &quot;NEEDS CLARIFICATION&quot;)<br>   - Fill Constitution Check section from constitution<br>   - Evaluate gates (ERROR if violations unjustified)<br>   - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)<br>   - Phase 1: Generate data-model.md, contracts/, quickstart.md<br>   - Phase 1: Update agent context by running the agent script<br>   - Re-evaluate Constitution Check post-design<br><br>4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.<br><br>## Phases<br><br>### Phase 0: Outline &amp; Research<br><br>1. **Extract unknowns from Technical Context** above:<br>   - For each NEEDS CLARIFICATION → research task<br>   - For each dependency → best practices task<br>   - For each integration → patterns task<br><br>2. **Generate and dispatch research agents**:<br><br>   ```text<br>   For each unknown in Technical Context:<br>     Task: &quot;Research {unknown} for {feature context}&quot;<br>   For each technology choice:<br>     Task: &quot;Find best practices for {tech} in {domain}&quot;<br>   ```<br><br>3. **Consolidate findings** in `research.md` using format:<br>   - Decision: [what was chosen]<br>   - Rationale: [why chosen]<br>   - Alternatives considered: [what else evaluated]<br><br>**Output**: research.md with all NEEDS CLARIFICATION resolved<br><br>### Phase 1: Design &amp; Contracts<br><br>**Prerequisites:** `research.md` complete<br><br>1. **Extract entities from feature spec** → `data-model.md`:<br>   - Entity name, fields, relationships<br>   - Validation rules from requirements<br>   - State transitions if applicable<br><br>2. **Generate API contracts** from functional requirements:<br>   - For each user action → endpoint<br>   - Use standard REST/GraphQL patterns<br>   - Output OpenAPI/GraphQL schema to `/contracts/`<br><br>3. **Project context update** → `.agents/rules/project-context.md`:<br>   <br>   Update or create `.agents/rules/project-context.md` using the template at `.specify/templates/project-context-template.md`.<br>   <br>   **Update rules**:<br>   - If file doesn&#39;t exist, create from template with information from this feature<br>   - If file exists, update only relevant sections:<br>     - Add new technologies from Technical Context (avoid duplicates)<br>     - Add new entities from data-model.md to Data Model Overview<br>     - Add new integrations from contracts/ to External Integrations<br>     - Prepend feature to Recent Features (keep last 5)<br>     - Update Last Updated date and Updated By fields<br>   - Preserve content between `&lt;!-- MANUAL ADDITIONS START --&gt;` and `&lt;!-- MANUAL ADDITIONS END --&gt;`<br>   - For Project Identity, only fill if empty (don&#39;t overwrite existing values)<br><br>**Output**: data-model.md, /contracts/*, quickstart.md, .agents/rules/project-context.md<br><br>## Key rules<br><br>- Use absolute paths<br>- ERROR on gate failures or unresolved clarifications</pre><p><em>Speckit.task file contains a set of instructions that break plan into ordered actionable steps.</em></p><pre>---<br>description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.<br>handoffs: <br>  - label: Analyze For Consistency<br>    agent: speckit.analyze<br>    prompt: Run a project analysis for consistency<br>    send: true<br>  - label: Implement Project<br>    agent: speckit.implement<br>    prompt: Start the implementation in phases<br>    send: true<br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;).<br><br>2. **Load design documents**: Read from FEATURE_DIR:<br>   - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)<br>   - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)<br>   - Note: Not all projects have all documents. Generate tasks based on what&#39;s available.<br><br>3. **Execute task generation workflow**:<br>   - Load plan.md and extract tech stack, libraries, project structure<br>   - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)<br>   - If data-model.md exists: Extract entities and map to user stories<br>   - If contracts/ exists: Map endpoints to user stories<br>   - If research.md exists: Extract decisions for setup tasks<br>   - Generate tasks organized by user story (see Task Generation Rules below)<br>   - Generate dependency graph showing user story completion order<br>   - Create parallel execution examples per user story<br>   - Validate task completeness (each user story has all needed tasks, independently testable)<br><br>4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:<br>   - Correct feature name from plan.md<br>   - Phase 1: Setup tasks (project initialization)<br>   - Phase 2: Foundational tasks (blocking prerequisites for all user stories)<br>   - Phase 3+: One phase per user story (in priority order from spec.md)<br>   - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks<br>   - Final Phase: Polish &amp; cross-cutting concerns<br>   - All tasks must follow the strict checklist format (see Task Generation Rules below)<br>   - Clear file paths for each task<br>   - Dependencies section showing story completion order<br>   - Parallel execution examples per story<br>   - Implementation strategy section (MVP first, incremental delivery)<br><br>5. **Report**: Output path to generated tasks.md and summary:<br>   - Total task count<br>   - Task count per user story<br>   - Parallel opportunities identified<br>   - Independent test criteria for each story<br>   - Suggested MVP scope (typically just User Story 1)<br>   - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)<br><br>Context for task generation: $ARGUMENTS<br><br>The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.<br><br>## Task Generation Rules<br><br>**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.<br><br>**Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.<br><br>### Checklist Format (REQUIRED)<br><br>Every task MUST strictly follow this format:<br><br>```text<br>- [ ] [TaskID] [P?] [Story?] Description with file path<br>```<br><br>**Format Components**:<br><br>1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)<br>2. **Task ID**: Sequential number (T001, T002, T003...) in execution order<br>3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)<br>4. **[Story] label**: REQUIRED for user story phase tasks only<br>   - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)<br>   - Setup phase: NO story label<br>   - Foundational phase: NO story label  <br>   - User Story phases: MUST have story label<br>   - Polish phase: NO story label<br>5. **Description**: Clear action with exact file path<br><br>**Examples**:<br><br>- ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`<br>- ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`<br>- ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`<br>- ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`<br>- ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)<br>- ❌ WRONG: `T001 [US1] Create model` (missing checkbox)<br>- ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)<br>- ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)<br><br>### Task Organization<br><br>1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:<br>   - Each user story (P1, P2, P3...) gets its own phase<br>   - Map all related components to their story:<br>     - Models needed for that story<br>     - Services needed for that story<br>     - Endpoints/UI needed for that story<br>     - If tests requested: Tests specific to that story<br>   - Mark story dependencies (most stories should be independent)<br><br>2. **From Contracts**:<br>   - Map each contract/endpoint → to the user story it serves<br>   - If tests requested: Each contract → contract test task [P] before implementation in that story&#39;s phase<br><br>3. **From Data Model**:<br>   - Map each entity to the user story(ies) that need it<br>   - If entity serves multiple stories: Put in earliest story or Setup phase<br>   - Relationships → service layer tasks in appropriate story phase<br><br>4. **From Setup/Infrastructure**:<br>   - Shared infrastructure → Setup phase (Phase 1)<br>   - Foundational/blocking tasks → Foundational phase (Phase 2)<br>   - Story-specific setup → within that story&#39;s phase<br><br>### Phase Structure<br><br>- **Phase 1**: Setup (project initialization)<br>- **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)<br>- **Phase 3+**: User Stories in priority order (P1, P2, P3...)<br>  - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration<br>  - Each phase should be a complete, independently testable increment<br>- **Final Phase**: Polish &amp; Cross-Cutting Concerns</pre><p><em>Below is a Speckit.analyze file contains that Review tasks for risks, gaps, or missing edge cases before implementation.</em></p><pre>---<br>description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.<br>handoffs: <br>  - label: Analyze For Consistency<br>    agent: speckit.analyze<br>    prompt: Run a project analysis for consistency<br>    send: true<br>  - label: Implement Project<br>    agent: speckit.implement<br>    prompt: Start the implementation in phases<br>    send: true<br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;).<br><br>2. **Load design documents**: Read from FEATURE_DIR:<br>   - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)<br>   - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)<br>   - Note: Not all projects have all documents. Generate tasks based on what&#39;s available.<br><br>3. **Execute task generation workflow**:<br>   - Load plan.md and extract tech stack, libraries, project structure<br>   - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)<br>   - If data-model.md exists: Extract entities and map to user stories<br>   - If contracts/ exists: Map endpoints to user stories<br>   - If research.md exists: Extract decisions for setup tasks<br>   - Generate tasks organized by user story (see Task Generation Rules below)<br>   - Generate dependency graph showing user story completion order<br>   - Create parallel execution examples per user story<br>   - Validate task completeness (each user story has all needed tasks, independently testable)<br><br>4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:<br>   - Correct feature name from plan.md<br>   - Phase 1: Setup tasks (project initialization)<br>   - Phase 2: Foundational tasks (blocking prerequisites for all user stories)<br>   - Phase 3+: One phase per user story (in priority order from spec.md)<br>   - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks<br>   - Final Phase: Polish &amp; cross-cutting concerns<br>   - All tasks must follow the strict checklist format (see Task Generation Rules below)<br>   - Clear file paths for each task<br>   - Dependencies section showing story completion order<br>   - Parallel execution examples per story<br>   - Implementation strategy section (MVP first, incremental delivery)<br><br>5. **Report**: Output path to generated tasks.md and summary:<br>   - Total task count<br>   - Task count per user story<br>   - Parallel opportunities identified<br>   - Independent test criteria for each story<br>   - Suggested MVP scope (typically just User Story 1)<br>   - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)<br><br>Context for task generation: $ARGUMENTS<br><br>The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.<br><br>## Task Generation Rules<br><br>**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.<br><br>**Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.<br><br>### Checklist Format (REQUIRED)<br><br>Every task MUST strictly follow this format:<br><br>```text<br>- [ ] [TaskID] [P?] [Story?] Description with file path<br>```<br><br>**Format Components**:<br><br>1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)<br>2. **Task ID**: Sequential number (T001, T002, T003...) in execution order<br>3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)<br>4. **[Story] label**: REQUIRED for user story phase tasks only<br>   - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)<br>   - Setup phase: NO story label<br>   - Foundational phase: NO story label  <br>   - User Story phases: MUST have story label<br>   - Polish phase: NO story label<br>5. **Description**: Clear action with exact file path<br><br>**Examples**:<br><br>- ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`<br>- ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`<br>- ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`<br>- ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`<br>- ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)<br>- ❌ WRONG: `T001 [US1] Create model` (missing checkbox)<br>- ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)<br>- ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)<br><br>### Task Organization<br><br>1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:<br>   - Each user story (P1, P2, P3...) gets its own phase<br>   - Map all related components to their story:<br>     - Models needed for that story<br>     - Services needed for that story<br>     - Endpoints/UI needed for that story<br>     - If tests requested: Tests specific to that story<br>   - Mark story dependencies (most stories should be independent)<br><br>2. **From Contracts**:<br>   - Map each contract/endpoint → to the user story it serves<br>   - If tests requested: Each contract → contract test task [P] before implementation in that story&#39;s phase<br><br>3. **From Data Model**:<br>   - Map each entity to the user story(ies) that need it<br>   - If entity serves multiple stories: Put in earliest story or Setup phase<br>   - Relationships → service layer tasks in appropriate story phase<br><br>4. **From Setup/Infrastructure**:<br>   - Shared infrastructure → Setup phase (Phase 1)<br>   - Foundational/blocking tasks → Foundational phase (Phase 2)<br>   - Story-specific setup → within that story&#39;s phase<br><br>### Phase Structure<br><br>- **Phase 1**: Setup (project initialization)<br>- **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)<br>- **Phase 3+**: User Stories in priority order (P1, P2, P3...)<br>  - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration<br>  - Each phase should be a complete, independently testable increment<br>- **Final Phase**: Polish &amp; Cross-Cutting Concerns</pre><p><em>Below is the Speckit.implement file. This file relies on the Speckit.plan.md file to practically implement the feature requested. it execute the task checking off each one.</em></p><pre>---<br>description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.<br>handoffs: <br>  - label: Analyze For Consistency<br>    agent: speckit.analyze<br>    prompt: Run a project analysis for consistency<br>    send: true<br>  - label: Implement Project<br>    agent: speckit.implement<br>    prompt: Start the implementation in phases<br>    send: true<br>---<br><br>## User Input<br><br>```text<br>$ARGUMENTS<br>```<br><br>You **MUST** consider the user input before proceeding (if not empty).<br><br>## Outline<br><br>1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like &quot;I&#39;m Groot&quot;, use escape syntax: e.g &#39;I&#39;\&#39;&#39;m Groot&#39; (or double-quote if possible: &quot;I&#39;m Groot&quot;).<br><br>2. **Load design documents**: Read from FEATURE_DIR:<br>   - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)<br>   - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)<br>   - Note: Not all projects have all documents. Generate tasks based on what&#39;s available.<br><br>3. **Execute task generation workflow**:<br>   - Load plan.md and extract tech stack, libraries, project structure<br>   - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)<br>   - If data-model.md exists: Extract entities and map to user stories<br>   - If contracts/ exists: Map endpoints to user stories<br>   - If research.md exists: Extract decisions for setup tasks<br>   - Generate tasks organized by user story (see Task Generation Rules below)<br>   - Generate dependency graph showing user story completion order<br>   - Create parallel execution examples per user story<br>   - Validate task completeness (each user story has all needed tasks, independently testable)<br><br>4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:<br>   - Correct feature name from plan.md<br>   - Phase 1: Setup tasks (project initialization)<br>   - Phase 2: Foundational tasks (blocking prerequisites for all user stories)<br>   - Phase 3+: One phase per user story (in priority order from spec.md)<br>   - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks<br>   - Final Phase: Polish &amp; cross-cutting concerns<br>   - All tasks must follow the strict checklist format (see Task Generation Rules below)<br>   - Clear file paths for each task<br>   - Dependencies section showing story completion order<br>   - Parallel execution examples per story<br>   - Implementation strategy section (MVP first, incremental delivery)<br><br>5. **Report**: Output path to generated tasks.md and summary:<br>   - Total task count<br>   - Task count per user story<br>   - Parallel opportunities identified<br>   - Independent test criteria for each story<br>   - Suggested MVP scope (typically just User Story 1)<br>   - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)<br><br>Context for task generation: $ARGUMENTS<br><br>The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.<br><br>## Task Generation Rules<br><br>**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.<br><br>**Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.<br><br>### Checklist Format (REQUIRED)<br><br>Every task MUST strictly follow this format:<br><br>```text<br>- [ ] [TaskID] [P?] [Story?] Description with file path<br>```<br><br>**Format Components**:<br><br>1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)<br>2. **Task ID**: Sequential number (T001, T002, T003...) in execution order<br>3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)<br>4. **[Story] label**: REQUIRED for user story phase tasks only<br>   - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)<br>   - Setup phase: NO story label<br>   - Foundational phase: NO story label  <br>   - User Story phases: MUST have story label<br>   - Polish phase: NO story label<br>5. **Description**: Clear action with exact file path<br><br>**Examples**:<br><br>- ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`<br>- ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`<br>- ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`<br>- ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`<br>- ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)<br>- ❌ WRONG: `T001 [US1] Create model` (missing checkbox)<br>- ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)<br>- ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)<br><br>### Task Organization<br><br>1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:<br>   - Each user story (P1, P2, P3...) gets its own phase<br>   - Map all related components to their story:<br>     - Models needed for that story<br>     - Services needed for that story<br>     - Endpoints/UI needed for that story<br>     - If tests requested: Tests specific to that story<br>   - Mark story dependencies (most stories should be independent)<br><br>2. **From Contracts**:<br>   - Map each contract/endpoint → to the user story it serves<br>   - If tests requested: Each contract → contract test task [P] before implementation in that story&#39;s phase<br><br>3. **From Data Model**:<br>   - Map each entity to the user story(ies) that need it<br>   - If entity serves multiple stories: Put in earliest story or Setup phase<br>   - Relationships → service layer tasks in appropriate story phase<br><br>4. **From Setup/Infrastructure**:<br>   - Shared infrastructure → Setup phase (Phase 1)<br>   - Foundational/blocking tasks → Foundational phase (Phase 2)<br>   - Story-specific setup → within that story&#39;s phase<br><br>### Phase Structure<br><br>- **Phase 1**: Setup (project initialization)<br>- **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)<br>- **Phase 3+**: User Stories in priority order (P1, P2, P3...)<br>  - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration<br>  - Each phase should be a complete, independently testable increment<br>- **Final Phase**: Polish &amp; Cross-Cutting Concerns</pre><p><em>For further reading.</em></p><ul><li><a href="https://danielmeppiel.github.io/agentic-sdlc-handbook/">The Agentic SDLC Handbook</a></li><li><a href="https://openprose.ai/">OpenProse - Engineer your agents</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4aNEdeSBFQs%3Fstart%3D1156%26feature%3Doembed%26start%3D1156&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4aNEdeSBFQs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4aNEdeSBFQs%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b8cb58ddfa71380fd1574f03e788d42/href">https://medium.com/media/2b8cb58ddfa71380fd1574f03e788d42/href</a></iframe><ul><li><a href="https://eitl.ai/blog/">Blog</a></li><li><a href="https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/">Spec-driven development with AI: Get started with a new open source toolkit</a></li></ul><p><a href="https://developer.microsoft.com/blog/spec-driven-development-spec-kit">https://developer.microsoft.com/blog/spec-driven-development-spec-kit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3615493e1bf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Design Patterns in Agentic AI.]]></title>
            <link>https://medium.com/@edbertkwesi.ek/exploring-design-patterns-in-agentic-ai-87cc2486ba10?source=rss-e712165c2158------2</link>
            <guid isPermaLink="false">https://medium.com/p/87cc2486ba10</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[agent-development-kit]]></category>
            <dc:creator><![CDATA[edbert kwesi]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 08:09:58 GMT</pubDate>
            <atom:updated>2026-03-10T08:09:58.762Z</atom:updated>
            <content:encoded><![CDATA[<p><em>We have a new employee , one who works not from home but from the virtual space a digital clone of the physical employee well packaged to finish-up all task with an almost close to human level performance in any corporate task, from complex reasoning task such as planning, researching, resolving complicated customer complaints and even doing the unthinkable like running a shop without any human intervention(</em><a href="https://andonlabs.com/vending">https://andonlabs.com/vending</a>)<em>. </em><strong><em>AI</em></strong><em> Agents (Digital clone of human capabilities ) are gradually setting a new tone for the corporate environment and redefining productivity and the economic value attached to it.</em></p><p><em>For ME personally from my logical conclusions there are only two SET of agents,</em></p><p><strong><em>Firstly a single-task virtual agent and a Multi-task virtual age</em></strong>nt.</p><p><strong><em>Single-task virtual agents</em></strong><em> are only designed for just a particular action and nothing else. For example a search agent only perform searches on the internet and that’s all nothing else.</em></p><p><em>Unlike Single-tasked virtual agent, </em><strong><em>Multi-tasked virtual agents</em></strong><em> have a functionality that enable them to carry out a host of task heavy activities, they are able to refine and improve on their outputs and also are quiet exceptional in activities such as p</em><strong><em>lanning , organizing information , extracting intent from user </em></strong><em>input , </em><strong><em>task-decomposition</em></strong><em> and a host of other human-level activities.</em></p><p><strong><em>Critically observing the whole Agentic Framework there are patterns that require a collection of sub-agents acting together for their full functionality to be at play, Take for example, ROUTING:</em></strong></p><p><em>Imagine an Agent that can diffuse intent or user request in a multi-path execution scenario , in order words routing involves a dynamic approach mapping or directing a user query to a specialized agent. Consider a team of agents with each sub-agent designated for a specific task a router is necessary to classify user query and direct it to the right sub-agent for execution. In Google ‘s Agent Development Kits (ADK) framework term this Routing pattern as Coordinator/Dispatcher pattern. it coordinator mechanism is such that it delegates task to the appropriate sub-agent for execution.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*wLBANqkGzlQaAeGfIa5J7w.png" /></figure><pre># Conceptual Code: Coordinator using LLM Transfer<br>from google.adk.agents import LlmAgent<br><br><br>billing_agent = LlmAgent(name=&quot;Billing&quot;, description=&quot;Handles billing inquiries.&quot;)<br>support_agent = LlmAgent(name=&quot;Support&quot;, description=&quot;Handles technical support requests.&quot;)<br><br><br>coordinator = LlmAgent(<br>    name=&quot;HelpDeskCoordinator&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    instruction=&quot;Route user requests: Use Billing agent for payment issues, Support agent for technical problems.&quot;,<br>    description=&quot;Main help desk router.&quot;,<br>    # allow_transfer=True is often implicit with sub_agents in AutoFlow<br>    sub_agents=[billing_agent, support_agent]<br>)<br># User asks &quot;My payment failed&quot; -&gt; Coordinator&#39;s LLM should call transfer_to_agent(agent_name=&#39;Billing&#39;)<br># User asks &quot;I can&#39;t log in&quot; -&gt; Coordinator&#39;s LLM should call transfer_to_agent(agent_name=&#39;Support&#39;)</pre><p><em>The code above shows two-agents: A billing-agent and a support agent each with it own unique task that it performs under a parent-agent called Coordinator .</em></p><p><strong><em>Sequential Agent:</em></strong> <em>Another architectural pattern ensuring sub-agents execute task in a step-by step manner . Just like following a step by step order to solve mathematical problems, sequential agents execute task without jumping a step in carrying out instructions in it nature that is,</em> i<em>t follows the order in which it sub-agents are laid out. For example consider an agent that performs the task of </em><strong><em>Continuous Integration (CI)</em></strong><em>, which suggest a building a code development pipeline, made of </em><strong><em>CodeWriterAgent,</em></strong><em> </em><strong><em>CodeReviewrAgen</em></strong><em>t, and a </em><strong><em>CodeRefactorAgent</em></strong><em>. A sequential agentic pattern is required to successfully set-up the code development pipeline since the code must be written before it gets to be reviewed. The</em><strong><em> sequentialAgent</em></strong><em> is the mother agent that routes information or user request but does it in a sequential bit according to how the sub-agents are arranged in writin</em>g.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HbkdxwwWO-uM43Iv.png" /><figcaption>Diagram illustrating the order of information flow in a sequentialAgent (google ADK framework)</figcaption></figure><pre>from google.adk.agents.sequential_agent import SequentialAgent<br>from google.adk.agents.llm_agent import LlmAgent<br><br># --- Constants ---<br>GEMINI_MODEL = &quot;gemini-2.5-flash&quot;<br><br># --- 1. Define Sub-Agents for Each Pipeline Stage ---<br><br># Code Writer Agent<br># Takes the initial specification (from user query) and writes code.<br>code_writer_agent = LlmAgent(<br>    name=&quot;CodeWriterAgent&quot;,<br>    model=GEMINI_MODEL,<br>    instruction=&quot;&quot;&quot;<br>    You are a Python Code Generator.<br>    Based *only* on the user&#39;s request, write Python code that fulfills the requirement.<br>    Output *only* the complete Python code block, enclosed in triple backticks (```python ... ```).<br>    Do not add any other text before or after the code block.<br>    &quot;&quot;&quot;,<br>    description=&quot;Writes initial Python code based on a specification.&quot;,<br>    output_key=&quot;generated_code&quot;<br>)<br><br># Code Reviewer Agent<br># Takes the code generated by the previous agent (read from state) and provides feedback.<br>code_reviewer_agent = LlmAgent(<br>    name=&quot;CodeReviewerAgent&quot;,<br>    model=GEMINI_MODEL,<br>    instruction=&quot;&quot;&quot;<br>    You are an expert Python Code Reviewer.<br>    Your task is to provide constructive feedback on the provided code.<br><br>    **Code to Review:**<br>    ```python<br>    {generated_code}<br>    ```<br><br>    **Review Criteria:**<br>    1.  **Correctness:** Does the code work as intended? Are there logic errors?<br>    2.  **Readability:** Is the code clear and easy to understand? Follows PEP 8 style guidelines?<br>    3.  **Efficiency:** Is the code reasonably efficient? Any obvious performance bottlenecks?<br>    4.  **Edge Cases:** Does the code handle potential edge cases or invalid inputs gracefully?<br>    5.  **Best Practices:** Does the code follow common Python best practices?<br><br>    **Output:**<br>    Provide your feedback as a concise, bulleted list. Focus on the most important points for improvement.<br>    If the code is excellent and requires no changes, simply state: &quot;No major issues found.&quot;<br>    Output *only* the review comments or the &quot;No major issues&quot; statement.<br>    &quot;&quot;&quot;,<br>    description=&quot;Reviews code and provides feedback.&quot;,<br>    output_key=&quot;review_comments&quot;<br>)<br><br><br># Code Refactorer Agent<br># Takes the original code and the review comments (read from state) and refactors the code.<br>code_refactorer_agent = LlmAgent(<br>    name=&quot;CodeRefactorerAgent&quot;,<br>    model=GEMINI_MODEL,<br>    instruction=&quot;&quot;&quot;<br>    You are a Python Code Refactoring AI.<br>    Your goal is to improve the given Python code based on the provided review comments.<br><br>    **Original Code:**<br>    ```python<br>    {generated_code}<br>    ```<br><br>    **Review Comments:**<br>    {review_comments}<br><br>    **Task:**<br>    Carefully apply the suggestions from the review comments to refactor the original code.<br>    If the review comments state &quot;No major issues found,&quot; return the original code unchanged.<br>    Ensure the final code is complete, functional, and includes necessary imports and docstrings.<br><br>    **Output:**<br>    Output *only* the final, refactored Python code block, enclosed in triple backticks (```python ... ```).<br>    Do not add any other text before or after the code block.<br>    &quot;&quot;&quot;,<br>    description=&quot;Refactors code based on review comments.&quot;,<br>    output_key=&quot;refactored_code&quot;<br>)<br><br><br># --- 2. Create the SequentialAgent ---<br># This agent orchestrates the pipeline by running the sub_agents in order.<br>code_pipeline_agent = SequentialAgent(<br>    name=&quot;CodePipelineAgent&quot;,<br>    sub_agents=[code_writer_agent, code_reviewer_agent, code_refactorer_agent],<br>    description=&quot;Executes a sequence of code writing, reviewing, and refactoring.&quot;,<br>)<br><br>root_agent = code_pipeline_agent<br><br>if __name__ == &quot;__main__&quot;:<br>print (root_agent) <br></pre><pre>SequentialAgent(sub_agents=[CodeWriterAgent, CodeReviewerAgent, CodeRefactorerAgent])</pre><p><strong><em>Similarly consider a scenario you are constantly searching the web for affordable flight booking not necessarily cheap</em></strong><em>.</em></p><p><em>An agent could do this for you easily whilst you are away. Most appropriate design pattern for such agent is Sequential due to the steps involve in designing such agent. Firstly, a sub-agent that takes the user request, then another sub-agent that continuously search the web to find flight bookings that satisfy your affordability requirements.</em></p><pre># Copyright 2025 Google LLC<br>#<br># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br># you may not use this file except in compliance with the License.<br># You may obtain a copy of the License at<br>#<br>#     http://www.apache.org/licenses/LICENSE-2.0<br>#<br># Unless required by applicable law or agreed to in writing, software<br># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br># See the License for the specific language governing permissions and<br># limitations under the License.<br><br>from google.adk.agents import Agent<br>from google.adk.runners import Runner<br>from google.adk.sessions import InMemorySessionService<br>from google.adk.tools import google_search<br>from google.genai import types<br><br>APP_NAME=&quot;google_search_agent&quot;<br>USER_ID=&quot;user1234&quot;<br>SESSION_ID=&quot;1234&quot;<br><br><br>root_agent = Agent(<br>    name=&quot;basic_search_agent&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    description=&quot;Agent to answer questions using Google Search.&quot;,<br>    instruction=&quot;I can answer your questions by searching the internet. Just ask me anything!&quot;,<br>    # google_search is a pre-built tool which allows the agent to perform Google searches.<br>    tools=[google_search]<br>)<br><br># Session and Runner<br>async def setup_session_and_runner():<br>    session_service = InMemorySessionService()<br>    session = await session_service.create_session(app_name=APP_NAME, user_id=USER_ID, session_id=SESSION_ID)<br>    runner = Runner(agent=root_agent, app_name=APP_NAME, session_service=session_service)<br>    return session, runner<br><br># Agent Interaction<br>async def call_agent_async(query):<br>    content = types.Content(role=&#39;user&#39;, parts=[types.Part(text=query)])<br>    session, runner = await setup_session_and_runner()<br>    events = runner.run_async(user_id=USER_ID, session_id=SESSION_ID, new_message=content)<br><br>    async for event in events:<br>        if event.is_final_response():<br>            final_response = event.content.parts[0].text<br>            print(&quot;Agent Response: &quot;, final_response)<br><br># Note: In Colab, you can directly use &#39;await&#39; at the top level.<br># If running this code as a standalone Python script, you&#39;ll need to use asyncio.run() or manage the event loop.<br>await call_agent_async(&quot;what&#39;s the latest ai news?&quot;)</pre><pre># Conceptual Example: Defining Hierarchy<br>from google.adk.agents import LlmAgent, BaseAgent<br><br><br># Define individual agents<br>greeter = LlmAgent(name=&quot;Greeter&quot;, model=&quot;gemini-2.0-flash&quot;)<br>task_doer = BaseAgent(name=&quot;TaskExecutor&quot;) # Custom non-LLM agent<br><br><br># Create parent agent and assign children via sub_agents<br>coordinator = LlmAgent(<br>    name=&quot;Coordinator&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    description=&quot;I coordinate greetings and tasks.&quot;,<br>    sub_agents=[ # Assign sub_agents here<br>        greeter,<br>        task_doer<br>    ]<br>)<br><br><br># Framework automatically sets:<br># assert greeter.parent_agent == coordinator<br># assert task_doer.parent_agent == coordinator</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGDm_uH6VxPY%3Fstart%3D12%26feature%3Doembed%26start%3D12&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGDm_uH6VxPY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGDm_uH6VxPY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/82854dc97a5989b196771cbebe06f839/href">https://medium.com/media/82854dc97a5989b196771cbebe06f839/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fj_l-9uNX2SA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dj_l-9uNX2SA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fj_l-9uNX2SA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2394cd14c4756f9d3cd256c23437e5ba/href">https://medium.com/media/2394cd14c4756f9d3cd256c23437e5ba/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0J_fz6RlqVg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0J_fz6RlqVg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0J_fz6RlqVg%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4050087698a27cb65a04fa8929030dbb/href">https://medium.com/media/4050087698a27cb65a04fa8929030dbb/href</a></iframe><p>you can explore further, design patterns ADK framework documentation for detailed insight.</p><p><a href="https://google.github.io/adk-docs/agents/workflow-agents/sequential-agents/">Agent Development Kit (ADK)</a></p><p>The AWS Strands framework has a More advance agentic pattern called swarm a very powerful and pattern capable of many task,</p><p><a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/swarm/?h=swarm">Swarm - Strands Agents</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*9P_Kd09FQTHSs0oHrqh-VA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87cc2486ba10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Journey of an Alchemist deep dive into the Model Context Protocol space, a space that extends…]]></title>
            <link>https://medium.com/@edbertkwesi.ek/the-journey-of-an-alchemist-deep-dive-into-the-model-context-protocol-space-a-space-that-extends-e4912b87a451?source=rss-e712165c2158------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4912b87a451</guid>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[edbert kwesi]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 04:58:10 GMT</pubDate>
            <atom:updated>2025-12-14T04:58:10.793Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Journey</strong> of a<em>n Alchemist deep dive into the</em> M<em>odel </em><strong><em>C</em></strong><em>ontext </em><strong><em>P</em></strong><em>rotocol space, a space that extends </em><strong><em>L</em></strong><em>arge </em><strong><em>L</em></strong><em>anguage </em><strong><em>M</em></strong><em>odels(LLM)and all of it capabilities to real world uses. For example </em><strong><em>MCP </em></strong><em>servers have clearly redefined the coding Command Line Interface (cli) and gradually doing same in other sectors as well</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QMfakitnnoTmPjPNZxhtw.png" /></figure><p><strong><em>The M.C.P Sdk , it make-up, functionalities </em>.</strong></p><p><em>The Model Context Protocol involves an interaction a connection between a client and a server.These two makeup the </em><strong><em>MCP</em></strong><em> sdk. its designed in a way such that it provides some sort of contextual information to a Large Language Model which intends guide and steers the actions of a Large Language Model towards certain objective.</em></p><p><strong><em>The Mo</em></strong><em>del</em><strong><em> C</em></strong><em>ontext</em><strong><em> P</em></strong><em>rotocol</em><strong><em> (MCP). </em></strong><em>A major part of the </em><strong><em>MCP</em></strong><em> sdk is the server main part or component of the MCP sdk. The server implementation involves core functionalities such as </em><strong><em>Tools</em></strong><em>, </em><strong><em>resources</em></strong><em>, </em><strong><em>prompts</em></strong><em>. </em><strong><em>Tools</em></strong><em> are the external functions within the server enables a Large Language Model to carry out a certain operation, for example the tool functionality can enable a Large Language Model to interact with the real world , such that it can have read and write access to databases, like updating and deleting records , driving a car without human intervention , think of it like an</em><strong><em> LLM</em></strong><em> performing a mechanical action as if it were in the real world. Every </em><strong><em>MCP</em></strong><em> server is designed with some sort of objective or purpose, for example there are MCP servers whose objective is to query data , read and write to a certain database . The purpose or objective of the server defines the functionality or the action that it can perform for example imagine an MCP server which is able to connect and tell you the weather meaning it has a query or read function then also request function. An </em><strong><em>MCP server is not as powerful than the tools it contain, the actions contained in the tools give it power, power to even access a phone from a far distance.</em></strong></p><p><em>Example: An MCP server could connect to a phone, then per the tools contained within the MCP server it has the autonomy to carry out instructions right from a chat console.</em></p><p><em>its core architectural make up is such that it has a Data layer and a Transportation layer with security layer excluded from it original architecture in addition it has another layer called Primitives. These primitives are like the kind or category of information that can be shared with a Large Language Model plus the variety of actions an LLM can take. we have server-side primitives and client side primitives. Server-side primitives are </em><strong><em>To</em></strong><em>ols,</em><strong><em> Re</em></strong><em>sources, and </em><strong><em>Pr</em></strong><em>ompts that the server exposes meaning such information&#39;s can be accessed through the client. Similarly client-side primitives are </em><strong><em>S</em></strong><em>ampling, </em><strong><em>El</em></strong><em>icitation, </em><strong><em>L</em></strong><em>ogging.Microsoft offers a very meticulous hands-on lessons for the Model Context Protocol</em></p><p><em>Some hands-on guide to follow to build your own Model Context Protocol</em></p><ul><li><a href="https://modelcontextprotocol.io/docs/getting-started/intro">What is the Model Context Protocol (MCP)? - Model Context Protocol</a></li><li><a href="https://learn.microsoft.com/en-us/training/support/mcp">Microsoft Learn MCP Server overview</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4zkIBMFdL2w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4zkIBMFdL2w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4zkIBMFdL2w%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c901112301d9d09ae7a377bc418785ff/href">https://medium.com/media/c901112301d9d09ae7a377bc418785ff/href</a></iframe><p><a href="https://huggingface.co/learn/mcp-course/unit2/gradio-server">https://huggingface.co/learn/mcp-course/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4912b87a451" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>