Why AI builds better and faster on the shoulders of giants
The best code your AI writes is the code it never has to write. When building on top of Drupal there is luckily a lot of that.
When giving an AI agent a task, my advice is to watch for one thing: does it start by researching or by writing code?
From personal experience, an AI agent will happily write a booking system from scratch. The forms, storage, email, spam protection, permissions, an admin screen. It will write thousands of lines of code in an afternoon. And I'm the one who has to review, test and maintain them.
That’s why I prefer to find out what already exists first and only write the glue.
Research is a lot cheaper than code
Tokens and time spent reading module code, libraries and issue queues pay for themselves many times over. An hour of research can save days of generated code that I didn’t need in the first place.
Drupal is great for this.
When you build on Drupal, you are standing and building on the shoulders of giants. Twenty-five years of contrib, and Drupal core that does the heavy lifting with a lot of APIs that you can use.
Most of what I need already exists, and in most cases it’s safe and well thought out. It’s designed by people who solved the problem before, and it’s tested and battle-hardened on thousands of sites.
Example 1: Webhaven
This site runs on Webhaven, a premium Drupal site template that I built based on several recipes. Forms, SEO, cookie consent, redirects, sitemaps, Canvas for page building: all of it is contrib, put together and configured.
So my agent never starts from an empty site. It starts on a site where the boring parts are done and done, well so there is a lot of context with best practices.
This speeds up developing on top of Drupal. The quality is high and I spend fewer tokens (and less time).
Example 2: the booking tool
On this site you can book a call with me. You can also ask your AI assistant to do it for you.
Here is what Drupal and contrib already had:
- Webform for the step-by-step form, storing bookings, confirmation emails and the reminder on the day of the call.
- Tool API and MCP Server so any AI assistant can see my free times and book a call.
- Drupal core for date ranges, cron, queues and flood control.
- Google's API client for Calendar and Meet.
What my agent and I wrote was the glue: a time slot picker, the logic that turns my availability and calendar into free times, and the connection to Google. Plus automated tests that run on website updates and on every new deploy to the server.
Better, not only faster
Based on the example above it’s obvious that this is a faster way to build. Less code to write means fewer tokens and less stuff to review.
But it’s also better because the quality goes up. Webform has handled spam, access checks and edge cases on thousands of sites. My glue code gets all of that for free.
The code you don't write has no bugs you have to find.
The giants need you too
Standing on someone's shoulders comes with a responsibility. While building the booking tool I hit a gap in Tool API. Instead of working around it in my own code, I fixed it upstream.
That's the deal. You take a lot, you give a little back, and the next person gets a slightly taller giant.
Where it doesn't fit
Glue works when the parts fit your problem. If you need to bend a module beyond what it was built for, writing your own can be the better choice. Building on contrib also means following someone else's release schedule. Until my fix is merged, I carry a patch.
My advice is to start by looking around. Most of the time, the giant is already there.