mcpField
T
typo3-typoscript-ref

typo3-typoscript-ref

github.com/netresearch开发257 次安装5 天前更新
代码仓库

关于 typo3-typoscript-ref

typo3-typoscript-ref 为 TYPO3 开发者提供 TypoScript、TSconfig 和 Fluid 的版本感知本地参考查询,并内置最佳实践提示。它涵盖代码编写、审查、弃用检查和问题排查。

主要功能

  1. 01按版本查询本地参考
  2. 02TypoScript、TSconfig 与 Fluid 指南
  3. 03检查弃用项与最佳实践
  4. 04提供审查清单和 lint 规则
  5. 05按配方查询并排查错误

适用场景

  1. 01编写符合 TYPO3 版本的配置
  2. 02审查现有 TypoScript 或 Fluid
  3. 03检查项目弃用项与安全问题
  4. 04排查页面配置错误

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/netresearch/typo3-typoscript-ref-skill --skill typo3-typoscript-ref

安装后在 Claude Code 中输入/typo3-typoscript-ref确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

evals/
evals.json
references/
annotations.json
debugging.md
patterns.md
topic-index.md
version-map.json
references/recipes/
ajax-endpoint.md
breadcrumb.md
content-elements.md
custom-content-element.md
error-pages.md
extbase-plugin.md
image-rendering.md
menu-setup.md
multi-language.md
page-setup.md
rte-config.md
site-sets.md
sitemap.md
structured-data.md
trailing-slash.md
references/review/
common-mistakes.md
deprecations.md
linting.md
migration-v12-to-v13.md
migration-v13-to-v14.md
performance.md
review-checklist.md
security.md
scripts/
detect-version.sh

详细介绍

TYPO3 TypoScript、TSconfig 和 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

规则

  1. 编写或审查 TypoScript/TSconfig/Fluid 代码前,始终运行 lookup.sh
  2. 始终遵循最佳实践注释(必需/已弃用/建议/提示)
  3. 编写 TypoScript 前,始终检查项目 lint 规则(--lint-rules)
  4. 编写新代码时:采用检测到的版本所支持的最新方法
  5. 审查现有代码时:标记已弃用的写法,并使用 --deprecations 检查项目版本
  6. 对于同时涉及 TypoScript 和 Fluid 的任务:使用 --with-fluid 标志
  7. 绝不要在生产配置中生成 config.no_cache = 1
  8. 在基于 Fluid 的模板中,优先使用 DataProcessors,而不是 CONTENT cObject

特定版本指南

  • v12:使用 FLUIDTEMPLATE、sys_template 静态包含和 constants.typoscript
  • v13:新建页面模板时优先使用 PAGEVIEW,引入 Site Sets,并使用 settings.definitions.yaml
  • v14:Site Sets 为必需项;PAGEVIEW 是页面渲染的标准方式(FLUIDTEMPLATE 属于旧式方案,但未被官方弃用);@import 为必需项(INCLUDE_TYPOSCRIPT 已移除);getTSFE() 条件已移除;资源路径优先使用 PKG: 而不是 EXT:

回答特定版本的问题时,始终查阅 references/review/deprecations.md 和相关迁移指南(migration-v12-to-v13.md 或 migration-v13-to-v14.md)。

审查工作流

审查 TypoScript/TSconfig/Fluid 代码时:

  1. 针对文件类型(typoscript、tsconfig 或 fluid)运行 --checklist
  2. 使用项目版本筛选 --deprecations 的结果
  3. 对照 references/review/common-mistakes.md 检查已知问题
  4. 查阅 references/review/security.md,检查 Fluid XSS 写法(f:format.raw、f:sanitize.html)
  5. 查阅 references/review/performance.md,检查是否过度使用 COA_INT/USER_INT
  6. 使用 --review 标志进行关键词查询,以附加弃用相关说明

参考索引

需求参考资料
TypoScript 写法、Fluid 最佳实践references/patterns.md
调试错误references/debugging.md
弃用列表references/review/deprecations.md
安全性(XSS、转义)references/review/security.md
性能(缓存、INT 对象)references/review/performance.md
常见错误references/review/common-mistakes.md
v12-v13 迁移references/review/migration-v12-to-v13.md
v13-v14 迁移references/review/migration-v13-to-v14.md
尾部斜杠、PageTypeSuffix、重复内容references/recipes/trailing-slash.md
主题索引(lookup.sh)references/topic-index.md

首次运行

scripts/lookup.sh --update

评论

支持 Markdown