Making TYPO3 AI-Ready: Clear Structures, Better Agents

How the TYPO3 Core already helps AI agents read your code, and what to add yourself: Schema API, Content Blocks, Property Hooks, DataHandler and Harness Engineering.

Overview

  • AI agents do not fail because of the model, but because of unclear architecture and a lack of structure in the codebase.
  • With the Schema API, strict types, and PSR-14, the TYPO3 Core already provides a solid foundation for AI readability.
  • Content Blocks, Property Hooks, and DataHandler patterns are the biggest levers for extension developers.
  • Harness Engineering, with linters, tests, and project rules, safeguards the quality of agent-generated code.
  • A prioritised roadmap outlines the first steps for existing TYPO3 projects.

AI agents rarely fail in TYPO3 projects for want of computing power. They fail because they lose context: to TCA branches, Extbase boilerplate, implicit side effects, and rules that only exist in people's heads. This is exactly where it is decided whether an agent implements a change cleanly or triggers expensive review loops.

The idea that architecture counts for more than the choice of model is not just a gut feeling. LangChain raised the success rate of its coding agent from 52.8% to 66.5% without a single model upgrade. Only the environment changed: better verification loops, clearer context, tighter feedback loops. Same model, different results.

The architecture of a codebase determines the quality of the agent – not the other way around.

This article keeps two perspectives apart: what has the TYPO3 Core already done to make code more machine-readable, and what can you, as an extension developer, add to your project?


Table of Contents  

AI Readability

Loss of context and architecture

Harness Engineering

Verification, context, constraints

Structured Specs

Machine-readable specifications

Roadmap

Phases from immediate to v14 migration

Conclusion

Three strongest levers


Why AI Readability Matters Now  

In traditional projects, code was structured for humans who had time to familiarise themselves with historical decisions. AI agents work differently: with limited context, they have to spot the relevant signal quickly. In 2023, Liu et al. showed in "Lost in the Middle" that language models exhibit a U-shaped attention curve over long contexts: they favour information at the beginning and the end, while the middle loses up to 20% of its effectiveness. Larger context windows make this worse rather than better.

For TYPO3, this means the more boilerplate, repetition, and implicit rules an extension contains, the higher the risk of imprecise patches, wrong shortcuts, and needless queries. If a TCA file runs to 400 lines of nested arrays, an agent sees a lot of syntax and very little business signal.

SituationWhat the model seesConsequence in the project
Large TCA file with nested arraysLots of syntax, little business signalHigher error rate for small configuration changes
Extbase model with getter/setter seriesToken budget is consumed by boilerplateBusiness logic shifts out of focus
Direct SQL updates on TCA recordsFormally plausible, but technically incorrect pathRisk to Workspaces, FAL references, and permissions
Project rules only in team knowledgeFalls back on training patternsInconsistent implementations across files

What the TYPO3 Core Already Provides  

For several versions now, the TYPO3 ecosystem has been modernising in a direction that directly benefits AI agents, even if that was never the original intent. Once you know these Core changes, it becomes clear why TYPO3 projects today can be structurally better placed for agentic workflows than many other PHP systems.

Schema API and Record API replace raw TCA arrays  

Since v13.2, the Schema API has offered a typed, object-oriented approach to TCA structures. Instead of accessing $GLOBALS['TCA'] directly, developers use an API that provides fields, types, and relations as objects. The accompanying Record API (v13.3) automatically transforms raw database values into typed objects: Record, FileReference, DateTimeImmutable. Relations are resolved via lazy loading.

For agents, this means less array navigation, clearer types, and a predictable object model. Note that the Schema API is currently marked as internal and may still change during the development of TYPO3 v13. The move to the Schema API is an ongoing Core initiative: the Core is gradually phasing out TCA as a PHP array.

Strict types and PHP attributes in Extbase  

TYPO3 v13 enforces strict typing in Extbase core classes: ActionController, PersistenceManager, ObjectStorage, and domain model base classes are consistently strictly typed. Anyone extending Extbase classes must adapt their signatures.

In v14, the clean-up continues: Extbase annotations (@Extbase\Validate) have been removed, and only native PHP attributes (#[Validate], with use TYPO3\CMS\Extbase\Attribute\Validate;) are accepted. The doctrine/annotations library is no longer needed. For AI agents this is a clear win: attributes are machine-readable, IDE-navigable, and statically analysable, none of which DocBlock annotations ever were.

Fluid 5.0 with strict type validation  

Fluid 5.0 in TYPO3 v14 validates ViewHelper arguments more strictly than before. Null values no longer generate empty HTML attributes, but rather omit the attribute entirely. Custom ViewHelpers require explicit return type declarations. Variable names with an underscore prefix are reserved.

This strictness reduces the class of errors agents can introduce in templates: the system flags type errors immediately at runtime instead of letting them slip through as silent misbehaviour.

PSR-14 Events instead of legacy hooks  

The migration from hooks and Signal/Slot to PSR-14 Events has been underway since v10 and is all but complete in v14. Events are typed classes with clearly defined properties, registered via Services.yaml. For agents, they are far easier to discover and use correctly than the old hook registrations with their magic strings and implicit parameters.

Content Blocks as a declarative alternative  

Content Blocks (v2.0 since November 2025, v14-compatible) shift the definition of content elements, record types, and page types into a single config.yaml. TCA, SQL, and backend forms are generated automatically. Core integration began in v13 with the Schema API, Record Transformation API, and automatic TCA field value transformation.

Content Blocks are not a Core extension but a community-maintained package; the infrastructure they rely on, however, has been deliberately anchored in the Core.

Rector and Fractor as community-funded migration tools  

For TYPO3 v14, 48 new Rector rules and 11 Fractor rules were created, funded by the Community Budget. Rector transforms PHP code (deprecations, breaking changes), while Fractor covers TypoScript, FlexForms, Fluid, and composer.json. For agents, this means automated migration instead of hunting for outdated patterns by hand.

Core MeasureVersionReplacesAI Benefit
Schema APIv13.2$GLOBALS['TCA'] accessesTyped OOP instead of array navigation
Record APIv13.3Manual type conversionAutomatic transformation into typed objects
Extbase Strict Typesv13.0Loose typing in core classesStatic analysability, fewer hallucinations
PHP attributes instead of annotationsv14.0@Extbase\Validate DocBlocksMachine-readable and IDE-navigable
Fluid 5.0 Strict Typesv14.0Loose argument validationType errors in templates immediately visible
PSR-14 Eventsv10–v14Hooks, Signal/SlotTyped classes instead of magic strings
Content Blocks v2.0v13–v14TCA + SQL + Overrides + TemplatesYAML Single Source of Truth
48 Rector rules + 11 Fractor rulesv14.0Manual migrationAutomated code transformation
The DataHandler & Persistence Initiative

The TYPO3 Core is working towards a long-term vision: decoupled persistence with JSON data types, ACLs independent of the backend user, and simplified localisation. This initiative makes the DataHandler not only more secure but also more predictable for agents, because every write operation passes through a single, clearly defined API.


What You Can Do in Your Project  

The Core modernisation lays the foundation. The decisive lever, though, lies within your own project: in the extension architecture, the write paths, and the rules you set for agents.

Property Hooks instead of getters/setters  

Legacy Extbase models are often too large for agents yet too thin on substance. An agent reads dozens of lines of trivial accessor methods before the actual business logic comes into view. PHP 8.4 Property Hooks put the relevant logic where it belongs: right on the property. This cuts roughly 85% of the boilerplate per field.

Note on Extbase hydration

When loading from the database, Extbase bypasses the constructor. Default values therefore belong in the property declaration, not in constructor promotion.

Content Blocks instead of TCA scattering  

TCA is powerful, but as a sprawling PHP array it makes a terrible workspace for agents. Content Blocks move the business definition into a declarative YAML file, and TCA, SQL, and backend forms are generated automatically. Changing a content type now means editing one file instead of four.

Why YAML works better for agents

YAML captures the business intent without syntactic noise. Agents no longer have to reconstruct nested PHP arrays and can validate changes against schema and linting far more quickly.

DataHandler as the only write path  

As soon as an agent modifies data in TCA-managed tables, it must take the correct route rather than the easiest one. In TYPO3, that route is the DataHandler. Workspaces, permissions, the reference index, and FAL relations are only handled correctly along this path. Direct QueryBuilder updates may look quicker in the short term, but they cost you integrity later on.

Do not inject DataHandler via DI

The DataHandler holds internal state. If it is injected like a stateless service, you get errors that are hard to reproduce. For write-heavy workflows, pin the instantiation path down in the project rules.

Project rules: .cursorrules, AGENTS.md and .cursor/rules  

An agent without project rules falls back on generic training patterns. An empirical study by UC Irvine (MSR 2026) analysed 401 repositories with Cursor rules and identified a clear taxonomy: Conventions, Guidelines, Project Information, and LLM Directives. The finding: persistent rules measurably reduce variance across sessions, models, and developers.

AGENTS.md has established itself as a cross-tool standard (Linux Foundation, Agentic AI Foundation). Cursor, Codex, Copilot, Windsurf, and Devin read it natively. For TYPO3 projects, the most critical rules belong in this format:

Rules are not optional

Rules in configuration files are not binding: under context pressure, agents may ignore them. Critical standards need additional mechanical enforcement through linters, tests, and CI gates.

Harness Engineering: The Environment is the Product  

The concept of Harness Engineering describes a fundamental shift: the code is not the product; the environment in which agents produce code is the product. A harness comprises verification loops (tests, linters, CI), context management (documentation, rules), constraints (architecture rules, dependencies), and feedback systems (logs, metrics).

OpenAI showed the principle in practice: a team of three (later seven) engineers used Codex agents to ship a production system of around one million lines of code, every line written by agents and not a single one coded by hand. The engineers designed the harness, not the code.

For TYPO3 projects, a Minimum Viable Harness consists of:

Harness LayerTYPO3 ToolEffect
Static analysisPHPStan Level 8+Type errors and dead paths are found before the review
Code stylePHP CS Fixer (PSR-12) Deterministic formatting across sessions
Architecture rules.cursor/rules/ + AGENTS.mdPersistent context for every agent run
TestsPHPUnit (Unit + Functional)Guarantee of behaviour during every refactoring
Content Block ValidationContent Block LintSchema errors in YAML before the build
CI GateGitHub Actions / GitLab CINo merge without passing a mechanical check

Structured specifications instead of prose  

Stefan van Egmond had 20 AI agents implement the same feature under identical architecture rules. Even so, the agents diverged on basic decisions: whether to copy tags, reset status, or carry over due dates. Natural-language specifications are ambiguous, hard to scan, and untestable.

The solution is machine-readable specifications built on patterns LLMs already know from their training data: Pact Contracts, Design by Contract, Specification by Example. In TYPO3 projects, this principle maps onto typed interfaces, contract-based DTOs, and explicit pre- and post-conditions.


Prioritised Roadmap for Existing TYPO3 Projects  

PhaseGoalFirst StepImpact
ImmediateMake hotspots visibleInventory large TCA files, getter/setter clusters, and direct write accessesYou see where AI currently experiences the most friction
ImmediateEstablish project rulesCreate AGENTS.md and .cursor/rules/ with TYPO3-specific directivesEvery agent run starts with the correct context
Next sprintModernise pilot featureMigrate an isolated feature to Content Blocks and leaner modelsProof of Value without migration risk
Next quarterBuild the harnessCouple PHPStan, tests, Content Block Lint, and CI gateMechanical safeguards for high agent volume
v14 migrationUtilise Core modernisationUse Rector/Fractor for automated migration, adapt Schema APIFewer legacy patterns, better agent compatibility
OngoingReduce context per featureExpand vertical slices and break up scattered utilitiesAgents work more securely with less context

Conclusion  

Optimising TYPO3 for AI does not mean writing for machines instead of humans. It means building a codebase that works better for both: for agents, because they can work more precisely with less context, and for teams, because architectural decisions become more visible and repeatable.

TYPO3 has one advantage that is often overlooked in this debate: the Core is already modernising in the right direction. The Schema API, strict types, PSR-14 Events, and the Content Blocks infrastructure are not promises for the future; they are here now and ready for production. The question is not whether the investment pays off, but how quickly you can close the gap between the Core foundation and your own project architecture.

The three strongest levers on the project side remain: less boilerplate (Property Hooks, Content Blocks), more explicit contracts (Typed Properties, PHP attributes, Schema API), and mechanical safeguards (Harness Engineering with PHPStan, tests, and CI gates).

If you want to assess your existing TYPO3 codebase and find out where AI agents are still being held back, a focused architecture review for TYPO3 projects is the fastest place to start.

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.