Skip to content
Martin Gratzer
Go back

From Ore to Iron: Build Your Own Coding Agent

I like learning hands-on. So last weekend I built something that is agent-inception in the best possible way: I used a coding agent to build a skill for your coding agent, and that skill shows how to build a coding agent.

It sounds gimmicky at first. In practice, each layer makes a different part of the system visible, and that’s where learning happens.

How I Got Here

Last summer I came across Geoffrey Huntley’s workshop on how to build a coding agent and had one of those useful realizations: the core loop isn’t complicated.

Building a few small agents myself triggered the same kind of shift Thomas Ptacek describes: the barrier is much lower than most people assume. Once you implement the loop yourself, a lot of the magic fades away.

I wanted to share this experience: hands-on, practical, and fun. Not a slide deck. Not “trust me.” Just one focused session where you end the day understanding more than you did in the morning.

That led to the idea for this project: use a coding agent to learn how to build a coding agent.

Bloomery

Bloomery is an Agent Skill that coaches you through implementing a ~300-line agentic loop yourself.

The design principle is simple: keep the essence, hide nothing. No framework abstraction, no SDK magic, just raw HTTP calls to an LLM API wrapped in a loop you can reason about.

You choose your programming language and an LLM provider, then Bloomery walks through 8 incremental steps. It starts with a chat loop, then adds conversation memory, system prompts, tool definitions, and eventually a complete loop with file operations and shell access.

Bloomery won’t generate the finished code for you in one go. Ideally you write it yourself, coached with hints and validation gates at each step. The idea: guide, don’t autopilot.

It works in any coding agent that supports skills. I love using Pi. The guided track takes ~60-90 minutes, the fast track ~30-45. If you’re short on time, you can ask it to generate the code for each step as well.

What You Learn Along the Way

The interesting part is that while you build your agent, the teaching agent is actively using the same mechanisms in front of you. Those moments are where the concepts click.

Step 2 introduces conversation history. Every message goes into an array, and that array is sent on every API call. You can feel context growth immediately because you are managing it yourself. This is where token cost and context drift stop being abstract ideas.

Step 4 adds tools and call detection logic. You see quickly that tool definitions consume context budget, and that fewer, sharper tools usually perform better.

By Step 6, you add a second tool and a dispatcher. That’s usually the moment the pattern clicks: new capability is “define schema + implement execution path.” Once you see that clearly, heavyweight abstractions feel optional.

Step 7 is the “bash is all you need” moment. One shell tool gives the agent broad power on your machine. That’s when safety stops being theoretical.

By the end, you have hands-on intuition for context engineering, token efficiency, and why system prompts shape behavior so strongly. You also see why multi-agent setups aren’t just about parallelism but about splitting context load.

That makes you better at using coding agents and, if that’s your goal, better at building products powered by them.

Try It

The name continues the metallurgy theme from Forge, the skill collection I wrote about previously, and another project I call Anvil. The forge shapes the process, the anvil holds it steady, and the bloomery is where raw material turns into something useful.

npx skills add mgratzer/bloomery

Open your coding agent, run /bloomery, and build your own agent from scratch. It takes about an hour. It won’t be production-grade, but it will be yours, and you’ll understand what’s going on under the hood.


Markdown
Share this post on:

Next Post
Forging a Workflow: Agentic Engineering in Practice