← Back to the blog

Oct 8, 2026·6 min

How I built this portfolio

A hand-built block engine, pixel art kittens, a map of Mexico, and the bugs that showed up while I built it with AI agents.

#Next.js#Canvas 2D#Agents#Pixel art

I wanted a portfolio that felt like mine. I pictured a page with a few pixel art kittens wandering around. Something with movement that wouldn't make you dizzy and wouldn't look like another card template with gradients. I also wanted it to say something about me, so it has a map of Mexico marking where I was born and where I live.

Here I tell you how I put it together, what I decided, and the bugs I ran into along the way. I start with the kittens and the map, which is what you see, and then I go down into how it works inside.

The kittens and the map

I generated the characters with ChatGPT. They come out as large pixel-style images, and each frame is a little different from the one before. I had to reduce each one to its real grid and clean up colors. Then I put together the animation frames so the cat wouldn't change size while walking. I gave the black cats a subtle outline because they disappeared against the site's dark background.

My portrait in "About me" went through the same thing. It also blinks, glances sideways, and raises its eyebrows when you hover over it.

Instead of a visitor counter I put in a block map of Mexico that tells something about me. I was born in Chihuahua and I live in Veracruz. The states come from Natural Earth data, projected and converted into a grid. I had to remove faraway islands like Revillagigedo, which showed up as loose blocks in the middle of the water.

The engine lives apart

Inside, the site is Next.js with TypeScript (App Router, SSG), and everything drawn with blocks runs on a custom Canvas 2D engine. What mattered most to me was that this engine lived in its own folder and knew nothing about React. That way I can change a section of the site without touching the machinery.

The animation depends on time, not on frames. Speed is measured in blocks per second, so it looks the same at 60 Hz as at 120 Hz. Each block stores a palette number instead of a color, and changing the whole palette doesn't force anything to be recalculated.

In the hero intro, the kitten works as the cursor and the blocks of the line appear where he's standing. So it looks like he's building it. If the animation moved on its own and the cat just walked over it, it would look fake. The rest of the site isn't built with blocks anymore. It's sections with their own characters, maps, and an arcade.

From the start, the site is generated statically. All the animation respects prefers-reduced-motion and can also be skipped.

The project ended up organized like this.

├── engine/              # Motor Canvas 2D (sin React)
├── src/
│   ├── app/             # Rutas y páginas (App Router)
│   ├── components/      # UI React
│   ├── content/         # Datos (proyectos, experiencia) y MDX del log
│   ├── i18n/            # Diccionarios es/en (sin librería de i18n)
│   └── lib/             # Utilidades compartidas
├── docs/                # Arquitectura, diseño, ADRs
├── AGENTS.md            # Reglas duras para agentes
└── MEMORY.md            # Estado entre sesiones

engine/ doesn't import React or anything from components/. React only mounts the canvas and talks to it through a tiny API. The projects, experience, and posts live in src/content/. The text you see on the site comes from dictionaries in src/i18n/dictionaries/{es,en}/ instead of being written directly in the JSX.

I also built the i18n by hand, without next-intl. Spanish goes without a prefix and English lives under /en. The documentation and ADRs are in docs/, so the why behind each decision stays there even if I switch chats or IDEs.

Everything else is in the React layer. Contact is an interactive terminal that sends through Resend, with a honeypot and rate limiting to slow down bots. There's chiptune audio with native Web Audio, some hidden games, and the CV at /cv and /en/cv, built with the same content and i18n. The engine only handles the grid.

With agents, but reading everything

I coded the architecture myself: the canvas engine, the minigames, the terminal, the language system. I leaned on Cursor and Antigravity to speed up the heavy work, like refactors, tests, and the back-and-forth of reviewing and fixing.

What helped me most was what I put around the agents, what is called harness engineering: in AGENTS.md I left fixed rules, like no deploying without permission or no putting React in the engine. The agent reads MEMORY.md when a session starts and updates it when it ends, so I don't have to explain everything again each time. The big decisions are written down as ADRs.

I also learned to read every report with a magnifying glass. An agent can tell you everything passed at 100% and have fixed the wrong problem. Ever since I ask for file and line as evidence, the results have improved a lot.

I wrote more about this in How I work with AI agents.

The bugs

They were the most fun part of the whole project. These are the ones that made me laugh (or suffer) the most.

  • The ghost blocks. The hero line wouldn't show up. The engine was created with a default size and queued the blocks in row 65. An instant later, the canvas adjusted to its real size of 10 rows, so the blocks were drawn 55 rows down, off the screen. I fixed it by waiting for the first real measurement before creating the engine.
  • The kitten walking backwards. The sprite metadata said it was facing right, but it was facing left. It came out as a perfect moonwalk.
  • Coahuila was Tamaulipas. On the MacBook, you clicked Coahuila and Tamaulipas got selected. The canvas was displayed at a different size than the one the engine believed, and the click shifted several cells to the right. Now all coordinate conversions go through a single function.
  • The commits that didn't exist. For days the agent reported successful commits. When I went to upload the project to GitHub, it turned out Git wasn't even installed on that computer. There was no history of anything.
  • The balloon without a cat. On the first visit, the "Building" balloon climbed to 100% floating on its own, because the kitten hadn't arrived yet. Now the sprites are preloaded before starting, and the balloon only appears if there's a cat below.

If you find a bug

There's surely one left that I haven't seen. The contact terminal is open, and if you tell me which section and which screen it happened on, I'll look into it.