typo3-simplify
БесплатноБез исполняемых скриптовНе проверенSimplify and refine TYPO3 extension code for clarity, consistency, and maintainability while preserving functionality. Reviews PHP classes, Fluid templates…
от dirnbauer★ 33 звезды на GitHubОб этом скилле
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.
Process
- Identify recently modified files (use
git diff --name-only HEAD~1or staged changes) - Run three parallel review passes: Reuse, Quality, Efficiency
- Aggregate findings, deduplicate, sort by impact
- Apply fixes, verify no behavior change
Pass 1: TYPO3 API Reuse
Find custom implementations that duplicate what TYPO3 already provides.
Replace Custom Code with Core APIs
| Custom Pattern | TYPO3 API Replacement |
|---|---|
Manual DB queries ($connection->executeQuery(...)) |
QueryBuilder with named parameters |
$GLOBALS['TYPO3_REQUEST'] |
Inject ServerRequestInterface via middleware/controller |
new FlashMessage(...) + manual queue |
FlashMessageService via DI |
| Manual JSON response construction | JsonResponse from PSR-7 |
GeneralUtility::makeInstance() |
Constructor injection via Services.yaml |
$GLOBALS['TSFE']->id |
$request->getAttribute('frontend.page.information')?->getId() (canonical on v14; routing page id also works) |
$GLOBALS['BE_USER'] |
Inject Context or BackendUserAuthentication |
ObjectManager::get() |
Constructor DI |
| Manual file path resolution | PathUtility, Environment::getPublicPath() |
| Custom caching with globals | CacheManager via DI with cache configuration |
BackendUtility::getRecord() for single field |
QueryBuilder selecting only needed columns |
| Manual page tree traversal | RootlineUtility or PageRepository |
GeneralUtility::_GP() / _POST() / _GET() |
$request->getQueryParams() / getParsedBody() |
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'] writes |
PSR-14 events or ExtensionConfiguration |
| Manual link generation | UriBuilder (backend) or ContentObjectRenderer::typoLink() |
Replace Deprecated Patterns (v14)
| Deprecated | v14 Replacement |
|---|---|
ext_localconf.php hook arrays |
#[AsEventListener] on PSR-14 events |
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] hooks |
PSR-14 events |
ext_tables.php module registration |
Configuration/Backend/Modules.php |
XCLASS |
PSR-14 events or DI decoration |
TCA eval for required, null |
Dedicated TCA keys: required, nullable |
TCA eval for trim |
Still valid in v14 — no dedicated TCA replacement; keep trim in eval when you need it |
renderType => 'inputDateTime' |
'type' => 'datetime' |
'type' => 'input', 'eval' => 'int' |
'type' => 'number' |
items with numeric array keys |
items with label/value keys |
Historical removals (pre–v14 code you may still read)
| Removed / legacy | When | Modern approach |
|---|---|---|
switchableControllerActions |
Deprecated in v10.3 (#89463), removed in v12.0 | Separate plugin registrations |
Signal/Slot Dispatcher |
Removed in v12 | PSR-14 events |
AbstractPlugin (pi_base) |
Made @internal v12.0 (#98281), deprecated v12.4 (#100639), removed v13.0 |
Extbase or middleware |
Code quality (not deprecations)
| Topic | Guidance |
|---|---|
$querySettings->setRespectStoragePage(false) |
Valid Extbase API — prefer setting query settings in the repository factory or controller, not scattered in repositories, for clarity |
Pass 2: Code Quality
PHP Classes
- One class per file, PSR-4 autoloading
-
declare(strict_types=1)on every PHP file -
finalon classes not designed for inheritance -
readonlyon immutable properties - Constructor promotion for DI dependencies
- Explicit return types on all methods
- No unused
useimports - No suppressed errors (
@) - Guard clauses over deep nesting (early returns)
- No mixed types where specific types exist
- Replace
arraytypehints with typed arrays or DTOs
// Before
class MyService
{
private ConnectionPool $connectionPool;
private Context $context;
public function __construct(ConnectionPool $connectionPool, Context $context)
{
$this->connectionPool = $connectionPool;
$this->context = $context;
}
public function getData($id)
{
// ...
}
}
// After
final class MyService
{
public function __construct(
private readonly ConnectionPool $connectionPool,
private readonly Context $context,
) {}
public function getData(int $id): array
{
// ...
}
}
Fluid Templates
- No inline PHP or complex ViewHelper chains
- Use
<f:translate>instead of hardcoded strings - Use
<f:link.page>/ `<f:link.
Установить typo3-simplify в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл typo3-simplify?
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.
Как установить скилл typo3-simplify?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл typo3-simplify запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic