This website
Goal
A fast, cheap, public site that I can update by writing Markdown and merging a pull request.
Decisions
- Static over server. The content changes rarely and never per user, so there is no backend.
- Firebase Hosting over Cloud Run. A CDN, HTTPS, and custom domains with a single config file.
- Keyless deploys. GitHub Actions authenticates to GCP through Workload Identity Federation, so there is no long-lived service-account key in the repository secrets.
The AI Process with Claude
Design
For the design phase I followed an iterative process of diverging and converging for each decision. I had Claude create 4 different styles of portfolios before converging on the look that I wanted. Then I did the same with color scheme, typeface, and navigation. I tried to practice being as opinionated as possible, using Claude's ability to generate multiple options in parrallel as a weapon.
Implementation
After making the design decisions, I asked Claude about the implementation. Originally, Claude had created everything with React. In always striving to practice positive engineering principles, I recognized that none of my desired features required React. So, instead, I asked Claude to remove the React and giant hero photo in favor of HTML and markdown rendering.
The resulting size improvements were awesome. The deployed package by over 100x; the portfolio was almost all the markdown content without any fluff.
| Page | Before | After | Smaller by |
|---|---|---|---|
| Home | ~620 KB | ~2.8 KB | ~220x |
| Post | ~199 KB | ~2.7 KB | ~74x |
| JavaScript, any | 150 KB minimum | 0 KB (0.4 KB on Writing) | ~100% |
| Project health | Before | After |
|---|---|---|
| Packages in lockfile | 403 | 178 (almost all dev tooling) |
| Runtime dependencies | 10 | 1 (marked, build-time only) |
| Source files | ~35 JSX/JS files | 3 scripts, 1 CSS, 1 JS |
Why optimize something that wasn't even 2 MB?
To that I would answer, why not? Is it not an engineer's job and passion to continually improve in all aspects? If I can remove 90% runtime dependencies, over 200 packages, and 28 source code files while maintaining core functionality, then I should. No! I must. It is an engineer's duty.
Learning
- Awesome pattern: design phases were AI creates multiple rendering's for human choice.
- AI can pivot extremely quickly in the early stages of implementation.
- Another awesome pattern: have you coding agents keep docs files for human todo's and persistant decisions.