Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 44 additions & 31 deletions skills/typo3-typoscript-ref/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The statement that FLUIDTEMPLATE is deprecated in v14 contradicts the provided reference files. According to references/review/migration-v12-to-v13.md (line 13) and references/review/deprecations.md (line 76), FLUIDTEMPLATE is NOT deprecated and continues to work in v13 and v14, although PAGEVIEW is recommended for new page templates.

Suggested change
- **v14**: Site Sets mandatory, FLUIDTEMPLATE deprecated, @import replaces INCLUDE_TYPOSCRIPT
- **v14**: Site Sets mandatory, @import replaces INCLUDE_TYPOSCRIPT, PAGEVIEW recommended


# 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

Expand Down
166 changes: 166 additions & 0 deletions skills/typo3-typoscript-ref/evals/evals.json
Original file line number Diff line number Diff line change
@@ -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" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The assertion pattern lookup\.sh.*--lint is imprecise. The actual flag defined in SKILL.md and implemented in lookup.sh is --lint-rules. Updating the pattern ensures the evaluation specifically verifies the correct flag usage.

Suggested change
{ "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--lint" },
{ "type": "tool_use", "tool": "Bash", "pattern": "lookup\\.sh.*--lint-rules" },

{ "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)" }
]
}
]
Loading