Simplify and refine TYPO3 extension code for clarity, consistency, and maintainability while preserving functionality. Reviews PHP classes, Fluid templates, TCA, Services.yaml, and ext_localconf/ext_tables for TYPO3 v14 best practices. Run after implementing a feature or before merging a PR. Use when working with simplify, clean up, refine, code quality, reduce complexity, readability, maintainability, review code, polish, TYPO3 code review.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Simplify and refine TYPO3 extension code for clarity, consistency, and maintainability while preserving functionality. Reviews PHP classes, Fluid templates, TCA, Services.yaml, and ext_localconf/ext_tables for TYPO3 v14 best practices. Run after implementing a feature or before merging a PR. Use when working with simplify, clean up, refine, code quality, reduce complexity, readability, maintainability, review code, polish, TYPO3 code review.
compatibility
TYPO3 14.x
metadata
{"version":"1.0.0"}
license
Apache-2.0 OR CC-BY-SA-4.0
TYPO3 Code Simplifier
Adapted from Boris Cherny's (Anthropic) code-simplifier agent for TYPO3 contexts.
Target: TYPO3 v14.x only.
Simplify and refine recently changed TYPO3 code. Preserve all functionality. Focus on
clarity over cleverness, TYPO3 API usage over custom implementations, and v14 patterns
over deprecated approaches.
Remove boilerplate columns definitions auto-created from ctrl on TYPO3 v14: hidden, starttime, endtime, fe_group, sys_language_uid, l10n_parent, l10n_diffsource
Use palettes for enablecolumns: Core uses palette key hidden for hidden, access for starttime, endtime, fe_group (verify keys in your table’s typesshowitem)
Remove standard ctrl columns from ext_tables.sql when ctrl enables them (hidden, , , , , , , , , , ) — only if they are auto-managed for that table
Services.yaml
Use autowiring (remove explicit argument definitions when type-hintable)
Use _defaults: autowire: true, autoconfigure: true, public: false
Remove manual service definitions for classes that autowiring handles
Remove factory: blocks when autowiring handles construction; keep factory: for non-trivial construction that autowiring cannot resolve. #[Autoconfigure] tags/configures services but does not replace factory: construction
Remove public: true unless needed for GeneralUtility::makeInstance()
ext_localconf.php / ext_tables.php
Minimize code — move to Configuration/ files where possible
Plugin registration only (no business logic)
Frontend plugins: ExtensionUtility::configurePlugin() in ext_localconf.phpandExtensionUtility::registerPlugin() (or TCA items) in Configuration/TCA/Overrides/tt_content.php — both are required for a complete registration
No addPageTSConfig — use Configuration/page.tsconfig
No addUserTSConfig — use Configuration/user.tsconfig
No addTypoScript — use Configuration/TypoScript/setup.typoscript
Pass 3: Efficiency
QueryBuilder: select only needed columns, not *
QueryBuilder: add setMaxResults() when expecting single row
Use count() queries instead of fetching all rows to count
Cache expensive operations with TYPO3 Caching Framework
Avoid N+1 queries in Extbase repositories (use JOIN or batch loading)
Use TYPO3\CMS\Core\Resource\ProcessedFileRepository not re-processing on every request
Remove findAll() calls without pagination
Lazy-load file references with #[\TYPO3\CMS\Extbase\Attribute\ORM\Lazy] (replace legacy @Lazy annotation)
Replace foreach + manual in_array() filtering with QueryBuilder WHERE IN
Remove redundant cache:flush calls in CLI commands
Keep numeric TCA items arrays alongside label/value format
Prefer Services.yaml_defaults (autowire / autoconfigure) plus Core registration attributes (#[AsCommand], #[AsEventListener], …) over ad-hoc factory: blocks
v14-Only Simplification Targets
The following simplification opportunities are v14-specific.
v14 Simplification Patterns [v14 only]
Pattern
Simplification
$GLOBALS['TSFE'] access
Fatal error in v14 (Breaking #107831) — replace with $request->getAttribute('frontend.page.information')
Extbase annotations (@validate)
Replace with #[\TYPO3\CMS\Extbase\Attribute\Validate]
MailMessage->send()
Inject TYPO3\CMS\Core\Mail\MailerInterface and call $this->mailer->send($email)
FlexFormService usage
Prefer FlexFormTools; FlexFormService remains as a BC alias in v14 but should not be used in new code
Bootstrap Modal JS
Frontend: native <dialog> where appropriate. Backend: use @typo3/backend/modal — it wraps native <dialog> in v14 (Breaking #107443); do not use raw Bootstrap modal JS
TCA ctrl.searchFields (removed in v14)
TYPO3 v14 derives backend search fields automatically; tune inclusion per column with 'searchable' => true/false (supported field types: input, text, email, link, slug, color, datetime (without custom dbType), flex, json, uuid) where supported
Custom localization parsers
Superseded by Symfony Translation Component integration (Feature #107436); BC maintained in v14 — prefer the new Symfony Translation API in new code
GeneralUtility::createVersionNumberedFilename()
Replace with SystemResourceFactory / SystemResourcePublisherInterface (System Resource API, Feature #107537)
Credits & Attribution
This skill is based on the excellent work by
Anthropic.
Special thanks to Anthropic for their generous open-source contributions, which helped shape this skill collection.
Adapted by webconsulting.at for this skill collection