<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oluwawunmi Adesewa </title>
    <description>The latest articles on DEV Community by Oluwawunmi Adesewa  (@oluwawunmiadesewa).</description>
    <link>https://dev.to/oluwawunmiadesewa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2834667%2Ffa2458fe-fdfc-499b-85da-09a25f1a58ad.jpg</url>
      <title>DEV Community: Oluwawunmi Adesewa </title>
      <link>https://dev.to/oluwawunmiadesewa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oluwawunmiadesewa"/>
    <language>en</language>
    <item>
      <title>How to Activate Claude Skills Automatically: 2 Fixes for 95% Activation</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Fri, 20 Feb 2026 04:12:57 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/claude-code-skills-not-triggering-2-fixes-for-100-activation-3b57</link>
      <guid>https://dev.to/oluwawunmiadesewa/claude-code-skills-not-triggering-2-fixes-for-100-activation-3b57</guid>
      <description>&lt;p&gt;The point of Claude Skills in Claude Code is autonomous skill activation. You define a skill and Claude automatically triggers it when relevant.&lt;/p&gt;

&lt;p&gt;But if you've actually tried building with Skills, you know that's not how it behaves by default.&lt;/p&gt;

&lt;p&gt;They don't trigger consistently. Even when the trigger conditions look correct, Claude often ignores them.&lt;/p&gt;

&lt;p&gt;While you can use workarounds like slash commands or stacking rules in the &lt;code&gt;CLAUDE.md&lt;/code&gt; file, these methods lose the core benefit: skills firing on their own.&lt;/p&gt;

&lt;p&gt;If you want to make Claude Code skills activate automatically instead of calling them yourself, this tutorial shows exactly how to set them up so they fire reliably.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why Claude Skills Don't Trigger&lt;/li&gt;
&lt;li&gt;
Fix 1: Detection Hook + Trigger Rules

&lt;ul&gt;
&lt;li&gt;What we Need the Skill to do&lt;/li&gt;
&lt;li&gt;What We Need to Install&lt;/li&gt;
&lt;li&gt;Step 1&lt;/li&gt;
&lt;li&gt;Step 2: Create the Hook Files&lt;/li&gt;
&lt;li&gt;Step 2: Configure Skill Triggers&lt;/li&gt;
&lt;li&gt;Step 3: Activate the Hook&lt;/li&gt;
&lt;li&gt;How It Works&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Fix 2: Forced Skill Evaluation

&lt;ul&gt;
&lt;li&gt;How Forced Skill Evaluation Works&lt;/li&gt;
&lt;li&gt;How to Set it up&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Bonus: Settings Tweak Worth Testing&lt;/li&gt;

&lt;li&gt;

Which Method Should You Use?

&lt;ul&gt;
&lt;li&gt;Use Detection Hook (Fix 1) when:&lt;/li&gt;
&lt;li&gt;Use Forced Evaluation (Fix 2) when:&lt;/li&gt;
&lt;li&gt;Use Custom Instructions (Bonus) when:&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;Quick Troubleshooting&lt;/li&gt;

&lt;li&gt;Shoutouts &amp;amp; References&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Claude Skills Don't Trigger
&lt;/h2&gt;

&lt;p&gt;The issue isn’t that Claude Skills don’t work. They do. The problem is when they activate. As activation depends on Claude’s interpretation of your prompt. It decides whether a skill is relevant, and sometimes it guesses wrong. That’s why skills don’t always fire when you expect.&lt;/p&gt;

&lt;p&gt;So, instead of leaving activation up to chance, we can guide Claude so skills trigger automatically every time. &lt;/p&gt;

&lt;p&gt;Here's how:&lt;/p&gt;




&lt;h2&gt;
  
  
  Fix 1: Detection Hook + Trigger Rules
&lt;/h2&gt;

&lt;p&gt;We owe this fix to &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Claude hooks &lt;/a&gt;, by the way. (ironically)&lt;/p&gt;

&lt;p&gt;For this fix, we use the &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook, which runs every time you send a prompt to Claude, before it responds. This lets us inject instructions into every prompt Claude sees, giving us reliable control over which skills run. &lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You type a prompt that should trigger a skill.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook runs.&lt;/li&gt;
&lt;li&gt;The hook reads your prompt and checks it against &lt;code&gt;skill-rules.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If there’s a match, the hook adds a small instruction telling Claude which skill to activate.&lt;/li&gt;
&lt;li&gt;Claude sees your prompt with the hook’s instruction. &lt;/li&gt;
&lt;li&gt;The correct skill runs automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This setup lets us reliably activate skills without manually calling them. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next, we’ll walk through an example using the &lt;code&gt;valibot&lt;/code&gt; validation skill to show exactly how to configure the hook and trigger rules&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What we Need the Skill to do&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need the skill to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Guide Claude to use composable validators like v.pipe()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensure proper TypeScript type inference&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make skill activation reliable whenever validation is mentioned&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Why valibot? It only loads the validators Claude actually uses, so token usage stays low and the skill runs fast. This matters when you're triggering skills throughout a coding session.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What We Need to Install&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To make this work automatically, we’ll set up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;UserPromptSubmit&lt;/code&gt; hook – runs on every prompt you send to Claude&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configuration file – tells the hook when to suggest skills&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Settings update – activates the hook&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Step 1
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure you have the valibot library installed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Copy the &lt;a href="https://github.com/open-circle/agent-skills" rel="noopener noreferrer"&gt;&lt;code&gt;valibot&lt;/code&gt;&lt;/a&gt; skill into your .skills/directory&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 - Create the Hook Files
&lt;/h2&gt;

&lt;p&gt;To make the &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook work for skill activation, you need two files in your .claude/hooks/ directory. Each file has a clear role:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.claude/hooks/skill-activation-prompt.sh&lt;/code&gt; – a shell script that runs automatically whenever you submit a prompt. Its job is to invoke the TypeScript script that handles the hook logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.claude/hooks/skill-activation-prompt.ts&lt;/code&gt; – contains the logic that reads your prompt and checks it against your skill-trigger rules defined in a &lt;code&gt;JSON&lt;/code&gt; file. If a rule matches, it injects instructions into the prompt so Claude can activate the correct skill.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This separation keeps things modular: the shell script handles execution, the TypeScript script handles logic, and the &lt;code&gt;JSON&lt;/code&gt; file holds the actual rules. Together, they let the hook run on every prompt and guide Claude reliably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File 1: &lt;code&gt;.claude/hooks/skill-activation-prompt.sh&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
set -e

cd "$CLAUDE_PROJECT_DIR/.claude/hooks"
cat | npx tsx skill-activation-prompt.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x .claude/hooks/skill-activation-prompt.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;File 2: &lt;code&gt;.claude/hooks/skill-activation-prompt.ts&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env node
import { readFileSync } from 'fs';
import { join } from 'path';

interface HookInput {
    session_id: string;
    transcript_path: string;
    cwd: string;
    permission_mode: string;
    prompt: string;
}

interface PromptTriggers {
    keywords?: string[];
    intentPatterns?: string[];
}

interface SkillRule {
    type: 'guardrail' | 'domain';
    enforcement: 'block' | 'suggest' | 'warn';
    priority: 'critical' | 'high' | 'medium' | 'low';
    promptTriggers?: PromptTriggers;
}

interface SkillRules {
    version: string;
    skills: Record&amp;lt;string, SkillRule&amp;gt;;
}

interface MatchedSkill {
    name: string;
    matchType: 'keyword' | 'intent';
    config: SkillRule;
}

async function main() {
    try {
        const input = readFileSync(0, 'utf-8');
        const data: HookInput = JSON.parse(input);
        const prompt = data.prompt.toLowerCase();

        const projectDir = process.env.CLAUDE_PROJECT_DIR || '$HOME/project';
        const rulesPath = join(projectDir, '.claude', 'skills', 'skill-rules.json');
        const rules: SkillRules = JSON.parse(readFileSync(rulesPath, 'utf-8'));

        const matchedSkills: MatchedSkill[] = [];

        for (const [skillName, config] of Object.entries(rules.skills)) {
            const triggers = config.promptTriggers;
            if (!triggers) {
                continue;
            }

            if (triggers.keywords) {
                const keywordMatch = triggers.keywords.some(kw =&amp;gt;
                    prompt.includes(kw.toLowerCase())
                );
                if (keywordMatch) {
                    matchedSkills.push({ name: skillName, matchType: 'keyword', config });
                    continue;
                }
            }

            if (triggers.intentPatterns) {
                const intentMatch = triggers.intentPatterns.some(pattern =&amp;gt; {
                    const regex = new RegExp(pattern, 'i');
                    return regex.test(prompt);
                });
                if (intentMatch) {
                    matchedSkills.push({ name: skillName, matchType: 'intent', config });
                }
            }
        }

        if (matchedSkills.length &amp;gt; 0) {
            let output = '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n';
            output += '🎯 SKILL ACTIVATION CHECK\n';
            output += '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n';

            const critical = matchedSkills.filter(s =&amp;gt; s.config.priority === 'critical');
            const high = matchedSkills.filter(s =&amp;gt; s.config.priority === 'high');
            const medium = matchedSkills.filter(s =&amp;gt; s.config.priority === 'medium');
            const low = matchedSkills.filter(s =&amp;gt; s.config.priority === 'low');

            if (critical.length &amp;gt; 0) {
                output += '⚠️ CRITICAL SKILLS (REQUIRED):\n';
                critical.forEach(s =&amp;gt; output += `  → ${s.name}\n`);
                output += '\n';
            }

            if (high.length &amp;gt; 0) {
                output += '📚 RECOMMENDED SKILLS:\n';
                high.forEach(s =&amp;gt; output += `  → ${s.name}\n`);
                output += '\n';
            }

            if (medium.length &amp;gt; 0) {
                output += '💡 SUGGESTED SKILLS:\n';
                medium.forEach(s =&amp;gt; output += `  → ${s.name}\n`);
                output += '\n';
            }

            if (low.length &amp;gt; 0) {
                output += '📌 OPTIONAL SKILLS:\n';
                low.forEach(s =&amp;gt; output += `  → ${s.name}\n`);
                output += '\n';
            }

            output += 'ACTION: Use Skill tool BEFORE responding\n';
            output += '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n';

            console.log(output);
        }

        process.exit(0);
    } catch (err) {
        console.error('Error in skill-activation-prompt hook:', err);
        process.exit(1);
    }
}

main().catch(err =&amp;gt; {
    console.error('Uncaught error:', err);
    process.exit(1);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install dependencies:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .claude/hooks
npm init &lt;span class="nt"&gt;-y&lt;/span&gt;  &lt;span class="c"&gt;# Creates package.json if you don't have one&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;tsx  &lt;span class="c"&gt;# Required to run TypeScript files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Configure Skill Triggers
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;.claude/skills/skill-rules.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "version": "1.0",
  "skills": {
    "valibot-usage": {
      "type": "domain",
      "enforcement": "suggest",
      "priority": "high",
      "description": "Valibot schema validation",
      "promptTriggers": {
        "keywords": [
          "validate",
          "validation",
          "schema",
          "type check",
          "verify input",
          "validate data",
          "parse request"
        ]
      },
      "fileTriggers": {
        "pathPatterns": [
          "**/*.ts",
          "**/*.js"
        ]
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file tells the hook when to suggest the &lt;code&gt;Valibot-usage&lt;/code&gt; skill. When you type words like "validate" or "schema" while editing TypeScript or JavaScript files, the hook detects it and suggests the &lt;code&gt;Valibot-usage&lt;/code&gt; skill.&lt;/p&gt;

&lt;p&gt;Each skill you want to auto-trigger needs an entry in this file. Right now we only have &lt;code&gt;Valibot-usage&lt;/code&gt;, but you can add more skills later by adding more entries under &lt;code&gt;"skills"&lt;/code&gt;. For example, if you had a React patterns skill, you'd add another entry for "react-patterns" with its own keywords and file patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Activate the Hook
&lt;/h2&gt;

&lt;p&gt;Add this to your &lt;code&gt;.claude/settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/skill-activation-prompt.sh"
          }
        ]
      }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you already have a settings.json with other hooks, just add the &lt;code&gt;UserPromptSubmit&lt;/code&gt; section.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: "validate this user input"
Claude: *writes manual if-statement validation*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: "validate this user input"
Hook: detects "validate" + .ts file
Claude: RECOMMENDED SKILLS:
  Valibot-usage 

ACTION: Use Skill tool BEFORE responding"
You: "yes"
Claude: uses valibot-usage skill to generate schema
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;One important thing to know:&lt;/strong&gt; The hook doesn't automatically load skills for you. It detects when a skill is relevant and tells Claude about it, but Claude will still ask you "Should I load the Valibot-usage skill?" before actually using it. You have to say yes.&lt;/p&gt;

&lt;p&gt;This is by design. The hook handles the detection part automatically so you don't have to remember which skill to use, but you still get final say on whether to load it.&lt;/p&gt;

&lt;p&gt;Now when you're building an API endpoint and ask Claude to validate the request body, it uses Valibot's composable validators, guided by the&lt;code&gt;valibot-usage&lt;/code&gt;skill. instead of writing manual checks. The validation logic stays readable even as your schemas get more complex.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fix 2: Forced Skill Evaluation
&lt;/h2&gt;

&lt;p&gt;This method also uses the &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook. But instead of just checking rules quietly, it forces Claude to evaluate each skill before writing any code. Claude has to commit to a skill decision instead of skipping straight to implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Forced Skill Evaluation Works
&lt;/h2&gt;

&lt;p&gt;When you type a prompt like "validate this API request," Claude goes through three steps:&lt;/p&gt;

&lt;p&gt;a. Evaluate&lt;br&gt;
Lists every skill and decides YES or NO with a reason:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;valibot-usage&lt;/code&gt;: YES - need schema validation&lt;br&gt;
react-patterns: NO - not building UI&lt;/p&gt;

&lt;p&gt;b. Activate&lt;br&gt;
Calls the skill for each YES decision:&lt;/p&gt;

&lt;p&gt;Skill(&lt;code&gt;valibot-usage&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;c. Implement&lt;br&gt;
Writes the code after committing to the skill decisions.&lt;/p&gt;

&lt;p&gt;This fix makes Claude stop and evaluate each skill before touching any code. It can't skip straight to implementation.&lt;/p&gt;

&lt;p&gt;Using words like MANDATORY or CRITICAL makes it harder for Claude to skip the activation step.&lt;/p&gt;


&lt;h2&gt;
  
  
  How to Set it up
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;.claude/hooks/skill-forced-eval.sh&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
# UserPromptSubmit hook that forces explicit skill evaluation
#
# This hook requires Claude to explicitly evaluate each available skill
# before proceeding with implementation.
#
# Installation: Copy to .claude/hooks/UserPromptSubmit

cat &amp;lt;&amp;lt;'EOF'
INSTRUCTION: MANDATORY SKILL ACTIVATION SEQUENCE

Step 1 - EVALUATE (do this in your response):
For each skill in &amp;lt;available_skills&amp;gt;, state: [skill-name] - YES/NO - [reason]

Step 2 - ACTIVATE (do this immediately after Step 1):
IF any skills are YES → Use Skill(skill-name) tool for EACH relevant skill NOW
IF no skills are YES → State "No skills needed" and proceed

Step 3 - IMPLEMENT:
Only after Step 2 is complete, proceed with implementation.

CRITICAL: You MUST call Skill() tool in Step 2. Do NOT skip to implementation.
The evaluation (Step 1) is WORTHLESS unless you ACTIVATE (Step 2) the skills.

Example of correct sequence:
- research: NO - not a research task
- Valibot-usage: YES - need schema validation 

[Then IMMEDIATELY use Skill() tool:]
&amp;gt; Skill(Valibot-usage)

[THEN and ONLY THEN start implementation]
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x .claude/hooks/skill-forced-eval.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add to &lt;code&gt;.claude/settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/skill-forced-eval.sh"
          }
        ]
      }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude writes down the decision, then has to follow through. Once it says "YES - need schema validation", it's locked in. It has to activate the skill before coding.&lt;/p&gt;

&lt;p&gt;It's more verbose though. You'll see Claude list every skill before it starts. But it works because Claude has to commit to the decision in writing before implementing anything.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Bonus: Settings Tweak Worth Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There's one more approach that's simpler than hooks but less consistent. If you don't want to deal with hook files, you can add instructions directly to Claude Code's settings.&lt;/p&gt;

&lt;p&gt;Go to Settings at Custom Instructions and add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MANDATORY: Before responding to ANY prompt, you MUST:
1. Check ALL available skills in &amp;lt;available_skills&amp;gt;
2. Identify which skills apply to this prompt
3. Use Skill(skill-name) for EACH applicable skill
4. ONLY THEN start your response

Do NOT skip skill activation. Do NOT proceed without checking skills.
This is NON-NEGOTIABLE for every single prompt.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The aggressive language ("MANDATORY", "NON-NEGOTIABLE") makes it harder for Claude to ignore. It becomes part of Claude's system context on every interaction.&lt;/p&gt;

&lt;p&gt;This works, but it's not as reliable as the hook approaches, as custom instructions sit in the background. Claude can still override them when it thinks it knows better, but Hooks force the behavior by injecting it into every prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Method Should You Use?
&lt;/h2&gt;

&lt;p&gt;The real question isn't which method has better pros/cons but about how you work and what you're building.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Detection Hook (Fix 1) when:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You're managing multiple skills across different contexts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have 5+ skills (validation, React patterns, database queries, API design, testing), Fix 1 scales better. The keyword-based detection in &lt;code&gt;skill-rules.json&lt;/code&gt; lets you map different triggers to different skills without forcing Claude to evaluate everything every time.&lt;/p&gt;

&lt;p&gt;Example: Your prompt mentions "validate user input" while editing a TypeScript API route. The hook detects &lt;code&gt;validate&lt;/code&gt; + &lt;code&gt;.ts&lt;/code&gt; file context and suggests only the Valibot skillâ€”not your React patterns or database skills. This selective activation keeps Claude focused.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your skills have clear linguistic or contextual triggers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fix 1 works best when you can define precise activation conditions. If you can articulate "when the user says X while editing Y file type, suggest Z skill," the detection hook will reliably fire. &lt;/p&gt;

&lt;p&gt;The JSON configuration gives you fine-grained control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keywords: &lt;code&gt;["validate", "schema", "parse request"]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Intent patterns: Regex matching like &lt;code&gt;"verify.*input"&lt;/code&gt; or &lt;code&gt;"check.*data"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;File patterns: &lt;code&gt;**/*.ts&lt;/code&gt;, &lt;code&gt;**/api/**/*.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You want to preserve Claude's autonomy for simple tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The detection hook &lt;em&gt;suggests&lt;/em&gt; skills but still asks permission. This matters when you're doing something straightforward that doesn't need skill intervention. You type "add a console.log here" ”no skill triggers, Claude just does it without an evaluation overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You're willing to invest setup time for long-term efficiency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fix 1 requires more initial work: shell script, TypeScript logic, JSON configuration, npm dependencies. But once it's set up, adding new skills is just editing one JSON file. If you're building a skill library for a team or long-term project, this upfront cost pays off.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Forced Evaluation (Fix 2) when:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You have 2-3 critical skills that must never be forgotten&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your project relies on a small set of non-negotiable patterns. Say a Valibot validation skill, a custom auth pattern, and a logging standard. Fix 2 guarantees Claude considers them every time. The three-step evaluation sequence (Evaluate, Activate and Implement) makes skill usage mandatory, not optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your skills apply broadly but Claude keeps missing them&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some skills don't have obvious keyword triggers. A "clean code principles" skill or "error handling patterns" skill might be relevant to almost any code task, but there's no single word that captures when to use them. Fix 2 solves this by making Claude explicitly evaluate every skill regardless of the prompt content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You're okay with verbosity for reliability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every prompt gets the full evaluation list. If you ask Claude to "fix a typo," it still lists every skill before doing anything. This is the tradeoff. 100% reliability in exchange for seeing the evaluation process every time. If you're working on something where correctness matters more than speed, this is worth it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Custom Instructions (Bonus) when:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You're testing whether skill activation is even your bottleneck&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before investing in hooks, spend 10 minutes adding the instruction to settings. If Claude starts consistently using skills, maybe the issue was just a gentle reminder, not a technical problem. If it doesn't work, you've learned that you need the stronger mechanisms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You have one dominant skill that should almost always load&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If 90% of your work involves one skill (like a specific framework pattern), custom instructions can work as a quick solution. "Always check if the React-patterns skill applies" is simpler than setting up hooks for a single skill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your project is temporary or exploratory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Prototyping for a few days? Building a proof-of-concept? Custom instructions give you skill activation without committing to infrastructure. You can remove it just as easily when the project ends.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Claude Code skills have the potential to solve a lot of the AI “slop” that happens when a model guesses or skips steps. Their real power comes when they trigger autonomously, reliably, and in the right context.&lt;/p&gt;

&lt;p&gt;With the fixes we’ve covered, using &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook for detection and forced evaluation. You can guide Claude to activate skills consistently, without manual intervention. That means fewer mistakes, cleaner code, and more predictable results.&lt;/p&gt;

&lt;p&gt;Skills don’t just exist to sit in the background; when set up right, they become a trusted part of your AI workflow, letting Claude handle complex tasks like validation, type inference, or any custom logic you design.&lt;/p&gt;

&lt;p&gt;Autonomous skills aren’t just convenient, they’re the key to unlocking Claude’s full potential.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Troubleshooting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;tsx: command not found&lt;/strong&gt;&lt;br&gt;
Run: &lt;code&gt;npm install tsx&lt;/code&gt; in &lt;code&gt;.claude/hooks/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hook not triggering&lt;/strong&gt;&lt;br&gt;
Check: &lt;code&gt;chmod +x skill-activation-prompt.sh&lt;/code&gt; and restart Claude Code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;skill-rules.json not found&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Verify path: &lt;code&gt;.claude/skills/skill-rules.json&lt;/code&gt; (not &lt;code&gt;.claude/hooks/&lt;/code&gt;)&lt;/p&gt;




&lt;h2&gt;
  
  
  Shoutouts &amp;amp; References
&lt;/h2&gt;

&lt;p&gt;The hook system used in fix 1 was built by diet103 (check his &lt;a href="https://github.com/diet103/claude-code-infrastructure-showcase" rel="noopener noreferrer"&gt;full code infrastructure &lt;/a&gt; for more).&lt;/p&gt;

&lt;p&gt;The hook system used in fix 2 is based on &lt;a href="https://scottspence.com/posts/how-to-make-claude-code-skills-activate-reliably#cost-and-performance-comparison" rel="noopener noreferrer"&gt;research&lt;/a&gt; by Scott Spence.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>typescript</category>
      <category>automation</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>Understanding Valibot: How it Works and When to Use it</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Sun, 28 Sep 2025 05:25:02 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/understanding-valibot-how-it-works-and-when-to-use-it-3j0a</link>
      <guid>https://dev.to/oluwawunmiadesewa/understanding-valibot-how-it-works-and-when-to-use-it-3j0a</guid>
      <description>&lt;p&gt;If you've looked up Valibot, you've probably noticed that most write-ups just say it's &lt;em&gt;"lighter and faster"&lt;/em&gt; but barely explain how or when to use it.&lt;/p&gt;

&lt;p&gt;For example, someone on r/reactjs mentioned:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"&lt;a href="https://www.reddit.com/r/reactjs/comments/195h2ye/migrating_from_zod_to_valibot_a_comparative/" rel="noopener noreferrer"&gt;The main issue right now is that it is really hard to discover Valibot features and understand how they work as the documentation is lacking at this stage. This IMO, is the biggest blocker right now."&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That gap is what this article intends to fill. I’ll walk through how Valibot’s functional design works, compare it with alternatives, and show where it truly shines (and where it might need more work).&lt;/p&gt;




&lt;h2&gt;
  
  
  A Few Things to Keep in Mind
&lt;/h2&gt;

&lt;p&gt;Before diving deeper, here are a few quick notes about Valibot that will help frame everything else.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Valibot is a &lt;a href="https://www.theserverside.com/tip/Understanding-the-principles-of-functional-programming" rel="noopener noreferrer"&gt;functional programming&lt;/a&gt;-based validation library.&lt;/li&gt;
&lt;li&gt;Its design leads to &lt;strong&gt;smaller bundle sizes&lt;/strong&gt;, &lt;strong&gt;faster performance&lt;/strong&gt;, and &lt;strong&gt;easier testing&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you’ve used Zod, Yup, or Joi, the differences here come down to how validation is built on &lt;a href="https://adabeat.com/fp/pure-functions-in-functional-programming/" rel="noopener noreferrer"&gt;pure functions and composition&lt;/a&gt; rather than &lt;a href="https://medium.com/@hendurhance/getting-started-with-method-chaining-in-object-oriented-programming-b3fd60bffe1e" rel="noopener noreferrer"&gt;objects and method chaining&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep these points in mind while we break down how Valibot actually works.&lt;/p&gt;




&lt;h2&gt;
  
  
  Valibot Relies Heavily on Functional Programming Principles
&lt;/h2&gt;

&lt;p&gt;Valibot data validation library relies heavily on functional programming principles. It is designed around composing small, independent, pure functions to build and execute validation and transformation pipelines.&lt;/p&gt;

&lt;p&gt;This core architectural decision is what enables everything else — the smaller bundles, the better performance, the reusability patterns, and the TypeScript integration that people talk about.&lt;/p&gt;




&lt;h2&gt;
  
  
  What "Functional Programming Principles" Means in Valibot
&lt;/h2&gt;

&lt;p&gt;Here is how Valibot incorporates the core concepts of functional programming:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Small, Pure Functions
&lt;/h3&gt;

&lt;p&gt;Valibot's API is intentionally designed around many small, single-purpose functions. For example, instead of a large &lt;code&gt;string&lt;/code&gt; object with many methods attached to it (as seen in libraries like Zod), Valibot provides independent functions like &lt;code&gt;string()&lt;/code&gt;, &lt;code&gt;minLength()&lt;/code&gt;, &lt;code&gt;email()&lt;/code&gt;, and &lt;code&gt;trim()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Zod approach - methods on objects&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Valibot approach - composed functions  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each function does one thing and does it well. &lt;code&gt;string()&lt;/code&gt; validates that something is a string. &lt;code&gt;email()&lt;/code&gt; validates email format. &lt;code&gt;minLength()&lt;/code&gt; checks minimum length. They don't know or care about each other—they're &lt;strong&gt;pure functions&lt;/strong&gt; that take an input and return a validated output (or throw an error).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Functional Composition and Data Pipelines
&lt;/h3&gt;

&lt;p&gt;Instead of method chaining, which is more common in object-oriented approaches, Valibot uses a &lt;code&gt;pipe()&lt;/code&gt; function to compose multiple validation actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;valibot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;LoginEmailSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nf"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Please enter your email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;The email address is badly formatted&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;string()&lt;/code&gt;, &lt;code&gt;minLength()&lt;/code&gt;, and &lt;code&gt;email()&lt;/code&gt; functions are passed into the &lt;code&gt;pipe()&lt;/code&gt; function. The data being validated flows through these functions, one after the other, in a consistent, predictable sequence.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;function composition&lt;/strong&gt;—you're building complex behavior by combining simpler functions, rather than creating large objects with many methods.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Immutability
&lt;/h3&gt;

&lt;p&gt;When Valibot transforms data (for example, using the &lt;code&gt;trim()&lt;/code&gt; function), it does not mutate the original input. Instead, it returns a new value. This &lt;strong&gt;immutability principle&lt;/strong&gt; ensures that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your original data is never accidentally modified&lt;/li&gt;
&lt;li&gt;Functions are predictable—same input always produces same output&lt;/li&gt;
&lt;li&gt;Side effects are minimized&lt;/li&gt;
&lt;li&gt;Code is easier to test and debug&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Modular Approach Has Several Benefits
&lt;/h2&gt;

&lt;p&gt;Now that we understand what Valibot's functional approach actually means, we can see why it creates tangible advantages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tree-shaking: The Bundle Size Revolution
&lt;/h3&gt;

&lt;p&gt;Because each function is a separate module, a bundler can &lt;a href="https://webpack.js.org/guides/tree-shaking/" rel="noopener noreferrer"&gt;tree-shake&lt;/a&gt; your code, removing any validation functions you don't actually use. This is the main reason for Valibot's famously small bundle size.&lt;/p&gt;

&lt;p&gt;Here’s the difference:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zod's approach:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;zod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// This might pull in string methods, number methods, object methods, etc.&lt;/span&gt;
&lt;span class="c1"&gt;// even if you only use z.string().email()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Valibot's approach:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;valibot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Your bundler includes exactly these three functions, nothing else&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I tested this with a real application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zod&lt;/strong&gt;: 31KB (minified + gzipped)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Valibot&lt;/strong&gt;: 8KB (minified + gzipped)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exact savings depend on which validators you use, but Valibot consistently delivers &lt;strong&gt;2-4x smaller bundles&lt;/strong&gt; due to its tree-shakable architecture.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can test this yourself at &lt;a href="https://bundlejs.com/?q=valibot,zod,yup" rel="noopener noreferrer"&gt;bundlejs.com&lt;/a&gt; with your specific validation needs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That 23KB difference comes directly from the modular function design enabling better tree-shaking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testability: Each Isolated Function is Easy to Test Thoroughly
&lt;/h3&gt;

&lt;p&gt;Each validation function can be tested in complete isolation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Test just the email validator&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;emailValidator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;emailValidator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;not&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toThrow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;emailValidator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;invalid&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toThrow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Test just the minLength validator&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lengthValidator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Too short&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;lengthValidator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;not&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toThrow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;lengthValidator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toThrow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Too short&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This granular testability contributes to the library's high test coverage and reliability. You can verify each piece of validation logic independently, making bugs easier to isolate and fix.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance: Function Calls vs Method Lookups
&lt;/h3&gt;

&lt;p&gt;JavaScript engines are &lt;a href="https://medium.com/@ThinkingLoop/7-javascript-compiler-tricks-hidden-inside-the-v8-engine-cb7adcba9845" rel="noopener noreferrer"&gt;highly optimized for function calls. &lt;/a&gt;When you write &lt;code&gt;pipe(string(), email())&lt;/code&gt;, the engine can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimize the function calls more aggressively&lt;/li&gt;
&lt;li&gt;Eliminate intermediate object creation&lt;/li&gt;
&lt;li&gt;Reduce memory allocation overhead&lt;/li&gt;
&lt;li&gt;Apply better caching strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In contrast, method chaining like &lt;code&gt;z.string().email()&lt;/code&gt; involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object method lookups&lt;/li&gt;
&lt;li&gt;Intermediate object creation for each step in the chain&lt;/li&gt;
&lt;li&gt;More complex memory management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why Valibot shows significant performance improvements in high-frequency scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-time validation&lt;/strong&gt;: 40-60% faster&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch processing&lt;/strong&gt;: 2-3x improvement&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reusability Through Composition
&lt;/h3&gt;

&lt;p&gt;The functional approach makes reusable validation patterns natural:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Define reusable validators as composed functions&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;emailValidator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;email&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;strongPassword&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nf"&gt;minLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nf"&gt;regex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;(?=&lt;/span&gt;&lt;span class="sr"&gt;.*&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;a-z&lt;/span&gt;&lt;span class="se"&gt;])(?=&lt;/span&gt;&lt;span class="sr"&gt;.*&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;A-Z&lt;/span&gt;&lt;span class="se"&gt;])(?=&lt;/span&gt;&lt;span class="sr"&gt;.*&lt;/span&gt;&lt;span class="se"&gt;\d)&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Compose them into different schemas&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userRegistration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;emailValidator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strongPassword&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;confirmPassword&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strongPassword&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;adminUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;emailValidator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;strongPassword&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because validators are just functions, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store them in variables&lt;/li&gt;
&lt;li&gt;Pass them as arguments to other functions&lt;/li&gt;
&lt;li&gt;Combine them in any way you need&lt;/li&gt;
&lt;li&gt;Test them independently&lt;/li&gt;
&lt;li&gt;Modify them in one place and have changes apply everywhere&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  This Changes How You Think About Validation
&lt;/h2&gt;

&lt;p&gt;Once you understand that Valibot is built on functional programming principles, everything else makes sense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why the bundle is smaller:&lt;/strong&gt; Tree-shaking works better with independent functions than with class methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it's faster:&lt;/strong&gt; Function calls are more optimizable than method chains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why TypeScript integration is seamless:&lt;/strong&gt; Pure functions with clear input/output types enable better type inference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why reusability feels natural:&lt;/strong&gt; Functions compose together more easily than object methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why custom validators integrate smoothly:&lt;/strong&gt; You're just writing another function that follows the same patterns.&lt;/p&gt;

&lt;p&gt;The functional programming foundation is what enables all the other benefits that make Valibot compelling.&lt;/p&gt;




&lt;h2&gt;
  
  
  When This Approach Works Best
&lt;/h2&gt;

&lt;p&gt;Understanding Valibot's functional nature helps you know when to choose it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Great fit when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're comfortable with functional programming patterns&lt;/li&gt;
&lt;li&gt;Bundle size and performance matter for your use case&lt;/li&gt;
&lt;li&gt;You need highly reusable validation logic&lt;/li&gt;
&lt;li&gt;You're working in a TypeScript-first environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Less ideal when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Your team strongly prefers object-oriented patterns: If everyone is used to Zod-style chaining or class-based libraries, Valibot’s functional approach may feel unnatural and slow adoption.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have a large existing validation layer: Migrating hundreds of Zod schemas to Valibot can be tedious. In such cases, the gains may not justify the cost unless bundle size or performance is a major pain point.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ecosystem integrations are important: Right now, Valibot doesn’t have the same level of adoption as Zod or Yup. That means fewer ready-made adapters for form libraries (like React Hook Form), frameworks, and API tools. You may need to write your own glue code until the ecosystem matures.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Valibot isn't just "Zod but smaller." It's a fundamentally different approach to validation based on functional programming principles.&lt;/p&gt;

&lt;p&gt;The small bundle size, better performance, excellent TypeScript integration, and reusability patterns all flow from this core architectural choice. Whether those benefits matter for your specific project is what should guide your decision to adopt it.&lt;/p&gt;

&lt;p&gt;But now you understand why those benefits exist and what tradeoffs they involve.&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://valibot.dev/" rel="noopener noreferrer"&gt;Valibot Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://v8.dev/blog/turbofan-jit" rel="noopener noreferrer"&gt;JavaScript Engine Optimization&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;If this helped, I’ve got more like it. Tools, tips, and honest takes on dev workflow. Follow here or on &lt;a href="https://x.com/Abutterflyee?t=SLAdFkHp21VerFvThdaDhA&amp;amp;s=09" rel="noopener noreferrer"&gt;X&lt;/a&gt; to catch the next one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Best JavaScript Backend Automation Tools (With TypeScript Support)</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Fri, 22 Aug 2025 05:14:59 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/best-javascript-backend-automation-tools-with-typescript-support-4m5n</link>
      <guid>https://dev.to/oluwawunmiadesewa/best-javascript-backend-automation-tools-with-typescript-support-4m5n</guid>
      <description>&lt;h2&gt;
  
  
  Best JavaScript Backend Automation Tools (With TypeScript Support)
&lt;/h2&gt;

&lt;p&gt;I’ve noticed that while there’s a lot of content on using AI for frontend work, backend automation doesn’t get the same attention. Most of the time, tutorials focus on frameworks or architecture, but not on automating the day-to-day backend tasks we all repeat.&lt;/p&gt;

&lt;p&gt;To fix that gap, I put this post together to highlight five JavaScript (and TypeScript) backend automation tools that can take care of the repetitive parts of backend development. Whether it’s writing data validation logic, database queries, API endpoints, type-safe client code, or SDK documentation, there’s a tool here to help you skip boilerplate and focus on shipping features.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why Automate Backend Development in JavaScript&lt;/li&gt;
&lt;li&gt;
5 JavaScript Backend Automation Tools

&lt;ul&gt;
&lt;li&gt;Valibot: Automating Data Validation&lt;/li&gt;
&lt;li&gt;Prisma: Automating Database Queries&lt;/li&gt;
&lt;li&gt;Convex: Backend-as-a-Service with Automation Built In&lt;/li&gt;
&lt;li&gt;ts-rest: Automating API Contracts and Clients&lt;/li&gt;
&lt;li&gt;Fern: Automating SDKs and API Documentation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Picking the Right Backend Automation Tool&lt;/li&gt;

&lt;li&gt;FAQ: JavaScript Backend Automation&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Automate Backend Development in JavaScript
&lt;/h2&gt;

&lt;p&gt;Most backend development boils down to repetitive work like writing validation logic, database queries, and endpoint handlers for every feature.&lt;/p&gt;

&lt;p&gt;Libraries like &lt;a href="https://zod.dev/" rel="noopener noreferrer"&gt;Zod&lt;/a&gt;, &lt;a href="https://joi.dev/" rel="noopener noreferrer"&gt;Joi&lt;/a&gt;, and &lt;a href="https://www.npmjs.com/package/yup" rel="noopener noreferrer"&gt;Yup&lt;/a&gt; help with validation, while ORMs like Prisma simplify database queries. But you still end up wiring everything together yourself. Schemas drift from models, client code falls out of sync, and you’re maintaining multiple sources of truth.&lt;/p&gt;

&lt;p&gt;Backend automation tools solve that problem.&lt;br&gt;&lt;br&gt;
Instead of redefining the same structures in multiple places, you define your schema once, and the tools generate everything else—validation, database operations, API endpoints, and client interfaces.&lt;/p&gt;

&lt;p&gt;They’re also relatively easy to add to existing projects and enforce consistent patterns across your codebase. That consistency is hard to maintain by hand and becomes more valuable as your app grows.&lt;/p&gt;




&lt;h2&gt;
  
  
  5 JavaScript Backend Automation Tools
&lt;/h2&gt;

&lt;p&gt;Each of these tools tackles a different piece of the backend puzzle. Used together, they can save you hours of wiring and boilerplate.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://valibot.dev/" rel="noopener noreferrer"&gt;Valibot&lt;/a&gt;: Automating Data Validation
&lt;/h3&gt;

&lt;p&gt;Validation is usually the first step in any backend. You need to make sure user input matches the structure your app expects. Traditionally, you’d write rules with libraries like Zod, Joi, or Yup, but that often means duplicating logic across frontend and backend.&lt;/p&gt;

&lt;p&gt;Valibot fixes this by letting you define validation schemas once and reuse them everywhere.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In plain JavaScript, you get runtime validation.
&lt;/li&gt;
&lt;li&gt;In TypeScript, those same schemas generate static types, so errors get caught before your app even compiles.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compared to Zod, Valibot is smaller, more modular, and built for performance-sensitive environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use Valibot&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you’re tired of duplicating validation logic across frontend and backend
&lt;/li&gt;
&lt;li&gt;If you want strong type safety in TypeScript
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://valibot.dev" rel="noopener noreferrer"&gt;Valibot Docs&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://www.prisma.io/" rel="noopener noreferrer"&gt;Prisma&lt;/a&gt;: Automating Database Queries
&lt;/h3&gt;

&lt;p&gt;After validation comes persistence. Most database work is just CRUD (create, read, update, delete). Writing SQL or ORM queries by hand is repetitive, and keeping them in sync with schema changes is error-prone.&lt;/p&gt;

&lt;p&gt;Prisma changes that. You define your data models in a Prisma schema, and Prisma generates a fully typed client for queries.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In JavaScript, you get a structured, intuitive client API.
&lt;/li&gt;
&lt;li&gt;In TypeScript, you also get autocomplete and compile-time checks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result? Queries that always match your schema, and fewer runtime surprises like missing fields or incorrect column names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use Prisma&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you want to avoid repetitive SQL
&lt;/li&gt;
&lt;li&gt;If you want type-safe queries with autocomplete
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.prisma.io/docs" rel="noopener noreferrer"&gt;Prisma Docs&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://www.convex.dev/" rel="noopener noreferrer"&gt;Convex&lt;/a&gt;: Backend-as-a-Service with Automation Built In
&lt;/h3&gt;

&lt;p&gt;Validation and queries solve part of the backend problem, but you still have to manage &lt;strong&gt;infrastructure&lt;/strong&gt;: servers, deployments, syncing logic between backend and frontend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Convex&lt;/strong&gt; takes a different approach. It’s a &lt;strong&gt;backend-as-a-service&lt;/strong&gt; where you define data models and functions in JS/TS, and Convex takes care of the rest:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Storage
&lt;/li&gt;
&lt;li&gt;Hosting
&lt;/li&gt;
&lt;li&gt;Generating a type-safe client for the frontend
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s especially useful for &lt;strong&gt;real-time apps&lt;/strong&gt; that need reactive data subscriptions. You don’t have to think about servers or deployment pipelines—just write your functions and ship.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use Convex&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you don’t want to manage servers or infrastructure
&lt;/li&gt;
&lt;li&gt;If you need a backend tightly integrated with JS/TS
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://docs.convex.dev" rel="noopener noreferrer"&gt;Convex Docs&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://ts-rest.com/" rel="noopener noreferrer"&gt;ts-rest&lt;/a&gt;: Automating API Contracts and Clients
&lt;/h3&gt;

&lt;p&gt;Even with validation, queries, and hosting sorted, there’s a common pain point: &lt;strong&gt;keeping APIs in sync&lt;/strong&gt;. Backends define routes and responses, frontends implement clients, and small mismatches cause big bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ts-rest&lt;/strong&gt; prevents this. You define your API contract once, and it generates both backend routes and a type-safe client.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;JavaScript&lt;/strong&gt;, you get a consistent client API.
&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;TypeScript&lt;/strong&gt;, you also get compile-time guarantees.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means the frontend and backend always speak the same language—no manual syncing required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use ts-rest&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your frontend and backend live in separate codebases
&lt;/li&gt;
&lt;li&gt;If you want to eliminate mismatches between client and server
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://ts-rest.com" rel="noopener noreferrer"&gt;ts-rest Docs&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Fern: Automating SDKs and API Documentation
&lt;/h3&gt;

&lt;p&gt;If you’re exposing an API to other developers, you’ll need SDKs and documentation. Writing both by hand is slow, and they often get out of date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fern&lt;/strong&gt; automates this. From a single API definition (like an OpenAPI spec), it generates:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client SDKs in multiple languages
&lt;/li&gt;
&lt;li&gt;Always-up-to-date API documentation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes your API easier for other developers to use while keeping your SDKs and docs in sync automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use Fern&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you’re building public APIs
&lt;/li&gt;
&lt;li&gt;If you need SDKs and docs that don’t fall behind your API
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://buildwithfern.com/docs" rel="noopener noreferrer"&gt;Fern Docs&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Picking the Right Backend Automation Tool
&lt;/h2&gt;

&lt;p&gt;If backend development feels repetitive, it’s because much of it is. These tools reduce duplication, enforce consistency, and help you focus on building features instead of boilerplate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with Valibot if you’re duplicating validation logic.
&lt;/li&gt;
&lt;li&gt;Use Prisma for type-safe database queries.
&lt;/li&gt;
&lt;li&gt;Try Convex if you want a managed backend that just works.
&lt;/li&gt;
&lt;li&gt;Reach for ts-rest to keep frontend and backend in sync.
&lt;/li&gt;
&lt;li&gt;Pick Fern if you’re exposing APIs to other developers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also mix and match. For example:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Valibot&lt;/strong&gt; for validation + &lt;strong&gt;Prisma&lt;/strong&gt; for database + &lt;strong&gt;ts-rest&lt;/strong&gt; for API contracts = a clean, automated Node.js backend.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ: JavaScript Backend Automation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is backend automation?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Backend automation uses tools to generate repetitive backend code—validation, queries, endpoints, docs—from a single definition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is backend automation only for TypeScript?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No. All of these tools work in JavaScript, but TypeScript users get extra type safety benefits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use multiple tools together?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Yes. Many teams combine them: Valibot for validation, Prisma for queries, ts-rest for API contracts, etc.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With these tools, you can skip boilerplate and spend more time on features.&lt;br&gt;&lt;br&gt;
Backend automation isn’t about replacing your workflow—it’s about removing the boring parts so you can &lt;strong&gt;ship faster, with fewer bugs, and with code that scales.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>backend</category>
      <category>automation</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Use ChatGPT for Coding: Prompts and Examples for Python, JavaScript, and More</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Thu, 26 Jun 2025 05:02:20 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/how-to-use-chatgpt-for-coding-prompts-and-examples-for-python-javascript-and-more-4hph</link>
      <guid>https://dev.to/oluwawunmiadesewa/how-to-use-chatgpt-for-coding-prompts-and-examples-for-python-javascript-and-more-4hph</guid>
      <description>&lt;p&gt;AI is changing how developers write code, solve bugs, and ship features. Tools like ChatGPT are no longer just nice to have, they're becoming part of the daily workflow.&lt;/p&gt;

&lt;p&gt;But using ChatGPT for coding effectively takes more than just asking, “Can you write this for me?” You need to understand what it’s good at, what it struggles with, and how to prompt it properly.&lt;/p&gt;

&lt;p&gt;This guide is built for developers who want to use ChatGPT as a practical coding assistant, not as a replacement for real understanding, but as a tool to move faster, reduce boilerplate, and learn on the job.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
What Can ChatGPT Do for Developers?

&lt;ul&gt;
&lt;li&gt;1. Generate Code Snippets&lt;/li&gt;
&lt;li&gt;2. Debug and Fix Errors&lt;/li&gt;
&lt;li&gt;3. Explain Code in Plain English&lt;/li&gt;
&lt;li&gt;4. Translate Between Programming Languages&lt;/li&gt;
&lt;li&gt;5. Generate Tests&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Best Prompt Practices for Developers&lt;/li&gt;

&lt;li&gt;

Real-World Use Cases by Language

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript / React&lt;/li&gt;
&lt;li&gt;SQL&lt;/li&gt;
&lt;li&gt;Bash&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Debugging Code with ChatGPT&lt;/li&gt;

&lt;li&gt;ChatGPT vs Copilot: Which Should You Use?&lt;/li&gt;

&lt;li&gt;Limitations and Warnings&lt;/li&gt;

&lt;li&gt;Frequently Asked Questions&lt;/li&gt;

&lt;li&gt;Final Thoughts: ChatGPT Won’t Code for You But It Can Make You Faster&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Can ChatGPT Do for Developers?
&lt;/h2&gt;

&lt;p&gt;Let’s start with what ChatGPT can help you with. These are the most common tasks developers use it for:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Generate Code Snippets&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You can describe a small task in plain English and get working code in return.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a Python function that validates an email address using regex.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ChatGPT will generate the function, and you can quickly test or modify it as needed. This saves time writing from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Debug and Fix Errors&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Paste in your error message or broken code, and ask what’s wrong. ChatGPT will often point you toward the fix, especially for common issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m getting a TypeError when mapping over an array in JavaScript. Here’s my code. What’s wrong?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Explain Code in Plain English&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use ChatGPT to understand legacy code, new APIs, or libraries you're not familiar with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Explain this function line by line.&lt;br&gt;&lt;br&gt;
What does this SQL query do?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s especially helpful when learning a new language or reading poorly documented code.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Translate Between Programming Languages&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You can convert a function or snippet from one language to another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Convert this Python function to JavaScript.&lt;br&gt;&lt;br&gt;
Translate this SQL query into MongoDB syntax.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Great when you're working across multiple stacks or switching environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Generate Tests&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You can ask ChatGPT to write unit tests for a given function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a Jest test for this React component.&lt;br&gt;&lt;br&gt;
Create unit tests for this Go function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It usually follows standard testing patterns, saving setup time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Prompt Practices for Developers
&lt;/h2&gt;

&lt;p&gt;You won’t get good code if you give a vague prompt. The more detail and context you provide, the more helpful ChatGPT becomes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Always Include:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;goal&lt;/strong&gt; (what you want to build or fix)
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;environment&lt;/strong&gt; (language, framework, context)
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;existing code&lt;/strong&gt; (if applicable)
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;error message&lt;/strong&gt; (if debugging)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bad Prompt:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a form.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Better Prompt:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a login form in React that uses Tailwind CSS. It should have email and password fields and show an error if the input is empty.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Advanced Tip:
&lt;/h3&gt;

&lt;p&gt;Break complex prompts into smaller steps: First ask for the structure, then styling, then validation.&lt;/p&gt;

&lt;p&gt;Avoid Pasting Proprietary Code: Be careful not to include sensitive data, internal logic, or anything that could expose business IP. ChatGPT sessions are private, but it’s still best practice to redact or abstract details.&lt;/p&gt;

&lt;p&gt;For more advanced prompt strategies that maintain privacy and improve accuracy, see this guide &lt;a href="https://dev.to/oluwawunmiadesewa/5-chatgpt-prompting-techniques-that-boost-developer-productivity-5aan"&gt;on advanced prompting techniques&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Use Cases by Language
&lt;/h2&gt;

&lt;p&gt;Let’s look at how developers use ChatGPT in different programming languages:&lt;/p&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data processing&lt;/strong&gt;: Ask it to clean, format, or filter data with pandas.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripting&lt;/strong&gt;: Generate one-off utilities or CLI tools.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt;: Write scripts to rename files, organize folders, or process logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a Python script that reads a CSV file and removes duplicate rows.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  JavaScript / React
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Component generation&lt;/strong&gt;: Build reusable components like buttons, forms, modals.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DOM scripting&lt;/strong&gt;: Ask for vanilla JS solutions to small UI tasks.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refactoring&lt;/strong&gt;: Simplify complex logic into cleaner functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Build a responsive navbar in React with a mobile dropdown. Use Tailwind CSS.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  SQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Query generation&lt;/strong&gt;: Ask for specific queries by describing your data structure.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance help&lt;/strong&gt;: Paste a slow query and ask how to optimize it.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema design&lt;/strong&gt;: Generate normalized tables or suggest indexes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a SQL query to find the top 10 customers by total purchase amount in the last 30 days.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Bash
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quick scripts&lt;/strong&gt;: Automate daily tasks like backups or log rotation.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cron job creation&lt;/strong&gt;: Ask for scheduling examples and common patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a bash script that zips all &lt;code&gt;.log&lt;/code&gt; files in a folder and deletes them after.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Debugging Code with ChatGPT
&lt;/h2&gt;

&lt;p&gt;Here’s a common use case: You paste in an error, and it helps you fix it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;You say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m getting &lt;code&gt;TypeError: undefined is not a function&lt;/code&gt; in my React app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You include your code, and ChatGPT walks you through the issue:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It identifies where you're calling a function that might be undefined.
&lt;/li&gt;
&lt;li&gt;It suggests adding a null check or verifying the import.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s not perfect, but it’s often enough to unblock you quickly.&lt;/p&gt;

&lt;p&gt;You can also ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does this error mean?
&lt;/li&gt;
&lt;li&gt;How do I fix this stack trace?
&lt;/li&gt;
&lt;li&gt;Why is this promise not resolving?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It works best when the error is isolated and reproducible.&lt;/p&gt;




&lt;h2&gt;
  
  
  ChatGPT vs Copilot: Which Should You Use?
&lt;/h2&gt;

&lt;p&gt;Both tools help with coding, but they serve different purposes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;ChatGPT&lt;/th&gt;
&lt;th&gt;GitHub Copilot&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Interface&lt;/td&gt;
&lt;td&gt;Chat-based&lt;/td&gt;
&lt;td&gt;Inline in code editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best For&lt;/td&gt;
&lt;td&gt;Explanation and code reasoning&lt;/td&gt;
&lt;td&gt;Fast code suggestions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ideal Use&lt;/td&gt;
&lt;td&gt;Debugging, learning, prototyping&lt;/td&gt;
&lt;td&gt;Writing small snippets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language Support&lt;/td&gt;
&lt;td&gt;Broad (English + code)&lt;/td&gt;
&lt;td&gt;Strong for JavaScript, Python&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use ChatGPT when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want a deeper explanation
&lt;/li&gt;
&lt;li&gt;You’re planning a larger feature
&lt;/li&gt;
&lt;li&gt;You want help debugging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use Copilot when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re moving fast and just need quick code
&lt;/li&gt;
&lt;li&gt;You want autocomplete inside your IDE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many developers use both.&lt;/p&gt;




&lt;h2&gt;
  
  
  Limitations and Warnings
&lt;/h2&gt;

&lt;p&gt;ChatGPT can speed things up, but it’s not always reliable. Here's what to watch out for:&lt;/p&gt;

&lt;h3&gt;
  
  
  Don’t blindly trust the code
&lt;/h3&gt;

&lt;p&gt;ChatGPT can generate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Insecure code (e.g., SQL injection vulnerabilities)
&lt;/li&gt;
&lt;li&gt;Inefficient algorithms
&lt;/li&gt;
&lt;li&gt;Code that doesn’t run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Always test AI-generated code.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  It has no live context
&lt;/h3&gt;

&lt;p&gt;ChatGPT doesn’t know your project structure unless you show it. It won’t "know" your dependencies or runtime environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  It doesn’t replace real experience
&lt;/h3&gt;

&lt;p&gt;AI is useful, but it won’t make judgment calls or design scalable architectures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is ChatGPT good for coding interviews?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Yes, it can explain algorithms, generate LeetCode-style problems, and help you understand solutions. But don’t rely on it during live interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use ChatGPT in a professional setting?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Yes, many developers do. Just avoid pasting sensitive or proprietary code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does ChatGPT learn from my code?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No. ChatGPT doesn’t remember your prompts or store your data between sessions unless you opt into custom training features. &lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts: ChatGPT Won’t Code for You But It Can Make You Faster
&lt;/h2&gt;

&lt;p&gt;ChatGPT is a powerful assistant. It won’t replace good judgment, problem-solving skills, or testing—but it can help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move faster on routine tasks
&lt;/li&gt;
&lt;li&gt;Get unstuck more quickly
&lt;/li&gt;
&lt;li&gt;Learn by example&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you treat it like a smart, slightly unreliable pair programmer, you’ll get the most out of it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this helped, I’ve got more like it. Tools, tips, and honest takes on dev workflow. Follow here or on &lt;a href="https://x.com/Abutterflyee?t=GsbkHgdvt-VQBwFtd2n2vg&amp;amp;s=09" rel="noopener noreferrer"&gt;X&lt;/a&gt; to catch the next one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>coding</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>5 ChatGPT Prompting Techniques to Boost Developer Productivity</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Sat, 21 Jun 2025 13:35:36 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/5-chatgpt-prompting-techniques-that-boost-developer-productivity-5aan</link>
      <guid>https://dev.to/oluwawunmiadesewa/5-chatgpt-prompting-techniques-that-boost-developer-productivity-5aan</guid>
      <description>&lt;p&gt;Most developers use ChatGPT for quick coding help like fixing bugs, writing functions, or understanding errors. But just using it doesn’t mean you’ve mastered it. Like any powerful tool, its real value comes from how well you use it, not just how often.&lt;/p&gt;

&lt;p&gt;Used well, ChatGPT can be a serious productivity boost. It can help you debug faster, analyze complex codebases, scaffold APIs, automate workflows, and stay in flow during long coding sessions.&lt;/p&gt;

&lt;p&gt;In this post, I'll break down 5 advanced ChatGPT prompting techniques for developers, each built for real-world use. Whether you’re trying to ship faster, write cleaner code, or streamline your workflow, these prompts will help you get more value out of every session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;1. Rolling Context Summaries&lt;/li&gt;
&lt;li&gt;2. Prompt Structuring for Cleaner, Faster Output&lt;/li&gt;
&lt;li&gt;3. Maximizing API Credits Without Losing Output Quality&lt;/li&gt;
&lt;li&gt;4. Customizing ChatGPT to Match Your Workflow&lt;/li&gt;
&lt;li&gt;Conclusion: Tools Only Help with Structure and Scale&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. Rolling Context Summaries
&lt;/h3&gt;

&lt;p&gt;One of the biggest limits when using ChatGPT for real development is its context window. ChatGPT can only “remember” about 128,000 tokens (roughly 80,000 words) in a conversation. When your code, logs, and conversation history get longer than that, it starts dropping the earliest parts — effectively forgetting what you told it at the start.&lt;/p&gt;

&lt;p&gt;This causes problems in long debugging sessions or complex multi-file analysis where you need consistent understanding across many messages.&lt;/p&gt;

&lt;p&gt;The best way to handle this is with &lt;strong&gt;rolling context summaries&lt;/strong&gt;. After working through a chunk of code or conversation, say every 20–30 messages, ask ChatGPT to summarize the key points so far in a few bullet points.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Summarize our last 20 messages in 5 bullet points focusing on the main issues and solutions.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Save that summary outside ChatGPT. When you start a new session or hit the token limit, paste the summary back into the prompt before continuing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Here’s what we covered before: [paste summary]. Now let’s continue debugging the payment module.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If your sessions get very long, break them into smaller chunks and summarize each. This method keeps ChatGPT informed without repeating everything and prevents loss of context.&lt;/p&gt;

&lt;p&gt;Without rolling summaries, ChatGPT forgets critical details, forcing you to repeat or re-explain context. Using summaries keeps workflows smooth and productive, especially for multi-file code reviews, long debugging sessions, or iterative problem solving.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Prompt Structuring for Cleaner, Faster Output
&lt;/h3&gt;

&lt;p&gt;Even with good context management, poor prompts can still derail a session. Most code generation issues don’t come from the model being incapable, they come from instructions that are too vague or too open-ended. Left to guess, the model often produces overly verbose, unstructured, or incomplete results.&lt;/p&gt;

&lt;p&gt;The best way to avoid this is by using simple, repeatable prompt patterns that keep the model focused on what you want and only what you want.&lt;/p&gt;

&lt;p&gt;When working with code, a good baseline is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Respond with code only in CODE SNIPPET format, no explanations."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This keeps responses clean and accurate. You don’t need paragraph-long explanations in the middle of a coding session, just working code you can drop in and test. Removing unnecessary output also makes it easier to see whether the result actually changed.&lt;/p&gt;

&lt;p&gt;When iterating on an existing file or component, these two are especially useful:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Just provide the parts that need to be modified."&lt;/p&gt;

&lt;p&gt;"Provide entire updated component."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The first is ideal for small tweaks. It avoids confusion from unchanged code being repeated. The second is better when changes affect multiple areas or when you want a fresh, consistent copy of the full component.&lt;/p&gt;

&lt;p&gt;Over time, using these phrases becomes second nature. You can even save them as text snippets or shortcut keys in your setup (for example, using a browser extension or editor plugin) to save time during repeated prompting.&lt;/p&gt;

&lt;p&gt;Without prompt structuring, LLMs tend to guess. That guesswork leads to bloated responses, wrong assumptions, or missed details. With structured prompts, responses are consistent and focused, helping you stay in flow, especially when working on large projects or switching between tasks frequently.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Maximizing API Credits Without Losing Output Quality
&lt;/h3&gt;

&lt;p&gt;When working with the ChatGPT API — especially in iterative development workflows, it’s easy to burn through tokens without realizing it. Every message costs credits, and long prompts or verbose replies can quickly accumulate. But with a few simple habits, you can keep costs low while still getting high-quality output.&lt;/p&gt;

&lt;p&gt;The most effective strategy is to &lt;strong&gt;optimize both the prompt and the model selection&lt;/strong&gt;. Start with concise, tightly scoped instructions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Explain Python classes with one short example.”&lt;/p&gt;

&lt;p&gt;“Fix the code, explain the issue, and suggest optimizations.”&lt;/p&gt;

&lt;p&gt;“Answer in under 100 words.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These kinds of constraints help control both input and output token counts. They also make it easier to test and read results. If you’re using the API directly, set &lt;code&gt;max_tokens&lt;/code&gt; to explicitly cap responses — useful for automating safeguards on repeated queries.&lt;/p&gt;

&lt;p&gt;For simpler tasks like debugging, drafting snippets, or summarizing logs, switch to lighter models like &lt;strong&gt;gpt-3.5-turbo&lt;/strong&gt; or &lt;strong&gt;gpt-4o-mini&lt;/strong&gt;. Reserve &lt;strong&gt;GPT-4&lt;/strong&gt; for final-stage refinement, complex reasoning, or critical correctness. This is the same strategy developers on Reddit use to stretch credit limits — do 80% of the work with cheaper models, and only escalate when needed.&lt;/p&gt;

&lt;p&gt;To avoid redundant calls, &lt;strong&gt;cache common responses&lt;/strong&gt;. If you’ve already asked the model to explain a type error or a specific regex function, save that answer locally or in a shared store. When the same issue comes up again, just reuse the result. This is especially useful if you’re building tools that field similar prompts repeatedly.&lt;/p&gt;

&lt;p&gt;You can also &lt;strong&gt;batch related queries&lt;/strong&gt;. Instead of three back-and-forths (“Fix this,” then “Explain it,” then “Suggest improvements”), just ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Fix this code, explain what was wrong, and suggest how to make it cleaner.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If follow-ups are likely, include them proactively:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If you find a bug, fix it. If the logic is unclear, simplify it.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This compresses multiple interactions into a single, efficient exchange.&lt;/p&gt;

&lt;p&gt;To monitor usage, set a &lt;strong&gt;monthly budget cap&lt;/strong&gt; in OpenAI’s dashboard. For deeper control, use libraries like &lt;code&gt;tiktoken&lt;/code&gt; to estimate message cost before sending, or implement per-user rate limits if you’re building against the API. These tools help you stay ahead of overages, especially when usage spikes unexpectedly during testing or scaling.&lt;/p&gt;

&lt;p&gt;Finally, when refining prompts over and over, reduce wasted iterations by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Drafting prompts locally before calling the API
&lt;/li&gt;
&lt;li&gt;Reusing the &lt;code&gt;messages&lt;/code&gt; array to preserve prior context without resending full logs
&lt;/li&gt;
&lt;li&gt;Embedding potential tweaks in the initial request (“If it fails, suggest alternatives.”)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small optimizations like these add up quickly, especially in high-volume use. With structured prompting, smart model selection, and a few guardrails, it’s possible to run large, useful sessions while staying well under credit limits.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Customizing ChatGPT to Match Your Workflow
&lt;/h3&gt;

&lt;p&gt;Once you’ve optimized your context, prompting, and credit usage, the next step is tailoring ChatGPT to your specific use case. Out of the box, the model is general-purpose, but with a few small changes, you can make it behave more like a teammate that understands your coding style, preferences, and domain.&lt;/p&gt;

&lt;p&gt;The most effective way to do this is through custom instructions. These let you define how ChatGPT should behave and what kind of responses you want. For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“You are a concise Python developer who always includes type hints.”&lt;/p&gt;

&lt;p&gt;“When asked to refactor code, always explain changes in a bullet list.”&lt;/p&gt;

&lt;p&gt;“Keep responses under 150 words unless otherwise requested.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can set this once and have it apply to every session, saving time and reducing the need for repetitive prompt engineering. In API calls, this works by prepending a system message (e.g., &lt;code&gt;{"role": "system", "content": "You are..."}&lt;/code&gt;), while in the ChatGPT UI, it lives under custom settings.&lt;/p&gt;

&lt;p&gt;For even more control, use function calling or tools integration. This allows ChatGPT to return structured outputs (like JSON) or interact with your codebase, APIs, or tools. You can use this to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate workflows (e.g., trigger actions after a valid response)
&lt;/li&gt;
&lt;li&gt;Extract structured data for parsing
&lt;/li&gt;
&lt;li&gt;Return only the function signature or schema, not the implementation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In dev-focused environments, this reduces the need for cleanup and lets you treat model output like an extension of your code editor.&lt;/p&gt;

&lt;p&gt;If you’re using ChatGPT for team or product work, you can also create custom GPTs. These let you define tools, upload files, set behavior, and even brand the experience. Think of it as building a domain-specific assistant that’s tuned to your stack, tone, and expectations.&lt;/p&gt;

&lt;p&gt;Finally, you can teach the model about your style through priming examples. These are simple examples of input/output pairs that show what kind of response you want. For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“When I say: ‘clean this up’, here’s what I expect...”  &lt;/p&gt;

&lt;p&gt;“When I give you code like this, reformat it like this.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Providing one or two examples early in a session can guide the model for the rest of the conversation, especially helpful for maintaining consistency across multiple outputs.&lt;/p&gt;

&lt;p&gt;Customizing ChatGPT is about automation and delegation. Whether through system messages, API-level behaviors, or primed examples, the goal is to shape the assistant so you spend less time explaining and more time building.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion: Tools Only Help with Structure and Scale
&lt;/h3&gt;

&lt;p&gt;At the end of the day, tools like ChatGPT don’t think for you. They extend your reach. They help with structure, by organizing and accelerating the tasks you already understand, and with scale, by letting you iterate faster, respond quicker, and offload the repetitive parts of coding or writing.&lt;/p&gt;

&lt;p&gt;But they can’t replace clarity of thought, sound judgment, or domain knowledge. You still have to guide the tool with tight prompts, sharp context, and a clear objective. The better your inputs, the more useful your outputs.&lt;/p&gt;

&lt;p&gt;Used well, ChatGPT becomes less of a chatbot and more of a collaborative assistant. Something that helps you stay focused, move faster, and work at a higher level, without burning time or budget.&lt;/p&gt;

&lt;p&gt;The more intentional your workflow, the more value you’ll get out of every session.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Looking for free AI tools to try these prompts with? Check out my hands-on review of &lt;a href="https://dev.to/oluwawunmiadesewa/best-chatgpt-alternatives-for-coding-in-2025-tested-and-compared-1cm9"&gt;Best Free ChatGPT Alternatives for Coding in 2025&lt;/a&gt;. Tested on real coding tasks with no subscriptions required.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And If this helped, I’ve got more like it. Tools, tips, and honest takes on dev workflow. Follow here or on &lt;a href="https://x.com/Abutterflyee?t=zk90POt6suVFuBkA8iOzrw&amp;amp;s=09" rel="noopener noreferrer"&gt;X&lt;/a&gt; to catch the next one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>productivity</category>
      <category>promptengineering</category>
      <category>ai</category>
    </item>
    <item>
      <title>Best Free ChatGPT Alternatives for Coding in 2025: Tested and Compared</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Wed, 18 Jun 2025 02:36:52 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/best-chatgpt-alternatives-for-coding-in-2025-tested-and-compared-1cm9</link>
      <guid>https://dev.to/oluwawunmiadesewa/best-chatgpt-alternatives-for-coding-in-2025-tested-and-compared-1cm9</guid>
      <description>&lt;p&gt;If you're working on personal projects or between jobs, you're probably looking for ways to stay productive without adding another monthly subscription. ChatGPT Plus can be helpful, but at $20/month, it’s not always easy to justify—especially if you're only using it for occasional coding tasks.&lt;/p&gt;

&lt;p&gt;Many developers in this situation turn to free ChatGPT alternatives to help with code generation, refactoring, debugging, and documentation. The challenge is finding tools that are actually useful for software development—not just general-purpose chatbots.&lt;/p&gt;

&lt;p&gt;In this guide, I’ve tested and compared the top free ChatGPT alternatives using real-world programming tasks. Whether you're building a portfolio project, contributing to open source, or learning new skills, these tools can help without the subscription.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What Makes a Good ChatGPT Alternative for Coding?&lt;/li&gt;
&lt;li&gt;How I Tested These Tools&lt;/li&gt;
&lt;li&gt;
Top Recommended Free ChatGPT Alternatives for Coding

&lt;ul&gt;
&lt;li&gt;Claude (by Anthropic)&lt;/li&gt;
&lt;li&gt;Bing Copilot (GPT‑4 for Free via Microsoft Edge)&lt;/li&gt;
&lt;li&gt;Phind (AI Search Built for Developers)&lt;/li&gt;
&lt;li&gt;Windsurf (Code Autocomplete and AI Assistant)&lt;/li&gt;
&lt;li&gt;HuggingChat (Open-Source AI You Can Run Locally)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Summary Table: How These Tools Stack Up&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Makes a Good ChatGPT Alternative for Coding?
&lt;/h2&gt;

&lt;p&gt;Not every AI tool is built for developers. If you're looking for a useful ChatGPT alternative for coding, it needs to go beyond answering general questions. Developers need tools that understand code, support real workflows, and return trustworthy, working output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deep code understanding for real-world tasks
&lt;/h3&gt;

&lt;p&gt;A strong ChatGPT alternative should go beyond syntax and autocomplete. It needs to understand logic, structure, and intent so it can help with debugging, code reviews, documentation, and writing tests that actually reflect what the code does.&lt;/p&gt;

&lt;h3&gt;
  
  
  Works inside your coding workflow
&lt;/h3&gt;

&lt;p&gt;Context switching kills productivity. The right tool should integrate with your IDE, support command-line usage, or at least offer a fast and minimal interface in the browser. &lt;/p&gt;

&lt;h3&gt;
  
  
  Designed for software development tasks
&lt;/h3&gt;

&lt;p&gt;General-purpose chatbots often break down when handling technical prompts. A good ChatGPT alternative for developers should support CLI commands, version control tasks, testing frameworks, and framework-specific help without losing context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Produces accurate and reliable code output
&lt;/h3&gt;

&lt;p&gt;Accuracy is non-negotiable. A ChatGPT alternative for coding must return valid, working code and ideally link to docs, examples, or trusted sources like GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast, responsive, and always available
&lt;/h3&gt;

&lt;p&gt;Waiting on output slows down your train of thought. A good coding assistant should respond quickly, even during peak hours or with complex prompts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clear data policies and privacy protection
&lt;/h3&gt;

&lt;p&gt;Most developers can’t paste sensitive or client code into a random chatbot. A good ChatGPT alternative for developers should offer transparency about data usage—or better, run locally or on-device to eliminate the risk altogether.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Want to get better results with these AI tools? Before we dive into testing, check out my guide on &lt;a href="https://dev.to/oluwawunmiadesewa/5-chatgpt-prompting-techniques-that-boost-developer-productivity-5aan"&gt;5 ChatGPT Prompting Techniques That Boost Developer Productivity&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How I Tested These Tools
&lt;/h2&gt;

&lt;p&gt;To keep things fair, I used the same workflow across all tools. Each tool was tested with prompts designed to reflect how developers actually use AI during real coding work.&lt;/p&gt;

&lt;p&gt;These included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Explaining code with context&lt;/strong&gt;: &lt;em&gt;“What’s the logic of this Python function if it’s used inside a larger API handler?”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Refactoring with constraints&lt;/strong&gt;: &lt;em&gt;“Refactor this function to improve readability, but keep the same runtime complexity.”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Debugging with reasoning&lt;/strong&gt;: &lt;em&gt;“Why is this function returning None instead of a value?”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Writing test cases with coverage in mind&lt;/strong&gt;: &lt;em&gt;“Write unit tests that cover both success and failure states.”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Documenting code for a teammate&lt;/strong&gt;: &lt;em&gt;“Add docstrings that explain usage, inputs, and edge cases.”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are pulled from real-world tasks I or teammates do regularly.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Languages used:&lt;/strong&gt; &lt;em&gt;JavaScript&lt;/em&gt; and &lt;em&gt;Python&lt;/em&gt;, pulled from actual codebases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing environment:&lt;/strong&gt; Each tool was used either in the browser or via a VS Code extension (if available). I didn’t use APIs, paid upgrades, or external plugins, just the default experience developers would get when trying the tool for free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Criteria used for evaluation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prompt understanding and response clarity
&lt;/li&gt;
&lt;li&gt;Accuracy of code output
&lt;/li&gt;
&lt;li&gt;Speed of response
&lt;/li&gt;
&lt;li&gt;Ability to follow up on questions
&lt;/li&gt;
&lt;li&gt;Documentation and reasoning quality
&lt;/li&gt;
&lt;li&gt;Data privacy or usage limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gave a clear baseline for comparison and helped surface which tools are usable for day-to-day coding—and which ones aren’t.&lt;/p&gt;

&lt;p&gt;Based on those criteria, here are the top &lt;strong&gt;ChatGPT alternatives for coding&lt;/strong&gt;, tested and compared so you can see exactly which ones are worth your time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Top Recommended Free ChatGPT Alternatives for Coding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://claude.ai/new" rel="noopener noreferrer"&gt;Claude&lt;/a&gt; (by Anthropic)
&lt;/h3&gt;

&lt;p&gt;If you're using ChatGPT to explain code, review logic, or write clean, readable functions, Claude actually does a better job.&lt;/p&gt;

&lt;p&gt;Claude is great at structured thinking. You can paste in a full function or even a small file, and it won’t lose the thread. It explains things clearly, asks follow-up questions when needed, and tends to write safer code by default.&lt;/p&gt;

&lt;p&gt;The free version, Claude 3 Sonnet on claude.ai, is surprisingly powerful. You get access to Claude’s top-tier reasoning for free, and it can handle large inputs (up to 200K tokens), which is helpful if you’re pasting in big chunks of code.&lt;/p&gt;

&lt;p&gt;It’s web-only though. So you’ll be switching tabs, but it’s fast, and you can keep a thread going as you work on a project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free plan includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to Claude 3 Sonnet (great at logic + explanations)
&lt;/li&gt;
&lt;li&gt;Huge context window (paste full files)
&lt;/li&gt;
&lt;li&gt;Fast response times in browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it beats ChatGPT:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Better at explaining logic-heavy code, reviewing full files, and keeping context over long conversations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it doesn’t:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No code interpreter, no IDE plugin, and it sometimes refuses tasks that seem risky.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Debugging, reviewing, or walking through code with a thoughtful assistant.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://copilot.microsoft.com/" rel="noopener noreferrer"&gt;Bing Copilot&lt;/a&gt; (GPT‑4 for Free via Microsoft Edge)
&lt;/h3&gt;

&lt;p&gt;If you just want GPT‑4 for free, this is the easiest win. Bing Copilot runs on GPT‑4, includes web access, and costs nothing if you’re using Microsoft Edge. Just sign into your Microsoft account and open the Copilot sidebar or go to copilot.microsoft.com.&lt;/p&gt;

&lt;p&gt;You get fast, high-quality code output. It also cites sources, which is handy when you want documentation links or updated examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free plan includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full access to GPT‑4 (with some rate limits)
&lt;/li&gt;
&lt;li&gt;Fast replies in a side panel or full window
&lt;/li&gt;
&lt;li&gt;Web access + citations
&lt;/li&gt;
&lt;li&gt;No IDE support, but easy to toggle while coding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it beats ChatGPT:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Same GPT‑4 model, but free. It also pulls in real-time info from the web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it doesn’t:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You have to use Microsoft Edge. No file uploads or custom GPTs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Quick code help and debugging—anything you'd normally ask GPT‑4.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://www.phind.com/" rel="noopener noreferrer"&gt;Phind&lt;/a&gt; (AI Search Built for Developers)
&lt;/h3&gt;

&lt;p&gt;If ChatGPT and Stack Overflow had a child, it’d be Phind. Phind is built specifically for coding, with a search-style interface and built-in web access. It pulls context from docs, GitHub issues, blog posts, and more. You can ask it for code, explanations, or help fixing errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free plan includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unlimited questions (with some throttling)
&lt;/li&gt;
&lt;li&gt;Access to models like GPT‑4-turbo
&lt;/li&gt;
&lt;li&gt;Fast search with web results
&lt;/li&gt;
&lt;li&gt;Chat-style interface with memory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it beats ChatGPT:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Phind understands developer intent better than most tools and gives source-backed answers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it doesn’t:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No IDE support. Struggles with multi-file logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Solving coding errors, getting examples, or replacing ChatGPT + Google.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://windsurf.com/" rel="noopener noreferrer"&gt;Windsurf&lt;/a&gt; (Code Autocomplete and AI Assistant)
&lt;/h3&gt;

&lt;p&gt;Windsurf (formerly Codeium) is a strong ChatGPT alternative for fast autocomplete, in-editor chat, and smart code help—without the cost.&lt;/p&gt;

&lt;p&gt;It integrates into your IDE, supports 70+ languages, and includes inline suggestions plus a sidebar-style AI chat. It’s privacy-friendly too, with no code used to train models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free plan includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unlimited autocomplete and refactor features
&lt;/li&gt;
&lt;li&gt;Extensions for VS Code, JetBrains, Jupyter, and more
&lt;/li&gt;
&lt;li&gt;Works with your local files
&lt;/li&gt;
&lt;li&gt;No usage limits or paywall&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it beats ChatGPT:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Windsurf feels like Copilot, but free. Offers real-time support inside your IDE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it doesn’t:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Not ideal for long discussions or architectural help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Autocomplete, documentation, and fast dev support in your editor.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://huggingface.co/chat/" rel="noopener noreferrer"&gt;HuggingChat&lt;/a&gt; (Open-Source AI You Can Run Locally)
&lt;/h3&gt;

&lt;p&gt;HuggingChat is the most developer-controlled alternative here. It’s powered by open models like LLaMA, Mistral, or Zephyr, hosted by Hugging Face. Use it in the browser or run locally with Ollama or LM Studio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free plan includes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;100% free via HuggingChat UI (no login needed)
&lt;/li&gt;
&lt;li&gt;Local hosting with no rate limits
&lt;/li&gt;
&lt;li&gt;Multiple model options
&lt;/li&gt;
&lt;li&gt;No data sharing if self-hosted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it beats ChatGPT:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Best option for devs who care about privacy or offline access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it doesn’t:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Not polished. Slower answers, no IDE plugin, and less fine-tuning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Devs who want full control or offline AI. Not ideal for beginners.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary Table: How These Tools Stack Up
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;IDE Integration&lt;/th&gt;
&lt;th&gt;Code Understanding&lt;/th&gt;
&lt;th&gt;Accuracy &amp;amp; Docs&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Privacy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Claude&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅ Strong logic&lt;/td&gt;
&lt;td&gt;✅ Structured&lt;/td&gt;
&lt;td&gt;⚡ Fast&lt;/td&gt;
&lt;td&gt;⚠️ Cloud-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bing Copilot&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅ GPT‑4 accuracy&lt;/td&gt;
&lt;td&gt;✅ Web citations&lt;/td&gt;
&lt;td&gt;⚡ Fast&lt;/td&gt;
&lt;td&gt;⚠️ Cloud-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phind&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅ Context-aware&lt;/td&gt;
&lt;td&gt;✅ Web sources&lt;/td&gt;
&lt;td&gt;⚡ Fast&lt;/td&gt;
&lt;td&gt;⚠️ Cloud-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Windsurf&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Built-in&lt;/td&gt;
&lt;td&gt;✅ Good&lt;/td&gt;
&lt;td&gt;⚠️ Limited docs&lt;/td&gt;
&lt;td&gt;⚡ Fast&lt;/td&gt;
&lt;td&gt;✅ Strong&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HuggingChat&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;⚠️ Local setup&lt;/td&gt;
&lt;td&gt;✅ Basic logic&lt;/td&gt;
&lt;td&gt;❌ Minimal docs&lt;/td&gt;
&lt;td&gt;🐢 Varies&lt;/td&gt;
&lt;td&gt;✅ Self-hosted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're looking for a free ChatGPT alternative for coding in 2025, you don’t need to settle for generic chatbots or limited trials.&lt;/p&gt;

&lt;p&gt;Try a few: &lt;strong&gt;Claude&lt;/strong&gt; is great for understanding code, &lt;strong&gt;Windsurf&lt;/strong&gt; brings AI straight into your IDE, &lt;strong&gt;Phind&lt;/strong&gt; offers search plus citations, &lt;strong&gt;Bing Copilot&lt;/strong&gt; gives you GPT‑4 for free while &lt;strong&gt;HuggingChat&lt;/strong&gt; gives you full control.&lt;/p&gt;

&lt;p&gt;Use the one that fits your current work, and don’t pay unless you absolutely need to.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this helped, I’ve got more like it. Tools, tips, and honest takes on dev workflow. Follow here or on &lt;a href="https://x.com/Abutterflyee?t=oNEkeAVIXTB0OzW0N59nzA&amp;amp;s=09" rel="noopener noreferrer"&gt;X&lt;/a&gt; to catch the next one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>productivity</category>
      <category>coding</category>
    </item>
    <item>
      <title>This Crash Tool Made Me Rethink How I Debug Mobile Apps 😲</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Wed, 04 Jun 2025 10:39:28 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/this-crash-tool-made-me-rethink-how-i-debug-mobile-apps-573j</link>
      <guid>https://dev.to/oluwawunmiadesewa/this-crash-tool-made-me-rethink-how-i-debug-mobile-apps-573j</guid>
      <description>&lt;p&gt;The way I see it, only developers really get developers, at least when it comes to building tools other devs actually want to use.&lt;/p&gt;

&lt;p&gt;Let me explain.&lt;/p&gt;

&lt;p&gt;I came across &lt;a href="https://www.instalog.dev/#pricing" rel="noopener noreferrer"&gt;Instalog.dev &lt;/a&gt;on LinkedIn back in April 2025. The developer behind it was announcing its launch, claiming it was &lt;a href="https://www.producthunt.com/products/instalog" rel="noopener noreferrer"&gt;a better Crashlytics alternative&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That was enough to make me try it.(&lt;em&gt;Part curiosity, part spite&lt;/em&gt;). I have a bit of a reflex to side-eye any tool trying to ride the coattails of something established.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But… the features actually made sense.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why Instalog Stands Out as a Crash Reporting Tool&lt;/li&gt;
&lt;li&gt;AI-Powered Crash Summaries That Read Like a Developer&lt;/li&gt;
&lt;li&gt;How Instalog Compares to Sentry’s AI Features&lt;/li&gt;
&lt;li&gt;Developer-Friendly Pricing With No Event Limits&lt;/li&gt;
&lt;li&gt;Setup Took Me 5 Minutes&lt;/li&gt;
&lt;li&gt;Linking User Feedback Directly to Crash Reports&lt;/li&gt;
&lt;li&gt;Why Instalog Works Better for Mobile Debugging&lt;/li&gt;
&lt;li&gt;Final Thoughts on Instalog for Mobile Crash Reporting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Instalog Stands Out as a Crash Reporting Tool
&lt;/h2&gt;

&lt;p&gt;Most crash reporting tools give you logs. Some add breadcrumbs. A few use AI.&lt;/p&gt;

&lt;p&gt;Instalog does something different: &lt;strong&gt;it actually helps you fix the bug.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That claim sounds bold, but it’s backed by how the tool is built. Let me break down what made me say that — and what features made me stick with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI-Powered Crash Summaries That Read Like a Developer
&lt;/h2&gt;

&lt;p&gt;Instalog’s crash summaries don’t read like generic GPT guesses. They sound like another developer looked at your logs and said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This API call is missing a null check. That’s what’s crashing on Android 13.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu26hoe9q9cat8u79cvi1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu26hoe9q9cat8u79cvi1.gif" alt="Instalog feedback" width="760" height="509"&gt;&lt;/a&gt;&lt;br&gt;
They’re specific, accurate, and fast.&lt;/p&gt;

&lt;p&gt;You spend less time digging through logs—and more time shipping fixes. That’s the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Instalog Compares to Sentry’s AI Features
&lt;/h2&gt;

&lt;p&gt;I’ve seen the AI summary feature Sentry is working on. It's incredible, but it's not generally available yet. Right now, it's limited to early adopters and higher-tier plans.&lt;/p&gt;

&lt;p&gt;Instalog’s summaries, on the other hand, are already available. They feel purpose-built for mobile, not just tacked on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer-Friendly Pricing With No Event Limits
&lt;/h2&gt;

&lt;p&gt;Sentry’s free plan caps out at 5,000 error events a month. After that, you’re upgrading—whether you want to or not.&lt;/p&gt;

&lt;p&gt;Instalog’s free tier doesn’t have that kind of ceiling. It’s $0/month, no time limit, and no hard stop when things get busy.&lt;/p&gt;

&lt;p&gt;The whole thing feels designed for solo devs and small teams. I haven’t hit any walls yet—and I’d probably know if I did.&lt;/p&gt;

&lt;p&gt;And if you do need more, the paid plan starts at $19/month. That gets you up to 100,000 error events per month. &lt;/p&gt;

&lt;p&gt;For comparison, Sentry’s $26/month tier only gives you 50,000 events. So you’re paying less and getting more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Took Me 5 Minutes
&lt;/h2&gt;

&lt;p&gt;I tested it in a Flutter app. The process was refreshingly simple: &lt;/p&gt;

&lt;p&gt;1.Add the package&lt;br&gt;
2.Drop in your API key&lt;/p&gt;

&lt;p&gt;Done.&lt;/p&gt;

&lt;p&gt;It supports Flutter, iOS, Android, and React Native.&lt;/p&gt;

&lt;p&gt;The docs lean a bit too hard on dev jokes, but they’re complete and technically solid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linking User Feedback Directly to Crash Reports
&lt;/h2&gt;

&lt;p&gt;This one surprised me.&lt;/p&gt;

&lt;p&gt;Users can report a bug inside the app. Instalog then ties that feedback directly to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logs&lt;/li&gt;
&lt;li&gt;Stack traces&lt;/li&gt;
&lt;li&gt;Session context&lt;/li&gt;
&lt;li&gt;Instalog feedback&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5kdumabag4h5o4bvtz6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5kdumabag4h5o4bvtz6.gif" alt="Instalog feedback" width="650" height="433"&gt;&lt;/a&gt;&lt;br&gt;
No guesswork. You get the technical and human side of the issue in one place.&lt;/p&gt;

&lt;p&gt;This kind of context is hard to get with Crashlytics or Sentry—unless you bolt on three other tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Instalog Works Better for Mobile Debugging
&lt;/h2&gt;

&lt;p&gt;The biggest difference though, is focus. Sentry is built for everything — frontend, backend, DevOps, mobile. That’s great for large teams, but it adds complexity.&lt;/p&gt;

&lt;p&gt;Instalog is mobile-first. Not just also supports mobile — but built for mobile.&lt;/p&gt;

&lt;p&gt;That makes it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster to set up&lt;/li&gt;
&lt;li&gt;Easier to navigate&lt;/li&gt;
&lt;li&gt;Better tuned for how mobile debugging actually works&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts on Instalog for Mobile Crash Reporting
&lt;/h2&gt;

&lt;p&gt;Most crash reporting tools stop at visibility. More logs, more alerts, more dashboards.&lt;/p&gt;

&lt;p&gt;Instalog goes one step further. It’s opinionated about what’s useful.&lt;/p&gt;

&lt;p&gt;It doesn’t just show you the problem—it suggests the fix.&lt;/p&gt;

&lt;p&gt;And while it’s still early in its development, it already solves the hardest parts of mobile crash reporting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real context&lt;/li&gt;
&lt;li&gt;Developer-level insight&lt;/li&gt;
&lt;li&gt;Simple setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instalog isn’t perfect, but it’s solving the right problems first. If this is its baseline, I’m genuinely curious what’s coming next. &lt;/p&gt;

&lt;p&gt;Maybe that’s a deeper AI debugging that catches regressions before they ship.&lt;br&gt;
Or just… more of this level of thoughtfulness, applied to the rest of the mobile dev stack.&lt;/p&gt;

&lt;p&gt;Whatever it is, I'm watching.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this helped, I’ve got more like it. Tools, tips, and honest takes on dev workflow. Follow here or on &lt;a href="https://x.com/Abutterflyee?t=KTExD0kuNYS97vA-AJz9hg&amp;amp;s=09" rel="noopener noreferrer"&gt;X&lt;/a&gt; to catch the next one.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>mobile</category>
      <category>ai</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Is Redux Necessary or is it Just About Following 'Best Practices' Without Questioning?</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Sat, 15 Mar 2025 02:32:05 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/is-redux-necessary-or-is-it-just-about-following-best-practices-without-questioning-489j</link>
      <guid>https://dev.to/oluwawunmiadesewa/is-redux-necessary-or-is-it-just-about-following-best-practices-without-questioning-489j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxomxrjd0cvyn3c7xokqe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxomxrjd0cvyn3c7xokqe.jpg" alt=" " width="720" height="677"&gt;&lt;/a&gt;&lt;br&gt;
If you've been around &lt;strong&gt;React&lt;/strong&gt; devs long enough, you've probably heard these sacred commandments:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thou shalt not use &lt;strong&gt;Context&lt;/strong&gt; for state management.&lt;/p&gt;

&lt;p&gt;Thou shalt install &lt;strong&gt;Redux&lt;/strong&gt; for all global state needs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Okay, maybe they aren't official, but it sure feels that way&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But here’s the thing, &lt;strong&gt;Redux&lt;/strong&gt; was built to solve a problem &lt;strong&gt;React&lt;/strong&gt; no longer has at the same scale. So, do you actually need it? Or is it just about following 'best practices' without questioning?&lt;/p&gt;

&lt;p&gt;Let's talk about it.&lt;/p&gt;
&lt;h2&gt;
  
  
  About Context API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; has always been the underdog. It was originally built to solve prop drilling, not global state management. And if you tried using it for state updates back in the pre-Hooks era, you probably had flashbacks of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyContext.Provider value={{ state, updateState }}&amp;gt;
  &amp;lt;SomeComponent /&amp;gt;
&amp;lt;/MyContext.Provider&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You just triggered a full app re-render, lol!&lt;/p&gt;

&lt;p&gt;No wonder people ran to &lt;strong&gt;Redux&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But then came &lt;strong&gt;Hooks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Suddenly, with &lt;code&gt;useContext&lt;/code&gt;and &lt;code&gt;useReducer&lt;/code&gt;, &lt;strong&gt;Context&lt;/strong&gt; could actually manage state, update it predictably, and optimize performance with &lt;code&gt;useMemo&lt;/code&gt; and &lt;code&gt;React.memo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So, does that mean &lt;strong&gt;Context + Hooks can replace Redux&lt;/strong&gt;?&lt;/p&gt;

&lt;h2&gt;
  
  
  When Context + Hooks Is Enough
&lt;/h2&gt;

&lt;p&gt;For most apps, &lt;strong&gt;Context&lt;/strong&gt; + &lt;strong&gt;Hooks&lt;/strong&gt; gets the job done. It works great for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Themes (light/dark mode)&lt;/li&gt;
&lt;li&gt;Authentication (user session data)&lt;/li&gt;
&lt;li&gt;App settings (language, preferences)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And with &lt;code&gt;useReducer&lt;/code&gt;, it can even handle more structured updates.&lt;/p&gt;

&lt;p&gt;For example, let’s say you need authentication state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const AuthContext = createContext();

const authReducer = (state, action) =&amp;gt; {
  switch (action.type) {
    case "LOGIN":
      return { ...state, user: action.payload, isAuthenticated: true };
    case "LOGOUT":
      return { ...state, user: null, isAuthenticated: false };
    default:
      return state;
  }
};

export const AuthProvider = ({ children }) =&amp;gt; {
  const [state, dispatch] = useReducer(authReducer, { user: null, isAuthenticated: false });

  return &amp;lt;AuthContext.Provider value={{ state, dispatch }}&amp;gt;{children}&amp;lt;/AuthContext.Provider&amp;gt;;
};

export const useAuth = () =&amp;gt; useContext(AuthContext);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s state management without &lt;strong&gt;Redux’s&lt;/strong&gt; boilerplate. &lt;/p&gt;

&lt;h2&gt;
  
  
  But What About Redux’s Superpowers ?
&lt;/h2&gt;

&lt;p&gt;Look, I get it, &lt;strong&gt;Redux&lt;/strong&gt; does have some cool tricks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Time-travel debugging&lt;/strong&gt; (because who doesn’t want to play god with their app’s history?)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Middleware&lt;/strong&gt;(like &lt;em&gt;redux-thunk&lt;/em&gt; for async operations)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global predictability&lt;/strong&gt; (because structuring state matters in big teams)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But here’s the question, Does your app need all of that?&lt;/p&gt;

&lt;p&gt;If your app is handling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-frequency state updates (real-time dashboards, websockets)&lt;/li&gt;
&lt;li&gt;Complex derived state (data that depends on multiple sources)&lt;/li&gt;
&lt;li&gt;Massive developer teams with strict state management rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then &lt;strong&gt;Redux&lt;/strong&gt; might be worth it.&lt;/p&gt;

&lt;p&gt;But if your app doesn’t check those boxes, you might just be over-engineering things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Still Not Sure? Let’s Play "Should I Use Redux&lt;/strong&gt;?"&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Do you need to debug state like &lt;em&gt;it’s a Netflix time-travel show&lt;/em&gt;?&lt;br&gt;
Yes? Go &lt;strong&gt;Redux&lt;/strong&gt;.&lt;br&gt;
No? &lt;strong&gt;Context + Hooks&lt;/strong&gt; is fine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does your app need middleware like &lt;em&gt;redux-thunk&lt;/em&gt; or &lt;em&gt;redux-saga&lt;/em&gt;?&lt;br&gt;
Yes? &lt;strong&gt;Redux&lt;/strong&gt;.&lt;br&gt;
No? &lt;strong&gt;Context + Hooks&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do you want to write a &lt;code&gt;reducer&lt;/code&gt;, &lt;code&gt;action&lt;/code&gt;, &lt;code&gt;dispatch&lt;/code&gt;, and &lt;code&gt;store&lt;/code&gt; just to toggle a sidebar?&lt;br&gt;
Yes? Seek help.&lt;br&gt;
No? &lt;strong&gt;Context + Hooks&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small to medium apps? &lt;strong&gt;Context + Hooks&lt;/strong&gt;" is your friend.&lt;/li&gt;
&lt;li&gt;Huge, complex apps with heavy async workflows? &lt;strong&gt;Redux&lt;/strong&gt; might be worth the extra setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still confused? Start with &lt;strong&gt;Context&lt;/strong&gt;. If things get messy, migrate to &lt;strong&gt;Redux&lt;/strong&gt; later.&lt;br&gt;
So,do you really need &lt;strong&gt;Redux&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;Before you type &lt;code&gt;npm install redux&lt;/code&gt;, ask yourself:&lt;/p&gt;

&lt;p&gt;"Am I solving a real problem, or am I just doing what everyone else does?"&lt;/p&gt;

&lt;p&gt;Still unsure? Check out my &lt;a href="https://medium.com/@bewajioluwawunmi/react-hook-with-the-context-api-for-global-state-management-in-react-applications-a-guide-d477b16023e5" rel="noopener noreferrer"&gt;explanatory article&lt;/a&gt; about the specific use cases of each.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy coding&lt;/em&gt; ! &lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Sat, 15 Mar 2025 01:04:07 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/-3cco</link>
      <guid>https://dev.to/oluwawunmiadesewa/-3cco</guid>
      <description></description>
    </item>
    <item>
      <title>Write Simpler Logical Expressions In Your Code with These 2 Rules!</title>
      <dc:creator>Oluwawunmi Adesewa </dc:creator>
      <pubDate>Mon, 03 Mar 2025 06:16:11 +0000</pubDate>
      <link>https://dev.to/oluwawunmiadesewa/write-simpler-logical-expressions-in-your-code-with-these-2-rules-172g</link>
      <guid>https://dev.to/oluwawunmiadesewa/write-simpler-logical-expressions-in-your-code-with-these-2-rules-172g</guid>
      <description>&lt;p&gt;When writing code, it's easy to get stuck in complex &lt;code&gt;if&lt;/code&gt; statements and nested conditions, where a single misplaced &lt;code&gt;not&lt;/code&gt; or &lt;code&gt;and&lt;/code&gt; can result in bugs and errors. &lt;/p&gt;

&lt;p&gt;But what if you could simplify logical statements and make your code more maintainable? This article shares two key rules in mathematical logic that simplify the process of writing clearer and simpler logical statements in programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Consider a scenario where you need to negate a logical statement with multiple &lt;code&gt;AND&lt;/code&gt; or &lt;code&gt;OR&lt;/code&gt; operators.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(A and B) or (C and D)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Manually negating this expression can be tricky because logical operators have &lt;a href="https://www.geeksforgeeks.org/operator-precedence-in-programming/" rel="noopener noreferrer"&gt;precedence rules&lt;/a&gt;, and distributing them incorrectly can cause a bug in your code.&lt;/p&gt;

&lt;p&gt;De Morgan's law simplifies this process by transforming expressions like these into more manageable forms, making it easier to write and understand complex logical statements&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is De Morgan’s Law?&lt;/strong&gt;&lt;br&gt;
De Morgan’s Laws are two transformational rules in mathematical logic that allow you to switch between &lt;code&gt;AND&lt;/code&gt; and &lt;code&gt;OR&lt;/code&gt; when negating an expression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's how it works&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NOT (A AND B) = (NOT A) OR (NOT B)&lt;/li&gt;
&lt;li&gt;NOT (A OR B) = (NOT A) AND (NOT B)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: &lt;em&gt;The notation for these two rules may vary slightly depending on the programming language or context, but the principle remains the same.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;These laws can be applied in programming to write clearer conditional statements. For example, &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consider this statement:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if not (x &amp;gt; y and y &amp;lt; z):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using De Morgan’s Law, you can rewrite it as:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if not x &amp;gt; y or not y &amp;lt; z:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This implies that conditional statements can be written in different ways to the same effect. As seen in the above example, when negating a statement with &lt;code&gt;and&lt;/code&gt; change it to &lt;code&gt;or&lt;/code&gt; and negate each condition. For &lt;code&gt;or&lt;/code&gt;, change it to &lt;code&gt;and&lt;/code&gt; and negate each condition.&lt;/p&gt;

&lt;p&gt;These transformations, while seemingly minor, make complex logical expressions clearer and easier to maintain in code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take a look at this loop condition&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while (selection != 'Q' || selection != 'q')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This loop condition appears logical but it has a flaw because the &lt;a href="https://www.lenovo.com/us/en/glossary/or-operator/?orgRef=https%253A%252F%252Fwww.google.com%252F" rel="noopener noreferrer"&gt;OR operator returns true if at least one of the conditions is true&lt;/a&gt;. This creates an &lt;strong&gt;infinite loop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using De Morgan’s second law:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while (selection != 'Q' &amp;amp;&amp;amp; selection != 'q')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the loop correctly exits when selection is either &lt;strong&gt;Q&lt;/strong&gt; or &lt;strong&gt;q.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apply De Morgan’s Law When:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplifying Nested Negations.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Before
if not (a and b and not c):
    print("Condition met")
#After
if not a or not b or c:
    print("Condition met")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Writing Clearer Logical Expressions.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Before
if (!(a &amp;amp;&amp;amp; b)) { console.log("True"); }
#After
if (!a || !b) { console.log("True"); }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both conditions evaluate the same way, but the second version is easier to read.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
While you still need to understand the rules and precedence of logical operators, De Morgan's law provides clear methods to break down and improve logical expressions into more manageable forms that require less mental effort to understand. &lt;/p&gt;

&lt;p&gt;So, the next time you find yourself dealing with nested conditions and negations, apply these two simple rules to clean up your logic and avoid unnecessary bugs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For a more comprehensive reading on De Morgan's law and it's usage in logical expressions, &lt;a href="https://blog.penjee.com/what-is-demorgans-law-in-programming-answered-with-pics/" rel="noopener noreferrer"&gt;check here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
