Return to site

Drupal (AI) Playground: Training and practicing building a module using AI

April 21, 2026

Successes and failures

I am continually experiencing both successes and failures while playing in my Drupal (AI) playground. My failures usually come from expecting too much of an AI, especially when I ask it to do too many things in a single prompt. My successes with AI come when I keep things useful, simple, and achievable.

Building something useful, simple, and achievable with AI

As I've learned about and maintained new ecosystems in Drupal, I like to review all available plugins. For the Webform module, I created reports for elements, handlers, variants, and exporters. For ECA, I developed an ECA Report module. For the Meta Tag module, I contributed a patch to get a Meta Tag plugin report committed. I think having a way to browse a module's or ecosystem's plugins helps developers understand what tools are available. A Drush command for exporting plugin definitions could be used by both humans and AI.

In the past, creating and maintaining a report could be time-consuming. The new reality is that AI makes it easier to build and maintain simple things like reports. One of the most common anecdotes I hear from non-technical people who "vibe code" is that they are building websites or reports to display information.

My goal was to create a report that lists all plugin managers, plugin definitions, and individual plugin details.

There ain’t nothing fancy here

The Plugin Report module I created with AI is nothing special. Claude Code’s only challenge was getting the PHP introspection code to pass PHPStan’s level 6 coding standards. In many ways, this module served as an exercise to reinforce my ability to guide an AI in the right direction. My biggest success with Claude was using it to address my biggest weakness in Drupal: JavaScript.

Claude understands JavaScript

I have written a lot of JavaScript in the past, but now I mainly write it to improve Drupal's UI/UX. For the plugins report, I want a simple client-side table with a keyword search, similar to the blocks keyword filter. I asked Claude to copy the block admin table filter JavaScript from Drupal core and apply it to my plugin report table. Claude effortlessly copied and updated the existing JavaScript namespace, classes, and IDs to work with the plugin report table.

I encountered a bug in the filter where clearing the search input doesn’t reset the table display. Once again, Claude implemented the recommended solution perfectly and documented it in the JavaScript source. Lastly, Claude did something I knew it could do but hadn’t tested: convert jQuery to plain-vanilla JavaScript and remove the jQuery dependency.

AI is really good at translating code

Converting jQuery to plain vanilla JavaScript is well documented online. It’s no surprise that it works with a simple one-sentence prompt, and a dedicated agent skill should make it foolproof. It's hard to accept that a task that may take a few hours, like de-JQuerifying a Drupal module, can be done in a few minutes by an AI. Here is the final de-Jquerified and improved admin table filter for plugin reports.

I used to take pride in organizing repetitive tasks and powering through them over a few days. With AI, rote tasks become pointless for humans.

Some of my skills are becoming worthless

I’ve been reluctant to try ChatGPT. Today I got over that reluctance. Now I understand why I was reluctant.

 

The value of 90% of my skills just dropped to $0. The leverage for the remaining 10% went up 1000x. I need to recalibrate.

 

-- Kent Beck

This quote from Kent Beck has resonated with me for weeks. It's a hard pill to swallow that the skills I spent years learning and perfecting are now worthless. Frankly, at first glance, it's hard to be optimistic and see the glass as half full when 90% of the tasks you used to do are now worthless. I understand why people get stuck on that point, and it might not be immediately clear how to recalibrate to 1000x one’s remaining skills.

Recalibrating and 1000x'ing my skills

Ha, the heading above isn't realistic for me right now. One can’t be handed an incredibly powerful tool, like a lightsaber, and wield it like a Jedi without training and practice.

Building this Plugin Report module is primarily about practicing how to build something with AI. I am unsure whether there is a path for training someone to use AI, because it would be like trying to teach someone to have a conversation when the best way to improve their conversational skills is to have a conversation, followed by introspection and reflection. Yep, these blog posts are my introspections on retraining and recalibration with AI. Lastly, I believe sharing what I am learning is the best way to reinforce it.

Sharing some tips and tricks

There are countless posts with tips and tricks for using AI coding agents. These tips and tricks are updated as fast as the AI models are writing them. For now, I want to share a few tips and recommendations that I don’t expect to change anytime soon.

Tips for AI coding agents

  • Try using two AI coding agents to understand their nuances and have them check each other's work. Personally, I am experimenting with Claude Code and Codex.
  • Join AI coding agent Reddit groups to learn how to use tools like Claude Code and Codex effectively and avoid common pitfalls. Also, Anthropic just released a series of Claude training courses.
  • Set up additional tools to support the AI, including Agents.md, skills, and MCP servers. 

Tips for prompting

  • Start with simple, achievable tasks and include example code in your prompts to help ensure you get what you want.
  • Use plan mode to understand what the AI will do before it does it.
  • If things go wrong with an AI, restart and look for a different, simpler approach or prompt. 

Using AI with Drupal

The latest models understand Drupal very well. Anything on Drupal.org and GitHub has been indexed by LLMs. Still, it helps to ask the AI to search core, contrib, and the web for code examples of what you want to implement. Appreciate Drupal's modularity and use AI to build small blocks of code with test coverage.

In closing, for myself

It's hard to let go of 90% of my skills. I'm just beginning to figure out what to do with the remaining 10%. This journey is challenging, frustrating, and invigorating.

Your AI journey will be unique, yet we are all in the same boat. As always, I am glad to be part of the Drupal community.

In closing, for you

My final tip is to experiment with AI and share your experience. Last week, the Drupal AI Learners Club held its first-ever meetup, with over 100 community members in attendance. Attendees shared their experiences with AI, accomplishments, and challenges. You are not alone on this journey.

Lastly, here is a 1-minute demo of the Plugin report module