<?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 Ivan Escribano on Medium]]></title>
        <description><![CDATA[Stories by Ivan Escribano on Medium]]></description>
        <link>https://medium.com/@ivanescribano1998?source=rss-2f75b9825c1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*f4RIySX6DyojNZoBQMRKnA.png</url>
            <title>Stories by Ivan Escribano on Medium</title>
            <link>https://medium.com/@ivanescribano1998?source=rss-2f75b9825c1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:10:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ivanescribano1998/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[Mastering Prompt Engineering (Complete 2026 Guide)]]></title>
            <link>https://medium.com/@ivanescribano1998/mastering-prompt-engineering-complete-2026-guide-a639b42120e9?source=rss-2f75b9825c1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a639b42120e9</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[chain-of-thought]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Ivan Escribano]]></dc:creator>
            <pubDate>Wed, 05 Nov 2025 09:33:44 GMT</pubDate>
            <atom:updated>2025-11-05T09:33:44.319Z</atom:updated>
            <content:encoded><![CDATA[<h4>A complete 2026 guide to prompt engineering from basics to advanced methods like CoT, Few-shot, and ReAct.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*kBxdC8Rm_uyYh1SFfSmQKw.png" /></figure><h3>Pompt engineering 101</h3><p>Working with generative AI or language models (like ChatGPT) always starts with what matters most: <strong>knowing how to talk to them</strong>.</p><p>Yes, literally: learning to communicate well with them. That’s what <em>prompt engineering</em> is all about.</p><p>You don’t need to be a programmer or a machine learning expert.</p><p>You don’t need to know code, neural networks, or statistics.</p><p>You just need to master the way to express yourself with clarity and structure.</p><p>Because, in the end, this is also a language. And like any language, the better you speak it, the more the other side understands you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7a-1A0tJDdYdYWimoY-XQ.png" /></figure><p>Imagine this:</p><ul><li>If you’re in England, you speak English.</li><li>If you’re in Spain, you speak Spanish.</li><li>If you program, you use programming languages the computer understands.</li></ul><p>So… if you work with language models (LLMs) or generative AI, <strong>you have to learn their language</strong>. And no, writing four words and expecting magic isn’t enough. There’s a method, there’s structure, there’s a way of thinking behind it.</p><p>The more you practice that way of communicating, the more you’ll master this new “digital language”. And best of all: anyone can do it.</p><h3>The Three Types of Messages</h3><p>Before diving into techniques, there’s something you must understand: <strong>the types of messages</strong> that form the basis of every interaction with an LLM.</p><p>When you work with ChatGPT, Claude, or any other model, three messages are always involved: <em>system</em>, <em>user</em>, and <em>assistant</em>. Knowing how to differentiate them gives you total control over the model’s behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHlLDtFwt_cv-ye38N_3jg.png" /></figure><h3>1. System Messages</h3><p>These are the model’s “base brain”. Here you define <strong>how you want it to behave</strong>, its style, its limits, its way of thinking.</p><pre>You are an assistant that helps improve Spanish.<br>Always act educationally in all your responses.<br>Don&#39;t talk like a chatbot, but like a teacher who writes clear and structured messages.</pre><p>This defines the model’s identity. If you don’t do it, it will respond generically or unpredictably.</p><h3>2. User Messages</h3><p>This is the message you write. It’s the <strong>direct input</strong> to the model: your question or request.</p><pre>Can you help me study the most common words in Spanish?</pre><p>That simple. But careful: the way you write it completely changes the quality of the response.</p><h3>3. Assistant Messages</h3><p>These are the AI’s responses. In agent design, they also serve as examples of the type of output you expect.</p><pre>AI: The most common phrases in Spanish you should know:<br>- Hello.<br>- Good morning.<br>- How are you?<br>...</pre><h3>Essential Prompt Engineering</h3><p>Now that you understand how dialogue is structured, let’s get practical: <strong>how to build effective prompts</strong>.</p><p>We’ll divide the entire process into five very clear steps:</p><ol><li>What</li><li>Who</li><li>How</li><li>Input</li><li>Output</li></ol><p>With this framework, your prompts will stop being simple questions and become <strong>intelligent instructions</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VR1DW2UyWZi6V_zrodP6Lw.png" /></figure><h3>1) What</h3><p>Always start by defining <strong>what you want to do, what for, and why</strong>. Context is everything.</p><p>Include:</p><ul><li>A clear objective.</li><li>A specific task.</li><li>The context of the instruction.</li><li>Imperative and direct instructions.</li></ul><pre>Task: I want a simple explanation of how variables work in Python.<br><br>What for: To be able to apply it in basic exercises without depending on tutorials.<br><br>Why: I&#39;m starting to program and want to understand the fundamentals from scratch.<br><br>Use analogies and examples to facilitate understanding.</pre><p><strong>Why it works:</strong></p><ul><li>It gives context and purpose.</li><li>It indicates what you expect (“I want”, “use”).</li><li>It allows the model to measure the response’s success.</li></ul><h3>2) Who</h3><p>Define <strong>who the AI should be</strong> and <strong>how it should behave</strong>. This directly affects the tone, detail, and type of language used.</p><p>Include:</p><ul><li>A specific role (teacher, designer, consultant, programmer…).</li><li>A defined tone (formal, motivating, empathetic, technical…).</li></ul><pre>Act as an English teacher with experience teaching beginners.<br><br>Adopt a patient, clear, and motivating tone.<br><br>Explain with simple examples and correct mistakes in a friendly way.</pre><p><strong>Why it works:</strong></p><ul><li>The model understands its identity (“I am a teacher”).</li><li>It adjusts the tone (“I speak calmly and teach”).</li><li>It responds with contextual coherence.</li></ul><h3>3) How</h3><p>Here you define <strong>how the model should think or work</strong>. You’re telling it the method, not just the result.</p><p>Include:</p><ul><li>Steps or subtasks.</li><li>Examples of desired structure or format.</li></ul><pre>Task:<br>Help a person prepare for a job interview.<br>Let&#39;s go step by step; first we&#39;ll do one step and then the next.<br><br>List of steps:<br>1. Research the company and note three facts you can mention during the interview.<br><br>2. Analyze the offer and explain what the position is looking for in 3 points.<br><br>3. Prepare five answers for common questions (&quot;Tell me about yourself&quot;, &quot;Strengths&quot;, &quot;Weaknesses&quot;, &quot;Why here&quot;, &quot;Key achievement&quot;).<br><br>Example output:<br><br>1. Company research:<br>- Name: [COMPANY_NAME]<br>- Fact 1: [KEY_FACT_1]<br>- Fact 2: [KEY_FACT_2]<br>...<br><br>2. Offer - What it&#39;s looking for (3–4 points):<br>- [REQUIREMENT_1]<br>- [REQUIREMENT_2]<br>...<br><br>3. Prepared answers (brief):<br>- Tell me about yourself: &quot;[ANSWER_TELL_ME_ABOUT_YOURSELF]&quot;<br>- Strengths: &quot;[ANSWER_STRENGTHS]&quot;<br>- Weaknesses: &quot;[ANSWER_WEAKNESSES]&quot;<br>...</pre><p><strong>Why it works:</strong></p><ul><li>It divides the task and structures the process.</li><li>The model produces more organized and practical results.</li></ul><h3>4) Input</h3><p>This part is key and many ignore it.</p><p><strong>How you structure your prompt completely changes the result.</strong></p><p>Don’t write chaotic paragraphs. Use tags and formatting. Models understand better if you clearly delimit sections.</p><p>Recommended formats: <strong>XML, JSON, or Markdown.</strong></p><p>XML is ideal because it separates context, task, tone, etc.</p><pre>&lt;prompt&gt;<br>  <br>&lt;context&gt;Launch: new feature to create carousels on LinkedIn, audience: freelancers and B2B agencies.&lt;/context&gt;<br>  <br>&lt;task&gt;Create a post that explains the benefit and converts to demos.&lt;/task&gt;<br>  <br>&lt;role&gt;Copywriter specialized in LinkedIn for B2B SaaS.&lt;/role&gt;<br>  <br>&lt;tone&gt;Clear, professional, and direct.&lt;/tone&gt;<br>  <br>&lt;output&gt;<br>    - Length 100–140 words.<br>    - 1 initial hook 10 words.<br>    - 3 key benefits with emojis.<br>    - 1 CTA &quot;Request demo&quot;<br>    - Max 3 hashtags.<br>  &lt;/output&gt;<br>&lt;/prompt&gt;</pre><p><strong>Why it works:</strong></p><ul><li>Tags structure the intention.</li><li>You avoid ambiguity.</li><li>The output precisely fits your needs.</li></ul><h3>5) Output</h3><p>Define exactly how you want the model to respond. Format, limits, tone, and example.</p><p>Include:</p><ul><li>Format (Markdown, list, table, XML…).</li><li>Length or limits.</li><li>Output example.</li></ul><pre>I want you to generate a study plan to learn Spanish in 3 months.<br><br>The output format should be:<br>- Markdown format.<br>- Put a summary table of the plan at the end.<br>- Study plan with maximum 150 words per month.<br><br>Here&#39;s an output example:<br><br>## Study plan to learn Spanish in 3 months<br><br>### This month:<br>- Point 1<br>- Point 2<br>... <br><br>### Next month:<br>- Point 1<br>- Point 2<br>...<br><br><br>And at the end a summary table like this:<br>| Week | Objective | Main activities |</pre><p><strong>Why it works:</strong></p><ul><li>It standardizes the output.</li><li>It gives you total control of the format.</li><li>It prevents the AI from “misinterpreting” your intention.</li></ul><h3>Advanced Prompt Engineering</h3><p>So far you’ve learned to build clear and structured prompts. But if you want to truly leverage the potential of models, you need to go one step further.</p><p>This is where advanced techniques come in. These not only allow you to get better answers, but also <strong>teach the model to think, reason, and improve its own outputs</strong>.</p><p>Let’s go through the most important ones:</p><ul><li><strong>Chain-of-Thought (CoT)</strong></li><li><strong>Least-to-Most</strong></li><li><strong>Self-Refine</strong></li><li><strong>Few-shot</strong></li><li><strong>Self-Consistency</strong></li><li><strong>Meta-prompting</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*68MTtzIwHL3ILQtTWcP89A.png" /></figure><h3>Chain-of-Thought (CoT)</h3><p>The model <strong>reasons its decisions before responding</strong>. Think of this as telling it: “before speaking, organize your ideas”.</p><p>You don’t need to see the reasoning (though you can ask for it), but you can guide it to mentally review the steps before writing.</p><pre>I want you to create technical documentation on how AI agents work.<br><br>I want you to reason before responding:<br><br>1. Have I structured the information to be accessible?<br>2. Have I included clear examples for better understanding?<br>3. Have I verified that the information is correct?<br>4. If I&#39;ve met these steps, respond with the technical documentation.<br>5. If not, review and improve your response before delivering it.</pre><p><strong>When to use it:</strong></p><ul><li>When you want more logical or complete explanations.</li><li>When the model should “think out loud” before responding.</li><li>When you seek quality and consistency.</li></ul><h3>Least-to-Most</h3><p>This technique divides the task <strong>from easiest to most difficult</strong>. Ideal for complex problems or processes with multiple levels.</p><pre>I want you to create a marketing plan to launch a new SaaS product.<br><br>I want to divide the task into subtasks and solve them step by step:<br><br>1. Define the product&#39;s target audience.<br>2. Identify the most effective marketing channels for that audience.<br>3. Create a launch calendar with specific actions.<br>We&#39;ll solve each subtask before moving to the next.</pre><p><strong>Why it works:</strong></p><ul><li>It prevents the model from getting lost with large tasks.</li><li>It allows you to work step by step and validate each part.</li></ul><h3>Self-Refine</h3><p>The model <strong>improves its own response</strong> with feedback (yours or automatic). First it generates something, then analyzes it and perfects it.</p><pre>INITIAL INPUT: I want you to create a summary of how I can study Generative AI.<br><br>INITIAL OUTPUT: [INITIAL_RESPONSE]<br><br>____________<br><br>IMPROVEMENT INPUT:<br>Now I want you to improve the previous response considering:<br>- Add practical study examples.<br>- Include free online resources.<br>- Make the summary more concise and direct.<br>- Give me a list of 5 practical projects to apply what I&#39;ve learned.<br><br>Improved output: [IMPROVED_RESPONSE]</pre><p><strong>When to use it:</strong></p><ul><li>When you need to iterate on a response.</li><li>When you seek additional precision or depth.</li><li>When the AI should review its own work.</li></ul><h3>Few-shot</h3><p>Here you <strong>teach with examples</strong>. You give the model a style or format template and ask it to imitate it.</p><pre>I want you to generate 5 content ideas for social media about digital marketing.<br><br>The format should be:<br><br>Example 1:<br>- Content idea: How to apply AI in email marketing.<br>- Brief description: Explains how AI can optimize email marketing campaigns through automatic personalization and segmentation.<br><br>Example 2:<br>- Content idea: How to write better subject lines for your newsletters.<br>- Brief description: Shows examples of subject lines that improve open rates.<br><br>etc.</pre><p><strong>Why it works:</strong></p><ul><li>The model understands the exact format you expect.</li><li>It maintains consistency in structure.</li><li>It learns from the example without deviating from the style.</li></ul><h3>Self-Consistency</h3><p>Here the model <strong>generates multiple responses</strong> and then chooses the most solid. It’s like doing an internal brainstorming before deciding.</p><pre>I want you to help me write an email to request feedback from my customers about a new product.<br><br>Generate 3 different versions of the email. Then:<br>- Mention pros and cons of each version.<br>- Select the most effective and professional one.<br>- Justify the final choice.</pre><p><strong>When to use it:</strong></p><ul><li>When you want to explore different approaches.</li><li>When you seek the best option among several alternatives.</li></ul><h3>Meta-prompting</h3><p>This technique consists of <strong>asking the model to improve your own prompt</strong>. It serves to optimize your way of asking for things.</p><pre>This is a prompt I use to generate images with AI:<br>[EXAMPLE PROMPT]<br><br>I want you to improve it to get more realistic and detailed images for generative AI apps like NanoBanana, Midjourney, or DALL·E.<br><br>Make sure to include more vivid descriptions, specific details, and relevant artistic styles.</pre><p><strong>Why it works:</strong></p><ul><li>It teaches you to write better prompts.</li><li>It helps you understand how AI thinks.</li><li>It’s a practical way to learn by iterating.</li></ul><h3>Prompting for Agents</h3><p>When you work with <strong>AI agents</strong>, <em>prompting</em> becomes even more important. It’s no longer just about generating text: here you define how the agent <strong>reasons, remembers, decides, and uses external tools</strong>.</p><p>Let’s go through the main techniques for designing intelligent agents:</p><ul><li><strong>ReAct</strong></li><li><strong>ToT (Tree of Thoughts)</strong></li><li><strong>DSP</strong></li><li><strong>Self-Reflection</strong></li></ul><h3>ReAct</h3><p>ReAct combines three things: <strong>reasoning</strong>, <strong>acting</strong> (using tools or APIs), and <strong>observing results</strong> to decide what to do next. It’s the base pattern of most agents.</p><pre>You must follow these instructions:<br><br>1. Search about the latest trends in generative AI, specifically in image generation.<br>2. Use the Brave Search API to search for updated information. Tool: [BRAVE-SEARCH-API]<br>3. Analyze the obtained results. If the information is sufficient, generate a summary with the most relevant trends. If not, search again.</pre><p><em>[INTERNAL AGENT REASONING]</em></p><pre>[Agent thought]:<br>&quot;First I&#39;ll search for the latest trends in generative AI in image generation using the Brave Search API.&quot;<br><br>[Action]:<br>Search(&quot;latest trends in generative AI in image generation&quot;, BRAVE-SEARCH-API)<br><br>[Observation]:<br>&quot;I got several recent articles talking about new image generation techniques using diffusion models and improvements in resolution.&quot;<br><br>[Decision]:<br>If coverage is sufficient → GenerateSummary(results)<br>If not → RepeatSearch(with alternative terms)</pre><p><strong>Why it works:</strong></p><ul><li>It allows dynamic reasoning.</li><li>The agent evaluates and decides based on real observations.</li><li>It emulates human thinking step by step.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*tQX22TxDx44h-g-U-gTdFQ.png" /></figure><h3>ToT (Tree of Thoughts)</h3><p>The agent <strong>explores multiple possible paths</strong> before deciding the best one. It generates different “branches” of thinking, evaluates them, and chooses the most promising.</p><pre>I need to generate a marketing plan.<br><br>1. Generate 3 different approaches for the marketing plan (branches).<br>2. For each approach, develop 2 detailed strategies (sub-branches).<br>3. Evaluate each strategy based on its feasibility and potential impact.<br>4. Select the most promising strategy and develop a detailed action plan.</pre><p><em>[INTERNAL AGENT REASONING]</em></p><pre>[Agent thought]:<br>&quot;First I&#39;ll generate 3 different approaches for the marketing plan.&quot;<br><br>[Action]:<br>Generate approaches:<br>Approach 1: Content marketing.<br>Approach 2: Paid advertising.<br>Approach 3: Influencer marketing.<br><br>[Branch development]:<br>Approach 1:<br>- Create educational blogs and videos.<br>...<br><br>Approach 2:<br>- Google Ads campaigns.<br>...<br><br>Approach 3:<br>- Collaborate with industry influencers.<br>...<br><br>[Evaluation]:<br>Evaluate each strategy according to: cost, time to results, scalability, and audience alignment.<br><br>[Selection]:<br>&quot;After evaluating, the most promising strategy is Content marketing, as it generates trust and attracts an interested audience.&quot;<br><br>[Final action]:<br>Develop detailed action plan for the selected strategy.</pre><p><strong>Why it works:</strong></p><ul><li>The agent doesn’t stick with the first idea.</li><li>It simulates exploratory reasoning.</li><li>It produces more robust and justified solutions.</li></ul><h3>DSP (Dynamic Step Planning)</h3><p>Here the agent <strong>works step by step</strong>, chaining tasks: the output of one step becomes the input of the next. Ideal for long operational processes.</p><pre>I want you to help me plan a corporate event.<br><br>1. First define the event&#39;s objective.<br>2. Create the necessary tasks and subtasks.<br>3. Execute each task sequentially.</pre><p><em>[INTERNAL AGENT REASONING]</em></p><pre>[Agent thought]:<br>&quot;First I&#39;ll define the event&#39;s objective.&quot;<br><br>[Action]:<br>Define event objective: &quot;Strengthen relationships with clients and present new products.&quot;<br><br>[Action]:<br>Create list of necessary tasks and subtasks:<br><br>1. Venue selection<br>  - Research options<br>  ...<br><br>2. Invitations<br>  - Create guest list<br>  ...<br><br>3. Logistics<br>  - Hire catering<br>  ...<br><br>[Action]:<br>Execute each task sequentially, verifying results before continuing.</pre><p><strong>Why it works:</strong></p><ul><li>It allows total flow control.</li><li>It reproduces human planning processes.</li><li>It avoids logical jumps between tasks.</li></ul><h3>Self-Reflection</h3><p>In this technique, the agent <strong>evaluates its own response</strong> and improves it if it doesn’t meet certain standards. It works as an internal learning loop.</p><pre>I want you to help me write a commercial proposal for a potential client.<br><br>1. Write an initial proposal based on the client&#39;s information.<br>2. Evaluate the proposal and determine if it meets the objectives.<br>3. If it doesn&#39;t meet them, improve and re-evaluate until reaching a score above 8/10.</pre><p><em>[INTERNAL AGENT REASONING]</em></p><pre>[Agent thought]:<br>&quot;First I&#39;ll write an initial proposal.&quot;<br><br>[Action]:<br>Write initial proposal:<br>&quot;Dear [Client], we are pleased to present our proposal for [Service/Product] which we believe aligns perfectly with your needs...&quot;<br><br>[Evaluation]:<br>I&#39;ll evaluate the proposal according to clarity, benefits, and call to action.<br>Result: 7/10<br><br>[Action]:<br>Improve proposal:<br>- Add details about benefits.<br>- Clarify the call to action.<br>- Adjust tone and structure.<br><br>[New evaluation]:<br>Score: 9/10.<br>The proposal is ready to be sent.</pre><p><strong>Why it works:</strong></p><ul><li>The agent learns to iterate.</li><li>It improves quality without human intervention.</li><li>It simulates real critical thinking.</li></ul><h3>Here’s the summary in a single image:</h3><p>You can use it as a cheatsheet to remember the concepts from basic to advanced, all the way to agentic prompting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*LRl8EAJVJChKBkBHq2Oesw.png" /></figure><h3>Conclusion</h3><p><em>Prompt engineering</em> isn’t about writing pretty sentences, but about <strong>structuring thought and communication</strong>. Every tag, every instruction, and every example you use is a clue for the AI to better understand what you expect.</p><p>Learning to “talk” with a model isn’t different from learning a language: it’s based on practice, clarity, and observation.</p><p>Start simple. Keep adjusting your prompts. Analyze what improves results and what makes them worse. And, above all, remember this: <strong>AI doesn’t guess what you’re thinking, but it does understand very well what you explain with clarity.</strong></p><h3>Did you enjoyed this article?</h3><p>If you like content about <strong>AI Engineering</strong>, <strong>building agents</strong>, and <strong>applying AI to real world products</strong>, follow me here:</p><ul><li><a href="https://www.linkedin.com/in/ivan-escribano-dev/">LinkedIn</a></li><li><a href="https://x.com/IvanEscribano98">X</a></li><li><a href="https://medium.com/@ivanescribano1998">Medium</a></li><li><a href="https://ivanescribano.substack.com/">Substack</a></li></ul><p>Leave a comment or share it if you found it useful I’d love to hear your thoughts and keep the conversation going.</p><p>If you want more don’t miss my last post about Agents:</p><p><a href="https://medium.com/@ivanescribano1998/how-i-build-ai-agents-in-3-simple-steps-2891ccb45c9b">https://medium.com/@ivanescribano1998/how-i-build-ai-agents-in-3-simple-steps-2891ccb45c9b</a></p><p>Thank you!! ❤❤❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a639b42120e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The cheat codes I use when building AI agents that actually work]]></title>
            <link>https://medium.com/@ivanescribano1998/how-i-build-ai-agents-in-3-simple-steps-2891ccb45c9b?source=rss-2f75b9825c1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2891ccb45c9b</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-engineer]]></category>
            <dc:creator><![CDATA[Ivan Escribano]]></dc:creator>
            <pubDate>Mon, 20 Oct 2025 23:49:24 GMT</pubDate>
            <atom:updated>2025-10-21T21:49:05.965Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are AI agents?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXLU1I4TckicoB1rDGMxoQ.png" /></figure><p>Agents are systems capable of <strong>reasoning, deciding, and acting autonomously</strong> to fulfill an objective.</p><p>Unlike traditional language models (LLMs), which only predict the next word based on their training data, agents perceive their environment, plan, and use external tools like Notion, Google Drive, or databases to achieve a concrete goal.</p><figure><img alt="Comparison chart contrasting LLMs and Agents, showing differences in memory, autonomy, and ability to use tools." src="https://cdn-images-1.medium.com/max/965/1*Xhz0HbKCDMiuK5Kgw3nYDw.png" /><figcaption>From passive models to active systems how agents go beyond LLMs.</figcaption></figure><p>Now that you understand what AI agents are, let’s look at how they actually work under the hood.</p><p>To do that, we’ll break them down into two essential layers:</p><ol><li>The <strong>Cognitive Architecture</strong>, which explains how an agent thinks, plans and learns.</li><li>The <strong>Technical Architecture</strong>, which shows the components and tools that make this reasoning possible in practice.</li></ol><h3>1. Cognitive Architecture</h3><p>The Cognitive architecture defines how the agent reasons and makes decisions within the technical infrastructure that supports it.</p><p>It consists of four pillars that function in a loop:</p><p><strong>profile → memory → planning → action → feedback</strong></p><h4>1.1 Profile</h4><p>Defines who the agent is and how it behaves.</p><p>Here you specify:</p><ul><li><strong>Role</strong>: writer, researcher, analyst, etc.</li><li><strong>Identity</strong>: direct or empathetic tone, technical or casual language etc.</li></ul><p>The profile determines the agent’s personality and the type of decisions it will make.</p><pre>&lt;profile&gt;<br>  &lt;role&gt;AI Content Strategist&lt;/role&gt;<br>  &lt;tone&gt;Analytical, confident, and conversational&lt;/tone&gt;<br>&lt;/profile&gt;</pre><h4>1.2 Memory</h4><p>Memory allows the agent to reason with context and learn over time.</p><p>There are two main types:</p><ul><li><strong>Short-term memory (working memory):</strong> similar to RAM. Contains temporary information necessary to complete a current task or conversation.</li><li><strong>Long-term memory (persistent):</strong> stores experiences, results, or learnings for later use. It is stored in databases or vector systems.</li></ul><p>At this stage, the agent is only instructed <em>what</em> to remember, not <em>how</em> to store it. The actual implementation of memory short-term or long-term will be defined later in the <strong><em>Technical Architecture</em></strong> section.</p><pre>&lt;memory&gt;<br>  During this conversation, remember:<br>  {{KEY_INFORMATION_TO_KEEP_IN_CONTEXT}}<br>  (The specific way memory is managed will be defined later in the Technical Architecture section.)<br>&lt;/memory&gt;</pre><h4>1.3 Planning</h4><p>In this module, the agent designs an action plan to achieve its objective. It uses the prompt content, memory, and available data to generate subtasks, choose tools, and establish an execution and validation flow.</p><p>To improve reasoning, prompting techniques are applied such as:</p><ul><li><strong>CoT (Chain of Thought):</strong> break the problem into clear, sequential reasoning steps.</li><li><strong>ReAct (Reason + Act):</strong> alternate between reasoning and tool use to refine results.</li><li><strong>DSP (Decision–State–Plan):</strong> decide, update the current state, and plan the next action.</li><li><strong>Self-Reflection:</strong> evaluate previous output before proceeding to improve accuracy.</li><li><strong>ToT (Tree of Thought):</strong> explore multiple reasoning paths and select the best outcome.</li></ul><figure><img alt="Mind map showing Prompting Techniques for Planning in agents, including CoT, ReAct, DSP, ToT, and Self-Reflection." src="https://cdn-images-1.medium.com/max/820/1*l4i-zoRi_0ogFNjDT21AwQ.png" /><figcaption><em>Prompting methods that shape how an agent reasons and executes complex tasks.</em></figcaption></figure><p>In this example, the <strong>ReAct</strong> strategy is applied the agent alternates between reasoning and action, evaluating the quality of the results.</p><pre>&lt;planning&gt;<br>  &lt;strategy&gt;ReAct&lt;/strategy&gt;<br>  &lt;task&gt;Find high-quality, recent articles about AI agents.&lt;/task&gt;<br><br>  &lt;tools&gt;<br>    &lt;tool name=&quot;brave_search&quot; purpose=&quot;real-time web search&quot; /&gt;<br>    &lt;tool name=&quot;assess_quality&quot; purpose=&quot;evaluate freshness and credibility&quot; /&gt;<br>  &lt;/tools&gt;<br><br>  &lt;steps&gt;<br>    - Reason: Define 5 focus areas to search for:<br>      [&quot;cognitive architecture&quot;, &quot;reasoning frameworks&quot;, &quot;RAG and memory&quot;, &quot;agent orchestration&quot;, &quot;real-world use cases&quot;]<br>    - Act (brave_search): run queries for each focus area.<br>    - Reason: Check if at least 5 relevant results meet quality criteria.<br>    - Act (assess_quality): filter and rank top sources.<br>    - Reason: If fewer than 5 high-quality results, refine terms and search again.<br>    - Return: final_answer with top 5 verified links and short summaries.<br>  &lt;/steps&gt;<br>&lt;/planning&gt;</pre><h4>1.4 Action</h4><p>The agent executes the plan defined in the previous step. Here it uses external tools (APIs, databases, search engines, etc.), analyzes the results, and generates a final output based on the collected data.</p><h4>1.5 Feedback</h4><p>Once the action is completed, the agent evaluates its own performance.</p><p>It compares the result with the original objective and, if performance is low or there are errors, adjusts the plan and returns to the planning step. This self-evaluation process allows the agent to continuously improve.</p><p><em>Below is a high-level model of the Cognitive Architecture, outlining each stage, its core question, and its purpose within the agent’s reasoning cycle.</em></p><figure><img alt="Diagram explaining the Cognitive Architecture of an agent, from Profile to Feedback, highlighting the questions each stage answers and its purpose." src="https://cdn-images-1.medium.com/max/1024/1*7BI_wzLno85UIv5yiWrqzw.png" /><figcaption>The cognitive loop how an agent thinks, learns, plans, acts, and improves.</figcaption></figure><h3>2. Technical Architecture</h3><p>In this section, we will see the components necessary to build the infrastructure in which our agent will operate to fulfill its objective.</p><p>I divide it into the following sections:</p><ul><li>Models (LLM, Embeddings)</li><li>Prompts</li><li>Memory</li><li>Flows (Chains / Agents)</li><li>External tools</li><li>RAG</li><li>Outputs</li><li>Construction frameworks</li></ul><h4>2.1 Models</h4><p>This module serves as the <strong>core intelligence</strong> of the agent — its brain.<br> Powered by Large Language Models (LLMs) such as <strong>GPT-5</strong>, <strong>Claude Sonnet 4.5</strong>, <strong>Grok 4</strong>, or <strong>Gemini</strong>, the agent can reason, plan, and execute complex tasks beyond simple text generation.</p><p><strong>Common tools and providers:</strong><br> OpenAI API · Anthropic / Claude API · Google Gemini API · xAI / Grok API</p><h4>2.2 Prompts</h4><p>The prompt is the foundation of the agent, where its role, identity, and how it should act, plan, and reason during the planning → action → feedback cycle are defined. This is defined in the <strong><em>Cognitive arquitecture</em></strong></p><p>You can use XML, JSON, or Markdown templates to structure your prompts more effectively (I recommend XML).</p><p>Below is an example of a template that can serve as a base structure to define the agent’s logic and behavior:</p><pre>&lt;prompt&gt;<br>  &lt;identity&gt;<br>    You are: {{AGENT_NAME}}<br>    You act as: {{BRIEF_ROLE_DESCRIPTION}}<br>    You act with a tone: {{TONE_AND_STYLE}}<br>  &lt;/identity&gt;<br><br>&lt;objective&gt;<br>    Goal:<br>    {{CLEAR_OBJECTIVE}}<br>    Success:<br>    {{BRIEF_SUCCESS_CRITERIA}}<br>  &lt;/objective&gt;<br><br>  &lt;memory&gt;<br>    In this conversation, remember:<br>    {{INFORMATION_TO_REMEMBER_FROM_CONVERSATION}}<br>  &lt;/memory&gt;<br><br>  &lt;rules&gt;<br>    - Do not invent information.<br>    - Prioritize {{MAIN_PRIORITY}}.<br>    - Use {{EXPECTED_FORMAT}} format.<br>    - If there is ambiguity: {{PROCEDURE_FOR_AMBIGUITY}}.<br>  &lt;/rules&gt;<br><br>  &lt;scope&gt;<br>    Include: {{INCLUDED_TOPICS}}<br>    Exclude: {{EXCLUDED_TOPICS}}<br>  &lt;/scope&gt;<br><br>  &lt;planning&gt;<br>    Available strategies:<br>    - CoT → sequential tasks<br>    - ReAct → tasks with tools or APIs<br>    - PLAN_JSON → long flows or multi-agent<br>    - DCR → writing with revision<br>    - Outline → structure before developing<br>    - Multivariants → generate and evaluate multiple ideas<br>    Choose only **one** according to the task.<br>  &lt;/planning&gt;<br><br>  &lt;output&gt;<br>    Return only the final answer (without visible reasoning) in this exact format:<br>    &lt;![CDATA[<br>    {{EXAMPLE_OF_JSON_OR_MARKDOWN_OUTPUT}}<br>    ]]&gt;<br>  &lt;/output&gt;<br>&lt;/prompt&gt;</pre><h4>2.3 Memory</h4><p>This module allows the agent to remember information within a flow or between previous conversations.</p><ul><li><strong>Short-term memory</strong> (similar to RAM) stores temporary data that is used during current execution.</li><li><strong>Long-term memory</strong> is persistent and stores useful information for future tasks or interactions, improving the agent’s contextual coherence and reasoning.</li></ul><p><strong>Tools:</strong></p><ul><li>Vector databases like <strong>Chroma</strong> or <strong>Pinecone</strong></li><li>Traditional databases like <strong>MongoDB</strong>, <strong>Supabase</strong>, or <strong>Firestore</strong>.</li></ul><figure><img alt="Visual comparison between short-term (RAM/session buffer) and long-term (storage/vector DB) memory in agents, including scope and lifetime." src="https://cdn-images-1.medium.com/max/1024/1*OvDXyQM2fz-47_e7KFllYg.png" /><figcaption>Agents remember like humans short-term context for tasks, long-term memory for accumulated knowledge.</figcaption></figure><h4>2.4 Flows / Chains</h4><p>Flows determine how the agent organizes and executes its tasks, and how different modules or sub-agents are connected.</p><p>Each type of flow adapts to a different type of problem or process.</p><ul><li><strong>Sequential flows:</strong> modules execute one after another in an orderly manner.</li><li><strong>Parallel flows:</strong> multiple independent flows execute and then results are combined.</li><li><strong>Conditional flows:</strong> execution depends on a prior condition.</li><li><strong>Feedback flows:</strong> the agent evaluates its output and decides whether to repeat or continue.</li><li><strong>Hierarchical flows:</strong> a main agent divides a complex task into subtasks and delegates them to sub-agents.</li><li><strong>State-based flows:</strong> the agent’s decisions depend on the current state or active memory.</li><li><strong>Composite flows:</strong> combine multiple flow types (for example, a sequential one followed by a conditional one).</li><li><strong>Goal-based flows:</strong> the agent designs its own flow according to the goal it must achieve.</li></ul><figure><img alt="Star-shaped diagram showing different Agent Flow Types sequential, parallel, conditional, hierarchical, feedback, composite, state-based, and goal-oriented." src="https://cdn-images-1.medium.com/max/1024/1*yJ_rigGbXE55noFg03kiHA.png" /><figcaption>Different reasoning flows determine how an agent plans, coordinates, and adapts its actions.</figcaption></figure><p><strong>Parallel Flow Example</strong></p><p>In a parallel flow, the agent runs multiple independent tasks simultaneously and their outputs are merged before generating the final answer.</p><figure><img alt="Parallel Flow Example — AI agents flow" src="https://cdn-images-1.medium.com/max/559/1*Tr-kAL2l17yH7oQHwzEyqw.png" /><figcaption><strong>Parallel Flow Example</strong></figcaption></figure><h4>2.5 External Tools</h4><p>Tools allow the agent to interact with the real world to fulfill its objective.</p><p>They can be used to search for information, access documents, communicate with other services, or execute actions in external environments.</p><p>Integrating them correctly expands the agent’s reach and connects it with real-time data or services.</p><p><strong>Examples:</strong></p><p>Google Drive, Notion, MCP servers, Brave Search API.</p><p><strong>How the Agent Works with MCP and External Tools</strong><br>The agent uses the MCP server as a secure bridge to external systems. It taps into services like Notion, Google Drive or APIs to fetch data, take actions, and integrate results into its reasoning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*eRNvYlf1Y_yNGIfHmFENAg.png" /><figcaption>Tool use AI agents</figcaption></figure><h4>2.6 RAG (Retrieval-Augmented Generation)</h4><p>This module allows the agent to enrich its context with external information before generating a response.</p><p>It can extract data from databases, documents, web or relevant files, improving the accuracy, relevance, and currency of the content it produces.</p><p><strong>Tools:</strong></p><p>Vector databases like <strong>Chroma DB</strong> or traditional ones like <strong>MongoDB</strong>.</p><p>This short example illustrates how the RAG process works step by step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*7UbQMjrIPvddJmJjqLvAbA.png" /><figcaption>RAG flow AI agents</figcaption></figure><h4>Outputs</h4><p>The output module defines how the agent returns its final response.</p><p>It is important to establish the expected format (for example, JSON or Markdown) and the data structures necessary to integrate it with other systems or automatic flows.</p><p><strong>Tools:</strong></p><p>Pydantic, Zod, schemas integrated in the OpenAI API.</p><h4>2.7 Construction Frameworks</h4><p>Given that agent architecture can be complex, there are frameworks that facilitate its construction and orchestration.</p><p>These frameworks help integrate all the previous modules into a coherent and maintainable structure.</p><p><strong>Tools:</strong></p><p>LangChain, LangGraph, OpenAI Agent SDK, LlamaIndex.</p><p>There are also no-code options like <strong>n8n</strong> or <strong>AgentKit</strong> from OpenAI if you are not familiar with coding.</p><p><em>This diagram complements the Cognitive Architecture by showing the technical backbone the systems and frameworks that make reasoning and action possible.</em></p><figure><img alt="Diagram showing the Technical Architecture of AI agents, including layers for models, prompts, memory, flows, tools, RAG, outputs, and frameworks." src="https://cdn-images-1.medium.com/max/820/1*6YTGQMGIitE-fRXkxXpTmw.png" /><figcaption><em>The technical backbone of an agent how models, memory, and tools integrate to support reasoning and action.</em></figcaption></figure><h3>3. How I organize myself when building agents</h3><p>When I start creating agents, I usually follow three simple steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*yudf63uq44bWWZUkm3OuLQ.png" /></figure><p><strong>1. First, I define how they’ll behave.</strong></p><p>I think about their role, how they’ll reason, and how they’ll interact with each other inside the system I’m building.</p><p><strong>2. Then, I design the technical structure.</strong></p><p>I set up the foundation — models, memory, tools, and flows — that allows everything to work together.</p><p><strong>3. Finally, I pick the right tools for each case.</strong></p><p>Not every agent needs the same setup. Sometimes I use LangChain, other times the OpenAI Agent SDK, or even something more visual like n8n.</p><blockquote><em>In short: think first, build second, connect third.</em></blockquote><blockquote><em>That’s the mindset behind every well-designed multi-agent system.</em></blockquote><h3>Did you enjoyed this article?</h3><p>If you like content about <strong>AI Engineering</strong>, <strong>building agents</strong>, and <strong>applying AI to real-world products</strong>, follow me here: on <a href="https://medium.com/@ivanescribano1998"><strong>Medium</strong> </a>and on <a href="https://www.linkedin.com/in/ivan-escribano-dev/"><strong>LinkedIn</strong></a>.</p><p>Leave a comment or share it if you found it useful I’d love to hear your thoughts and keep the conversation going. Thank you!! ❤❤❤</p><h3><strong>Interesting resources to look:</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEDb37y_MhRw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEDb37y_MhRw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEDb37y_MhRw%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/47baab1cbd9a34317b74d62d8e243904/href">https://medium.com/media/47baab1cbd9a34317b74d62d8e243904/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyF9kGESAi3M%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyF9kGESAi3M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyF9kGESAi3M%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/725a017a786b5b4ffda90fc18888ea59/href">https://medium.com/media/725a017a786b5b4ffda90fc18888ea59/href</a></iframe><p><a href="https://openai.github.io/openai-agents-python/">OpenAI Agents SDK</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/MaryamMiradi/status/1969794887815192890&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/5aa4a13c4261610b3e665f56f392d95a/href">https://medium.com/media/5aa4a13c4261610b3e665f56f392d95a/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/IntuitMachine/status/1969723501675164157&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b85b1b0fd7b8b726862e8c65cab5308/href">https://medium.com/media/8b85b1b0fd7b8b726862e8c65cab5308/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FT1Lowy1mnEg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DT1Lowy1mnEg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FT1Lowy1mnEg%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bc0ce5d991e635c1bc4d4065f14a782/href">https://medium.com/media/5bc0ce5d991e635c1bc4d4065f14a782/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2891ccb45c9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Boost Your Career with a Simple Tactic? Discover the Impact of Note-Taking Here:]]></title>
            <link>https://medium.com/@ivanescribano1998/how-to-boost-your-career-with-a-simple-tactic-discover-the-impact-of-note-taking-here-1cde5fedb7c0?source=rss-2f75b9825c1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cde5fedb7c0</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[professional-development]]></category>
            <dc:creator><![CDATA[Ivan Escribano]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 17:28:52 GMT</pubDate>
            <atom:updated>2024-02-18T17:28:52.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*hw-qBjtgq-wcGrxc5HPPDQ.png" /></figure><p>In today’s fast-paced world, the simplicity of note-taking can be underestimated. Yet, this simple act can have a profound impact on your professional development. Here’s how:</p><ul><li><strong>Improves focus and understanding in meetings:</strong> By taking notes, you keep your attention focused on the speaker, facilitating a better understanding of their ideas, pending questions, and important details. This practice benefits not only your understanding but also the quality of communication.</li><li><strong>Acts as a subtle compliment:</strong> When you take notes during a conversation, you convey interest and respect for the other person’s ideas. This encourages a richer exchange of knowledge, advice, and creativity.</li><li><strong>Boosts team productivity:</strong> Note-taking significantly improves our productivity and that of the team. By recording important tasks, advice, and key details during meetings, we reduce the need for future clarifications from our colleagues. This saves us time and also prevents interrupting our colleagues’ workflow, facilitating more efficient time management for the entire team.</li><li><strong>Enhances your memory and mental clarity:</strong> Taking notes helps us remember more about what is discussed in meetings, for example. Some people may have an incredible memory, but our brain and storage capacity are limited, and it holds personal and professional matters, problems, joys, birthdays, etc.</li></ul><h3>Reflection</h3><p><strong>It’s totally human and normal to forget details</strong>; after all, we are not machines. However, it’s important to look for effective ways to retain as much information as possible in our day-to-day lives. This not only favors our professional development but also our personal growth. <strong>Recognizing our limitations and adopting strategies like note-taking allows us to capture those important moments and ideas</strong>, thus improving our efficiency and enriching our experiences at work and in personal life.</p><h3>Tools to Get Started</h3><ul><li>For simplicity: Paper and notebook.</li><li>For basic digital: Notepad on your device / Google Keep.</li><li>For a more advanced solution: <strong>Tools like Notion, which I personally use as my “second brain”</strong>.</li></ul><p>Now It’s Your Turn! How do you manage all the information you receive in your day-to-day? Do you rely on your memory, or do you use an app to help you? Do you think this strategy improves your daily efficiency? If you have any tips or methods that have been useful to you, we’d love to hear about them in the comments!</p><p>If you liked this content, I invite you to follow me on LinkedIn:<br><a href="https://www.linkedin.com/in/ivan-escribano-dev/">https://www.linkedin.com/in/ivan-escribano-dev/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cde5fedb7c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New CSS features to start using in 2024]]></title>
            <link>https://medium.com/@ivanescribano1998/new-css-features-to-start-using-in-2024-0e3771fe9c85?source=rss-2f75b9825c1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e3771fe9c85</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <dc:creator><![CDATA[Ivan Escribano]]></dc:creator>
            <pubDate>Thu, 08 Feb 2024 22:31:27 GMT</pubDate>
            <atom:updated>2025-10-20T23:57:31.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>New CSS features to start using in 2024 | By Ivan Escribano</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twH0irqJq5hFHlGTWn5ACg.png" /></figure><h3>The :is() pseudo-class</h3><p>The CSS :is() pseudo-class offers a powerful and convenient way to apply a single rule to multiple elements.</p><h4>Example structure</h4><p>Consider you want to target the “card-title” and “card-description” elements within a “card” container. Here’s how you’d typically write the HTML structure:</p><pre>&lt;div class=&quot;card&quot;&gt;<br>&lt;!--How to select this elements--&gt;<br>  &lt;h2 class=&quot;card-title&quot;&gt;Card Title&lt;/h2&gt;<br>  &lt;p class=&quot;card-description&quot;&gt;This is the card description. Here, you can add more details about the card&#39;s content.&lt;/p&gt;<br>  &lt;button class=&quot;card-button&quot;&gt;Click here&lt;/button&gt;<br>&lt;/div&gt;<br><br>&lt;div class=&quot;card2&quot;&gt;<br>  &lt;h2 class=&quot;card-title&quot;&gt;Card Title&lt;/h2&gt;<br>  &lt;p class=&quot;card-description&quot;&gt;This is the card description. Here, you can add more details about the card&#39;s content.&lt;/p&gt;<br>  &lt;button class=&quot;card-button&quot;&gt;Click here&lt;/button&gt;<br>&lt;/div&gt;</pre><h4>Traditional approach</h4><p>Normally, you might select these elements like this:</p><pre>.card .card-title,<br>.card .card-description {<br>  color: blue;<br>}</pre><h4>Using :is</h4><p>With the :is pseudo-class, you can simplify the selection:</p><pre>/* selecting title and description inside card*/<br>.card :is(.card-title, .card-description) {<br>  color: blue;<br>}</pre><h3>Nesting like SASS in CSS</h3><p>CSS nesting is a recently proposed feature that allows CSS selectors to be written inside other selectors, like the functionality offered by preprocessors like SASS.</p><h4>Traditional approach</h4><p>Typically, you might target elements like this:</p><pre>.cards .card .card-description {<br>  color: blue;<br>}<br><br>.cards .card .card-title {<br>  color: red;<br>}</pre><h4>Using CSS nesting</h4><p>With the nesting feature(similar to SASS), your code can be more organized:</p><pre>.cards {<br>  .card {<br>    &amp; .card-description {<br>      color: blue;<br>    }<br>    &amp; .card-title {<br>      color: red;<br>    }<br>  }<br>}</pre><h3>The @ layer directive to re order styles.</h3><p>The @layer directive allows you to organize your CSS into logical layers. This organization helps control the <strong>order</strong> in which styles are applied.</p><p>To prioritize the styles you want to prevail, you can use @layer:</p><pre>/* Specify the order to apply styles in cascade */<br>@layer legacyCard, newCard;<br><br>/* Imagine you have a lot of styles */<br>@layer newCard {<br>  .card {<br>    background-color: red;<br>  }<br>}<br>@layer legacyCard {<br>  .card {<br>    background-color: green;<br>  }<br>}</pre><p>The red background is applied because, through the @layer, we&#39;re reordering the cascade styles. Traditionally, the &quot;legacyCard&quot; would be applied as it&#39;s the latest in the CSS document, but @layer changes this behavior applying the “newCard” because is putting it in last.</p><h3>How to improve responsiveness with @container</h3><p>CSS’s @container allows elements to adjust their styles based on the size of their parent container, moving beyond the traditional viewport-based media queries.</p><h4>How @ container works</h4><pre>.card {<br>  /*Add as a container type and name*/<br>  container-type: inline-size;<br>  container-name: card;<br>  width: 500px;<br>}<br><br>/* Applies when the card&#39;s max width is 600px, not the whole screen */<br>@container card (max-width: 600px) {<br>  .card-title {<br>    color: blue;<br>  }<br>}</pre><p>In this scenario, the .card-title will turn blue only when the .card container itself has a maximum width of 600px, regardless of the viewport size. This is a departure from traditional media queries, where adjustments are based on the overall size of the browser window.</p><h3>The : has() pseudo-class</h3><p>The CSS :has() pseudo-class introduces a powerful way to select an element based on its descendants, akin to applying conditional styles.</p><h4>HTML Structure for Demonstration</h4><p>Consider we have two identical card sections:</p><pre>&lt;section class=&quot;cards&quot;&gt;<br>  &lt;!-- First CARD with a link --&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;h2 class=&quot;card-title&quot;&gt;Card Title&lt;/h2&gt;<br>    &lt;p class=&quot;card-description&quot;&gt;This is the card description. Here, you can add more details about the card&#39;s content.&lt;/p&gt;<br>    &lt;button class=&quot;card-button&quot;&gt;Click here&lt;/button&gt;<br>    &lt;a href=&quot;url&quot; class=&quot;card-link&quot;&gt;Link text&lt;/a&gt;<br>  &lt;/div&gt;<br><br>&lt;!-- Second CARD without a link --&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;h2 class=&quot;card-title&quot;&gt;Card Title&lt;/h2&gt;<br>    &lt;p class=&quot;card-description&quot;&gt;This is the card description. Here, you can add more details about the card&#39;s content.&lt;/p&gt;<br>    &lt;button class=&quot;card-button&quot;&gt;Click here&lt;/button&gt;<br>  &lt;/div&gt;<br>&lt;/section&gt;</pre><h4>Example of Using :has()</h4><p>To exclusively select the card containing a link, you would use:</p><pre>.card:has(.card-link) {<br>  background-color: red;<br>}</pre><h4>Comparison Example</h4><p>Without :has(), selecting a parent based on its children&#39;s presence would be significantly more complex, often requiring JavaScript. :has() simplifies this process, allowing for straightforward CSS-only solutions.</p><p><strong>If you like this content follow me on Linkedin for more:<br></strong><a href="https://www.linkedin.com/in/ivan-escribano-dev/">https://www.linkedin.com/in/ivan-escribano-dev/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e3771fe9c85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>