A focused marketing manager using laptop at the office to review her new microsite.
20 February, 2026 //

Using Agentic AI Without Vibe Coding

#Advice
#Backend
#Drupal
#Insights
#Tutorial

Daniel Johnson, Developer at Pivale Drupal agency - A man with dark hair and glasses.
Written by Daniel Johnson Backend developer

Daniel is a backend developer, with a keen focus on end-to-end testing, attention to detail and crafting bespoke ecommerce solutions. Daniel is a graduate of Keele University, with a year's study at VU Amsterdam, achieving a first class degree in Computer Science.

Agentic AI is increasingly used during software development to accelerate implementation and reduce repetitive work. When applied carefully it can significantly improve development speed and assist with complex systems such as Drupal. However, the same capabilities can also introduce risks when the generated output is accepted without sufficient understanding or review.

The concept of vibe coding describes a situation where developers rely on generated code that appears plausible but is not properly evaluated. In large Drupal codebases this can lead to fragile implementations and difficult debugging later in the project lifecycle.

This article outlines practical observations about using Agentic AI when building custom Drupal solutions and describes approaches that improve the quality and reliability of generated code.

Why developers use Agentic AI for coding

The primary benefit is increased development speed. Many tasks in Drupal development involve repeating patterns that are already well understood. Agentic AI can accelerate these tasks while still allowing developers to maintain control over the architecture.

Common advantages include:

  • Generating boilerplate code for plugins, services, and controllers
  • Assisting with repetitive implementation details once a design has been decided
  • Helping explore different implementation approaches before committing to one
  • Providing quick references to Drupal APIs and existing patterns

Despite these advantages, the use of Agentic AI introduces a requirement for stronger review and validation practices.

What Agentic AI does poorly and well

Situations where Agentic AI struggles

Agentic AI often performs poorly when requests require both high level design and low level implementation at the same time. When asked to build a complete system from a broad prompt, inconsistencies can appear across files and the resulting code may not align with established Drupal conventions.

A common example occurs when generating Drupal configuration.

For example, nested menu items in Drupal frequently expose limitations in generated output. In repeated attempts to generate nested menu definitions, the following issues often appear:

  • Incorrect parent link references
  • Menu items that appear in the wrong location
  • Valid looking configuration that does not behave correctly at runtime

This happens because the Drupal menu system relies on an understanding of how routes, menu links, and hierarchy interact. Small configuration mistakes can produce subtle errors that are not obvious from reading the YAML files alone.

Similar issues can occur with other declarative Drupal systems:

  • Menu configuration files
  • Local task and action links
  • Permission definitions
  • Routing and controller mappings

These areas require familiarity with Drupal conventions rather than only correct syntax.

Situations where Agentic AI performs well

Agentic AI produces much stronger results when the task is narrowly defined and constrained. Smaller units of work reduce the likelihood of incorrect assumptions and make it easier to verify the output.

Typical examples include:

  • Implementing a single plugin or service
  • Extending an existing class following a known pattern
  • Updating an isolated part of a module
  • Completing implementation details after the architecture is defined

Another important factor is the presence of good reference code within the project. When the codebase contains consistent patterns, the AI can mirror those patterns effectively.

This is especially useful when extending contributed modules. Pointing the AI toward an existing implementation within a module often leads to more accurate results.

A practical approach to working with Agentic AI

Set clear boundaries

Constraining the scope of the work significantly improves the reliability of generated output. Clear instructions reduce the chance of unnecessary changes or invented patterns.

Effective constraints typically include:

  • Specifying which files should be modified
  • Requiring the use of an existing implementation pattern
  • Preventing the introduction of new architecture unless explicitly requested

These constraints help maintain consistency within the codebase and reduce unexpected side effects.

Break the problem into smaller units

A structured workflow improves outcomes when using Agentic AI.

A recommended approach is:

  • Define the goal of the feature or change
  • Design the architecture before generating code
  • Divide the implementation into independent tasks
  • Validate each step before continuing

This method ensures that each component can be reviewed and tested in isolation. It also reduces the likelihood that errors will propagate through multiple files.

Use reference implementations

Agentic AI produces better output when it can follow an established example. Providing explicit references improves both accuracy and consistency.

Useful reference strategies include:

  • Directing the AI to a specific module that implements similar behaviour
  • Pointing to an existing custom plugin or service within the project
  • Requesting that the output match the style and structure of existing code

In Drupal development, understanding where similar functionality already exists is often critical. Reference based prompts help ensure that generated code aligns with the framework and the project.

The importance of avoiding vibe coding

Understanding must precede generation

Developers should have a clear understanding of the intended outcome before asking the AI to produce code. This does not prevent collaboration with AI during planning, but it ensures that decisions remain intentional.

Important questions to answer include:

  • What problem is being solved
  • What behaviour defines a successful implementation
  • What constraints exist within the system

This understanding enables developers to identify incorrect assumptions and evaluate alternative approaches produced by the AI.

Use validation tools to verify output

Automated tooling is essential when integrating generated code into a production codebase. Validation should rely on objective signals rather than intuition.

Common tools that support this process include:

  • PHPStan for static analysis
  • PHPUnit for behavioural testing
  • Drupal specific testing infrastructure

These tools provide feedback that can highlight incorrect assumptions or incomplete implementations.

Recognising incorrect implementations

Without a clear expectation of the intended outcome, it becomes difficult to evaluate generated code. Code that appears correct may still conflict with Drupal conventions or system behaviour.

The most reliable approach is to ensure that:

  • The architecture is understood before implementation
  • Generated code is reviewed and validated
  • Testing confirms the expected behaviour

Agentic AI should support development rather than replace technical reasoning.

Agentic AI is a valuable addition to modern Drupal development workflows. It can accelerate implementation and reduce the effort required for repetitive tasks. However, effective use requires deliberate structure and careful validation.

Teams that benefit most from Agentic AI tend to follow several consistent practices:

  • They define architecture before generating code
  • They constrain the scope of AI generated changes
  • They rely on existing code patterns as references
  • They validate results using analysis and testing tools

When used in this way, Agentic AI becomes a tool that enhances development rather than introducing uncertainty into the codebase.

Daniel Johnson, Developer at Pivale Drupal agency - A man with dark hair and glasses.
Written by Daniel Johnson Backend developer

Daniel is a backend developer, with a keen focus on end-to-end testing, attention to detail and crafting bespoke ecommerce solutions. Daniel is a graduate of Keele University, with a year's study at VU Amsterdam, achieving a first class degree in Computer Science.

Barry Fisher, Founder and CEO at Pivale digital transformation agency - a man with dark hair, a neat beard, moustache and glasses.

Contact us



Or send us a message...