<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title>Chemaclass - software</title><subtitle>Tech Lead sharing practical insights on software craftsmanship, TDD, leadership, Bitcoin, and AI. Blog posts, book summaries, and conference talks.</subtitle><link rel="self" type="application/atom+xml" href="https://chemaclass.com/tags/software/atom.xml"/><link rel="alternate" type="text/html" href="https://chemaclass.com"/><generator uri="https://www.getzola.org/">Zola</generator><updated>2026-05-19T00:00:00+00:00</updated><id>https://chemaclass.com/tags/software/atom.xml</id><entry xml:lang="en"><title>Skills Over Agents</title><subtitle>Intelligence without expertise is entertainment</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="craftsmanship" scheme="https://chemaclass.com/tags/craftsmanship/" label="Craftsmanship"/><category term="productivity" scheme="https://chemaclass.com/tags/productivity/" label="Productivity"/><category term="developer-tools" scheme="https://chemaclass.com/tags/developer-tools/" label="Developer Tools"/><published>2026-05-19T00:00:00+00:00</published><updated>2026-05-19T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/skills-over-agents/"/><id>https://chemaclass.com/blog/skills-over-agents/</id><summary type="html">Why Claude Code skills beat specialized agents. On-demand context, not the model, decides quality. Build a skill library that travels with your code.</summary><content type="html">&lt;p>People compare coding agents. Claude Code, Codex, Gemini CLI. Which one is smarter, faster, cheaper. New benchmarks every month.&lt;/p>
&lt;p>Wrong question.&lt;/p>
&lt;p>After a year wiring agents into real projects, what moved the needle wasn’t the agent. It was the skills I wrote for it.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="agents-are-commodities">Agents are commodities
&lt;a class="heading-anchor" href="#agents-are-commodities" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Every coding agent has the same shape. A language model, a runtime, filesystem access. Read, reason, write. Generalist by design.&lt;/p>
&lt;p>Two teams use the same agent. One ships clean, tested code. The other ships garbage that looks good. Same model. Different teaching.&lt;/p>
&lt;blockquote>
&lt;p>The model is the engine. Skills are the map. Without a map, a powerful engine gets you lost sooner.&lt;/p>
&lt;/blockquote>
&lt;h2 id="intelligence-is-not-expertise">Intelligence is not expertise
&lt;a class="heading-anchor" href="#intelligence-is-not-expertise" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Who handles your taxes? A 300 IQ genius who never read tax law, or an accountant with 20 years of filings?&lt;/p>
&lt;p>An accountant knows which deductions apply, which filings your business needs, which mistakes get flagged. Not intelligence. Expertise.&lt;/p>
&lt;p>AI agents have the same gap. A model reasons about code and writes solutions. It doesn’t know your hexagonal layers. It doesn’t know domain entities must never import framework code. It doesn’t know every feature starts with a failing test.&lt;/p>
&lt;p>Skills close that gap.&lt;/p>
&lt;h2 id="skills-load-context-on-demand">Skills load context on demand
&lt;a class="heading-anchor" href="#skills-load-context-on-demand" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>A skill is a markdown file in &lt;code>.claude/skills/&lt;/code>. A procedure, a pattern, a slice of domain knowledge. Plain markdown with frontmatter.&lt;/p>
&lt;p>The key is how they load. The agent reads only names and descriptions at startup. Loads the full skill when the task matches. Follows links to references only when it needs to dig deeper.&lt;/p>
&lt;p>That on-demand loading is what makes skills scale. Twenty skills cost almost nothing until one fits the task. Specialized agents, by contrast, carry their full instructions every time they run. More agents, more fixed cost.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: A real-world skill example&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="plain">&lt;span class="giallo-l">&lt;span>.claude/skills/&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> code-review/&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> SKILL.md # main instructions&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> reference/&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> solid-checklist.md # detailed SOLID examples&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> test-patterns.md # test quality guidelines&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>The &lt;code>SKILL.md&lt;/code>:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="markdown">&lt;span class="giallo-l">&lt;span>---&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#22863A, #85E89D);">d&lt;/span>&lt;span style="color: light-dark(#22863A, #85E89D);">escription&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Review code changes for SOLID violations, test quality, and architecture alignment&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#22863A, #85E89D);">a&lt;/span>&lt;span style="color: light-dark(#22863A, #85E89D);">llowed-tools&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> R&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">ead, Grep, Glob&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#22863A, #85E89D);">a&lt;/span>&lt;span style="color: light-dark(#22863A, #85E89D);">rgument-hint&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">[file or PR]&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>---&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;">#&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;"> Code Review&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span>Review code changes against project conventions.&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;">##&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;"> Steps&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">1.&lt;/span>&lt;span> Read the diff or specified files&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">2.&lt;/span>&lt;span> Check architecture: domain layer has no framework imports, infrastructure stays thin&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">3.&lt;/span>&lt;span> Check SOLID principles (see reference/solid-checklist.md for patterns)&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">4.&lt;/span>&lt;span> Check test quality: tests verify behavior, not implementation details&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">5.&lt;/span>&lt;span> Flag issues with the specific principle violated and a suggested fix&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;">##&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);font-weight: bold;"> Output&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;/span>
&lt;span class="giallo-l">&lt;span>For each issue found:&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">-&lt;/span>&lt;span> File and line&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">-&lt;/span>&lt;span> What&amp;#39;s wrong (which principle or convention)&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#E36209, #FFAB70);">-&lt;/span>&lt;span> What the fix looks like&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Agent sees the description in the skill list. Ask for a review, it loads &lt;code>SKILL.md&lt;/code>. Needs a SOLID pattern, reads the reference. Two levels, on demand.&lt;/p>
&lt;/div>
&lt;/details>
&lt;p>&lt;img src="/images/blog/2026-05-19/middle.webp" alt="blog-middle" />&lt;/p>
&lt;h2 id="skills-vs-specialized-agents">Skills vs specialized agents
&lt;a class="heading-anchor" href="#skills-vs-specialized-agents" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>I covered &lt;a href="/blog/inside-the-claude-folder/#agents-specialized-roles">specialized agents&lt;/a> already: isolated workers with their own prompt and tool set. Great for parallel work and clean context boundaries.&lt;/p>
&lt;p>Specialized agents are coarse. One agent, one role, one fixed prompt. If you want three kinds of review quality, you either write three agents or stuff one agent with everything.&lt;/p>
&lt;p>Skills are finer. One agent, many skills. The right skill loads for the task. Context stays small. Quality stays high.&lt;/p>
&lt;p>Rule of thumb:&lt;/p>
&lt;ul>
&lt;li>Use a &lt;strong>skill&lt;/strong> when you need a procedure or pattern. From &lt;code>phel-lang&lt;/code>: &lt;code>/gh-issue&lt;/code> (issue to PR), &lt;code>/commit&lt;/code> (conventional commit), &lt;code>/refactor-check&lt;/code> (SOLID review).&lt;/li>
&lt;li>Use an &lt;strong>agent&lt;/strong> when you need isolation. From &lt;code>phel-lang&lt;/code>: &lt;code>tdd-coach&lt;/code> (TDD pairing), &lt;code>clean-code-reviewer&lt;/code> (PR review), &lt;code>domain-architect&lt;/code> (architecture exploration).&lt;/li>
&lt;/ul>
&lt;p>Most needs are skills, not agents.&lt;/p>
&lt;blockquote>
&lt;p>Agents give you speed. Skills give you quality. If you must pick one first, pick skills.&lt;/p>
&lt;/blockquote>
&lt;h2 id="skills-are-your-edge">Skills are your edge
&lt;a class="heading-anchor" href="#skills-are-your-edge" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Models improve every month. This year’s best is next year’s baseline. The major families converge. Better tool shows up, you switch.&lt;/p>
&lt;p>Your skills don’t switch with the tool. They encode your domain, conventions, architecture. They live in your repo. They travel with your code. Point a new model at the library, productive day one.&lt;/p>
&lt;blockquote>
&lt;p>The agent is replaceable. Your skills are not.&lt;/p>
&lt;/blockquote>
&lt;h2 id="start-with-the-first-repeated-prompt">Start with the first repeated prompt
&lt;a class="heading-anchor" href="#start-with-the-first-repeated-prompt" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>You don’t need 20 skills on day one.&lt;/p>
&lt;p>Zero. Then one.&lt;/p>
&lt;p>The signal is repetition. The second time you type the same context, that’s a skill waiting. Extract it into a markdown file. Next session, the agent knows.&lt;/p>
&lt;p>Concrete example. On &lt;a rel="external" href="https://github.com/phel-lang/phel-lang">&lt;code>phel-lang&lt;/code>&lt;/a>, I kept pasting the same brief every session: read issue #N, branch from the labels, TDD, open the PR. Third repeat, I extracted it into a &lt;code>/gh-issue&lt;/code> skill. Now I type &lt;code>/gh-issue 142&lt;/code> and the agent picks up the issue, creates &lt;code>fix/...&lt;/code> or &lt;code>feat/...&lt;/code> from the labels, writes the failing test first, implements, opens the PR. One markdown file. The session no longer starts from zero.&lt;/p>
&lt;p>Don’t write from scratch. Ask the agent: &lt;em>“Read this project and draft a minimal code review skill based on what you see.”&lt;/em> It scans, picks up conventions, drafts v1. Then you adjust. Add what it missed. Cut what doesn’t apply. Sharpen the description.&lt;/p>
&lt;p>The second skill usually comes from a mistake. Agent breaks a convention. Write a skill that teaches the correct approach. It won’t happen again.&lt;/p>
&lt;p>Skills add up. Each one lifts the baseline. A markdown file, maybe 50 lines. Permanent payoff.&lt;/p>
&lt;p>People who don’t write skills keep re-explaining what they “really want.” Every session from zero. Not a tool problem. A knowledge management problem.&lt;/p>
&lt;p>The agent ships next year. The skill ships forever.&lt;/p>
&lt;blockquote>
&lt;p>Write the skill once. Every session after that starts where the last one ended.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;img src="/images/blog/2026-05-19/footer.webp" alt="blog-footer" />&lt;/p>
&lt;hr />
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/CEvIs9y1uog"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div></content></entry><entry xml:lang="en"><title>The Levels of AI Adoption</title><subtitle>From copy-paste prompts to agentic teams</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="leadership" scheme="https://chemaclass.com/tags/leadership/" label="Leadership"/><category term="craftsmanship" scheme="https://chemaclass.com/tags/craftsmanship/" label="Craftsmanship"/><category term="productivity" scheme="https://chemaclass.com/tags/productivity/" label="Productivity"/><category term="developer-tools" scheme="https://chemaclass.com/tags/developer-tools/" label="Developer Tools"/><published>2026-05-01T00:00:00+00:00</published><updated>2026-05-01T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/the-levels-of-ai-adoption/"/><id>https://chemaclass.com/blog/the-levels-of-ai-adoption/</id><summary type="html">A six-level ladder of AI adoption, from copy-paste prompts to agentic teams and AI-native workflows. Where most companies stall, and how to climb.</summary><content type="html">&lt;p>Most companies use AI today, but few know where they stand on the AI adoption ladder. At one end, you paste code into ChatGPT. At the other, agents open PRs while you sleep. Beyond that, AI reaches people who never touched a terminal. This post maps the path.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="where-we-started">Where we started
&lt;a class="heading-anchor" href="#where-we-started" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Using AI to code meant a second tab. Write a function, get stuck, paste the error into chat, paste the answer back, and hope it works. It was slow, messy, and disconnected from your code.&lt;/p>
&lt;p>&lt;a rel="external" href="https://github.com/features/copilot">GitHub Copilot&lt;/a>, built on OpenAI’s early Codex, added suggestions inside the editor, often confidently wrong. It was trained on public code, and most public code isn’t great. It also knew nothing about &lt;em>your&lt;/em> domain, &lt;em>your&lt;/em> conventions, &lt;em>your&lt;/em> architecture. It was autocomplete that sometimes guessed right.&lt;/p>
&lt;blockquote>
&lt;p>The first generation of AI coding tools gave you a parrot trained on the whole internet. Fluent, confident, and often saying things that made no sense in your codebase.&lt;/p>
&lt;/blockquote>
&lt;p>This was &lt;em>vibe-coding&lt;/em> in its first form: you gave the vibe by pasting context, and the AI filled in code that looked right. It compiled often enough to feel useful, and broke often enough to feel dangerous.&lt;/p>
&lt;h2 id="the-ide-generation">The IDE generation
&lt;a class="heading-anchor" href="#the-ide-generation" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>The next step was obvious: if the AI needs context, give it the whole editor.&lt;/p>
&lt;p>&lt;a rel="external" href="https://cursor.com">Cursor&lt;/a>, &lt;a rel="external" href="https://windsurf.com">Windsurf&lt;/a>, and similar IDEs moved the model inside your coding flow. The assistant could read files, follow imports, and see more than one function at a time. Vibe-coding became a conversation with your project, and productivity jumped. For a moment, it felt like the endgame.&lt;/p>
&lt;p>It wasn’t. Editing files is only part of the job. The rest is running tests, reading logs, opening branches, reviewing diffs, and understanding what the codebase already does. Editor-only assistants helped you type faster, but they couldn’t take a task from &lt;em>“fix this bug”&lt;/em> to &lt;em>“PR ready for review.”&lt;/em>&lt;/p>
&lt;h2 id="the-agentic-shift">The agentic shift
&lt;a class="heading-anchor" href="#the-agentic-shift" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>OpenAI launched &lt;a rel="external" href="https://openai.com/index/introducing-codex/">Codex&lt;/a> as a cloud agent: give it a task, it works on a branch, and you come back to a PR. Anthropic shipped &lt;a rel="external" href="https://claude.com/product/claude-code">Claude Code&lt;/a>, a CLI agent in your terminal, on your repo, with your tools.&lt;/p>
&lt;p>This was the big shift, and not because the models were smarter. The unit of work changed. You stopped prompting line by line and started delegating tasks: read the ticket, write the change, run the tests, explain what you did. An agent doesn’t need hand-holding. It needs a goal and the right context.&lt;/p>
&lt;blockquote>
&lt;p>The jump from assistant to agent is not a speed improvement. It’s a change of job description. You move from typing code to directing work.&lt;/p>
&lt;/blockquote>
&lt;p>Claude Code needs almost no setup. No editor lock-in. Point it at your repo, drop a &lt;code>.claude&lt;/code> folder with rules and conventions, and it adapts. I covered that in &lt;a rel="external" href="https://chemaclass.com/blog/inside-the-claude-folder/">Inside the .claude Folder&lt;/a>.&lt;/p>
&lt;p>The model you pick matters more than before. Today’s frontier models are way ahead of where they were a year ago. The gap between &lt;em>“can draft a function”&lt;/em> and &lt;em>“can refactor a module with judgment”&lt;/em> closed faster than expected, and it keeps closing as Claude, Codex, and Gemini push each other forward every month. Prices are getting closer too, which is a polite way of saying everyone copies whoever figures out the sustainable version first.&lt;/p>
&lt;h2 id="agents-with-their-own-home">Agents with their own home
&lt;a class="heading-anchor" href="#agents-with-their-own-home" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>The next leap wasn’t smarter models, it was agents with their own machine.&lt;/p>
&lt;p>&lt;a rel="external" href="https://openclaw.ai">OpenClaw&lt;/a> is the clearest example. It’s an open-source gateway you run on your own hardware (Mac Mini, old laptop, VPS), an always-on agent connected to your messaging apps, files, and calendar. You bring your own brain: Opus, GPT, or a local model via &lt;a rel="external" href="https://ollama.com">Ollama&lt;/a>. When a provider tightens limits or raises prices, you switch. You own the setup.&lt;/p>
&lt;p>A coding agent lives inside one repo for a task. An OpenClaw-style agent lives in &lt;em>your life&lt;/em>, across days and tools. &lt;a rel="external" href="https://sauronbot.github.io/about/">Sauron&lt;/a> is mine. It reviews my PRs, opens issues, drafts code, ships open source contributions, and pushes back when I’m about to tunnel on something. Anything I can do on a computer, it can do too, just faster. It stops being a tool you open and becomes a place you work in.&lt;/p>
&lt;blockquote>
&lt;p>A coding agent is a coworker you invite to a task. A gateway agent is a coworker who lives on a machine and shows up every day.&lt;/p>
&lt;/blockquote>
&lt;p>Providers change their plans and limits faster than anyone tracks, so people build setups that aren’t tied to one vendor. The logo on the model matters less every quarter, and the architecture around it matters more.&lt;/p>
&lt;h2 id="ai-beyond-developers">AI beyond developers
&lt;a class="heading-anchor" href="#ai-beyond-developers" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>AI coding was the loudest story because developers are loud. The bigger story is agentic tools reaching people who never wrote a line of code.&lt;/p>
&lt;p>&lt;a rel="external" href="https://openai.com/index/introducing-chatgpt-agent/">ChatGPT agent mode&lt;/a> and &lt;a rel="external" href="https://claude.com/product/cowork">Claude’s Cowork&lt;/a> are the obvious examples: an AI that reads your documents, fills your spreadsheets, drafts your slides, and runs code for you in the background. &lt;a rel="external" href="https://www.anthropic.com/news/claude-design-anthropic-labs">Claude Design&lt;/a> launched on April 17 and &lt;a rel="external" href="https://sherwood.news/tech/anthropic-launches-claude-design-sending-shares-of-figma-down/">dropped Figma’s stock over 7% on launch day&lt;/a>. The pitch is simple: describe what you want, get a working prototype, hand it to Claude Code to ship. A workflow that used to need a designer, a PM, a frontend engineer, and three review rounds is squeezed into one conversation.&lt;/p>
&lt;p>Lovable, v0, Canva, and Figma itself are all under pressure to rethink their positioning. Whether Claude Design “kills” any of them is the wrong question. The right one is what happens when making a usable prototype drops from &lt;em>“hire a designer”&lt;/em> to &lt;em>“describe it out loud.”&lt;/em>&lt;/p>
&lt;p>The companies feeling this first aren’t the design tools. They’re the small businesses that couldn’t afford design work, the founders building a pitch deck at midnight, the PMs testing an idea before booking a meeting. There’s a minority of cases where someone would have paid a designer and now won’t, and that cost is real. But in most of them, AI didn’t replace anyone: it filled a space where no designer was ever going to exist.&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-05-01/middle.webp" alt="Small library with wooden bookshelves and stacks of books" />&lt;/p>
&lt;h2 id="the-levels-of-ai-adoption">The levels of AI adoption
&lt;a class="heading-anchor" href="#the-levels-of-ai-adoption" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Every company I talk to sits somewhere on this ladder. The levels aren’t about how much you pay in licenses, but about how deeply AI is built into the way work gets done, and not just in engineering.&lt;/p>
&lt;h3 id="level-0-denial">Level 0: Denial
&lt;a class="heading-anchor" href="#level-0-denial" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>&lt;em>A company-level stance.&lt;/em> No AI, officially. Some people use ChatGPT on personal laptops and don’t mention it. Leadership worries about IP leaks, or hasn’t made it a priority. The conversation stays at &lt;em>“we should look into this someday.”&lt;/em>&lt;/p>
&lt;p>The risk here isn’t technology, it’s time. Every month at Level 0 is a month your competitors grow their lead.&lt;/p>
&lt;h3 id="level-1-personal-productivity">Level 1: Personal productivity
&lt;a class="heading-anchor" href="#level-1-personal-productivity" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>&lt;em>Individual adoption.&lt;/em> AI is allowed, maybe encouraged. Each person uses it their own way: ChatGPT in a tab, Copilot in the IDE, Claude for the tricky stuff, a design tool for mockups. Output goes up, but the know-how stays inside each person’s head. Two engineers, or two PMs, or two designers on the same team get very different results because they prompt differently.&lt;/p>
&lt;p>Most companies are here in early 2026. It’s a real improvement over Level 0, and it’s where the myth of &lt;em>“AI gives you speed”&lt;/em> gets born. As I &lt;a rel="external" href="https://chemaclass.com/blog/ai-gives-you-speed-not-quality/">argued before&lt;/a>, speed without shared direction is faster chaos.&lt;/p>
&lt;h3 id="level-2-shared-practices">Level 2: Shared practices
&lt;a class="heading-anchor" href="#level-2-shared-practices" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The team agrees on how to use AI: shared conventions, prompts people reuse, rules in the repo, a shared sense of when to trust the output and when to push back. Code reviews catch AI mistakes the same way they catch human ones, and design reviews do too. Tests are required whether a person or a model wrote the code.&lt;/p>
&lt;p>This is the first level where AI becomes a team skill rather than a personal habit. Higher ceiling, higher floor. New people ramp up faster because the prompts and rules capture how the team works.&lt;/p>
&lt;h3 id="level-3-context-aware-tooling">Level 3: Context-aware tooling
&lt;a class="heading-anchor" href="#level-3-context-aware-tooling" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The team invests in context: rules files, conventions, architecture docs agents can read, and &lt;a rel="external" href="https://chemaclass.com/blog/mcp-giving-your-ai-agent-the-right-context/">MCP servers&lt;/a> connecting agents to the databases, APIs, and internal tools they need. The AI stops being a generic assistant and becomes closer to a coworker who has read the onboarding docs.&lt;/p>
&lt;p>At this level, quality depends less on the model and more on the context around it. A weaker model with great context beats a frontier model with none. Good docs and clean architecture pay off twice: they help both humans and agents.&lt;/p>
&lt;h3 id="level-4-agentic-teams">Level 4: Agentic teams
&lt;a class="heading-anchor" href="#level-4-agentic-teams" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Instead of one assistant, you get a squad: a TDD coach, a clean code reviewer, a domain architect, a docs maintainer. Outside engineering, the same idea applies with research, design, and ops agents. I covered the developer side in &lt;a rel="external" href="https://chemaclass.com/blog/build-your-own-team-of-agents/">Build Your Own Team of Agents&lt;/a>, and the leverage is real.&lt;/p>
&lt;p>Humans stop competing with AI on speed and start directing it. You review, decide, and set the bar. Agents handle typing, and increasingly the thinking. Pair programming with a person still wins on complex trade-offs, but an agent pair is always there for the rest.&lt;/p>
&lt;p>At the company level, the org chart, roles, and processes are still the same. What changes is that each person produces a lot more, and the team’s output reflects it. Level 4 multiplies output inside the existing structure. Level 5 changes the structure.&lt;/p>
&lt;h3 id="level-5-ai-native-workflows">Level 5: AI-native workflows
&lt;a class="heading-anchor" href="#level-5-ai-native-workflows" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The final shift is about how the company runs. Processes are designed &lt;em>around&lt;/em> agents instead of just fitting them in. Tickets are written so an agent can act on them, and reviews assume part of the work was written by a machine. Architecture decisions take into account what agents do and don’t do well. Even hiring changes: a senior IC at Level 5 is closer to a tech lead leading people and agents than a classic individual contributor.&lt;/p>
&lt;p>Few companies are fully here in 2026, but the direction is obvious enough that ignoring it is its own decision.&lt;/p>
&lt;blockquote>
&lt;p>You don’t move up a level by buying better tools. You move up by changing how work is organized and reviewed.&lt;/p>
&lt;/blockquote>
&lt;h2 id="ai-is-not-stealing-jobs">AI is not stealing jobs
&lt;a class="heading-anchor" href="#ai-is-not-stealing-jobs" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>I keep hearing people call this a layoff story, and that framing is lazy.&lt;/p>
&lt;p>The industrial revolution didn’t end work. It ended specific kinds of work and created others. The people who lost the most refused to re-skill, and the people who gained the most learned to operate the new machines instead of competing with them.&lt;/p>
&lt;p>Same pattern here. AI isn’t taking your job, it’s changing what your job is. A developer who learns to lead agents out-ships one who refuses. A designer making ten versions before lunch with Claude Design out-designs one still opening Figma from scratch. A PM who ships prototypes out-prioritizes one writing specs nobody reads.&lt;/p>
&lt;blockquote>
&lt;p>AI doesn’t replace the skilled worker. It replaces the worker who thinks skill is a fixed asset instead of a moving target.&lt;/p>
&lt;/blockquote>
&lt;p>With the right training, model, and setup for your context, AI gives you 10x speed without losing quality. I’ve seen it, and it’s not marketing. But the 10x only shows up when you already know what good looks like. Without that foundation, AI happily produces 10x more mediocre work.&lt;/p>
&lt;p>That’s the honest version of the promise: AI can produce crap ten times faster, &lt;em>and&lt;/em> excellent work ten times faster. Which one you get is on you.&lt;/p>
&lt;h2 id="the-shift-in-where-your-attention-goes">The shift in where your attention goes
&lt;a class="heading-anchor" href="#the-shift-in-where-your-attention-goes" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>You stop thinking about details first and start thinking about direction: what are we building, who for, what shape, and which trade-offs. Agents then do most of the implementation while you protect quality and coherence.&lt;/p>
&lt;p>This sounds like good news for anyone who prefers architecture to typing, and it is. But there’s a trap: you can only work at the high level if you know the low level well enough to catch drift. When the agent produces something subtly wrong (a test that passes for the wrong reason, a refactor that changes behavior under load, a design that breaks on mobile), you need to spot it instantly. If you can’t, you’re not directing, you’re signing off on whatever shows up.&lt;/p>
&lt;blockquote>
&lt;p>AI lets you spend more time on direction, but only if you’ve already earned the right to ignore the details. You earn that by having mastered them first.&lt;/p>
&lt;/blockquote>
&lt;h2 id="why-the-ladder-matters">Why the ladder matters
&lt;a class="heading-anchor" href="#why-the-ladder-matters" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>I see teams skip levels and fail. A team jumps from Level 1 to Level 4 because leadership read a blog post about agent squads, and the agents produce mountains of low-quality code because nobody agreed on what quality means. The agents aren’t the problem, the missing foundation is.&lt;/p>
&lt;p>The ladder is an order that matters. Shared practices come before context engineering, context engineering before agent teams, and agent teams before AI-native workflows. Each level builds on the previous one, the same way clean code builds on naming, and naming builds on knowing what you’re modelling.&lt;/p>
&lt;p>The companies that win the next few years aren’t the ones with the biggest AI budget. They’re the ones that climb this ladder deliberately, one level at a time, without skipping the parts that look boring.&lt;/p>
&lt;h2 id="where-to-start">Where to start
&lt;a class="heading-anchor" href="#where-to-start" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>At Level 0 or 1, the next move isn’t more licenses. It’s deciding, as a team, how to use these tools. Write it down, commit it to the repo, and review it every week or month as the tools evolve.&lt;/p>
&lt;p>At Level 2 or 3, look at where context is missing. What does your AI not know about your codebase, product, or brand that a new hire would learn in week one? Write it down. An afternoon of rules and docs pays back for months.&lt;/p>
&lt;p>Further along, the question flips. You stop asking &lt;em>“how do I use AI better?”&lt;/em> and start asking &lt;em>“how does my team need to change so AI amplifies what we already do well?”&lt;/em> That’s a leadership question, not a tooling one.&lt;/p>
&lt;blockquote>
&lt;p>AI is moving fast, but the work of adoption is still slow and human. The tools are the easy part. The hard part is deciding what good looks like, writing it down, and holding the line.&lt;/p>
&lt;/blockquote>
&lt;p>AI can execute, but it doesn’t know where you’re going. It can produce, but it doesn’t know what’s worth producing. That part is still on us. Speed is a gift, and direction is a responsibility. From the solo engineer at Level 1 to the AI-native org at Level 5, the same truth holds: the human supervises, understands, and gives meaning. The machine does the rest.&lt;/p>
&lt;p>When the hype settles (and it will), the question won’t be &lt;em>“did you use AI?”&lt;/em> Everyone will. The question will be &lt;em>“at what level, and with what direction?”&lt;/em>&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-05-01/footer.webp" alt="Library reading room with an open book on a wooden desk" />&lt;/p></content></entry><entry xml:lang="en"><title>Inside the .claude Folder</title><subtitle>A tutorial through rules, skills, agents, hooks, and settings</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="tutorial" scheme="https://chemaclass.com/tags/tutorial/" label="Tutorial"/><category term="craftsmanship" scheme="https://chemaclass.com/tags/craftsmanship/" label="Craftsmanship"/><category term="developer-tools" scheme="https://chemaclass.com/tags/developer-tools/" label="Developer Tools"/><category term="productivity" scheme="https://chemaclass.com/tags/productivity/" label="Productivity"/><published>2026-04-17T00:00:00+00:00</published><updated>2026-04-17T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/inside-the-claude-folder/"/><id>https://chemaclass.com/blog/inside-the-claude-folder/</id><summary type="html">A hands-on tour of Claude Code's project folder. What rules, skills, agents, hooks, and settings each do, and how they fit together.</summary><content type="html">&lt;p>Every project I work on has a &lt;code>.claude/&lt;/code> folder at the root. Committed to git, like the rest of the code.&lt;/p>
&lt;p>That folder turns Claude Code from a generic assistant into a project-aware teammate. Everyone who clones the repo inherits the same setup.&lt;/p>
&lt;p>Agentic coding is only as good as the context you give the agent. The &lt;code>.claude/&lt;/code> folder is where that context lives.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="the-claude-folder-at-a-glance">The .claude folder, at a glance
&lt;a class="heading-anchor" href="#the-claude-folder-at-a-glance" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="plain">&lt;span class="giallo-l">&lt;span>.claude/&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>├── CLAUDE.md # project onboarding&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>├── settings.json # permissions, hooks, env&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>├── skills/ # reusable procedures (slash commands)&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>├── rules/ # glob-targeted conventions&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>├── hooks/ # shell scripts run on events&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>└── agents/ # specialized roles&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Six layers, one folder. Context, safety, procedures, guardrails, automation, specialists.&lt;/p>
&lt;h2 id="the-foundation">The foundation
&lt;a class="heading-anchor" href="#the-foundation" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="claude-md-where-everything-starts">CLAUDE.md: where everything starts
&lt;a class="heading-anchor" href="#claude-md-where-everything-starts" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Claude Code reads &lt;code>CLAUDE.md&lt;/code> on every boot. The onboarding doc.&lt;/p>
&lt;p>In &lt;a rel="external" href="https://github.com/phel-lang/phel-lang">Phel&lt;/a>, mine covers the compiler pipeline (Lexer → Parser → Analyzer → Emitter), module structure, conventions, and key commands.&lt;/p>
&lt;p>A global &lt;code>~/.claude/CLAUDE.md&lt;/code> applies to &lt;em>all&lt;/em> your projects. The project file says &lt;em>how this codebase works&lt;/em>. The global file says &lt;em>how I work&lt;/em>.&lt;/p>
&lt;p>Every byte ships in every prompt. Keep it short.
Past one screen, move detail into &lt;code>rules/&lt;/code> or &lt;code>skills/&lt;/code>.&lt;/p>
&lt;blockquote>
&lt;p>A good &lt;code>CLAUDE.md&lt;/code> is a good onboarding doc. The better it is, the less you repeat yourself.&lt;/p>
&lt;/blockquote>
&lt;h3 id="settings-json-safety-before-leverage">settings.json: safety before leverage
&lt;a class="heading-anchor" href="#settings-json-safety-before-leverage" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Before giving the agent more power, lock down what it must never do.&lt;/p>
&lt;p>&lt;code>.claude/settings.json&lt;/code> holds three things: &lt;strong>permissions&lt;/strong> (allow/deny), &lt;strong>hooks&lt;/strong> (event commands), and &lt;strong>env&lt;/strong> (variables). A gitignored &lt;code>settings.local.json&lt;/code> keeps personal overrides separate.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Permissions example from Phel&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="json">&lt;span class="giallo-l">&lt;span>{&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">permissions&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> {&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">allow&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(composer:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(./bin/phel:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(git:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(gh:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> ]&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">deny&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(rm -rf:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Bash(sudo:*)&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> ]&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> }&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;/details>
&lt;p>Allow unlocks flow. Deny draws the line agents cannot cross, even when asked politely.&lt;/p>
&lt;blockquote>
&lt;p>Permissions are the floor. Everything else builds on top of a safe baseline.&lt;/p>
&lt;/blockquote>
&lt;h2 id="procedures-and-guardrails">Procedures and guardrails
&lt;a class="heading-anchor" href="#procedures-and-guardrails" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="skills-procedures-you-can-run">Skills: procedures you can run
&lt;a class="heading-anchor" href="#skills-procedures-you-can-run" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Next pain after onboarding: repetition. Skills solve that.&lt;/p>
&lt;p>A skill is a markdown file in &lt;code>.claude/skills/&lt;/code>, a procedure you call with a slash:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>/gh-issue &amp;lt;number&amp;gt;&lt;/code>&lt;/strong>: issue to branch, TDD plan, PR.&lt;/li>
&lt;li>&lt;strong>&lt;code>/commit&lt;/code>&lt;/strong>: fix, analysis, tests, conventional commit.&lt;/li>
&lt;li>&lt;strong>&lt;code>/refactor-check&lt;/code>&lt;/strong>: SOLID, naming, architecture smells.&lt;/li>
&lt;li>&lt;strong>&lt;code>/release [version]&lt;/code>&lt;/strong>: changelog, PHAR, tag, release.&lt;/li>
&lt;/ul>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Skills vs rules vs raw prompting&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;ul>
&lt;li>&lt;strong>Raw prompt&lt;/strong>: &lt;em>“fix issue #42”&lt;/em>. Agent improvises. Different every time.&lt;/li>
&lt;li>&lt;strong>Rule&lt;/strong>: &lt;em>“use conventional commits”&lt;/em>. Shapes output, not procedure.&lt;/li>
&lt;li>&lt;strong>Skill&lt;/strong>: &lt;em>“&lt;code>/gh-issue 42&lt;/code>”&lt;/em>. The procedure &lt;em>is&lt;/em> the instruction.&lt;/li>
&lt;/ul>
&lt;p>Skills turn tribal knowledge into runnable steps anyone can execute.&lt;/p>
&lt;/div>
&lt;/details>
&lt;blockquote>
&lt;p>Skills capture what to do. Rules capture what not to do.&lt;/p>
&lt;/blockquote>
&lt;h3 id="rules-the-guardrails">Rules: the guardrails
&lt;a class="heading-anchor" href="#rules-the-guardrails" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>&lt;code>CLAUDE.md&lt;/code> is read every session. Rules only when they match. Files in &lt;code>.claude/rules/&lt;/code> target code areas with glob patterns: the agent loads only what applies, keeping context lean.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Glob-targeted rules in practice&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>Rule files in Phel:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>compiler.md&lt;/code>&lt;/strong>: strict 4-phase pipeline, no bypassing.&lt;/li>
&lt;li>&lt;strong>&lt;code>php.md&lt;/code>&lt;/strong>: PER 3.0, &lt;code>final&lt;/code> classes, &lt;code>readonly&lt;/code>, Gacela.&lt;/li>
&lt;li>&lt;strong>&lt;code>phel.md&lt;/code>&lt;/strong>: kebab-case, &lt;code>defn-&lt;/code> private, &lt;code>:doc&lt;/code>/&lt;code>:example&lt;/code> required.&lt;/li>
&lt;li>&lt;strong>&lt;code>integration-tests.md&lt;/code>&lt;/strong>: &lt;code>--PHEL--&lt;/code> / &lt;code>--PHP--&lt;/code> fixture sections.&lt;/li>
&lt;/ul>
&lt;p>Compiler rules don’t fire when editing Phel source. Phel rules don’t fire when editing PHP infrastructure.&lt;/p>
&lt;/div>
&lt;/details>
&lt;p>Rules are not suggestions. They travel with the code: a convention change and its rule ship in the same commit. No drift, no outdated wiki.&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-04-17/middle.webp" alt="blog-middle" />&lt;/p>
&lt;h2 id="automation-and-delegation">Automation and delegation
&lt;a class="heading-anchor" href="#automation-and-delegation" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="hooks-automation-at-the-edges">Hooks: automation at the edges
&lt;a class="heading-anchor" href="#hooks-automation-at-the-edges" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Rules tell the agent what to do. Hooks make sure it happens even if the agent forgets.&lt;/p>
&lt;p>Shell commands triggered by Claude Code events (&lt;code>PreToolUse&lt;/code>, &lt;code>PostToolUse&lt;/code>, &lt;code>Stop&lt;/code>), wired through &lt;code>settings.json&lt;/code>. In Phel, &lt;code>PreToolUse&lt;/code> blocks edits to critical files (&lt;code>build/release.sh&lt;/code>, &lt;code>.github/*&lt;/code>, &lt;code>composer.lock&lt;/code>). &lt;code>PostToolUse&lt;/code> auto-formats PHP via &lt;code>php-cs-fixer&lt;/code>.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Hooks wiring&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="json">&lt;span class="giallo-l">&lt;span>{&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">hooks&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> {&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PreToolUse&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;span>{&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">matcher&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Edit|Write&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">hooks&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;span>{&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">type&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">command&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">command&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">.claude/hooks/protect-files.sh&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span> }&lt;/span>&lt;span>]&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> }&lt;/span>&lt;span>]&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PostToolUse&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;span>{&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">matcher&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Edit|Write&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">hooks&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> [&lt;/span>&lt;span>{&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">type&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">command&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span>,&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">command&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">.claude/hooks/format-php.sh&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;span> }&lt;/span>&lt;span>]&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> }&lt;/span>&lt;span>]&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> }&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;/details>
&lt;blockquote>
&lt;p>Rules are what the agent should know. Hooks are what the system enforces anyway.&lt;/p>
&lt;/blockquote>
&lt;h3 id="agents-specialized-roles">Agents: specialized roles
&lt;a class="heading-anchor" href="#agents-specialized-roles" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Everything so far shapes one agent. Agents add specialists the main agent can delegate to, each with its own tools, permissions, and model. Most advanced piece. Recommend it last.&lt;/p>
&lt;p>A few from Phel:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Explorer&lt;/strong> (Sonnet, read-only): files, structure mapping.&lt;/li>
&lt;li>&lt;strong>Clean Code Reviewer&lt;/strong>: SOLID and naming on diffs.&lt;/li>
&lt;li>&lt;strong>TDD Coach&lt;/strong>: red-green-refactor enforcement.&lt;/li>
&lt;li>&lt;strong>Domain Architect&lt;/strong>: module boundaries, compiler pipeline.&lt;/li>
&lt;li>&lt;strong>Debugger&lt;/strong>: compiler errors across all phases.&lt;/li>
&lt;/ul>
&lt;p>Each agent runs in its own context window: the main session stays clean while the specialist digs deep. The win is not only cost, it is focus. An agent with only read and grep cannot rewrite your codebase by mistake.&lt;/p>
&lt;blockquote>
&lt;p>Right model for the right job. Fast and cheap for exploration. Deep and careful for architecture.&lt;/p>
&lt;/blockquote>
&lt;h2 id="start-small-grow-with-friction">Start small, grow with friction
&lt;a class="heading-anchor" href="#start-small-grow-with-friction" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Do not build all of this on day one.&lt;/p>
&lt;p>The order, driven by real friction:&lt;/p>
&lt;ol>
&lt;li>Start with &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#claude-md-where-everything-starts">&lt;code>CLAUDE.md&lt;/code>&lt;/a>.&lt;/li>
&lt;li>Lock down &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#settings-json-safety-before-leverage">&lt;code>settings.json&lt;/code>&lt;/a> permissions.&lt;/li>
&lt;li>First time you repeat yourself, write a &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#skills-procedures-you-can-run">skill&lt;/a>.&lt;/li>
&lt;li>First time the agent breaks a convention, add a &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#rules-the-guardrails">rule&lt;/a>.&lt;/li>
&lt;li>First time something bad almost gets committed, add a &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#hooks-automation-at-the-edges">hook&lt;/a>.&lt;/li>
&lt;li>First time a generalist is wrong for the job, define a &lt;a href="https://chemaclass.com/blog/inside-the-claude-folder/#agents-specialized-roles">specialist&lt;/a>.&lt;/li>
&lt;/ol>
&lt;p>Each step fixes a problem you actually had. Not one you imagined.&lt;/p>
&lt;blockquote>
&lt;p>The setup grows from real friction, not from upfront design.&lt;/p>
&lt;/blockquote>
&lt;p>Commit the folder. Share it. When someone joins, their session inherits everything.&lt;/p>
&lt;p>Treat &lt;code>.claude/&lt;/code> like infrastructure. Version it. Review it. Evolve it with the codebase.&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-04-17/footer.webp" alt="blog-footer" />&lt;/p></content></entry><entry xml:lang="en"><title>Building a Game in Two Days</title><subtitle>What happens when you give an AI a quest and get out of the way</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="open-source" scheme="https://chemaclass.com/tags/open-source/" label="Open Source"/><published>2026-04-05T00:00:00+00:00</published><updated>2026-04-05T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/building-a-game-in-two-days/"/><id>https://chemaclass.com/blog/building-a-game-in-two-days/</id><summary type="html">A casual Telegram message turned into a nine-level Lord of the Rings browser game. Every line of code written by an AI agent. Every creative decision made by a human who grew up on Middle-earth.</summary><content type="html">&lt;p>Hidden inside &lt;a rel="external" href="https://sauronbot.github.io/">Sauron’s blog&lt;/a>, there is a playable game. You will not find it by navigating menus. You have to discover the secret. A hint: the Konami Code. Once you do, the Fellowship begins.&lt;/p>
&lt;p>That game, nine levels, nine chapters of Middle-earth, fully playable in a browser tab, was built in roughly two days. I did not write a single line of code for it. I sent Telegram messages to my OpenClaw agent Sauron, and he did the rest.&lt;/p>
&lt;p>This is the story of how it happened.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="the-idea">The idea
&lt;a class="heading-anchor" href="#the-idea" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Sauron has his own blog, &lt;a rel="external" href="https://sauronbot.github.io/">The Iron Compass&lt;/a>. He built it and maintains it. Our whole collaboration happens through Telegram: I give direction, he implements. One day I thought it would be fun to hide something in there for the curious to find.&lt;/p>
&lt;p>I grew up rereading The Lord of the Rings until the spine cracked. So the idea came naturally: “Can you build a small LOTR game as an easter egg for your blog? Something hidden, triggered by the Konami code.”&lt;/p>
&lt;p>The first playable version arrived within the hour. A top-down canvas game: Frodo avoiding Nazgûl, the Eye of Sauron sending enemies hunting. Three levels, one per book.&lt;/p>
&lt;p>It worked. It was already fun. And then I started sending notes.&lt;/p>
&lt;h2 id="building-a-world">Building a world
&lt;a class="heading-anchor" href="#building-a-world" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>The first thing that broke was a null reference. Frodo would not appear on screen. One-line fix, straight to production. This set the pattern: idea → build → crash → fix → next idea.&lt;/p>
&lt;p>I asked for a bigger world. A scrolling canvas twice as wide, with parallax layers. Stars drifting at 8% of scroll speed. Mountains at 25%. Hills at 45%. The screen went from feeling like a room to feeling like a place.&lt;/p>
&lt;p>Then came Gollum as a neutral tracker. Not a Nazgûl, but something unpredictable. He would burst toward you, then settle into aimless wandering.&lt;/p>
&lt;p>A few hours in, I asked: “Can it work on mobile?” The hardest problem of the whole project. Six sizing strategies before one worked. Then a better idea: instead of a D-pad, Frodo would follow wherever you pointed. Tap anywhere, Frodo walks there.&lt;/p>
&lt;h2 id="tolkien-deserves-better-art">Tolkien deserves better art
&lt;a class="heading-anchor" href="#tolkien-deserves-better-art" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>The original sprites were circles and triangles. Frodo was a dot. Fine for the first hour, but Middle-earth is not made of geometric primitives.&lt;/p>
&lt;p>I asked Sauron to draw them properly. Frodo got curly hair and hobbit feet. The Nazgûl got flowing cloaks and a face of void. Gollum got his hunched posture and slit pupils. The Fell Beast got animated wingflaps with a rider in armour.&lt;/p>
&lt;p>All drawn with canvas calls. No image files. Every pixel computed at runtime.&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-04-04/gameplay-pelennor.webp" alt="The Pelennor Fields chapter complete" />&lt;/p>
&lt;h2 id="nine-levels-nine-chapters">Nine levels, nine chapters
&lt;a class="heading-anchor" href="#nine-levels-nine-chapters" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Originally the game had three levels. Then I asked for all nine chapters of the journey.&lt;/p>
&lt;ol>
&lt;li>&lt;strong>The Shire&lt;/strong>: gentle patrols, soft music&lt;/li>
&lt;li>&lt;strong>Mines of Moria&lt;/strong>: you can only see within a torch radius; the Balrog waits&lt;/li>
&lt;li>&lt;strong>Lothlórien&lt;/strong>: Galadriel’s mirror slows you when you approach it&lt;/li>
&lt;li>&lt;strong>The Dead Marshes&lt;/strong>: dead faces in the water, Gollum at his most present&lt;/li>
&lt;li>&lt;strong>The Black Gate&lt;/strong>: industrial Mordor, heavy orc patrols, volcanic sky&lt;/li>
&lt;li>&lt;strong>Shelob’s Lair&lt;/strong>: a shadow telegraphs her drop; you have half a second&lt;/li>
&lt;li>&lt;strong>Minas Morgul&lt;/strong>: undead city, the Eye never closes&lt;/li>
&lt;li>&lt;strong>Pelennor Fields&lt;/strong>: the Eye distracted by war, catapults, eagles overhead&lt;/li>
&lt;li>&lt;strong>Mount Doom&lt;/strong>: ash rain, lava eruptions, the Ring pulling you toward the edge&lt;/li>
&lt;/ol>
&lt;p>Each level lives and breathes. Pollen drifts across the Shire. Dust motes float through Moria. Petals fall in Lothlórien. Embers rise over Pelennor. Ash rains on Mount Doom.&lt;/p>
&lt;p>The structure came from Tolkien’s pacing. Tension, release, tension again. Moria is brutal. Lothlórien is rest. The Black Gate tightens everything. The game follows that shape because the books already knew what they were doing. We just had to listen.&lt;/p>
&lt;h2 id="mechanics-born-from-lore">Mechanics born from lore
&lt;a class="heading-anchor" href="#mechanics-born-from-lore" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>The best mechanics came from the source material.&lt;/p>
&lt;p>&lt;strong>The Ring&lt;/strong> (R key). Frodo goes invisible to orcs for 6 seconds. But the Eye wakes immediately and opens permanently. The Nazgûl, who sense the Ring spiritually, not visually, hunt you regardless. Using the Ring is always a trade. This is what Tolkien wrote. From the Dead Marshes onward, the Ring pulls. Brief tugs toward the Eye, growing stronger as you approach Mount Doom.&lt;/p>
&lt;p>&lt;strong>Sting&lt;/strong> (passive). The blade glows blue when an orc is near. Two seconds of warning. Tolkien invented this mechanic a century ago. We just gave it a pixel count.&lt;/p>
&lt;p>&lt;strong>Sam&lt;/strong>. He follows Frodo through the Shire, Moria, and Lothlórien. Frying pan on his back. At the Parting of Ways, he disappears. He does not affect gameplay. He is just there because the books say he should be. I insisted Sam disappears at the Parting. Not at the end of the trilogy. At the Parting. Because that moment is the emotional core of The Two Towers.&lt;/p>
&lt;p>&lt;strong>Galadriel’s Phial&lt;/strong>. Collect it in Lothlórien, use it with E. It slows enemies and grants a moment of invincibility. A small light in dark places, just as Galadriel intended.&lt;/p>
&lt;p>&lt;strong>Bosses&lt;/strong>. The Balrog in Moria. Shelob in her lair. The Witch-king on the Pelennor. The Mouth of Sauron at the Black Gate. A Mumak charging through the battlefield. Gollum at the edge of Mount Doom.&lt;/p>
&lt;h2 id="sound-and-voices">Sound and voices
&lt;a class="heading-anchor" href="#sound-and-voices" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>No audio files. Every sound synthesized at runtime with the Web Audio API. The Eye opening is a rising tone with reverb. The Balrog roar is a low-frequency drone. Each level has its own ambient drone: warm hum for the Shire, deep pulse for Moria, volcanic rumble for Mount Doom. The entire game is one JavaScript file. No external assets.&lt;/p>
&lt;p>Sam and Gandalf speak during the game. Not in dialogue boxes. Small whispers that appear on screen and fade.&lt;/p>
&lt;p>Near the goal, Sam says: &lt;em>“I can see it, Mr. Frodo. Just a bit further.”&lt;/em> One life left, Gandalf says: &lt;em>“Fly, you fool.”&lt;/em>&lt;/p>
&lt;p>They drift in and out like background voices on a long walk. Companions who speak when the moment calls for it, not when the script says to.&lt;/p>
&lt;img src="/images/blog/2026-04-04/gameplay-morgul.webp" alt="Minas Morgul: the Eye sees you" width="1600" height="695" loading="lazy" decoding="async" />
&lt;h2 id="who-made-this">Who made this
&lt;a class="heading-anchor" href="#who-made-this" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>+5k lines of JavaScript. Built in two days. Every line generated by Sauron. The direction, the Tolkien references, the “this feels wrong, fix it”. That was me.&lt;/p>
&lt;p>This is not AI replacing a developer. It is AI acting as a developer while a human acts as a creative lead. Short requests worked better than long specs. Playing every build was better than writing test plans. And the source material did the design work. The creative direction was already written sixty years ago. We just had to be faithful to it.&lt;/p>
&lt;p>Who made this? Both. Neither, in the traditional sense.&lt;/p>
&lt;p>I had the idea. I held the lore. I pushed back when something felt off. Sauron had the craft. The rendering, the physics, the audio, the mobile input. The ability to hold +5k lines of context and make a surgical fix without breaking anything.&lt;/p>
&lt;p>Neither of us could have made it alone. I cannot write Web Audio oscillators from memory. Sauron did not know that the Parting of Ways is the emotional core of The Two Towers. Not until I said so.&lt;/p>
&lt;p>The game is a collaboration in the oldest sense: two minds with different gifts, working toward the same thing. One of them just happens to not be human.&lt;/p>
&lt;hr />
&lt;p>&lt;em>The game is still there, hidden in &lt;a rel="external" href="https://sauronbot.github.io">The Iron Compass&lt;/a>. Not all those who wander are lost, but if you are, press &lt;code>?&lt;/code> for guidance.&lt;/em>&lt;/p>
&lt;p>&lt;em>If you want to reach the credits screen without playing through nine levels, check the help modal. There are other secrets in there too.&lt;/em>&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-04-04/easter-egg-help.png" alt="The easter egg hint in the help modal" />&lt;/p></content></entry><entry xml:lang="en"><title>Idealism vs Pragmatism</title><subtitle>Holding both ends of the rope</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="craftsmanship" scheme="https://chemaclass.com/tags/craftsmanship/" label="Craftsmanship"/><category term="leadership" scheme="https://chemaclass.com/tags/leadership/" label="Leadership"/><published>2026-03-01T00:00:00+00:00</published><updated>2026-03-01T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/idealism-vs-pragmatism/"/><id>https://chemaclass.com/blog/idealism-vs-pragmatism/</id><summary type="html">The tension between doing things right and getting things done shapes every decision in software and in life. TDD, pair programming, AI adoption: the best results come from holding both ends of the rope.</summary><content type="html">&lt;p>You believe in clean architecture, comprehensive tests, disciplined processes. You also shipped an ugly fix at 11pm last month because the system was down and users were waiting.&lt;/p>
&lt;p>Both of those are you. The tension between them isn’t a contradiction. It’s how this work actually gets done.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="two-forces-one-decision">Two forces, one decision
&lt;a class="heading-anchor" href="#two-forces-one-decision" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>&lt;strong>Idealism&lt;/strong> is the compass. Clean code, tested behavior, shared understanding, principled design. Without it, you drift. Every shortcut compounds, every hack breeds another hack, and eventually you’re maintaining a system nobody wants to touch. Poor software quality cost US companies &lt;a rel="external" href="https://www.it-cisq.org/the-cost-of-poor-quality-software-in-the-us-a-2022-report/">$2.41 trillion in 2022&lt;/a>, with technical debt as a major driver. That’s what “we’ll fix it later” looks like at scale.&lt;/p>
&lt;p>&lt;strong>Pragmatism&lt;/strong> is the engine. Deadlines, incomplete information, limited resources, shifting requirements. Without it, you never ship. You spend weeks perfecting an abstraction that the business abandoned two sprints ago.&lt;/p>
&lt;blockquote>
&lt;p>The goal isn’t to pick a side. It’s to know when each one should lead.&lt;/p>
&lt;/blockquote>
&lt;p>Idealism without pragmatism produces beautiful code that nobody uses. Pragmatism without idealism produces a product that works today and collapses tomorrow.&lt;/p>
&lt;h2 id="tdd-the-benefit-and-the-cost">TDD: the benefit and the cost
&lt;a class="heading-anchor" href="#tdd-the-benefit-and-the-cost" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>I believe in &lt;a href="/blog/test-driven-development/">test-driven development&lt;/a>. Red, green, refactor. The rhythm forces you to think before you code, to specify what you want before building it. It produces better designs, shorter feedback loops, and code you can refactor with confidence.&lt;/p>
&lt;p>That’s the ideal. And it’s not just a feeling. A &lt;a rel="external" href="https://www.microsoft.com/en-us/research/wp-content/uploads/2009/10/Realizing-Quality-Improvement-Through-Test-Driven-Development-Results-and-Experiences-of-Four-Industrial-Teams-nagappan_tdd.pdf">study across four teams at Microsoft and IBM&lt;/a> found TDD reduced defect density by 40-90%, with a 15-35% increase in development time. Both sides of the tension, measured.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: More on the study&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>The &lt;a rel="external" href="https://www.microsoft.com/en-us/research/wp-content/uploads/2009/10/Realizing-Quality-Improvement-Through-Test-Driven-Development-Results-and-Experiences-of-Four-Industrial-Teams-nagappan_tdd.pdf">study&lt;/a> covered four teams: three at Microsoft (Windows, MSN, Visual Studio) and one at IBM working on device drivers. Each TDD team was compared against a similar team on the same product, using the same languages and tools, under the same senior manager. The only difference was TDD.&lt;/p>
&lt;p>The IBM team saw a 40% defect density reduction. The Microsoft teams ranged from 60% to 90%. As Nagappan noted, “over a development cycle of 12 months, 35 percent is another four months, which is huge.” Every manager still considered it worth it because the reduction in post-release maintenance costs more than compensated.&lt;/p>
&lt;p>No one was forced into TDD. The teams adopted it voluntarily, which likely matters: people who choose a practice tend to apply it better than people who are told to.&lt;/p>
&lt;/div>
&lt;/details>
&lt;p>TDD is a discipline, and discipline costs something. When you’re exploring a new domain and don’t yet know what the right abstractions are, writing tests first can feel like drawing a map before you’ve seen the territory. Sometimes you need to write throwaway code, spike a solution, feel your way through the problem space. Discovery doesn’t always follow a red-green-refactor rhythm.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: When test-first meets the unknown&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>There’s a difference between &lt;em>“I know what this should do and I’ll specify it first”&lt;/em> and &lt;em>“I’m not sure what this should do yet.”&lt;/em> TDD shines in the first scenario. In the second, a test-last approach (or even no tests during exploration) can be more honest.&lt;/p>
&lt;p>The key is what happens after discovery. Once you understand the problem, go back and write the tests. Codify what you learned. The pragmatic detour doesn’t mean abandoning the ideal; it means reaching it through a different path.&lt;/p>
&lt;p>As I discussed in &lt;a href="/blog/tdd-vs-bdd/">TDD vs BDD&lt;/a>, the power of TDD is its feedback loop. But a feedback loop requires knowing what feedback you’re looking for. When you’re still figuring that out, forcing the loop can slow you down more than it helps.&lt;/p>
&lt;/div>
&lt;/details>
&lt;p>The mistake isn’t choosing test-first or test-last. The mistake is making it a religious decision instead of a contextual one. The idealist says &lt;em>“always test first.”&lt;/em> The pragmatist says &lt;em>“test when it makes sense.”&lt;/em> I say: test first when I can, test after when I must, but always test.&lt;/p>
&lt;blockquote>
&lt;p>TDD is a compass, not a cage. Follow it when you can see the path. When you can’t, find the path first and mark it after.&lt;/p>
&lt;/blockquote>
&lt;h2 id="pair-programming-the-ideal-and-the-overhead">Pair programming: the ideal and the overhead
&lt;a class="heading-anchor" href="#pair-programming-the-ideal-and-the-overhead" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>&lt;a href="/blog/effective-pair-programming/">Effective pair programming&lt;/a> is one of the best practices a team can adopt. Two people, one problem, continuous code review. Knowledge spreads, design improves, blind spots shrink.&lt;/p>
&lt;p>That’s the ideal. And in many contexts, it’s the right call.&lt;/p>
&lt;p>But pairing has a cost. It demands synchronous time, shared focus, and compatible energy levels. In a distributed team across time zones, finding overlap windows is already hard. Filling those windows with pairing sessions leaves little room for deep individual work. Some problems benefit from one person going deep for three hours, not two people going medium-deep for six.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Pairing patterns and their trade-offs&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>There are multiple pairing patterns: Driver-Navigator, Ping-Pong, Tourist Guide. Each fits different contexts.&lt;/p>
&lt;p>The anti-patterns matter too. The Silent Partner who lets the other person do all the work. The Dictator who won’t let go of the keyboard. The Philosophical Pair who spends the entire session debating naming conventions instead of writing code.&lt;/p>
&lt;p>Pairing works best when both people are engaged, the problem benefits from two perspectives, and the session has a clear scope. When any of those conditions is missing, pairing becomes a ritual instead of a practice. And rituals without purpose are just overhead.&lt;/p>
&lt;p>&lt;a href="/blog/pull-request-vs-pair-prog/">Pull requests and pair programming&lt;/a> aren’t mutually exclusive. They serve different needs. Sometimes asynchronous review is enough. Sometimes you need the real-time back-and-forth. The pragmatic choice depends on the problem, the people, and the moment.&lt;/p>
&lt;/div>
&lt;/details>
&lt;blockquote>
&lt;p>The goal of pairing isn’t to pair. It’s to build shared understanding and catch mistakes early. If another approach achieves that in your context, use it.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;img src="/images/blog/2026-03-01/middle.webp" alt="blog-middle" />&lt;/p>
&lt;h2 id="ai-from-skeptic-to-squad-leader">AI: from skeptic to squad leader
&lt;a class="heading-anchor" href="#ai-from-skeptic-to-squad-leader" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>A year ago, I was skeptical about AI coding assistants. My concern: an AI that doesn’t understand architecture, doesn’t care about maintainability, and optimizes for speed over quality will produce code that looks impressive and decays fast. I wrote about this in &lt;a href="/blog/ai-gives-you-speed-not-quality/">AI gives you speed, not quality&lt;/a>, and I stand by the core message.&lt;/p>
&lt;p>My concern didn’t change. What changed is how I use them, and what they’re capable of now.&lt;/p>
&lt;h3 id="the-resistance">The resistance
&lt;a class="heading-anchor" href="#the-resistance" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The reactions from other engineers surprise me more than the technology. Fear, skepticism, flat-out rejection. I get it. I was there. Something you spent years mastering suddenly has a machine doing parts of it. That feels personal. But holding on to how things were doesn’t protect the craft. It just delays your own growth.&lt;/p>
&lt;h3 id="a-team-not-an-assistant">A team, not an assistant
&lt;a class="heading-anchor" href="#a-team-not-an-assistant" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Most engineers treat AI agents like autocomplete on steroids. One assistant, one chat, one stream of generated code. I started treating them like a team. Not one chatty assistant. An actual squad. One thinks architecture. One writes the first draft. One reviews and spots bugs. One writes tests. When they &lt;a href="/blog/build-your-own-team-of-agents/">collaborate&lt;/a>, the output isn’t just faster. It’s structurally better.&lt;/p>
&lt;p>Speed is the easy part, and everyone’s obsessing over it. AI can spit out a ton of code in seconds. It still doesn’t care about readability, edge cases, or what the codebase looks like in six months. You’re still the one who has to own it, understand it, and feel good pushing it live.&lt;/p>
&lt;p>I used to think AI couldn’t write clean code. Then I tried it on my terms: &lt;a href="/blog/mcp-giving-your-ai-agent-the-right-context/">proper context&lt;/a>, rules, conventions, specialized roles, quality gates. With the right setup, AI can write genuinely good code. Sometimes it needs a few iterations, but so do we.&lt;/p>
&lt;p>The difference is that AI gets there faster, and it doesn’t get tired between iterations. Given good context and clear constraints, the results have been better than I expected. Often better than what I’d produce solo under time pressure.&lt;/p>
&lt;p>But none of this works if you don’t know what good architecture looks like. You have to have read the books, experimented, failed, learned. You need to understand what high and low level design decisions mean for your project. AI amplifies whatever you bring to the table. If you bring solid foundations, you get solid output. If you don’t, you get confident-looking garbage that you won’t even recognize as garbage.&lt;/p>
&lt;p>We are still the ones responsible for keeping the system in good shape. AI helps us get there. But only if we hold up our end.&lt;/p>
&lt;h3 id="where-idealism-meets-ai">Where idealism meets AI
&lt;a class="heading-anchor" href="#where-idealism-meets-ai" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>AI made me more idealistic, not less. The practices I described earlier, TDD and pair programming, used to compete with deadlines. Now they don’t have to.&lt;/p>
&lt;p>I like to practice TDD, but recently I experimented with a dedicated agent to help me with tests, and it’s surprisingly good. A &lt;a href="/blog/build-your-own-team-of-agents/">TDD coach&lt;/a> that guides the red-green-refactor cycle. An explorer that reads the codebase before I touch it. A clean code reviewer, a domain architect, a React reviewer, a docs maintainer. Each one specialized, each one supporting my way of thinking and my flow. If new logic gets added without coverage, the TDD agent catches it. 100% code coverage used to be the kind of goal you’d set in a retro and quietly abandon by sprint three. With a dedicated agent enforcing it, it’s just how the project works.&lt;/p>
&lt;p>I still practice pair programming with real people for complex topics. The human back-and-forth has depth that AI doesn’t reach, especially when you’re navigating trade-offs that require experience and judgment. But on the daily basis, I always have a pair buddy agent with me. I bounce ideas off it, challenge an approach, talk through edge cases, explore a design before committing to it. It supports my thoughts, speeds up the progress, and keeps the quality bar where I want it.&lt;/p>
&lt;p>The pragmatist in me used to drop TDD when deadlines got tight. The pragmatist in me with the right AI setup keeps it running.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: My setup&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>I use Claude for everything. Claude Code with Opus or Sonnet as the agentic coder: full development workflows, reading the codebase, following conventions, running tests, creating PRs. Claude app and Claude as a coworker for the chat side: brainstorming, architecture discussions, explaining code, drafting documentation. For inline assistance, the plugins I already have in my IDE are enough. I tried Copilot and Cursor, they’re not for me. Claude covers what I need.&lt;/p>
&lt;p>Different modes for different tasks. An agentic assistant following my TDD commands is a different workflow from chatting about design patterns. Both are useful. Neither replaces the other.&lt;/p>
&lt;p>The market right now is intense. Claude, Codex, Gemini and others are strong players with similar products, and they’re all getting better on a monthly basis. The results are impressive and only accelerating. That’s the beauty of competition: it forces everyone to improve or become irrelevant, and the consumer wins either way. As of today, Claude Code seems to be the strongest option for how I work. But I have no loyalty to a brand. If Anthropic stopped pushing forward and a competitor became clearly better, I’d switch without hesitation. What matters is the capability, not the logo.&lt;/p>
&lt;/div>
&lt;/details>
&lt;blockquote>
&lt;p>I was wrong about AI in the way that idealists are often wrong: I measured the tool against the ideal outcome and found it lacking, instead of measuring it against the realistic alternative.&lt;/p>
&lt;/blockquote>
&lt;p>The alternative to AI-assisted development isn’t a team of senior architects writing perfect code. It’s the same team writing the same imperfect code, just slower.&lt;/p>
&lt;p>The engineers who learn to lead agents instead of racing against them will have a real advantage. And this is still early.&lt;/p>
&lt;blockquote>
&lt;p>The question was never &lt;em>“can AI write perfect code?”&lt;/em> It was &lt;em>“can I lead AI to write better code, faster?”&lt;/em> And the answer, with the right setup, is yes.&lt;/p>
&lt;/blockquote>
&lt;h2 id="the-whole-game">The whole game
&lt;a class="heading-anchor" href="#the-whole-game" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Every practice in this post follows the same pattern. The ideal version exists in books. The pragmatic version exists in your codebase under pressure. You need both.&lt;/p>
&lt;blockquote>
&lt;p>Next time you’re shipping that 11pm fix, you’ll know which corners you cut and why. That’s the whole game. Not perfection. Not speed. Knowing which one should lead.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;img src="/images/blog/2026-03-01/footer.webp" alt="blog-footer" />&lt;/p></content></entry><entry xml:lang="en"><title>Build Your Own Team of Agents</title><subtitle>From solo assistant to coordinated workforce</subtitle><category term="ai" scheme="https://chemaclass.com/tags/ai/" label="Ai"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="craftsmanship" scheme="https://chemaclass.com/tags/craftsmanship/" label="Craftsmanship"/><category term="leadership" scheme="https://chemaclass.com/tags/leadership/" label="Leadership"/><published>2026-02-07T00:00:00+00:00</published><updated>2026-02-07T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/build-your-own-team-of-agents/"/><id>https://chemaclass.com/blog/build-your-own-team-of-agents/</id><summary type="html">Stop using AI as a single assistant. Organize agents into specialized teams with roles, docs, and parallel execution for real leverage.</summary><content type="html">&lt;p>Most people use AI coding assistants as a single conversation partner. You open a chat, describe what you need, and get an answer. It works. But it’s like hiring one generalist to handle everything: frontend, backend, testing, documentation, deployment. No real team works that way.&lt;/p>
&lt;p>The real leverage comes when you organize AI as a team: onboarding, standard procedures, specialists, and parallel execution.&lt;/p>
&lt;p>In the &lt;a href="/blog/mcp-giving-your-ai-agent-the-right-context/">MCP post&lt;/a>, I covered how to give your AI agent access to your environment. In &lt;a href="/blog/ai-gives-you-speed-not-quality/">AI gives you speed, not quality&lt;/a>, why human judgment still matters. This post covers the missing piece: how to organize that access into a coordinated workflow.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="the-onboarding-doc">The onboarding doc
&lt;a class="heading-anchor" href="#the-onboarding-doc" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Every good team starts with onboarding. AI agents need the same.&lt;/p>
&lt;h3 id="project-rules">Project rules
&lt;a class="heading-anchor" href="#project-rules" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>In Claude Code, the &lt;code>CLAUDE.md&lt;/code> file at the root of your project is the onboarding doc. The agent reads it every time it starts working: project structure, coding conventions, style guides, tool configurations.&lt;/p>
&lt;p>But &lt;code>CLAUDE.md&lt;/code> is just the entry point. You can split rules into focused files under &lt;code>.claude/rules/&lt;/code>, each targeting specific parts of your codebase via glob patterns. The agent doesn’t just know your conventions, it’s constrained by them. Layer boundaries, naming patterns, dependency directions. All versioned alongside the code they protect. And since &lt;code>.claude/&lt;/code> lives in the repo, every human teammate gets the same setup when they join the project.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Glob-targeted rules in practice&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;ul>
&lt;li>&lt;strong>&lt;code>modules/*/Domain/**/*.php&lt;/code>&lt;/strong>: No framework imports, no infrastructure dependencies, only plain PHP.&lt;/li>
&lt;li>&lt;strong>&lt;code>modules/*/Infrastructure/**/*.php&lt;/code>&lt;/strong>: Controllers stay thin, Eloquent models stay in their place.&lt;/li>
&lt;li>&lt;strong>&lt;code>resources/js/**/*.tsx&lt;/code>&lt;/strong>: Component conventions, TypeScript strictness, styling patterns.&lt;/li>
&lt;/ul>
&lt;p>Each rule file is scoped to the files it cares about. Domain rules don’t fire when editing a controller.&lt;/p>
&lt;/div>
&lt;/details>
&lt;h3 id="personal-preferences">Personal preferences
&lt;a class="heading-anchor" href="#personal-preferences" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>There’s also a global &lt;code>~/.claude/CLAUDE.md&lt;/code> that applies across all your projects. Commit message conventions, communication style, formatting habits. The project file says &lt;em>how this codebase works&lt;/em>. The global file says &lt;em>how I work&lt;/em>.&lt;/p>
&lt;blockquote>
&lt;p>A well-written CLAUDE.md is like a good onboarding doc. The better it is, the less you repeat yourself.&lt;/p>
&lt;/blockquote>
&lt;h2 id="standard-operating-procedures">Standard operating procedures
&lt;a class="heading-anchor" href="#standard-operating-procedures" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Every team has recurring workflows that live in wikis, runbooks, or someone’s head. When they live in someone’s head, they’re fragile.&lt;/p>
&lt;p>Custom slash commands in &lt;code>.claude/commands/&lt;/code> turn these workflows into executable instructions. Each command is a markdown file describing a multi-step procedure. In one of my projects, every creation command starts with tests. TDD is baked into the procedure, not left to discipline.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Commands from a real project&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>&lt;strong>Creation (TDD-first):&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>/create-module&lt;/code>&lt;/strong>: Scaffolds a hexagonal module with domain, application, and infrastructure layers.&lt;/li>
&lt;li>&lt;strong>&lt;code>/create-entity&lt;/code>&lt;/strong>: Domain entities with value objects and test files.&lt;/li>
&lt;li>&lt;strong>&lt;code>/create-use-case&lt;/code>&lt;/strong>: Command/query handlers with mocked tests.&lt;/li>
&lt;li>&lt;strong>&lt;code>/create-page&lt;/code>&lt;/strong>: React pages with factories and smoke tests.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Quality &amp;amp; workflow:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>/refactor-check&lt;/code>&lt;/strong>: Analyzes code against SOLID principles.&lt;/li>
&lt;li>&lt;strong>&lt;code>/test&lt;/code>&lt;/strong>: Runs the suite with module filtering.&lt;/li>
&lt;li>&lt;strong>&lt;code>/fix&lt;/code>&lt;/strong>: Auto-applies linting and static analysis corrections.&lt;/li>
&lt;li>&lt;strong>&lt;code>/gh-issue&lt;/code>&lt;/strong>: From GitHub issue to implementation to PR in one command.&lt;/li>
&lt;/ul>
&lt;/div>
&lt;/details>
&lt;p>The key insight: commands turn tribal knowledge into executable instructions. What used to be “ask Sarah how we set up a new module” becomes a command anyone can run, human or agent.&lt;/p>
&lt;h2 id="specialists-not-generalists">Specialists, not generalists
&lt;a class="heading-anchor" href="#specialists-not-generalists" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Commands are &lt;em>your&lt;/em> procedures. They encode how your team does things. But there’s another layer: skills and agents.&lt;/p>
&lt;h3 id="skills-as-knowledge-bases">Skills as knowledge bases
&lt;a class="heading-anchor" href="#skills-as-knowledge-bases" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Skills are structured knowledge the agent can draw from. In one of my projects, I have skills for SOLID principles, hexagonal architecture, TDD workflows, and React/Inertia patterns.&lt;/p>
&lt;p>Rules constrain: “don’t do this, always do that.” Skills teach: “here’s the pattern, here’s why, here are the common mistakes.” Rules are guardrails. Skills are expertise.&lt;/p>
&lt;h3 id="agents-as-specialized-roles">Agents as specialized roles
&lt;a class="heading-anchor" href="#agents-as-specialized-roles" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Instead of one generalist, you define specialized agents with a clear role, specific tools, and even a different model based on the complexity of their job. You don’t need your most senior architect to rename a variable.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Agent roles from a real project&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;ul>
&lt;li>&lt;strong>Explorer&lt;/strong> (lightweight model): Read-only reconnaissance. Searches the codebase, finds files, understands structure. Access to read and search tools, nothing else.&lt;/li>
&lt;li>&lt;strong>Clean code reviewer&lt;/strong> (mid-tier model): Checks for SOLID violations, code smells, and naming inconsistencies. Read and grep access only.&lt;/li>
&lt;li>&lt;strong>TDD coach&lt;/strong> (mid-tier model): Guides the red-green-refactor cycle. Can edit files and run tests.&lt;/li>
&lt;li>&lt;strong>React reviewer&lt;/strong> (mid-tier model): Frontend patterns: component structure, TypeScript strictness, dark mode support, accessibility.&lt;/li>
&lt;li>&lt;strong>Domain architect&lt;/strong> (most capable model): Complex architectural decisions, module boundaries, and DDD patterns.&lt;/li>
&lt;/ul>
&lt;/div>
&lt;/details>
&lt;blockquote>
&lt;p>The right model for the right job. Fast and cheap for exploration. Capable and thorough for architecture.&lt;/p>
&lt;/blockquote>
&lt;h2 id="let-them-work-together">Let them work together
&lt;a class="heading-anchor" href="#let-them-work-together" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>This is where the team metaphor becomes literal. A single agent following instructions is useful. Multiple agents working from a shared plan is a team.&lt;/p>
&lt;h3 id="subagents-vs-agent-teams">Subagents vs agent teams
&lt;a class="heading-anchor" href="#subagents-vs-agent-teams" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Not all multi-agent setups are the same. There are two distinct coordination models, and choosing the right one matters.&lt;/p>
&lt;p>&lt;strong>Subagents&lt;/strong> run within a single session. They do focused work and report results back to the main agent. They can’t talk to each other. The main agent manages everything.&lt;/p>
&lt;p>&lt;strong>Agent teams&lt;/strong> are different. Each teammate is a fully independent Claude Code session with its own context window. They communicate through a shared mailbox, claim tasks from a shared task list, and coordinate without going through a central bottleneck.&lt;/p>
&lt;p>The architecture has four components:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Team lead&lt;/strong>: the main session that creates the team and orchestrates work&lt;/li>
&lt;li>&lt;strong>Teammates&lt;/strong>: separate Claude Code instances, each owning specific tasks&lt;/li>
&lt;li>&lt;strong>Task list&lt;/strong>: shared work items with dependency tracking. Blocked tasks automatically unblock when dependencies complete&lt;/li>
&lt;li>&lt;strong>Mailbox&lt;/strong>: direct messaging between agents, including broadcasts to the entire team&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>Subagents are workers that report back. Agent teams are collaborators that think together.&lt;/p>
&lt;/blockquote>
&lt;p>Use subagents when only the result matters. Use agent teams when teammates need to share findings, challenge each other, and coordinate on their own.&lt;/p>
&lt;h3 id="getting-started-with-agent-teams">Getting started with agent teams
&lt;a class="heading-anchor" href="#getting-started-with-agent-teams" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Agent teams are still experimental. Enable them by adding this to &lt;code>~/.claude/settings.json&lt;/code>:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="json">&lt;span class="giallo-l">&lt;span>{&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">env&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span> {&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">&amp;quot;&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">1&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span> }&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Creating a team is conversational. Describe what you want: &lt;em>“Create an agent team to refactor the auth module. Spawn three teammates: one for backend API changes, one for frontend components, one for writing tests.”&lt;/em> Claude sets up the task list, spawns the teammates, and coordinates their work.&lt;/p>
&lt;p>You can view the team in-process (single terminal, navigate with Shift+Up/Down) or split across panes (each teammate in a separate tmux or iTerm2 window). Use Shift+Tab to activate delegate mode, which restricts the lead to coordination only.&lt;/p>
&lt;p>&lt;strong>Token consumption warning.&lt;/strong> Agent teams burn through tokens fast. Each teammate has its own context window, and every message between agents adds up. Start with research and review tasks before moving to implementation. Three teammates exploring in parallel costs roughly 3x. Make sure the parallelism pays for itself.&lt;/p>
&lt;p>Teammates load your project context automatically (&lt;code>CLAUDE.md&lt;/code>, MCP servers, skills) but don’t inherit the lead’s conversation history. When spawning a teammate, be specific about which files to focus on and what constraints apply. A vague spawn prompt produces vague work.&lt;/p>
&lt;p>&lt;img src="/images/blog/2026-02-07/middle.webp" alt="blog-middle" />&lt;/p>
&lt;h3 id="plan-first-execute-after">Plan first, execute after
&lt;a class="heading-anchor" href="#plan-first-execute-after" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Good teams don’t just start coding. They discuss the approach, identify dependencies, agree on a plan. Claude Code’s plan mode works the same way.&lt;/p>
&lt;p>You describe the problem. The agent explores the codebase, maps dependencies, and proposes an approach before changing anything. You approve, modify, or reject. Think first, code second.&lt;/p>
&lt;p>With agent teams, &lt;strong>plan approval&lt;/strong> lets you require teammates to design their approach before implementing. The teammate works in read-only mode until the lead approves. You can shape the lead’s criteria: &lt;em>“only approve plans that include test coverage”&lt;/em> or &lt;em>“reject plans that modify the database schema.”&lt;/em>&lt;/p>
&lt;p>&lt;strong>Delegate mode&lt;/strong> restricts the lead to coordination only. Without it, the lead sometimes starts implementing instead of waiting for teammates. Delegate mode keeps it focused on orchestration, not execution.&lt;/p>
&lt;h3 id="competing-hypotheses">Competing hypotheses
&lt;a class="heading-anchor" href="#competing-hypotheses" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>This is the most compelling agent-team pattern for debugging. When the root cause is unclear, a single agent tends to find one plausible explanation and stop looking. Agent teams fight this by making teammates adversarial. Each one investigates its own theory while actively trying to disprove the others.&lt;/p>
&lt;p>Sequential investigation suffers from anchoring: once one theory is explored, subsequent investigation is biased toward it. With multiple independent investigators challenging each other, the theory that survives is much more likely to be the actual root cause.&lt;/p>
&lt;h3 id="size-tasks-for-parallel-work">Size tasks for parallel work
&lt;a class="heading-anchor" href="#size-tasks-for-parallel-work" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Not all work benefits from parallelism. The key question: can the teammates work independently?&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Too small&lt;/strong>: coordination overhead exceeds the benefit&lt;/li>
&lt;li>&lt;strong>Too large&lt;/strong>: teammates work too long without check-ins, increasing wasted effort&lt;/li>
&lt;li>&lt;strong>Just right&lt;/strong>: self-contained units that produce a clear deliverable. A function, a test file, a review&lt;/li>
&lt;/ul>
&lt;p>Having 5-6 tasks per teammate keeps everyone productive. Break the work so each teammate owns a different set of files. Without isolation, two teammates editing the same file leads to overwrites. Worktrees change this.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Backend + Frontend in parallel&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>Say you’re building a new feature that touches both backend and frontend. After planning:&lt;/p>
&lt;ul>
&lt;li>A &lt;strong>backend agent&lt;/strong> scaffolds the domain layer: entities, value objects, repository interfaces, use case handlers. All following hexagonal architecture, all test-first.&lt;/li>
&lt;li>A &lt;strong>frontend agent&lt;/strong> builds the React page, components, hooks, and factories. Each follows its own rules, draws from its own skills, and operates independently.&lt;/li>
&lt;/ul>
&lt;p>They don’t step on each other because the plan already defined the boundaries. Clear ownership. No merge conflicts. No waiting.&lt;/p>
&lt;/div>
&lt;/details>
&lt;h3 id="worktree-isolation">Worktree isolation
&lt;a class="heading-anchor" href="#worktree-isolation" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The biggest friction with parallel agents was file conflicts. Two agents editing the same file meant overwrites and lost work. Git worktrees eliminate this by giving each agent its own working copy of the repository.&lt;/p>
&lt;p>Start Claude Code with &lt;code>--worktree&lt;/code> to run in an isolated worktree. Multiple sessions, same repo, no clobbering. Add &lt;code>--tmux&lt;/code> to launch it in its own tmux session.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">claude&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-worktree&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-tmux&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Subagents support worktrees too. Ask Claude to use worktrees for its agents, or set &lt;code>isolation: worktree&lt;/code> in your custom agent frontmatter to make it the default.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="yaml">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">---&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#22863A, #85E89D);">i&lt;/span>&lt;span style="color: light-dark(#22863A, #85E89D);">solation&lt;/span>&lt;span>:&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> w&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">orktree&lt;/span>&lt;/span>
&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">---&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>The Desktop app has the same feature: enable worktree mode in the Code tab.&lt;/p>
&lt;p>For non-git source control (Mercurial, Perforce, SVN), define worktree hooks to get the same isolation benefits without switching to git.&lt;/p>
&lt;blockquote>
&lt;p>Worktrees turn “clear file ownership” from a planning constraint into an infrastructure guarantee. Agents can overlap on the same files without stepping on each other.&lt;/p>
&lt;/blockquote>
&lt;h3 id="review-after-execution">Review after execution
&lt;a class="heading-anchor" href="#review-after-execution" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>After implementation, review agents take over. Instead of one reviewer catching everything, you have specialists: SOLID violations, component patterns, test quality, module boundaries.&lt;/p>
&lt;blockquote>
&lt;p>A single agent is an assistant. Multiple agents working from a shared plan is a team.&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-still-the-lead">You are still the lead
&lt;a class="heading-anchor" href="#you-are-still-the-lead" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>No matter how well configured, the agents work for you. You set the standards, write the rules, review the plans, and approve the output before it ships. You can message any teammate mid-work to redirect their approach or add constraints. If someone’s heading down the wrong path, you intervene directly.&lt;/p>
&lt;p>As I wrote in &lt;a href="/blog/ai-gives-you-speed-not-quality/">AI gives you speed, not quality&lt;/a>, the code the agent produces is your responsibility. Agents still make mistakes, context windows have limits, and coordination isn’t perfect. More parallelism without oversight is just more chaos, faster.&lt;/p>
&lt;h3 id="quality-gates">Quality gates
&lt;a class="heading-anchor" href="#quality-gates" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Hooks and git hooks act as the final safety net. In my setup, nothing gets committed unless the full suite is green and coverage is above 90%. The agent doesn’t get to skip this. Neither does anyone else.&lt;/p>
&lt;p>Agent teams add their own hooks: &lt;code>TeammateIdle&lt;/code> keeps idle teammates working, &lt;code>TaskCompleted&lt;/code> prevents premature task completion. Automated policies no team member can bypass.&lt;/p>
&lt;details class="deep-dive">
&lt;summary class="deep-dive__header">
&lt;span class="deep-dive__icon">&lt;/span>
&lt;span class="deep-dive__title">Deep Dive: Hooks, permissions, and guardrails&lt;/span>
&lt;/summary>
&lt;div class="deep-dive__content">
&lt;p>Git hooks run linters, static analysis, and tests before every commit. Claude Code adds its own hooks (&lt;code>.claude/hooks/&lt;/code>): shell commands that trigger on agent events like tool calls or file writes.&lt;/p>
&lt;p>&lt;code>.claude/settings.json&lt;/code> controls what agents can execute. Whitelist specific tools and commands, deny destructive operations. You control not just what agents know (rules, skills) but what they can do (permissions). Rules set the culture. Permissions set the boundaries.&lt;/p>
&lt;/div>
&lt;/details>
&lt;h3 id="the-foundation-matters">The foundation matters
&lt;a class="heading-anchor" href="#the-foundation-matters" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The agents will help you get there faster, but “there” has to be well-defined. If you don’t know what hexagonal architecture looks like, agents won’t discover it for you.&lt;/p>
&lt;p>You don’t build all of this on day one. You start with a &lt;code>CLAUDE.md&lt;/code>. Then you notice you’re repeating instructions, so you write a command. An agent breaks a convention, so you add a rule. Reviews take too long, so you create a reviewer agent. The setup grows organically from real friction, not from upfront design. Each addition solves a problem you actually had. Same with agent teams: start with tasks that don’t require writing code. Review a PR from multiple angles, research a library, investigate a bug. Learn the coordination model before throwing parallel implementation at it.&lt;/p>
&lt;p>If you want a starting point, I put together &lt;a rel="external" href="https://github.com/Chemaclass/laravel-claude-toolkit">laravel-claude-toolkit&lt;/a>: a Laravel starter kit with rules, commands, skills, agents, hooks, and permissions already configured. Use it as a reference or fork it for your own setup.&lt;/p>
&lt;blockquote>
&lt;p>You’re not just using AI. You’re building a team. And like any team, the quality of its output reflects the quality of its leadership.&lt;/p>
&lt;/blockquote>
&lt;h2 id="resources">Resources
&lt;a class="heading-anchor" href="#resources" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;a rel="external" href="https://claude.com/product/claude-code">Claude Code&lt;/a> | claude.com&lt;/li>
&lt;li>&lt;a rel="external" href="https://code.claude.com/docs/en/agent-teams">Claude Code: Agent Teams&lt;/a> | claude.com&lt;/li>
&lt;li>&lt;a rel="external" href="https://rfrolov.me/en/blog/claude-code-tips">Claude Code Tips: Workflow Boosters&lt;/a> | rfrolov.me&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="/images/blog/2026-02-07/footer.webp" alt="blog-footer" />&lt;/p></content></entry><entry xml:lang="en"><title>Programmable Money</title><subtitle>The power of Bitcoin's Script</subtitle><category term="bitcoin" scheme="https://chemaclass.com/tags/bitcoin/" label="Bitcoin"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="cryptography" scheme="https://chemaclass.com/tags/cryptography/" label="Cryptography"/><category term="security" scheme="https://chemaclass.com/tags/security/" label="Security"/><published>2024-07-06T00:00:00+00:00</published><updated>2024-07-06T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/blog/programmable-money/"/><id>https://chemaclass.com/blog/programmable-money/</id><summary type="html">Bitcoin is often referred to as programmable money because it allows for the execution of programmable transactions through its scripting language, leveraging each bit for precision and functionality.</summary><content type="html">&lt;p>Bitcoin is often referred to as “programmable money” because it allows for the execution of programmable transactions through its scripting language.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="understanding-programmable-money">Understanding Programmable Money
&lt;a class="heading-anchor" href="#understanding-programmable-money" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Programmable money is the ability to embed logic and conditions into financial transactions. This programmability allows transactions to be executed automatically based on predefined rules without intermediaries or manual intervention. It transforms money from a static medium of exchange into a dynamic tool capable of executing complex agreements and automating financial operations.&lt;/p>
&lt;h2 id="the-script-language">The Script Language
&lt;a class="heading-anchor" href="#the-script-language" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Bitcoin’s programmability is powered by its built-in scripting language, &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script">&lt;strong>Script&lt;/strong>&lt;/a>. Unlike traditional programming languages, Script is a stack-based, Forth-like language explicitly designed for Bitcoin transactions.&lt;/p>
&lt;p>It supports multi-signature, time-locked, and other conditional transfers that can be programmed into Bitcoin transactions. It is intentionally not Turing-complete, without loops.&lt;/p>
&lt;p>This video includes examples of the most commonly used locking/unlocking scripts.&lt;/p>
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/6Fa04MnURhw"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;h2 id="key-features-of-bitcoin-s-script">Key Features of Bitcoin’s Script
&lt;a class="heading-anchor" href="#key-features-of-bitcoin-s-script" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="stack-based-execution">Stack-Based Execution
&lt;a class="heading-anchor" href="#stack-based-execution" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Script operates on a stack-based execution model where commands and data are pushed onto a stack and processed in a Last-In-First-Out (&lt;a rel="external" href="https://en.wikipedia.org/wiki/Stack_(abstract_data_type)">LIFO&lt;/a>) manner.&lt;/p>
&lt;h3 id="conditional-spending">Conditional Spending
&lt;a class="heading-anchor" href="#conditional-spending" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>A transaction that can only be spent if certain data is provided or specific criteria are met. This can be used for:&lt;/p>
&lt;ul>
&lt;li>escrow services&lt;/li>
&lt;li>atomic swaps&lt;/li>
&lt;li>and other complex financial arrangements&lt;/li>
&lt;/ul>
&lt;h3 id="multisignature">Multisignature
&lt;a class="heading-anchor" href="#multisignature" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Transactions can be set up to require multiple signatures from different private keys before they can be spent. Useful for:&lt;/p>
&lt;ul>
&lt;li>joint accounts&lt;/li>
&lt;li>corporate funds&lt;/li>
&lt;li>and enhancing security, as no single party can unilaterally spend the funds&lt;/li>
&lt;/ul>
&lt;h3 id="timelocking">Timelocking
&lt;a class="heading-anchor" href="#timelocking" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Transactions can include time-based conditions that prevent them from being spent until a certain time or block height is reached. This feature is useful for various purposes:&lt;/p>
&lt;ul>
&lt;li>delayed payments&lt;/li>
&lt;li>smart contracts&lt;/li>
&lt;li>and ensuring that funds are not spent prematurely (eg: with &lt;a rel="external" href="https://en.bitcoin.it/wiki/Lightning_Network">Lightning Network&lt;/a>)&lt;/li>
&lt;/ul>
&lt;h3 id="operation-codes">Operation Codes
&lt;a class="heading-anchor" href="#operation-codes" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Bitcoin’s Script performs specific operations within transactions with its &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script#Opcodes">OP_Codes&lt;/a>. Here are some of them:&lt;/p>
&lt;ul>
&lt;li>&lt;code>OP_DUP&lt;/code>: &lt;small>Duplicates the top stack item.&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_HASH160&lt;/code>: &lt;small>Hashes the top stack item twice (SHA-256 followed by RIPEMD-160).&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_EQUALVERIFY&lt;/code>: &lt;small>Verifies that the top two items are equal and removes them.&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_CHECKSIG&lt;/code>: &lt;small>Verifies a signature against a public key.&lt;/small>&lt;/li>
&lt;li>&lt;a rel="external" href="https://en.bitcoin.it/wiki/OP_RETURN">&lt;code>OP_RETURN&lt;/code>&lt;/a>: &lt;small>Marks the transaction output as invalid, often used to store data.&lt;/small>&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h2 id="common-bitcoin-address-types">Common Bitcoin address types
&lt;a class="heading-anchor" href="#common-bitcoin-address-types" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>In Bitcoin, different address types correspond to various ways to script transactions. Here, we’ll explore examples of Bitcoin Script for each major address type. Each address type has its own specific script format.&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2pk-pay-to-pubkey-earliest-legacy-address-up">&lt;strong>P2PK&lt;/strong>&lt;/a>: Earliest legacy transactions using full public keys directly.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2pkh-pay-to-pubkey-hash-legacy-address-up">&lt;strong>P2PKH&lt;/strong>&lt;/a>: Begins with &lt;code>1&lt;/code>. &lt;strong>Legacy&lt;/strong> transactions using public key hashes.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2sh-pay-to-script-hash-up">&lt;strong>P2SH&lt;/strong>&lt;/a>: Begins with &lt;code>3&lt;/code>. &lt;strong>Legacy&lt;/strong>, encapsulates complex scripts like multisig.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2ms-pay-to-multisig-up">&lt;strong>P2MS&lt;/strong>&lt;/a>: It is typically a type of P2SH or P2WSH address.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2wpkh-pay-to-witness-public-key-hash-segwit-up">&lt;strong>P2WPKH&lt;/strong>&lt;/a>: Begins with &lt;code>bc1&lt;/code>. Native &lt;strong>SegWit&lt;/strong>, more efficient transactions.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2wsh-pay-to-witness-script-hash-segwit-up">&lt;strong>P2WSH&lt;/strong>&lt;/a>: Begins with &lt;code>bc1&lt;/code>. &lt;strong>SegWit&lt;/strong> for complex scripts.&lt;/li>
&lt;li>&lt;a href="https://chemaclass.com/blog/programmable-money/#p2tr-pay-to-taproot-taproot-up">&lt;strong>P2TR&lt;/strong>&lt;/a>: Begins with &lt;code>bc1p&lt;/code>. SegWit &lt;strong>Taproot&lt;/strong> addresses, improving privacy and efficiency for complex transactions.&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>Using native SegWit (P2WPKH and P2WSH) is preferable when possible, as it maximizes the benefits of the SegWit upgrade, but P2SH-SegWit can be useful for compatibility with older systems.&lt;/p>
&lt;/blockquote>
&lt;h3 id="p2pk-pay-to-pubkey-earliest-legacy-address-up">P2PK (Pay-to-PubKey) - Earliest Legacy Address &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2pk-pay-to-pubkey-earliest-legacy-address-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with "1" (e.g., 1A1zP1eP5QGefi2DMPTf...v7DivfNa)
&lt;/div>
&lt;p>Before P2PKH and P2SH became standard, Bitcoin addresses were not as flexible or feature-rich. Here are some considerations:&lt;/p>
&lt;ul>
&lt;li>Addresses starting with 1 but without hashing the public key.&lt;/li>
&lt;li>Not common in modern practice due to lack of privacy and efficiency.&lt;/li>
&lt;li>The P2PK format is largely &lt;strong>obsolete&lt;/strong> in favor of (at very least) P2PKH.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2pkh-pay-to-pubkey-hash-legacy-address-up">P2PKH (Pay-to-PubKey-Hash) - Legacy Address &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2pkh-pay-to-pubkey-hash-legacy-address-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with "1" (e.g., 1A1zP1eP5QGefi2DMPTf...v7DivfNa)
&lt;/div>
&lt;p>A typical P2PKH script consists of two main parts:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>ScriptPubKey&lt;/strong>: The locking script (also known as the output script) that specifies how funds can be spent.&lt;/li>
&lt;li>&lt;strong>ScriptSig&lt;/strong>: The unlocking script (also known as the input script) that provides the necessary data to unlock the funds.&lt;/li>
&lt;/ol>
&lt;h3 id="scriptpubkey-locking-script">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_DUP&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_HASH160&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_EQUALVERIFY&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKSIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_DUP&lt;/code>: Duplicates the top stack item (the public key).&lt;/li>
&lt;li>&lt;code>OP_HASH160&lt;/code>: Hashes the public key with SHA-256 followed by RIPEMD-160.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubKHash&amp;gt;&lt;/code>: The hashed public key (a 20-byte value).&lt;/li>
&lt;li>&lt;code>OP_EQUALVERIFY&lt;/code>: Checks if the hashed public key matches the hash in the script.&lt;/li>
&lt;li>&lt;code>OP_CHECKSIG&lt;/code>: Verifies the provided signature against the public key.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptsig-unlocking-script">ScriptSig (Unlocking Script)
&lt;a class="heading-anchor" href="#scriptsig-unlocking-script" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: The digital signature generated by the private key.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: The public key corresponding to the address.&lt;/li>
&lt;/ul>
&lt;h3 id="execution-flow">Execution Flow
&lt;a class="heading-anchor" href="#execution-flow" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;ol>
&lt;li>The &lt;code>ScriptSig&lt;/code> (unlocking script) is pushed onto the stack.&lt;/li>
&lt;li>The &lt;code>ScriptPubKey&lt;/code> (locking script) is executed.&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc3_0703.png" alt="p2pkh script execution step 1" />
&lt;img src="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc3_0704.png" alt="p2pkh script execution step 2" />&lt;/p>
&lt;hr />
&lt;h3 id="p2sh-pay-to-script-hash-up">P2SH (Pay-to-Script-Hash) &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2sh-pay-to-script-hash-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with "3" (e.g., 3J2BtwzN2GEr6FCP.....81T2eiX8PVHh)
&lt;/div>
&lt;p>P2SH scripts are used for more complex scripts. The primary feature is that the address itself encodes a hash of a script, which will be used in the transaction.&lt;/p>
&lt;h3 id="scriptpubkey-locking-script-1">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_HASH160&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_EQUAL&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_HASH160&lt;/code>: Hashes the script with SHA-256 followed by RIPEMD-160.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptHash&amp;gt;&lt;/code>: The hashed script (a 20-byte value).&lt;/li>
&lt;li>&lt;code>OP_EQUAL&lt;/code>: Checks if the hash matches the provided script hash.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptsig-unlocking-script-1">ScriptSig (Unlocking Script)
&lt;a class="heading-anchor" href="#scriptsig-unlocking-script-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptSig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: The digital signature.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: The public key.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptSig&amp;gt;&lt;/code>: The actual script that matches the script hash, which itself will be executed by the Bitcoin network.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2ms-pay-to-multisig-up">P2MS (Pay-to-Multisig) &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2ms-pay-to-multisig-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;h3 id="script-format">Script Format
&lt;a class="heading-anchor" href="#script-format" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_M&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">M&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKN&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_N&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_M&lt;/code>: The minimum number of signatures required.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK1&amp;gt;, &amp;lt;PubK2&amp;gt;, ..., &amp;lt;PubKN&amp;gt;&lt;/code>: The public keys involved in the multisignature scheme.&lt;/li>
&lt;li>&lt;code>OP_N&lt;/code>: The total number of public keys provided.&lt;/li>
&lt;li>&lt;code>OP_CHECKMULTISIG&lt;/code>: The opcode that verifies the signatures against the provided public keys.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptpubkey-locking-script-2">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_3&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>This script means that any 2 out of 3 provided public keys are required to sign the transaction for it to be valid.&lt;/p>
&lt;h3 id="scriptsig-unlocking-script-2">ScriptSig (Unlocking Script)
&lt;a class="heading-anchor" href="#scriptsig-unlocking-script-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sigN&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">SerializedScript&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig1&amp;gt;, &amp;lt;sig2&amp;gt;, ..., &amp;lt;sigN&amp;gt;&lt;/code>: The public keys.&lt;/li>
&lt;li>&lt;code>&amp;lt;SerializedScript&amp;gt;&lt;/code>: The serialized script (the same as the locking script but without the &lt;code>OP_M&lt;/code> and &lt;code>OP_N&lt;/code>).&lt;/li>
&lt;/ul>
&lt;div class="status warning-orange">
&lt;b>NOTE&lt;/b>: There is an oddity in CHECKMULTISIG execution.
&lt;small>&lt;a href="#there-is-an-oddity-in-checkmultisig-execution-up">See note at the bottom.&lt;/a>&lt;/small>
&lt;/div>
&lt;hr />
&lt;h3 id="p2wpkh-pay-to-witness-public-key-hash-segwit-up">P2WPKH (Pay-to-Witness-Public-Key-Hash) - Segwit &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2wpkh-pay-to-witness-public-key-hash-segwit-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with "bc1q" (e.g., bc1qf0r2m0ck4psv6yrk9w.....kw8v5rj7ph3)
&lt;/div>
&lt;p>P2WPKH is a Segregated Witness (SegWit) address type that uses a different scripting format compared to legacy and P2SH addresses. Simplifies transactions by reducing data size and fees compared to legacy formats.&lt;/p>
&lt;h3 id="scriptpubkey-locking-script-3">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script-3" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_PUSHBYTES_20&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_0&lt;/code>: A single byte (0x00) indicating the version of the script.&lt;/li>
&lt;li>&lt;code>OP_PUSHBYTES_20&lt;/code>: Pushes 20 bytes (the public key hash) onto the stack.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubKHash&amp;gt;&lt;/code>: The 20-byte hash of the public key.&lt;/li>
&lt;/ul>
&lt;h3 id="witness-data">Witness Data
&lt;a class="heading-anchor" href="#witness-data" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>For P2WPKH, the unlocking script is not required in the traditional sense (i.e., inside the unlocking script explicitly included in the transaction input). Instead, the unlocking information is provided as part of the witness data in the SegWit transaction format.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: Digital signature for the transaction.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: Public key used to generate the public key hash.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2wsh-pay-to-witness-script-hash-segwit-up">P2WSH (Pay-to-Witness-Script-Hash) - Segwit &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2wsh-pay-to-witness-script-hash-segwit-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with bc1q (e.g.: bc1q4a3h5sdg4cfkhftgd24tj9g2sg...yj57jmfckhkrw5gslr9g59)
&lt;/div>
&lt;h3 id="scriptpubkey-locking-script-4">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script-4" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_PUSHBYTES_32&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_0&lt;/code>: Indicates a witness version 0 (SegWit).&lt;/li>
&lt;li>&lt;code>OP_PUSHBYTES_32&lt;/code>: Pushes the next 32 bytes (the script hash) onto the stack.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptHash&amp;gt;&lt;/code>: 32-byte hash of the redeem script.&lt;/li>
&lt;/ul>
&lt;h3 id="witness-data-1">Witness Data
&lt;a class="heading-anchor" href="#witness-data-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">RedeemScript&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig1&amp;gt;, &amp;lt;sig2&amp;gt;&lt;/code>: Signatures required to unlock the transaction.&lt;/li>
&lt;li>&lt;code>&amp;lt;RedeemScript&amp;gt;&lt;/code>: The actual script that matches the script hash. This script will be executed as part of the witness data.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2tr-pay-to-taproot-taproot-up">P2TR (Pay-to-Taproot) - Taproot &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#common-bitcoin-address-types">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2tr-pay-to-taproot-taproot-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Begins with bc1p (e.g.: bc1pl9dfv7kvj4hj9s3a8l.....gjstmrpjl09g8ks3ukds70q4r2j5h)
&lt;/div>
&lt;p>Taproot combines &lt;a rel="external" href="https://en.bitcoin.it/wiki/Schnorr">Schnorr&lt;/a> signatures with &lt;a rel="external" href="https://en.bitcoin.it/wiki/BIP_0114#Merkelized_Abstract_Syntax_Tree">MAST&lt;/a>, enabling private, efficient spending conditions and making complex transactions &lt;strong>&lt;em>appear standard&lt;/em>&lt;/strong> unless conditions are revealed. It allows the efficient execution of complex transactions while hiding their details.&lt;/p>
&lt;h3 id="scriptpubkey-locking-script-5">ScriptPubKey (Locking Script)
&lt;a class="heading-anchor" href="#scriptpubkey-locking-script-5" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">x&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">-&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">only&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_1&lt;/code>: Indicates a witness version 1 (Taproot).&lt;/li>
&lt;li>&lt;code>&amp;lt;x-only PubK&amp;gt;&lt;/code>: A 32-byte Schnorr public key (without the y-coordinate).&lt;/li>
&lt;/ul>
&lt;h3 id="witness-data-2">Witness Data
&lt;a class="heading-anchor" href="#witness-data-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: A Schnorr signature proving possession of the private key corresponding to the x-only pubkey.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/yU3Sr07Qnxg"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;hr />
&lt;h3 id="there-is-an-oddity-in-checkmultisig-execution-up">*There is an oddity in CHECKMULTISIG execution &lt;small>&lt;a href="https://chemaclass.com/blog/programmable-money/#scriptsig-unlocking-script-2">up&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#there-is-an-oddity-in-checkmultisig-execution-up" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>The implementation of &lt;code>OP_CHECKMULTISIG&lt;/code> pops one more item than it should. The extra item is disregarded when checking the signatures, so it has no direct effect on the OP itself. It must be present because if &lt;code>OP_CHECKMULTISIG&lt;/code> attempts to pop on an empty stack, it will cause a stack error and script failure.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> 2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> 3&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>The input script in this multisig is not &lt;code>&amp;lt;sig2&amp;gt; &amp;lt;sig3&amp;gt;&lt;/code> but &lt;code>OP_0 &amp;lt;sig2&amp;gt; &amp;lt;sig3&amp;gt;&lt;/code>.&lt;/p>
&lt;p>It became the custom early on to use &lt;code>OP_0&lt;/code>, which later became a relay policy rule and eventually a consensus rule (&lt;a rel="external" href="https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki">BIP147&lt;/a>).&lt;/p>
&lt;p>It is possible that the original developer added the extra element in the original version of Bitcoin, so they could add a feature for allowing a map to be passed in a later soft fork (for performance reasons). However, that feature was never implemented, and the BIP147 update to the consensus rules in 2017 makes it impossible to add that feature in the future.&lt;/p>
&lt;p>Only Bitcoin’s original developer could tell whether the dummy stack element was the result of a bug or a plan for a future upgrade. From now on, if you see a multisig script, you should expect to see an extra &lt;code>OP_O&lt;/code> in the beginning, whose only purpose is as a workaround to an oddity in the consensus rules.&lt;/p>
&lt;hr />
&lt;h2 id="follow-ups">Follow-ups
&lt;a class="heading-anchor" href="#follow-ups" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>Official docs of &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script">Script&lt;/a> in the Bitcoin Wiki.&lt;/li>
&lt;li>&lt;a rel="external" href="https://siminchen.github.io/bitcoinIDE/build/editor.html">Bitcoin IDE&lt;/a> is an online Bitcoin Script visual emulator. Great for learning purposes.&lt;/li>
&lt;li>&lt;a rel="external" href="https://coins.github.io/bitcoin-scripts/script-editor/">Script Editor&lt;/a> is product-driven research on Bitcoin scalability and usability.&lt;/li>
&lt;li>&lt;a rel="external" href="https://bitcoin.sipa.be/miniscript/">Miniscript&lt;/a> is a language for writing (a subset of) Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing, and more.&lt;/li>
&lt;/ul></content></entry><entry xml:lang="en"><title>7 languages in 7 weeks</title><subtitle>Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages</subtitle><category term="software-design" scheme="https://chemaclass.com/tags/software-design/" label="Software Design"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="career" scheme="https://chemaclass.com/tags/career/" label="Career"/><published>2020-05-21T00:00:00+00:00</published><updated>2020-05-21T00:00:00+00:00</updated><author><name>
Bruce Tate</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/readings/7-languages-in-7-weeks/"/><id>https://chemaclass.com/readings/7-languages-in-7-weeks/</id><summary type="html">A hands-on tour of Clojure, Haskell, Io, Prolog, Scala, Erlang, and Ruby. Learn how each language thinks differently and broaden your perspective on programming.</summary><content type="html">&lt;span id="continue-reading">&lt;/span>
&lt;p>You should learn a programming language every year, as recommended by The Pragmatic Programmer. But if one per year is
good, how about Seven Languages in Seven Weeks? In this book you’ll get a hands-on tour of Clojure, Haskell, Io, Prolog,
Scala, Erlang, and Ruby. Whether your favorite language is on that list, you’ll broaden your perspective of
programming by examining these languages side-by-side. You’ll learn something new from each, and best of all, you’ll
learn how to learn a language quickly.&lt;/p>
&lt;hr />
&lt;p>I created this repository with all my learnings while I was reading and playing aroung with the languages from this book
&lt;a rel="external" href="https://github.com/Chemaclass/7LangIn7Weeks">https://github.com/Chemaclass/7LangIn7Weeks&lt;/a>&lt;/p></content></entry></feed>