From a8c846d12a1764c3b6d7ee98d993b7ea75931afa Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 1 Apr 2026 10:28:57 +0200 Subject: [PATCH] Add 20 evals and improve SKILL.md with version routing, review workflow, and reference index Eval diagnostics revealed gaps in the original SKILL.md: - No version-specific guidance (v12/v13/v14 routing) - No structured review workflow for code reviews - Missing reference index for security, performance, migration docs - No explicit deprecation cross-referencing instructions SKILL.md improvements (216 -> 386 words, under 500 limit): - Added Version-Specific Guidance section - Added Review Workflow with 6 concrete steps - Added Reference Index table mapping needs to files - Expanded rules to include deprecation checking --- skills/typo3-typoscript-ref/SKILL.md | 75 +++++---- skills/typo3-typoscript-ref/evals/evals.json | 166 +++++++++++++++++++ 2 files changed, 210 insertions(+), 31 deletions(-) create mode 100644 skills/typo3-typoscript-ref/evals/evals.json diff --git a/skills/typo3-typoscript-ref/SKILL.md b/skills/typo3-typoscript-ref/SKILL.md index 018b9ee..4c15426 100644 --- a/skills/typo3-typoscript-ref/SKILL.md +++ b/skills/typo3-typoscript-ref/SKILL.md @@ -10,47 +10,60 @@ Version-aware local lookup with always-on best practices. ## Usage ```bash -# Reference lookup -scripts/lookup.sh "stdWrap wrap" - -# With Fluid context -scripts/lookup.sh "PAGEVIEW" --with-fluid +scripts/lookup.sh "stdWrap wrap" # Reference lookup +scripts/lookup.sh "PAGEVIEW" --with-fluid # With Fluid context +scripts/lookup.sh --recipe page-setup # Recipe for common tasks +scripts/lookup.sh "FLUIDTEMPLATE" --review # Adds deprecation warnings +scripts/lookup.sh --deprecations # Deprecation list +scripts/lookup.sh --checklist typoscript # Review checklist (typoscript|tsconfig|fluid) +scripts/lookup.sh --lint-rules # Project lint rules +scripts/lookup.sh --debug "The page is not configured" # Debug error +scripts/lookup.sh --update # Update cache +scripts/lookup.sh "TEXT" --version 12 # Override version +``` -# Recipe for common tasks -scripts/lookup.sh --recipe page-setup +## Rules -# Code review mode (adds deprecation warnings) -scripts/lookup.sh "FLUIDTEMPLATE" --review +1. ALWAYS run `lookup.sh` before writing or reviewing TypoScript/TSconfig/Fluid code +2. ALWAYS follow best practice annotations (required/deprecated/recommended/tip) +3. ALWAYS check project lint rules (`--lint-rules`) before writing TypoScript +4. When writing NEW code: use the most modern approach for the detected version +5. When reviewing EXISTING code: flag deprecated patterns, check `--deprecations` for the project's version +6. For combined TypoScript+Fluid tasks: use `--with-fluid` flag +7. Never generate `config.no_cache = 1` in production setups +8. Prefer DataProcessors over CONTENT cObject in Fluid-based templates -# Deprecation list -scripts/lookup.sh --deprecations +## Version-Specific Guidance -# Review checklist -scripts/lookup.sh --checklist typoscript +- **v12**: Use FLUIDTEMPLATE, sys_template static includes, constants.typoscript +- **v13**: Prefer PAGEVIEW for new page templates, introduce Site Sets, use settings.definitions.yaml +- **v14**: Site Sets mandatory, FLUIDTEMPLATE deprecated, @import replaces INCLUDE_TYPOSCRIPT -# Project lint rules -scripts/lookup.sh --lint-rules +When answering version-specific questions, always consult `references/review/deprecations.md` and the relevant migration guide (`migration-v12-to-v13.md` or `migration-v13-to-v14.md`). -# Debug error message -scripts/lookup.sh --debug "The page is not configured" +## Review Workflow -# Update cache -scripts/lookup.sh --update +When reviewing TypoScript/TSconfig/Fluid code: -# Override version -scripts/lookup.sh "TEXT" --version 12 -``` +1. Run `--checklist` for the file type (typoscript, tsconfig, or fluid) +2. Run `--deprecations` filtered to project version +3. Cross-reference `references/review/common-mistakes.md` for known pitfalls +4. Check `references/review/security.md` for Fluid XSS patterns (f:format.raw, f:sanitize.html) +5. Check `references/review/performance.md` for COA_INT/USER_INT overuse +6. Use `--review` flag on keyword lookups to append deprecation context -## Rules +## Reference Index -1. ALWAYS run lookup.sh before writing TypoScript/TSconfig/Fluid code -2. ALWAYS follow best practice annotations (required/deprecated/recommended/tip levels) -3. ALWAYS check project lint rules before writing TypoScript (--lint-rules) -4. When writing NEW code: use the most modern approach for the detected version -5. When reviewing EXISTING code: flag deprecated and required-level annotation violations -6. For combined TypoScript+Fluid tasks: use --with-fluid flag -7. Never generate `config.no_cache = 1` in production setups -8. Prefer DataProcessors over CONTENT cObject in Fluid-based templates +| Need | Reference | +|------|-----------| +| TypoScript patterns, Fluid best practices | `references/patterns.md` | +| Debugging errors | `references/debugging.md` | +| Deprecation lists | `references/review/deprecations.md` | +| Security (XSS, escaping) | `references/review/security.md` | +| Performance (caching, INT objects) | `references/review/performance.md` | +| Common mistakes | `references/review/common-mistakes.md` | +| Migration v12-v13 | `references/review/migration-v12-to-v13.md` | +| Migration v13-v14 | `references/review/migration-v13-to-v14.md` | ## First Run diff --git a/skills/typo3-typoscript-ref/evals/evals.json b/skills/typo3-typoscript-ref/evals/evals.json new file mode 100644 index 0000000..0b91d3f --- /dev/null +++ b/skills/typo3-typoscript-ref/evals/evals.json @@ -0,0 +1,166 @@ +[ + { + "name": "lookup_stdwrap", + "prompt": "I need to use stdWrap wrap in my TYPO3 TypoScript setup. Look up the reference for me.", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*stdWrap" }, + { "type": "content", "pattern": "stdWrap|wrap" } + ] + }, + { + "name": "lookup_fluidtemplate", + "prompt": "How do I configure a FLUIDTEMPLATE content object in TYPO3 v12 TypoScript?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*FLUIDTEMPLATE" }, + { "type": "content", "pattern": "templateRootPaths|templateName" }, + { "type": "content", "pattern": "(v12|version 12)" } + ] + }, + { + "name": "pageview_vs_fluidtemplate", + "prompt": "Should I use PAGEVIEW or FLUIDTEMPLATE for a new TYPO3 v13 project?", + "assertions": [ + { "type": "content", "pattern": "PAGEVIEW" }, + { "type": "content", "pattern": "(recommend|prefer|modern|new)" }, + { "type": "content", "pattern": "FLUIDTEMPLATE" } + ] + }, + { + "name": "recipe_page_setup", + "prompt": "Show me the recipe for a basic page setup in TypoScript.", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--recipe.*page-setup" }, + { "type": "content", "pattern": "page\\s*=\\s*PAGE" } + ] + }, + { + "name": "recipe_menu_setup", + "prompt": "How do I create a navigation menu in TypoScript? Show me the recipe.", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--recipe.*menu" }, + { "type": "content", "pattern": "(HMENU|MenuProcessor|menu)" } + ] + }, + { + "name": "deprecations_v13", + "prompt": "What TypoScript features are deprecated in TYPO3 v13?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--deprecations" }, + { "type": "content", "pattern": "(INCLUDE_TYPOSCRIPT|Site Sets|deprecated)" } + ] + }, + { + "name": "deprecations_v14", + "prompt": "What TypoScript changes are removed in TYPO3 v14?", + "assertions": [ + { "type": "content", "pattern": "INCLUDE_TYPOSCRIPT" }, + { "type": "content", "pattern": "(removed|removal)" } + ] + }, + { + "name": "debug_page_not_configured", + "prompt": "I get 'The page is not configured' error in my TYPO3 frontend. How do I fix it?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--debug.*page.*not configured" }, + { "type": "content", "pattern": "(PAGE|page\\s*=|typeNum)" } + ] + }, + { + "name": "debug_template_not_found", + "prompt": "TYPO3 shows 'No TypoScript template found' on my page. What is wrong?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--debug" }, + { "type": "content", "pattern": "(sys_template|Site Set|root)" } + ] + }, + { + "name": "checklist_typoscript", + "prompt": "Give me a code review checklist for TypoScript files.", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--checklist.*typoscript" }, + { "type": "content", "pattern": "(no_cache|deprecated|stdWrap)" } + ] + }, + { + "name": "checklist_fluid", + "prompt": "What should I check when reviewing Fluid templates?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--checklist.*fluid" }, + { "type": "content", "pattern": "(f:translate|f:format\\.raw|escap)" } + ] + }, + { + "name": "review_existing_typoscript", + "prompt": "Review this TypoScript for issues:\n```typoscript\npage = PAGE\npage.10 = FLUIDTEMPLATE\npage.10.file = EXT:my_ext/template.html\nconfig.no_cache = 1\n[globalVar = GP:L=1]\n config.sys_language_uid = 1\n[end]\n```", + "assertions": [ + { "type": "content", "pattern": "(no_cache|deprecated|production)" }, + { "type": "content", "pattern": "(condition|globalVar|legacy|Symfony)" }, + { "type": "content", "pattern": "(templateRootPaths|file)" } + ] + }, + { + "name": "lint_rules_lookup", + "prompt": "What lint rules should I follow when writing TypoScript?", + "assertions": [ + { "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--lint" }, + { "type": "content", "pattern": "(indent|spacing|lint)" } + ] + }, + { + "name": "site_sets_v13", + "prompt": "How do I set up Site Sets in TYPO3 v13 to distribute my extension's TypoScript?", + "assertions": [ + { "type": "content", "pattern": "config\\.yaml" }, + { "type": "content", "pattern": "(settings\\.definitions|dependencies|Configuration/Sets)" } + ] + }, + { + "name": "coa_vs_coa_int", + "prompt": "When should I use COA_INT instead of COA in TypoScript?", + "assertions": [ + { "type": "content", "pattern": "COA_INT" }, + { "type": "content", "pattern": "(uncached|dynamic|per.request|every request)" }, + { "type": "content", "pattern": "(cache|performance|overhead)" } + ] + }, + { + "name": "copy_vs_reference", + "prompt": "What is the difference between < and =< operators in TypoScript?", + "assertions": [ + { "type": "content", "pattern": "(copy|independent)" }, + { "type": "content", "pattern": "(reference|linked|current state)" } + ] + }, + { + "name": "fluid_xss_prevention", + "prompt": "How do I prevent XSS in my Fluid templates?", + "assertions": [ + { "type": "content", "pattern": "(escape|auto.escap|f:format\\.raw)" }, + { "type": "content", "pattern": "(f:sanitize\\.html|trusted|user.input)" } + ] + }, + { + "name": "dataprocessor_usage", + "prompt": "I need to fetch news records and display them in a Fluid template. Should I use CONTENT cObject or DatabaseQueryProcessor?", + "assertions": [ + { "type": "content", "pattern": "DatabaseQueryProcessor" }, + { "type": "content", "pattern": "(Fluid|prefer|dataProcessing)" } + ] + }, + { + "name": "condition_syntax_v12", + "prompt": "How do I write a condition in TypoScript that checks if a backend user is logged in (TYPO3 v12+)?", + "assertions": [ + { "type": "content", "pattern": "backend\\.user\\.isLoggedIn" }, + { "type": "content", "pattern": "(Symfony|Expression Language|\\[)" } + ] + }, + { + "name": "migration_v12_to_v13", + "prompt": "What TypoScript changes are needed when upgrading from TYPO3 v12 to v13?", + "assertions": [ + { "type": "content", "pattern": "(Site Sets|PAGEVIEW|config\\.baseURL)" }, + { "type": "content", "pattern": "(migration|upgrade|replace)" } + ] + } +]