Drupal site building with Claude

Starting setup:

  • https://gitlab.agile.coop/teci/drupal-dev
  • CLAUDE.md
  • MCP and System7

Commands to build a cat site using Claude:

We're building a Drupal site about cats. Configure Drupal with a suitable name and tag line.
Create a Drupal 'cat' content type that has a title, decsription, image, an entity reference to 3 related cats and an entity reference to a breed taxonomy. The form display should list the fields in the order given. Entity reference fields shold use an autocomplete. The default display should show the fields in the order given with the field title hidden.
Create some content: 5 breed taxonomy terms and 20 cats. For each image find a random cat picture online.
Create a teaser view for each cat that just shows the title, image and description trimmed to 300 characters.
Use Drupal test traits to write a PHPUnit ExistingSite test that creates a new cat node by submitting the node create form and then checks the fields display correctly on the new node page.
The homepage of our Drupal cat site should display a random cat image. Create a custom block plugin that shows a new cat image every day.
Create a PHPUnit Functional test for the daily cat image block.
Place the block at the top of the content region. It should only appear on the <front> page.
Refactor the daily cat image block by Drupal creating a Drupal service that returns the URL to the daily cat image and then inject the service into the block. Create a PHPUnit Kernel test to confirm the service works as expected.
Confirm all code quality and PHPUnit tests pass and there are no deprecation errors in the cat_site module.

Links

  • [[2025-W34]]