
Typo3 Docs
- 62 installs
- 7 repo stars
- Updated August 4, 2026
- netresearch/typo3-docs-skill
Helps with ai & agent building tasks.
About
typo3-docs is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- typo3-docs
- AI & Agent Building
- AI-coding skill
Typo3 Docs by the numbers
- 62 all-time installs (skills.sh)
- +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #6,310 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/netresearch/typo3-docs-skill --skill typo3-docsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 62 |
|---|---|
| repo stars | ★ 7 |
| Last updated | August 4, 2026 |
| Repository | netresearch/typo3-docs-skill ↗ |
What it does
Helps with ai & agent building tasks.
Files
TYPO3 Documentation Skill
Create and maintain TYPO3 extension documentation following official docs.typo3.org standards.
Core Workflow
1. Run extraction first to identify documentation gaps:
scripts/extract-all.sh /path/to/extension
scripts/analyze-docs.sh /path/to/extension2. Consult the appropriate reference file for the task 3. Use TYPO3-specific directives, not plain text 4. Validate: scripts/validate_docs.sh /path/to/extension 5. Render: scripts/render_docs.sh /path/to/extension
Critical: When the user asks to "show docs", render and display HTML output, not raw RST.
Element Selection Guide
| Content Type | Directive |
|---|---|
| Complete code | literalinclude (preferred over code-block) |
| Short snippets | code-block with :caption: |
| Config options | confval with :name:, :type:, :default: |
| PHP API | php:method:: -- use :returntype: for nullable/union types |
| Notices | note, tip, warning, important |
| Feature grids | card-grid with stretched-link in footer |
| Alternatives | tabs (synchronized) |
| Screenshots | figure with :zoom: lightbox :class: with-border with-shadow |
Critical Rules
- UTF-8, 4-space indent, 80 char lines, LF
- CamelCase files, sentence case headings
- Permalink anchors (
.. _label:) before every heading - Index.rst in every subdirectory
- PNG screenshots with
:alt:and:zoom: lightbox - .editorconfig in
Documentation/ - Screenshots MANDATORY for backend modules, config, workflows
- Max 250 lines per RST -- split with
toctree - No `mailto:` -- use GitHub Issues/Discussions
- PHP domain: no
?Type/Type|nullinphp:method::; use:returntype:
Code Example Validation
Cross-reference code examples against extension source: grep method names in Classes/, compare CLI arguments against configure(), verify API signatures match. See references/extraction-patterns.md.
Pre-Commit Checklist
1. .editorconfig in Documentation/, Index.rst in every directory 2. 4-space indent, no tabs, max 80 chars 3. Code blocks have :caption:, inline code uses proper roles 4. Screenshots exist with :alt: and :zoom: lightbox 5. scripts/validate_docs.sh passes, render has no warnings 6. README and Documentation/ are synchronized
References
references/file-structure.md-- directory layout, naming conventionsreferences/guides-xml.md-- build configuration, interlink settingsreferences/coding-guidelines.md-- .editorconfig, indentation rulesreferences/rst-syntax.md-- headings, lists, tables, formattingreferences/text-roles-inline-code.md--:php:,:file:,:guilabel:,:ref:references/code-structure-elements.md-- code blocks, confval, PHP domainreferences/typo3-directives.md-- confval, versionadded, deprecatedreferences/content-directives.md-- accordion, tabs, card-gridreferences/screenshots.md-- image requirements, figure directivesreferences/rendering.md-- Docker commands, live previewreferences/intercept-deployment.md-- webhook, build triggersreferences/asset-templates-guide.md-- templates, screenshot workflowreferences/architecture-decision-records.md-- ADR patternsreferences/documentation-coverage-analysis.md-- coverage scoringreferences/scripts-guide.md-- script optionsreferences/typo3-extension-architecture.md-- extension layout
Documentation Context for AI Assistants
This is the official TYPO3 extension documentation directory in reStructuredText (RST) format.
Documentation Type
TYPO3 Extension Documentation - Published at docs.typo3.org
Documentation Strategy
<!-- Describe what this documentation covers and its target audience --> <!-- Example: "End-user guide for content editors using the extension features" --> <!-- Example: "Technical integration guide for developers implementing custom configurations" --> <!-- Example: "Complete extension documentation including user guide, configuration reference, and API docs" -->
Target Audience:
Main Topics:
Not Covered: <!-- What is intentionally documented elsewhere -->
Documentation Framework
- Format: reStructuredText (RST)
- Build System: TYPO3 Documentation rendering tools
- Published At: https://docs.typo3.org/p/[vendor]/[extension]/main/en-us/
- Automated Build: TYPO3 Intercept webhook deployment
File Structure
Required Files
Index.rst- Main documentation entry pointguides.xml- Documentation metadata (modern, preferred)Settings.cfg- Documentation metadata (legacy, migrate to guides.xml)
Common Sections
Introduction/- Getting started, features overviewInstallation/- Installation and upgrade guidesConfiguration/- TypoScript, extension configurationIntegration/- Integration with other systemsEditor/- User guide for content editorsDeveloper/- Developer documentationAPI/- PHP API reference documentationTroubleshooting/- Common issues and solutions
TYPO3-Specific Directives
Configuration Documentation
Use confval for configuration options:
.. confval:: myOption
:name: ext-myext-myoption
:type: string
:Default: 'default value'
Description of the configuration option.Version Documentation
Document version-specific features:
.. versionadded:: 2.0
Support for feature X was added.
.. versionchanged:: 2.1
Behavior changed to improve performance.
.. deprecated:: 2.2
This feature will be removed in version 3.0.PHP API Documentation
Document PHP methods and classes:
.. php:method:: processData(array $data): array
Process the provided data array.
:param array $data: The input data
:returns: Processed data arrayCard Grid Navigation
Create visual navigation with card grids:
.. card-grid::
:columns: 2
:gap: 4
.. card:: :ref:`Installation <installation>`
How to install and configure the extension.
.. card:: :ref:`Configuration <configuration>`
TypoScript and extension configuration reference.Cross-References
Internal References
.. _my-section-label:
Section Title
=============
Reference it with :ref:`my-section-label` or :ref:`custom text <my-section-label>`External TYPO3 Docs
:ref:`t3coreapi:caching` - Reference to TYPO3 Core API docs
:ref:`t3tsref:stdwrap` - Reference to TypoScript ReferenceCode References
:php:`ClassName` - PHP class
:ts:`config.tx_myext` - TypoScript
:file:`Configuration/TCA/` - File path
:bash:`composer require` - Shell commandRST Syntax Patterns
Headings
=============
Document Title (Level 1 - only once per file)
=============
Section (Level 2)
=================
Subsection (Level 3)
--------------------
Subsubsection (Level 4)
^^^^^^^^^^^^^^^^^^^^^^^Lists
Bullet list:
* Item 1
* Item 2
Numbered list:
#. First
#. Second
Definition list:
Term
Definition of the term.Code Blocks
.. code-block:: php
<?php
$variable = 'value';
.. code-block:: typoscript
plugin.tx_myext {
setting = value
}Admonitions
.. note::
Important information for users.
.. warning::
Critical warning about potential issues.
.. tip::
Helpful suggestion or best practice.Local Rendering
Render Documentation
# Using Docker (recommended)
cd Documentation
docker run --rm --pull always \
-v $(pwd):/project \
ghcr.io/typo3-documentation/render-guides:latest \
--config=Documentation
# View output
open Documentation-GENERATED-temp/Result/project/0.0.0/Index.htmlValidate Documentation
# Check for syntax errors and warnings
scripts/validate_docs.sh
# Common issues to check:
# - Broken cross-references
# - Invalid directive syntax
# - Heading level inconsistencies
# - Missing required filesDeployment
TYPO3 Intercept Webhook
Documentation is automatically built and deployed when:
1. Changes pushed to main branch 2. Webhook configured (docs-hook.typo3.org) 3. TYPO3 Intercept receives notification 4. Documentation rebuilt and published
guides.xml Configuration (Modern - Preferred)
<?xml version="1.0" encoding="UTF-8"?>
<guides xmlns="https://www.phpdoc.org/guides"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.phpdoc.org/guides https://www.phpdoc.org/guides/guides.xsd"
default-code-language="php">
<project title="Extension Name"
version="1.0.0"
copyright="since 2024 by Vendor Name"/>
<extension class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
edit-on-github="vendor/extension"
edit-on-github-branch="main"
edit-on-github-directory="Documentation"
project-home="https://github.com/vendor/extension"
project-repository="https://github.com/vendor/extension"
project-issues="https://github.com/vendor/extension/issues"/>
</guides>Settings.cfg Configuration (Legacy)
[general]
project = Extension Name
version = 1.0
release = 1.0.0
copyright = 2024
[html_theme_options]
project_repository = https://github.com/vendor/extensionNote: New extensions should useguides.xml. Migrate existingSettings.cfgtoguides.xmlfor modern PHP-based rendering.
Documentation Extraction and Analysis
Using Extraction Tools
Before creating or updating documentation, use extraction tools to:
1. Identify gaps - Find undocumented classes, methods, and configuration options 2. Ensure accuracy - Verify documented defaults match actual code 3. Speed up documentation - Use extracted data as templates
Extraction Workflow
Step 1: Extract Project Data
# From project root directory
cd /path/to/extension
scripts/extract-all.sh # Core extraction (PHP, configs, composer)
scripts/extract-all.sh --all # Include build configs and repo metadataExtraction data saved to .claude/docs-extraction/data/:
php_apis.json- Classes, methods, docblocksextension_meta.json- ext_emconf.php dataconfig_options.json- ext_conf_template.txt optionsdependencies.json- composer.json requirementsproject_files.json- README, CHANGELOG content
Step 2: Analyze Coverage
scripts/analyze-docs.shGenerates Documentation/ANALYSIS.md with:
- Missing documentation items
- Outdated configuration defaults
- Inconsistencies between code and docs
- Prioritized recommendations
Step 3: Review Analysis
Open Documentation/ANALYSIS.md and identify:
- Priority 1: Missing core documentation (undocumented classes, essential configs)
- Priority 2: Outdated content (wrong defaults, old signatures)
- Priority 3: Enhancement opportunities (missing examples, incomplete descriptions)
Step 4: Use Extracted Data
When documenting items from ANALYSIS.md:
1. Open corresponding JSON file in .claude/docs-extraction/data/ 2. Copy relevant information (descriptions, defaults, types) 3. Create RST documentation using proper directives 4. Add examples and context beyond extracted data
Example: Using Extracted Config Data
ANALYSIS.md identifies missing option:
### fetchExternalImages
- Type: boolean
- Default: true
- Security Warning: Enabling this setting fetches arbitrary URLsCheck extracted data:
cat .claude/docs-extraction/data/config_options.json | jq '.config_options[] | select(.key=="fetchExternalImages")'Create documentation:
.. confval:: fetchExternalImages
:type: boolean
:Default: true
:Path: $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['ext_key']['fetchExternalImages']
[Paste extracted description]
.. warning::
[Paste extracted security warning]
[TODO: Add usage examples]
[TODO: Add troubleshooting tips]Extraction Best Practices
DO:
- Run
scripts/analyze-docs.shbefore starting documentation work - Use extracted data as starting templates, not final documentation
- Add usage examples and context beyond extracted descriptions
- Re-run analysis after updates to track progress
- Keep extraction data gitignored (already in
.claude/)
DON'T:
- Skip extraction for existing extensions (saves time finding gaps)
- Commit
.claude/docs-extraction/to version control - Blindly copy extracted data without adding examples
- Ignore security warnings in config option extractions
- Forget to validate after using extracted data
Extraction Data Structure
php_apis.json:
{
"classes": [
{
"name": "ClassName",
"namespace": "Vendor\\Extension\\Path",
"file": "Classes/Path/ClassName.php",
"description": "Class description from docblock",
"author": "Author Name",
"methods": [...]
}
]
}config_options.json:
{
"config_options": [
{
"key": "settingName",
"type": "boolean",
"default": "1",
"description": "Description from ext_conf_template.txt",
"security_warning": "Warning text if present"
}
]
}See references/extraction-patterns.md for complete extraction documentation.
Best Practices
1. Clear Structure: Organize docs by audience (users vs developers) 2. Card Grids: Use card-grid for main navigation pages 3. Cross-References: Use :ref: labels instead of hardcoded paths 4. Code Examples: Always include working code examples 5. Version Markers: Document version-specific features 6. Screenshots: Place in Images/ directory, reference with .. image:: 7. Validation: Always validate before committing 8. Local Preview: Render locally to verify appearance
Common Issues
Broken cross-references:
- Verify label exists:
.. _label-name: - Check reference syntax:
:ref:label-name`` - Ensure label is unique
Rendering warnings:
- Check heading level consistency (no skipped levels)
- Verify directive syntax (proper indentation)
- Validate code block languages are supported
Webhook not triggering:
- Check guides.xml or Settings.cfg has correct repository URL
- Verify webhook configured in repository settings (https://docs-hook.typo3.org)
- Check TYPO3 Intercept logs for errors
- First-time webhooks require TYPO3 Documentation Team approval (1-3 days)
Resources
- TYPO3 Documentation Guide
- RST Syntax Reference
- TYPO3 Directives
- Card Grids
- Cross-References
- Local Rendering
# Checkpoints for typo3-docs skill
# Validates TYPO3 extension documentation following docs.typo3.org standards
version: 1
skill_id: typo3-docs
mechanical:
# === DIRECTORY STRUCTURE ===
- id: TD-01
type: file_exists
target: Documentation/
severity: error
desc: "Documentation/ directory must exist"
- id: TD-02
type: file_exists
target: Documentation/Index.rst
severity: error
desc: "Documentation/Index.rst must exist as main entry point"
- id: TD-03
type: file_exists
target: Documentation/guides.xml
severity: error
desc: "Documentation/guides.xml must exist for rendering configuration"
# === EDITORCONFIG ===
- id: TD-04
type: file_exists
target: Documentation/.editorconfig
severity: warning
desc: "Documentation/.editorconfig should exist for consistent formatting"
# === GUIDES.XML CONTENT ===
- id: TD-05
type: contains
target: Documentation/guides.xml
pattern: "<project"
severity: error
desc: "guides.xml must contain project element"
- id: TD-06
type: contains
target: Documentation/guides.xml
pattern: "version="
severity: warning
desc: "guides.xml should specify documentation version"
# guides.xml extension identification — any of these per-line tokens
# satisfies the check. The previous regex required `<extension` and
# `class=` on the same line (rare in real guides.xml — TYPO3 docs
# convention puts each attribute on its own line). It also rejected
# the slash form `vendor/key` for interlink-shortcode (the real
# canonical form).
- id: TD-07
type: regex
target: Documentation/guides.xml
pattern: 'extension-key="[a-z_-]+"|<extension(>|[[:space:]]|$)|interlink-shortcode="[a-z_/-]+"'
severity: warning
desc: "guides.xml should identify the extension via extension-key=, <extension …>, or interlink-shortcode=vendor/key"
# === INDEX.RST CONTENT ===
- id: TD-08
type: regex
target: Documentation/Index.rst
pattern: "^={3,}$"
severity: error
desc: "Index.rst must have proper RST title underline"
- id: TD-09
type: contains
target: Documentation/Index.rst
pattern: ".. toctree::"
severity: warning
desc: "Index.rst should have toctree directive"
# === FILE NAMING (CamelCase) ===
- id: TD-10
type: command
pattern: "find Documentation/ -name '*.rst' | grep -E '/[a-z]' | grep -v Index.rst | head -1 && exit 1 || exit 0"
severity: warning
desc: "RST files should use CamelCase naming (e.g., Configuration.rst not configuration.rst)"
# === IMAGE FORMAT ===
- id: TD-11
type: command
pattern: "find Documentation/ -type f \\( -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' -o -name '*.bmp' \\) | head -1 && exit 1 || exit 0"
severity: warning
desc: "Images should be in PNG format, not JPG/GIF/BMP"
- id: TD-12
type: file_exists
target: Documentation/Images/
severity: info
desc: "Documentation/Images/ directory should exist for screenshots"
# === README CONSISTENCY ===
- id: TD-13
type: file_exists
target: README.md
severity: warning
desc: "README.md should exist at repository root"
- id: TD-14
type: contains
target: README.md
pattern: "Documentation"
severity: info
desc: "README.md should reference the Documentation folder"
# === NO MAILTO LINKS ===
- id: TD-18
type: command
pattern: "grep -rn 'mailto:' Documentation/ 2>/dev/null | head -1 && exit 1 || exit 0"
severity: warning
desc: "Documentation must not contain mailto: links; use GitHub Issues/Discussions URLs"
# === INDEX.RST IN SUBDIRECTORIES ===
- id: TD-19
type: command
pattern: "find Documentation/ -mindepth 1 -type d ! -name Images ! -name '_*' 2>/dev/null | while read dir; do [ ! -f \"$dir/Index.rst\" ] && echo \"Missing: $dir/Index.rst\" && exit 1; done; exit 0"
severity: warning
desc: "Every Documentation/ subdirectory must contain an Index.rst file"
# === GUIDES.XML THEME ===
- id: TD-25
type: contains
target: Documentation/guides.xml
pattern: 'theme="typo3docs"'
severity: warning
desc: "guides.xml should use theme=\"typo3docs\" for proper TYPO3 documentation rendering"
# === MAX RST PAGE LENGTH ===
- id: TD-26
type: command
pattern: "find Documentation/ -name '*.rst' -exec sh -c 'wc -l < \"$1\"' _ {} \\; 2>/dev/null | awk '$1 > 250 {found=1} END {exit found ? 1 : 0}'"
severity: info
desc: "RST pages should not exceed 250 lines; split into sub-pages with toctree"
# === NO TABS IN RST ===
- id: TD-27
type: command
pattern: "grep -rPn '\\t' Documentation/*.rst Documentation/**/*.rst 2>/dev/null | head -1 && exit 1 || exit 0"
severity: warning
desc: "RST files must use spaces only (4 spaces), never tabs"
# === COMMON DOCUMENTATION SECTIONS ===
- id: TD-15
type: file_exists
target: Documentation/Configuration/
severity: info
desc: "Documentation/Configuration/ directory should exist"
- id: TD-16
type: file_exists
target: Documentation/Installation/
severity: info
desc: "Documentation/Installation/ directory should exist"
- id: TD-17
type: file_exists
target: Documentation/Introduction/
severity: info
desc: "Documentation/Introduction/ directory should exist"
# === DOCUMENTATION ACCURACY ===
- id: TD-30
type: command
pattern: "bash scripts/check-guides-xml-version-sync.sh"
severity: error
desc: "guides.xml version and release attributes must both match ext_emconf.php version"
- id: TD-31
type: command
pattern: "grep -rn 'getTranslation\\|importXliffFile\\|findByIdentifier\\|findByComponent' Documentation/ 2>/dev/null | head -1 && echo 'Found common wrong method names in documentation' && exit 1 || exit 0"
severity: error
desc: "Documentation must not reference common wrong method names (getTranslation, importXliffFile, findByIdentifier, findByComponent)"
# === DOCUMENTATION COMPLETENESS ===
- id: TD-41
type: command
pattern: "bash scripts/check-unreleased-versions.sh"
severity: warning
desc: "versionadded/versionchanged directives should reference released versions only"
# Note: TD-43 (guides.xml version+release sync) removed — consolidated into TD-30
# which now uses check-guides-xml-version-sync.sh (checks both version and release attributes)
# === REQUIRED DOCUMENTATION SECTIONS ===
- id: TD-44
type: command
pattern: "bash scripts/check-required-doc-sections.sh"
severity: warning
desc: "Documentation should include Introduction, Installation, Configuration, Usage, Developer, and Troubleshooting/FAQ sections"
# === UNTRANSLATED FLUID STRINGS ===
- id: TD-45
type: command
pattern: "bash scripts/check-untranslated-fluid-strings.sh"
severity: warning
desc: "Fluid templates should use f:translate for user-facing text; flag hardcoded English strings (>3 words in title/aria-label/alt)"
# === RST SUBSTITUTIONS USAGE ===
- id: TD-46
type: command
pattern: "bash scripts/check-rst-substitutions-used.sh"
severity: info
desc: "If Includes.rst.txt defines substitutions, they should be used in Introduction/Index.rst and Installation/Index.rst instead of hardcoded values"
# === PLANTUML RENDERING ===
- id: TD-47
type: command
pattern: "grep -rnP '\\.\\.\\s*uml::' Documentation/ 2>/dev/null | head -1 && echo 'Found .. uml:: directive(s) — TYPO3 docs toolchain may not support PlantUML. Use .. code-block:: text or .. figure:: instead.' && exit 1 || exit 0"
severity: warning
desc: ".. uml:: directives require PlantUML support which TYPO3 docs toolchain may not provide; use .. code-block:: text or .. figure:: alternatives"
# === CHANGELOG VERSION COVERAGE ===
- id: TD-48
type: command
pattern: "bash scripts/check-changelog-version-coverage.sh"
severity: warning
desc: "CHANGELOG.md should have entries for all git tags between initial and current version"
# === ADR COVERAGE ===
- id: TD-49
type: command
pattern: "bash scripts/check-adr-coverage.sh"
severity: info
desc: "Extensions with >10 classes should have Documentation/Developer/Adr/ for significant architectural decisions"
llm_reviews:
# === CONTENT QUALITY ===
- id: TD-20
domain: documentation
prompt: |
Review the Documentation/Index.rst file for:
- Proper RST formatting with correct heading levels
- Clear project description in the introduction
- Logical toctree ordering (Introduction, Installation, Configuration, etc.)
- Appropriate maxdepth setting in toctree
Report any formatting issues or missing standard sections.
severity: warning
desc: "Index.rst should have proper structure and formatting"
- id: TD-21
domain: documentation
prompt: |
Compare README.md with Documentation/Index.rst:
- Extension name should be consistent
- Version references should match
- Feature descriptions should align
- Installation instructions should not contradict
Report any inconsistencies between these files.
severity: warning
desc: "README.md and Documentation should be consistent"
- id: TD-22
domain: documentation
prompt: |
Review the guides.xml configuration for:
- Correct project name matching extension key
- Appropriate release/version values
- Valid copyright statement
- Proper vendor and extension settings
Check against TYPO3 documentation rendering requirements.
severity: warning
desc: "guides.xml should be properly configured for docs.typo3.org"
- id: TD-23
domain: documentation
prompt: |
Check documentation completeness:
- Installation instructions with composer and TER options
- Configuration reference for TypoScript/FlexForm settings
- Usage examples with code snippets
- Changelog or version history
Report missing critical sections for an extension user.
severity: info
desc: "Documentation should cover installation, configuration, and usage"
- id: TD-24
domain: documentation
prompt: |
Review RST file naming conventions:
- Files should use CamelCase (Configuration.rst, not configuration.rst)
- Index.rst is the exception (lowercase allowed)
- Directory names should also follow CamelCase
List any files not following the convention.
severity: info
desc: "RST files should follow TYPO3 CamelCase naming convention"
# === DOCUMENTATION ACCURACY ===
- id: TD-32
domain: documentation
prompt: |
Review Documentation/Configuration/Index.rst (and any TypoScript configuration docs) for backend module TypoScript usage.
Backend modules MUST use the `module.` prefix in TypoScript, NOT `plugin.`.
Check for patterns like:
- `plugin.tx_extensionname` used for backend module configuration (WRONG)
- Should be `module.tx_extensionname` for backend modules
Report any instances where `plugin.` prefix is used for backend module TypoScript configuration.
severity: warning
desc: "TypoScript docs must use module. prefix (not plugin.) for backend modules"
- id: TD-33
domain: documentation
prompt: |
Compare CLI command documentation against the actual ImportCommand (or other Command classes) configure() method.
For each documented CLI command:
1. Find the corresponding Command class in Classes/Command/
2. Read its configure() method to get actual arguments and options
3. Compare documented arguments/options against actual configure() definitions
4. Check that argument names, option names, descriptions, and required/optional status match
Report any mismatches between documented CLI arguments and actual Command::configure() definitions.
severity: error
desc: "CLI command documentation must match actual Command::configure() arguments"
- id: TD-40
domain: documentation
prompt: |
Check Documentation/ChangeLog/Index.rst (or similar changelog file) against git tags.
1. List all git tags with `git tag -l`
2. For each tag that represents a release version, verify it appears in the changelog
3. Check that changelog entries are in reverse chronological order
Report any git tags (release versions) missing from the changelog documentation.
severity: warning
desc: "ChangeLog should include entries for all git tags (release versions)"
- id: TD-42
domain: documentation
prompt: |
Check all Documentation sections that should contain screenshots (especially for backend modules, configuration screens, and UI workflows).
Look for:
- Sections with TODO placeholders instead of actual content
- Screenshot references (.. figure::) pointing to non-existent images
- Sections titled "Screenshots" or similar that are empty or contain only placeholder text
- Backend module documentation lacking any screenshots
Report any sections with missing or placeholder screenshot content.
severity: medium
desc: "Screenshots sections should have actual content, not TODO placeholders"
# === API EXAMPLE ACCURACY ===
- id: TD-50
domain: documentation
prompt: |
Compare code examples in README.md and Documentation/ RST files against the actual codebase.
For each code example that references PHP classes, methods, or functions:
1. Find the actual class in Classes/ directory
2. Verify the method signatures match (method name, parameters, return types)
3. Check that convenience methods shown in examples actually exist
4. Verify namespace and use statements are correct
Report any code examples that reference methods or signatures that don't exist in the codebase.
severity: error
desc: "Code examples in README.md and docs must use actual method signatures from the codebase"
{
"skill_name": "typo3-docs",
"evals": [
{
"id": 1,
"eval_name": "create-docs-from-scratch",
"prompt": "Create documentation for this TYPO3 extension from scratch. It has PHP classes, TCA configuration, and a backend module but no Documentation/ directory yet.",
"expected_output": "A complete Documentation/ directory with guides.xml, Index.rst, subdirectories for Configuration, Installation, and Editor sections. Each subdirectory has its own Index.rst. An .editorconfig is present. guides.xml has correct project, version, and interlink attributes.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Documentation/Index.rst exists with correct RST heading hierarchy",
"Documentation/guides.xml exists with project attribute matching extension key",
"guides.xml contains typo3/cms interlink entry",
"Documentation/.editorconfig exists with indent_size = 4",
"Every subdirectory under Documentation/ contains an Index.rst",
"RST files use 4-space indentation, not tabs",
"Headings use sentence case, not Title Case",
"File and directory names use CamelCase convention",
"No RST file exceeds 250 lines",
"Index.rst contains a toctree directive linking to sub-pages"
]
},
{
"id": 2,
"eval_name": "add-configuration-section",
"prompt": "Add a Configuration section to the existing TYPO3 extension documentation. The extension has TypoScript setup, FlexForm XML, and ext_conf_template.txt settings that need documenting.",
"expected_output": "A new Documentation/Configuration/Index.rst file with confval directives for each setting, organized by source (TypoScript, FlexForm, Extension Configuration). The parent toctree is updated to include the new section.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Documentation/Configuration/Index.rst exists",
"Uses confval directive with :type: and :default: options for settings",
"Parent Index.rst toctree includes Configuration/Index",
"TypoScript settings documented with code-block:: typoscript",
"FlexForm options documented with their actual field names",
"RST file uses 4-space indentation throughout",
"Line length does not exceed 80 characters",
"Section heading uses correct RST underline character for its level"
]
},
{
"id": 3,
"eval_name": "validate-and-fix-docs",
"prompt": "Check if the documentation follows TYPO3 standards and fix any issues. Run the validation script and correct all problems found.",
"expected_output": "A validation report identifying RST issues (indentation, missing alt text, incorrect heading levels, missing .editorconfig). Each issue is fixed in place. The validation script passes cleanly after fixes.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Runs scripts/validate_docs.sh against the extension path",
"Identifies specific RST issues with file paths and line numbers",
"Fixes indentation to 4-space standard",
"Ensures all figure/image directives have :alt: option",
"Ensures .editorconfig exists in Documentation/",
"Every subdirectory has an Index.rst after fixes",
"No mailto: links remain after fixes",
"Re-runs validation to confirm all issues resolved"
]
},
{
"id": 4,
"eval_name": "add-screenshots-backend-module",
"prompt": "Add screenshots to the documentation for the backend module. The extension has a TYPO3 backend module that needs visual documentation with annotated screenshots.",
"expected_output": "Screenshot placeholders or captured images in Documentation/Images/ with figure directives in the relevant RST files. Each figure uses :alt:, :zoom: lightbox, and :class: with-border with-shadow options.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Documentation/Images/ directory exists for screenshot storage",
"RST files use figure directive, not raw image directive",
"Every figure has :alt: text describing the screenshot content",
"Every figure has :zoom: lightbox option",
"Every figure has :class: with-border with-shadow",
"Screenshot filenames use CamelCase convention",
"Screenshots are PNG format",
"Figure captions describe what the user sees in the screenshot"
]
},
{
"id": 5,
"eval_name": "generate-guides-xml",
"prompt": "Create a guides.xml file for this TYPO3 extension. The extension is hosted on GitHub at netresearch/my-extension with composer name netresearch/my-extension. It supports TYPO3 12 and 13.",
"expected_output": "A Documentation/guides.xml with correct XML structure, theme attribute on <guides>, extension class, project metadata extracted from composer.json and GitHub, and appropriate inventory elements.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"guides.xml has theme='typo3docs' as attribute on <guides> element, not as child element",
"Extension element has class attribute with T3Docs Typo3DocsTheme extension class",
"edit-on-github uses owner/repo format, not full URL",
"edit-on-github-branch is set to the default branch",
"edit-on-github-directory is set to Documentation",
"project-contact does NOT use mailto: link",
"interlink-shortcode uses composer package name format",
"All inventory URLs end with trailing slash",
"project-home, project-repository, and project-issues attributes are present"
]
},
{
"id": 6,
"eval_name": "render-docs-docker",
"prompt": "Render the documentation for this TYPO3 extension locally using Docker and show me the result.",
"expected_output": "Executes the Docker render command with correct image and mount. Reports output location at Documentation-GENERATED-temp/Index.html. If errors occur, diagnoses and fixes RST issues before re-rendering.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses ghcr.io/typo3-documentation/render-guides:latest Docker image",
"Mounts project root as /project volume",
"Uses --config=Documentation flag",
"Reports output location as Documentation-GENERATED-temp/Index.html",
"Does not suggest obsolete Sphinx-based rendering tools",
"If render fails, diagnoses RST errors and fixes them"
]
},
{
"id": 7,
"eval_name": "confval-directive-usage",
"prompt": "Document these three extension configuration settings using proper TYPO3 directives: enableCache (boolean, default true), maxItems (integer, default 50), apiEndpoint (string, no default, required).",
"expected_output": "RST content using confval directive for each setting with :type:, :Default:, :name:, and description. Required setting has :required: true. Settings are organized under a configuration heading.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. confval:: directive for each setting",
"Each confval has :type: option with correct data type",
"Each confval has :name: option for cross-referencing",
"Boolean and integer settings have :Default: values",
"Required setting has :required: true or documents it as required",
"Uses 4-space indentation for directive content",
"Descriptive text explains what each setting does"
]
},
{
"id": 8,
"eval_name": "version-directives",
"prompt": "Add version information to the documentation: a new feature added in 2.0.0, a changed behavior in 2.1.0, and a deprecated option in 2.2.0 that will be removed in 3.0.0.",
"expected_output": "RST content using versionadded, versionchanged, and deprecated directives with version numbers and descriptive text explaining each change.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. versionadded:: 2.0.0 directive with description",
"Uses .. versionchanged:: 2.1.0 directive with description",
"Uses .. deprecated:: 2.2.0 directive with removal version mentioned",
"Each directive has indented description text",
"Directives are placed near the relevant content they describe",
"No plain text used where version directives should be"
]
},
{
"id": 9,
"eval_name": "rst-heading-hierarchy",
"prompt": "Create a documentation page with a title, two sections, and each section has a subsection. The topic is 'Extension configuration' covering TypoScript setup and site set configuration.",
"expected_output": "An RST file with correct heading hierarchy: = above and below for title, = below for sections, - below for subsections. Each heading has a permalink anchor label.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Page title uses = above and below the text",
"Section headings use = below only",
"Subsection headings use - below only",
"Underlines are exactly the same length as heading text",
"Every heading has a .. _label: anchor immediately before it",
"Labels use lowercase-with-hyphens format",
"Headings use sentence case, not Title Case"
]
},
{
"id": 10,
"eval_name": "text-roles-inline-code",
"prompt": "Write a paragraph in RST describing how to navigate to the TYPO3 backend module at Admin Tools > Settings, edit the file Configuration/TypoScript/setup.typoscript, use the keyboard shortcut Ctrl+S to save, and reference the TYPO3 Core API documentation for dependency injection.",
"expected_output": "RST content using :guilabel: for UI elements, :file: for file paths, :kbd: for keyboard shortcuts, and :ref: with intersphinx for cross-documentation references.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses :guilabel:`Admin Tools > Settings` for UI navigation",
"Uses :file: role for file path references",
"Uses :kbd:`Ctrl+S` for keyboard shortcuts",
"Uses :ref:`t3coreapi:dependency-injection` for cross-doc reference",
"Does not use plain text or backticks for UI elements",
"Does not use inline code for file paths where :file: should be used"
]
},
{
"id": 11,
"eval_name": "content-tabs-directive",
"prompt": "Create installation instructions for a TYPO3 extension that can be installed via Composer or via the Extension Manager. Show both methods using tabs.",
"expected_output": "RST content using the tabs directive with a Composer tab containing a code-block for the composer command and an Extension Manager tab with step-by-step instructions.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. tabs:: directive as container",
"Has .. tab:: Composer with code-block:: bash",
"Has .. tab:: Extension Manager with numbered steps",
"Proper indentation: tab content indented under tab directive",
"Code block has :caption: option",
"Tabs content is complete and actionable"
]
},
{
"id": 12,
"eval_name": "php-domain-documentation",
"prompt": "Document the PHP class ImageController in namespace Vendor\\Extension\\Controller. It has a method processImage(ServerRequestInterface $request): ResponseInterface that can return null on error.",
"expected_output": "RST content using php:namespace, php:class, and php:method directives. The nullable return type is handled via :returntype: annotation, not in the method signature.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. php:namespace:: directive for namespace",
"Uses .. php:class:: directive for the class",
"Uses .. php:method:: directive for processImage",
"Nullable return type uses :returntype: string|null, NOT ?ResponseInterface in signature",
"Method has :param: with type and description",
"Method has :returns: with description",
"Does not use ?Type or Type|null in method signature line"
]
},
{
"id": 13,
"eval_name": "intercept-webhook-setup",
"prompt": "Set up automatic documentation deployment to docs.typo3.org for a TYPO3 extension hosted on GitHub.",
"expected_output": "Step-by-step instructions for configuring the TYPO3 Intercept webhook on GitHub, including the correct payload URL, content type, and event selection. Mentions the first-build approval requirement.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Webhook payload URL is https://docs-hook.typo3.org",
"Content type is application/json",
"SSL verification is enabled",
"Push event is selected",
"Mentions that first build requires TYPO3 Documentation Team approval",
"Mentions that extension must be registered in TER",
"Does not reference obsolete docs rendering infrastructure"
]
},
{
"id": 14,
"eval_name": "code-example-validation",
"prompt": "The documentation references a method called generateReport() in the Developer section, but I'm not sure if it exists in the actual extension code. Validate the code examples in the documentation against the real source.",
"expected_output": "Cross-references code examples from Documentation/ RST files against actual PHP classes in Classes/. Identifies methods, class names, or CLI arguments that don't match the real code and suggests corrections.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Searches Classes/ directory for the referenced method name",
"Compares documented method signatures against actual PHP code",
"Reports mismatches between docs and source code",
"Checks CLI arguments against configure() methods in Command classes",
"Suggests corrections for any discrepancies found",
"Uses grep or search tools to find method definitions"
]
},
{
"id": 15,
"eval_name": "card-grid-navigation",
"prompt": "Create a card grid for the documentation Index.rst with cards for Introduction, Installation, Configuration, and Usage sections. Each card should have an emoji, description, and link.",
"expected_output": "RST content with card-grid directive containing four cards with emoji titles, descriptive text, and card-footer with stretched-link buttons linking to the respective sections.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. card-grid:: directive with :columns: and :columns-md: options",
"Each card uses .. card:: with emoji in title",
"Each card has .. card-footer:: with :ref: link",
"Card footer uses :button-style: with stretched-link class",
"Cards have descriptive text between title and footer",
"Grid has :gap: and :card-height: options set"
]
},
{
"id": 16,
"eval_name": "intersphinx-cross-references",
"prompt": "Add cross-references to the TYPO3 Core API documentation for dependency injection, TCA column types, and TypoScript stdWrap in the extension documentation.",
"expected_output": "RST content with :ref: roles using intersphinx prefixes (t3coreapi:, t3tca:, t3tsref:) and corresponding inventory entries in guides.xml.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses :ref:`t3coreapi:dependency-injection` syntax for Core API",
"Uses :ref:`t3tca:columns-types` syntax for TCA reference",
"Uses :ref:`t3tsref:stdwrap` syntax for TypoScript reference",
"Corresponding <inventory> elements exist in guides.xml",
"Inventory URLs end with trailing slash",
"Does not add unused inventory entries"
]
},
{
"id": 17,
"eval_name": "watch-mode-live-preview",
"prompt": "Set up live documentation preview with auto-reload for editing TYPO3 extension documentation.",
"expected_output": "Docker command for watch mode with separate volume mounts, port mapping, and the --watch flag. Mentions accessing http://localhost:1337 and limitations of watch mode.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses ghcr.io/typo3-documentation/render-guides:latest image",
"Includes --watch flag in docker command",
"Maps port 1337 with -p 1337:1337",
"Uses separate volume mounts for Documentation and GENERATED-temp",
"Mentions URL http://localhost:1337/Index.html for preview",
"Notes that guides.xml changes or new files require container restart"
]
},
{
"id": 18,
"eval_name": "extraction-and-analysis",
"prompt": "Analyze the documentation coverage for this TYPO3 extension. Identify what PHP classes, configuration options, and commands are documented vs undocumented.",
"expected_output": "Runs extraction scripts to discover documentable items in the extension, then analyzes coverage gaps. Reports which classes, settings, and CLI commands lack documentation.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Runs or references scripts/extract-all.sh for discovery",
"Runs or references scripts/analyze-docs.sh for coverage analysis",
"Identifies undocumented PHP classes from Classes/ directory",
"Identifies undocumented configuration settings",
"Identifies undocumented CLI commands if any exist",
"Provides actionable list of documentation gaps to fill"
]
},
{
"id": 19,
"eval_name": "editorconfig-and-formatting",
"prompt": "Ensure the documentation follows TYPO3 coding guidelines. Check that .editorconfig exists, indentation is 4 spaces, line endings are LF, and line length is max 80 chars.",
"expected_output": "Creates or verifies .editorconfig in Documentation/ with correct settings. Checks RST files for indentation and line length compliance. Fixes any violations.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Documentation/.editorconfig exists or is created",
".editorconfig has indent_style = space and indent_size = 4",
".editorconfig has end_of_line = lf",
".editorconfig has charset = utf-8",
"RST files use 4-space indentation, not tabs",
"Lines do not exceed 80 characters",
"Files end with a newline"
]
},
{
"id": 20,
"eval_name": "plantuml-diagram",
"prompt": "Add an architecture diagram to the Developer documentation showing the extension's service pipeline: Parser -> Resolver -> Renderer with descriptions.",
"expected_output": "RST content using the .. uml:: directive with inline PlantUML syntax showing a component diagram. Includes :caption: option and proper indentation.",
"files": [],
"project_path": "/home/cybot/projects/t3x-cowriter/main",
"assertions": [
"Uses .. uml:: directive for the diagram",
"Has :caption: option describing the diagram",
"Contains valid PlantUML syntax with component definitions",
"Shows relationships between Parser, Resolver, and Renderer",
"Proper 4-space indentation for directive content",
"Uses skinparam for clean styling"
]
}
]
}
Architecture Decision Records (ADRs)
Source: nr_llm Extension - ADR Documentation Patterns Purpose: Document architectural decisions with context and consequences
Overview
Architecture Decision Records capture important architectural decisions along with their context and consequences. They provide a historical record of why certain decisions were made, helping future maintainers understand the codebase.
When to Write an ADR
- Major architectural changes (new patterns, frameworks, approaches)
- Technology choices (libraries, APIs, protocols)
- Significant refactoring decisions
- Security-relevant decisions
- Performance optimization strategies
- Deprecation of existing patterns
Directory Structure
Extension/
├── Documentation/
│ └── DeveloperGuide/
│ └── ArchitectureDecisions/
│ └── Index.rst # Links to ADRs
├── claudedocs/ # AI-readable ADRs
│ ├── ADR-001-initial-architecture.md
│ ├── ADR-002-provider-abstraction.md
│ └── ADR-013-api-key-encryption.md
└── README.mdADR Format
Standard Template
# ADR-NNN: Title
## Status
[Proposed | Accepted | Deprecated | Superseded by ADR-XXX]
## Context
What is the issue that we're seeing that is motivating this decision or change?
## Decision
What is the change that we're proposing and/or doing?
## Consequences
What becomes easier or more difficult to do because of this change?
### Positive
- Benefit 1
- Benefit 2
### Negative
- Tradeoff 1
- Tradeoff 2
### Neutral
- Side effect 1Extended Template (Recommended)
# ADR-NNN: Descriptive Title
## Status
Accepted
## Date
2024-12-30
## Context
Describe the forces at play, including technical, political, social, and
project local. These forces are probably in tension.
## Problem Statement
Clear statement of the specific problem being solved.
## Decision Drivers
- Driver 1: What factors influenced this decision?
- Driver 2: Performance requirements?
- Driver 3: Security considerations?
- Driver 4: Maintainability concerns?
## Considered Options
### Option 1: [Name]
**Description:** Brief explanation
**Pros:**
- Advantage 1
- Advantage 2
**Cons:**
- Disadvantage 1
- Disadvantage 2
### Option 2: [Name]
**Description:** Brief explanation
**Pros:**
- Advantage 1
**Cons:**
- Disadvantage 1
## Decision
We chose Option 1 because...
## Implementation Details
// Code example showing the decided approach
## Consequences
### Positive
- What becomes easier
### Negative
- What becomes harder
### Risks
- Potential issues to watch for
## Related Decisions
- ADR-005: Related decision
- ADR-012: Prerequisite decision
## References
- [External documentation](https://example.com)
- [TYPO3 documentation](https://docs.typo3.org)Example ADRs
ADR-012: API Key Encryption
# ADR-012: API Key Encryption at Rest
## Status
Accepted
## Date
2024-12-15
## Context
The extension stores API keys for external services (OpenAI, Anthropic, etc.)
in the database. These keys provide full access to paid APIs and could be
misused if exposed through:
- Database breaches
- Backup file exposure
- SQL injection attacks
- Unauthorized admin access
## Problem Statement
How do we protect API keys stored in the database while maintaining
usability for backend configuration?
## Decision Drivers
- Security: Keys must not be readable from raw database content
- Usability: Editors must be able to configure keys in backend
- Performance: Encryption/decryption should be fast
- Simplicity: No external dependencies (vault services)
## Considered Options
### Option 1: sodium_crypto_secretbox
**Description:** Use PHP's built-in libsodium with XSalsa20-Poly1305
**Pros:**
- Built into PHP 7.2+
- Authenticated encryption (detects tampering)
- Constant-time operations (timing attack resistant)
- Well-audited cryptographic library
**Cons:**
- Requires key management
- Keys in memory during processing
### Option 2: openssl_encrypt
**Description:** Use OpenSSL with AES-256-GCM
**Pros:**
- Well-known algorithm
- Built into PHP
**Cons:**
- More configuration options (easier to misconfigure)
- IV management complexity
### Option 3: External Vault (HashiCorp)
**Description:** Store keys in external secrets manager
**Pros:**
- Enterprise-grade security
- Audit logging
- Key rotation built-in
**Cons:**
- Added infrastructure dependency
- Increased complexity
- Overkill for most TYPO3 installations
## Decision
We chose **sodium_crypto_secretbox** because:
1. No external dependencies
2. Simple API with secure defaults
3. Built into modern PHP
4. Authenticated encryption prevents tampering
## Implementation
Key derivation uses TYPO3's encryptionKey with domain separation:
private function getEncryptionKey(): string { return hash('sha256', $this->encryptionKey . ':provider_encryption', true); }
public function encrypt(string $plaintext): string { $nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); $ciphertext = sodium_crypto_secretbox($plaintext, $nonce, $this->getEncryptionKey()); sodium_memzero($plaintext); return 'enc:' . base64_encode($nonce . $ciphertext); }
## Consequences
### Positive
- API keys protected at rest
- No plaintext keys in database dumps
- Tampering is detectable
- Compatible with TYPO3 security model
### Negative
- Keys visible in memory during encryption/decryption
- Key rotation requires re-encryption of all values
- Encrypted values are longer than plaintext
### Risks
- Loss of TYPO3 encryptionKey = loss of all API keys
- Backup/restore must preserve encryptionKey
## Related Decisions
- ADR-013: Three-level configuration architectureADR-013: Three-Level Configuration Architecture
# ADR-013: Three-Level Configuration Architecture
## Status
Accepted
## Date
2024-12-20
## Context
The extension needs to support:
- Multiple API keys per provider (production/development)
- Custom endpoints (Azure OpenAI, self-hosted models)
- Reusable model definitions
- Use-case-specific configurations
The existing single-table design cannot represent these relationships cleanly.
## Decision
Implement a three-tier architecture:
Configuration (use-case settings) ↓ references Model (capability definitions) ↓ references Provider (API connection)
## Implementation
Three database tables with Extbase relations:
- tx_nrllm_provider: Connection credentials
- tx_nrllm_model: Model capabilities
- tx_nrllm_configuration: Use-case settings
## Consequences
### Positive
- Multiple credentials per provider type
- Clean separation of concerns
- Reusable model definitions
- Testability (swap providers in tests)
### Negative
- More complex database schema
- Migration needed for existing data
- Three TCA files to maintainBest Practices
Naming Conventions
- Format:
ADR-NNN-kebab-case-title.md - Numbers: Zero-padded, sequential (001, 002, 003)
- Title: Descriptive, action-oriented
Content Guidelines
1. Be specific - Include code examples, not just concepts 2. Document alternatives - Show what wasn't chosen and why 3. Include dates - Decisions have context in time 4. Link related ADRs - Build a decision graph 5. Update status - Mark deprecated/superseded decisions
RST Integration
.. toctree::
:maxdepth: 2
:caption: Architecture Decisions
ArchitectureDecisions/ADR-001-InitialArchitecture
ArchitectureDecisions/ADR-012-ApiKeyEncryption
ArchitectureDecisions/ADR-013-ThreeLevelConfigurationAI-Readable Format (claudedocs/)
Keep a parallel set of ADRs in Markdown for AI assistants:
claudedocs/
├── README.md # Overview for AI
├── ADR-001-initial-architecture.md
├── ADR-012-api-key-encryption.md
├── context-architecture.md # Current state summary
└── patterns/ # Reusable patterns
├── adapter-registry.md
└── encryption-service.mdADR Lifecycle
┌──────────┐ ┌──────────┐ ┌────────────┐
│ Proposed │ ──▶ │ Accepted │ ──▶ │ Deprecated │
└──────────┘ └──────────┘ └────────────┘
│ │
│ ▼
│ ┌────────────────┐
└─────────▶ │ Superseded by │
│ ADR-XXX │
└────────────────┘Tools and Automation
Generate ADR Index
#!/bin/bash
# scripts/generate-adr-index.sh
echo "# Architecture Decision Records" > docs/adr/README.md
echo "" >> docs/adr/README.md
echo "| ADR | Title | Status |" >> docs/adr/README.md
echo "|-----|-------|--------|" >> docs/adr/README.md
for file in docs/adr/ADR-*.md; do
number=$(basename "$file" | grep -oP 'ADR-\d+')
title=$(head -1 "$file" | sed 's/# //')
status=$(grep -m1 "^## Status" -A2 "$file" | tail -1)
echo "| [$number]($file) | $title | $status |" >> docs/adr/README.md
doneADR Template Script
#!/bin/bash
# scripts/new-adr.sh
NEXT_NUM=$(ls docs/adr/ADR-*.md 2>/dev/null | wc -l)
NEXT_NUM=$((NEXT_NUM + 1))
PADDED=$(printf "%03d" $NEXT_NUM)
TITLE="${1:-untitled}"
SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
FILENAME="docs/adr/ADR-${PADDED}-${SLUG}.md"
cat > "$FILENAME" << EOF
# ADR-${PADDED}: ${TITLE}
## Status
Proposed
## Date
$(date +%Y-%m-%d)
## Context
[Describe the context]
## Decision
[Describe the decision]
## Consequences
### Positive
-
### Negative
-
EOF
echo "Created: $FILENAME"Related References
- Michael Nygard's ADR format
- ADR Tools
rst-syntax.md- RST formatting for TYPO3 docstypo3-extension-architecture.md- Extension structure
Asset Templates Guide
Templates for TYPO3 documentation projects.
AI Agent Context
To provide AI assistants with documentation context, copy assets/AGENTS.md to the extension's Documentation/ folder. This template includes:
- Documentation type and strategy
- Target audience definition
- File structure overview
- Style guidelines for AI-generated content
Screenshot Requirements (MANDATORY)
| Documentation Topic | Screenshot Required |
|---|---|
| Backend module interfaces | ✅ YES - Show the module UI |
| Extension configuration screens | ✅ YES - Show settings location |
| Multi-step UI workflows | ✅ YES - One screenshot per step |
| TCA/FlexForm configurations | ✅ YES - Show resulting forms |
| Frontend visual output | ✅ YES - Show what users see |
| Error messages/states | ✅ YES - Help users identify issues |
Do NOT write "TODO: add screenshot" or skip screenshots. If you cannot take a screenshot, explicitly ask the user to provide one or use MCP tools to capture them.
Screenshot Workflow
1. Identify all UI elements that need screenshots (see requirements table above) 2. Set TYPO3 backend to light theme 3. Capture screenshots using one of the methods below 4. Crop to relevant area 5. Save as PNG in Documentation/Images/ with CamelCase naming 6. Add RST image directive with :alt:, :zoom: lightbox, and :class: with-border with-shadow 7. Verify screenshots render correctly in documentation build
Taking Screenshots
Using browser DevTools (Chrome/Firefox):
# Open DevTools (F12), then:
# Ctrl+Shift+P -> "Capture screenshot" or "Capture full size screenshot"Using Playwright MCP (automated):
mcp__playwright__browser_take_screenshotUsing Chrome DevTools MCP:
mcp__chrome-devtools__take_screenshotScreenshot Checklist
- [ ] PNG format used
- [ ] Light theme in TYPO3 backend
- [ ] Cropped to relevant area
- [ ]
:alt:text describes image content - [ ]
:zoom: lightboxadded for click-to-enlarge - [ ]
:class: with-border with-shadowfor visual polish - [ ] Image stored in
Documentation/Images/with CamelCase name
Code Blocks and Structure Elements
Complete reference for code blocks, inline code, and structure elements in TYPO3 documentation.
Based on:
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Codeblocks.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Confval.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/InlineCode.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Phpdomain.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/SiteSettings.html
When to Use What
| Content Type | Element | Example |
|---|---|---|
| Short inline examples (< 5 lines) | code-block directive | Quick syntax demos |
| Complete code snippets | `literalinclude` directive (preferred) | PHP classes, services, TCA |
| External code files | literalinclude directive | Full example files |
| Configuration options | confval directive | Extension settings, TCA fields |
| Inline PHP | :php: role | Class names, method calls |
| Inline TypoScript | :typoscript: role | TypoScript properties |
| File paths | :file: role | ext_localconf.php |
| UI elements | :guilabel: role | Button labels, menu items |
| Keyboard shortcuts | :kbd: role | Ctrl+S |
| PHP API documentation | php:class, php:method | Public API reference |
| Site settings | typo3:site-set-settings | Site set configuration |
Code Blocks
Basic Syntax
.. code-block:: <language>
:caption: <file-path-or-description>
<code-content>Important: Blank line required between options and code. No blank lines between directive and options.
Available Options
| Option | Purpose | Example |
|---|---|---|
:caption: | File path or description (recommended) | :caption: EXT:my_ext/ext_localconf.php |
:linenos: | Show line numbers | :linenos: |
:lineno-start: | Start line numbering at N | :lineno-start: 10 |
:emphasize-lines: | Highlight specific lines | :emphasize-lines: 3,5-7 |
:name: | Reference label for linking | :name: my-code-example |
Common Languages
| Language | Identifier |
|---|---|
| PHP | php |
| TypoScript | typoscript |
| YAML | yaml |
| XML | xml |
| HTML | html |
| JavaScript | javascript or js |
| CSS | css |
| Shell/Bash | bash or shell |
| SQL | sql |
| JSON | json |
| Plain text | plaintext or text |
| Diff | diff |
Examples
PHP with caption and line numbers:
.. code-block:: php
:caption: EXT:my_extension/Classes/Service/MyService.php
:linenos:
<?php
declare(strict_types=1);
namespace Vendor\MyExtension\Service;
class MyService
{
public function doSomething(): void
{
// Implementation
}
}TypoScript with emphasized lines:
.. code-block:: typoscript
:caption: EXT:my_extension/Configuration/TypoScript/setup.typoscript
:emphasize-lines: 3-4
lib.myContent = TEXT
lib.myContent {
value = Hello World
wrap = <div class="content">|</div>
}Placeholders
Use angle brackets for variable values:
.. code-block:: php
$result = $this->myService->process('<your-value>');For XML/HTML, use comments:
.. code-block:: xml
<property><!-- your-value --></property>literalinclude Directive (Preferred for Code)
`literalinclude` is the preferred way to include code examples in TYPO3 documentation. It provides:
- Syntax validation: IDE support catches errors in source files
- Reusability: Same snippet can be included in multiple places
- Maintainability: Update code in one place, documentation stays in sync
- Testability: Code files can be validated/linted separately
File Naming Convention
Code snippet files use an underscore prefix to indicate they are include files:
| File Type | Naming Pattern | Example |
|---|---|---|
| PHP classes | _ClassName.php | _TranslationService.php |
| Configuration | _config-name.yaml | _services.yaml |
| TCA | _tca-tablename.php | _tca-apiendpoint.php |
| TypoScript | _setup.typoscript | _setup.typoscript |
File Organization
Store code snippets in the same directory as the RST file that uses them, or in a shared location:
Documentation/
├── Usage/
│ ├── Index.rst
│ ├── ApiEndpointExample.rst
│ ├── _ApiEndpoint.php ← DTO class
│ ├── _ApiClientService.php ← Service class
│ └── _tca-apiendpoint.php ← TCA definition
├── Developer/
│ ├── Adr/
│ │ ├── ADR-009-ExtensionConfig.rst
│ │ ├── _TranslationService.php
│ │ └── _DirectUsage.phpBasic Syntax
.. literalinclude:: _MyClass.php
:language: php
:caption: EXT:my_ext/Classes/Service/MyClass.phpOptions
| Option | Purpose |
|---|---|
:language: | Syntax highlighting language (required) |
:caption: | Display caption showing target file path |
:lines: | Include only specific lines (e.g., 15-30) |
:linenos: | Show line numbers |
:emphasize-lines: | Highlight specific lines |
:start-after: | Start after matching text marker |
:end-before: | End before matching text marker |
Example: Complete Service Class
Source file:
// Documentation/Usage/_TranslationService.php
<?php
declare(strict_types=1);
namespace Acme\AcmeTranslate\Service;
use Netresearch\NrVault\Http\SecretPlacement;
use Netresearch\NrVault\Service\VaultServiceInterface;
final class TranslationService
{
public function __construct(
private readonly VaultServiceInterface $vault,
) {}
public function translate(string $text): string
{
return $this->vault->http()
->withAuthentication($this->apiKey, SecretPlacement::Bearer)
->sendRequest($request);
}
}RST usage:
.. literalinclude:: _TranslationService.php
:language: php
:caption: EXT:acme_translate/Classes/Service/TranslationService.php
:linenos:Example: Extract Specific Lines
.. literalinclude:: _TranslationService.php
:language: php
:caption: Key method implementation
:lines: 17-22
:emphasize-lines: 3-4Example: Using Text Markers
For more maintainable line selection, use text markers:
Source file with markers:
// ... class definition ...
// START: translate-method
public function translate(string $text): string
{
return $this->vault->http()
->withAuthentication($this->apiKey, SecretPlacement::Bearer)
->sendRequest($request);
}
// END: translate-methodRST usage:
.. literalinclude:: _TranslationService.php
:language: php
:caption: Translation method
:start-after: // START: translate-method
:end-before: // END: translate-methodInline Code Roles
Language-Specific Roles
| Role | Usage | Example |
|---|---|---|
:php: | PHP code, TYPO3 classes | :php:\TYPO3\CMS\Core\Utility\GeneralUtility`` |
:php-short: | TYPO3 classes (short name) | :php-short:\TYPO3\CMS\Core\Utility\GeneralUtility`` |
:typoscript: | TypoScript code | :typoscript:lib.parseFunc`` |
:tsconfig: | TSconfig | :tsconfig:TCEMAIN.table.pages`` |
:yaml: | YAML values | :yaml:imports`` |
:html: | HTML markup | :html:<div class="content">`` |
:css: | CSS code | :css:.my-class`` |
:js: | JavaScript | :js:document.querySelector`` |
:bash: | Shell commands | :bash:composer require`` |
:fluid: | Fluid template code | :fluid:{f:format.html()}`` |
Utility Roles
| Role | Usage | Example |
|---|---|---|
:file: | File paths | :file:ext_localconf.php`` |
:path: | Directory paths | :path:Configuration/`` |
:guilabel: | UI elements | :guilabel:Save and close`` |
:kbd: | Keyboard shortcuts | :kbd:Ctrl+S`` |
:ref: | Cross-references | :ref:my-section-label`` |
:t3src: | TYPO3 source link | :t3src:core/Classes/...`` |
Menu Paths with guilabel
Use > as separator:
Navigate to :guilabel:`Admin Tools > Settings > Extension Configuration`.PHP Class Linking
TYPO3 Core classes automatically link to api.typo3.org:
Use :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance()` to create objects.confval Directive
Document configuration values in a structured, language-independent way.
When to Use confval
- Extension configuration options
- TCA field definitions
- TypoScript properties
- YAML configuration options
- FlexForm settings
Basic Syntax
.. confval:: option_name
:name: unique-option-name
:type: string
:default: 'default value'
:required: true
Description of what this option does and how to use it.Available Options
| Option | Purpose |
|---|---|
:name: | Unique identifier for linking (required for non-unique titles) |
:type: | Value type (string, int, bool, array, etc.) |
:default: | Default value |
:required: | Whether the option is mandatory |
:noindex: | Exclude from index |
Custom attributes are also supported for domain-specific properties.
Example: Extension Configuration
.. confval:: encryptionMethod
:name: ext-myvault-encryptionMethod
:type: string
:default: 'aes-256-gcm'
:required: false
The encryption algorithm used for storing secrets.
Supported values:
- ``aes-256-gcm`` (recommended)
- ``xchacha20-poly1305``confval-menu Directive
Display a list of confval entries:
.. confval-menu::
:name: my-extension-options
:display: tableDisplay options: table, list, tree
PHP Domain
Document PHP APIs with structured directives.
Namespace Declaration
.. php:namespace:: Vendor\Extension\ServiceClass Documentation
.. php:class:: VaultService
Manages secure storage and retrieval of secrets.
.. php:method:: store(string $identifier, string $secret, array $options = []): void
Store a secret in the vault.
:param string $identifier: Unique identifier for the secret
:param string $secret: The secret value to store
:param array $options: Additional storage options
:throws: \Vendor\Extension\Exception\VaultException
.. php:method:: retrieve(string $identifier): ?string
Retrieve a secret from the vault.
:param string $identifier: The secret identifier
:returntype: ?stringCross-Referencing PHP Elements
| Role | Purpose |
|---|---|
:php:class: | Link to class |
:php:interface: | Link to interface |
:php:func: | Link to method/function |
:php:const: | Link to constant |
:php:exc: | Link to exception |
Note: Escape backslashes: :php:class:\\Vendor\\Extension\\MyClass``
When NOT to Use PHP Domain
Use confval instead of PHP domain for:
- TCA configuration
- Extension configuration arrays
- Any PHP array-based configuration
Site Settings Documentation
Auto-document site set settings from YAML definitions.
Syntax
.. typo3:site-set-settings:: PROJECT:/Configuration/Sets/MySet/settings.definitions.yaml
:name: my-site-settingsOptions
| Option | Purpose |
|---|---|
:name: | Namespace prefix for links |
:type: | Filter by field type |
:Label: | Column width for labels |
:default: | Column width for defaults |
The PROJECT: prefix loads files from the extension directory.
Decision Guide
Use literalinclude When (Preferred)
- Complete code examples (classes, services, configuration)
- Code is 5+ lines or represents a complete unit
- Code should be syntactically valid and testable
- Same code might be referenced multiple times
- You want IDE support for the source files
Use code-block When
- Very short snippets (< 5 lines)
- Pseudocode or conceptual examples
- Code with intentional placeholders like
<your-value> - Quick syntax demonstrations
Use confval When
- Documenting configuration options
- Values have type, default, required attributes
- Need structured presentation of settings
Use Inline Roles When
- Mentioning code elements in text
- Referencing file paths, UI elements
- Keep paragraphs readable (avoid overuse)
Use PHP Domain When
- Documenting public API
- Creating formal class/method reference
- Need cross-referencing between API elements
Pre-Commit Checklist
1. ✅ Complete code examples use `literalinclude` with _filename.ext source files 2. ✅ Source files have underscore prefix (_MyClass.php) 3. ✅ All code blocks/includes have :caption: with target file path 4. ✅ Correct :language: identifier used 5. ✅ Code syntax is valid (highlighting works) 6. ✅ Placeholders use angle brackets <your-value> 7. ✅ Configuration uses confval directive 8. ✅ Inline code uses appropriate roles (:php:, :file:, etc.) 9. ✅ UI elements use :guilabel:
References
- Code Blocks: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Codeblocks.html
- confval: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Confval.html
- Inline Code: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/InlineCode.html
- PHP Domain: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/Phpdomain.html
- Site Settings: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Code/SiteSettings.html
RST Coding Guidelines
Complete reference for TYPO3 documentation coding standards.
Based on: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Advanced/CodingGuidelines.html
.editorconfig (Required)
Every Documentation/ folder must contain an .editorconfig file to enforce consistent formatting:
# Documentation/.editorconfig
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80
[*.rst]
indent_size = 4
[*.{yaml,yml}]
indent_size = 2
[*.xlf]
indent_size = 2TYPO3 v14+: XLIFF files use 2-space indentation (Important #107971). Extensions shipping translations alongside docs should align.
Why .editorconfig?
- Ensures consistent formatting across editors (VS Code, PhpStorm, Vim, etc.)
- Prevents common issues: wrong indentation, trailing whitespace, mixed line endings
- Auto-enforces TYPO3 documentation standards
Encoding
- UTF-8 encoding for all files
- Include special characters directly (no escape sequences)
Indentation
| Rule | Value |
|---|---|
| Indentation style | Spaces only (never tabs) |
| RST indentation size | 4 spaces per level |
| YAML indentation size | 2 spaces per level |
| XLIFF indentation size | 2 spaces per level (TYPO3 v14+, Important #107971) |
| RST code examples | 4 spaces indentation |
Critical: Incorrect indentation causes rendering failures. RST is whitespace-sensitive. The file-type split above matches the .editorconfig block shown earlier: [*] (and [*.rst]) use 4 spaces, [*.{yaml,yml}] and [*.xlf] use 2.
.. note::
This is correctly indented with 4 spaces.
The content aligns properly.
.. code-block:: php
<?php
// Code block content also uses 4 spaces
$example = 'value';Line Length
- Maximum 80 characters per line
- Shorter lines improve:
- Source code readability
- GitHub diff viewing
- Side-by-side editing
Breaking long lines:
This is a long paragraph that needs to be broken into multiple
lines to stay under the 80-character limit. Continue on the next
line without extra indentation for paragraph text.
.. confval:: some_very_long_configuration_name
:type: string
:default: some_default_value
Description wraps naturally when it exceeds the line limit.Whitespace
| Rule | Requirement |
|---|---|
| Trailing whitespace | Remove from all line endings |
| Blank lines | Use to separate sections and directives |
| Final newline | Required at end of file |
| Line endings | LF (Unix-style), not CRLF |
Heading Hierarchy
Use consistent underlining characters per heading level:
| Level | Character | Usage |
|---|---|---|
| 1 | = above and below | Page title only |
| 2 | = below | Major sections |
| 3 | - below | Subsections |
| 4 | ~ below | Sub-subsections |
| 5 | " below | Paragraphs |
| 6 | ' below | Deep nesting |
| 7 | ^ below | Rarely used |
| 8 | # below | Rarely used |
Rules:
- Underline must be exactly the same length as heading text
- Each file starts with level 1, regardless of document hierarchy
- Use sentence case (not Title Case)
=========================
Page title in sentence case
=========================
Section heading
===============
Subsection heading
------------------
Sub-subsection heading
~~~~~~~~~~~~~~~~~~~~~~Version Hints
Use standard TYPO3 directives for version information:
.. versionadded:: 12.0
This feature was added in TYPO3 12.0.
.. versionchanged:: 13.0
The behavior was modified in TYPO3 13.0.
.. deprecated:: 12.4
This feature is deprecated and will be removed in TYPO3 14.0.GUI and Keyboard References
Menu Paths
Use :guilabel: with > separator:
Navigate to :guilabel:`Admin Tools > Settings > Extension Configuration`.Keyboard Shortcuts
Use :kbd: role:
Press :kbd:`Ctrl+S` to save.
Use :kbd:`Ctrl+Shift+P` to open the command palette.Button Labels
Match exact GUI spelling:
Click :guilabel:`Save and close` to apply changes.Common Formatting Errors
Wrong Indentation
.. note::
Wrong: only 2 spaces
.. note::
Correct: 4 spacesInconsistent Heading Underlines
Section
====
Wrong: underline too short
Section
=======
Correct: matches text lengthTrailing Whitespace
This line has trailing spaces.
Wrong: spaces at end
This line is clean.
Correct: no trailing whitespaceMixed Tabs and Spaces
.. code-block:: php
Wrong: tab character after ..
.. code-block:: php
Correct: spaces onlyNo Email Addresses in Documentation
NEVER include email addresses (mailto: links or raw email addresses) in public documentation. This applies to:
guides.xmlproject-contactattribute- RST page content
Includes.rst.txtsubstitutions- README files synced with documentation
Use instead: GitHub Issues URL, GitHub Discussions URL, or other public web-based contact channels.
Why: Email addresses in public repositories attract spam and expose personal information. GitHub Issues/Discussions provide trackable, public communication channels.
Pre-Commit Checklist
1. ✅ .editorconfig exists in Documentation/ 2. ✅ All files use UTF-8 encoding 3. ✅ Indentation uses 4 spaces (no tabs) 4. ✅ Lines are under 80 characters 5. ✅ No trailing whitespace 6. ✅ Files end with a newline 7. ✅ Line endings are LF (Unix-style) 8. ✅ Heading underlines match text length 9. ✅ Sentence case for headings 10. ✅ No mailto: links or email addresses in documentation
Editor Configuration
VS Code
Install the EditorConfig extension. It automatically reads .editorconfig.
PhpStorm / IntelliJ
EditorConfig support is built-in. Enable in Settings > Editor > Code Style.
Vim
Install editorconfig-vim plugin:
Plug 'editorconfig/editorconfig-vim'References
- Coding Guidelines: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Advanced/CodingGuidelines.html
- EditorConfig: https://editorconfig.org/
Content Directives Reference
Complete reference for TYPO3 documentation content directives: accordions, admonitions, cards, tabs, tables, versions, and viewhelpers.
Based on:
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Accordion.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Admonitions.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Cards.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Tabs.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Tables.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Versions.html
- https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Viewhelper.html
When to Use What
| Content Type | Directive | Use Case |
|---|---|---|
| Collapsible sections | accordion | FAQ-style content, optional details |
| Warnings/notes | Admonitions | Important notices, tips, cautions |
| Overview grids | card-grid | Feature lists, navigation pages |
| Alternative code | tabs | Multi-language examples, version variants |
| Structured data | Tables | Comparisons, reference data |
| Version info | versionadded | API changes, new features |
| Fluid docs | typo3:viewhelper | ViewHelper reference |
Accordion
Collapsible content sections for FAQ-style presentation or optional details.
Basic Syntax
.. accordion::
:name: faq-accordion
.. accordion-item:: First question?
:name: faq-first
Answer to the first question.
.. accordion-item:: Second question?
:name: faq-second
:open:
Answer to the second question.
This one is open by default.Options
| Option | Purpose |
|---|---|
:name: | Unique identifier for linking (:ref:) |
:open: | Display accordion item expanded by default |
Best Practices
- Use for FAQ sections
- Use for optional, supplementary information
- Use for long content that would break reading flow
- Do NOT use for critical information users might miss
Admonitions
Visual callouts to highlight important information.
Available Types
| Type | Purpose | Visual |
|---|---|---|
note | General information | Blue info icon |
tip | Helpful suggestions | Green lightbulb |
hint | Subtle suggestions | Similar to tip |
warning | Potential issues | Yellow warning |
caution | Exercise care | Yellow caution |
attention | Important notice | Yellow attention |
important | Critical information | Yellow important |
danger | Serious problems | Red danger |
error | Error conditions | Red error |
seealso | Related links | Blue links |
Syntax Examples
Note (most common):
.. note::
This is important background information.Tip with title:
.. tip::
:title: Performance Optimization
Consider caching the result for better performance.Warning:
.. warning::
This action cannot be undone.See Also:
.. seealso::
- :ref:`related-topic`
- `External Resource <https://example.com>`_Options
| Option | Purpose |
|---|---|
:title: | Custom heading (default: directive name) |
:class: | Additional CSS classes |
:name: | Label for cross-referencing |
Decision Guide
| Situation | Use |
|---|---|
| Background context | note |
| Helpful suggestion | tip |
| Potential problems | warning |
| Data loss risk | danger |
| Related resources | seealso |
| API deprecation | deprecated (version directive) |
Cards
Grid-based presentation for overview pages and feature lists.
Basic Card Grid
.. card-grid::
:columns: 2
:columns-md: 3
:gap: 4
:class: pb-4
:card-height: 100
.. card:: Feature One
Description of the first feature.
.. card:: Feature Two
Description of the second feature.
.. card:: :ref:`Linked Card <target-label>`
Card with a linked title.Card Grid Options
| Option | Purpose | Example |
|---|---|---|
:columns: | Columns on small screens | :columns: 1 |
:columns-md: | Columns on medium screens | :columns-md: 2 |
:columns-lg: | Columns on large screens | :columns-lg: 3 |
:gap: | Spacing between cards (0-5) | :gap: 4 |
:card-height: | Uniform card height | :card-height: 100 |
:class: | CSS classes | :class: pb-4 |
Card Options
| Option | Purpose |
|---|---|
:headline-level: | Heading level (default 2) |
:link: | Make entire card clickable |
Use Cases
- Documentation landing pages
- Feature overview sections
- Navigation hub pages
- Comparison layouts
Tabs
Grouped content with synchronized tab switching.
Basic Syntax
.. tabs::
.. group-tab:: PHP
.. code-block:: php
<?php
$value = 'example';
.. group-tab:: TypoScript
.. code-block:: typoscript
lib.example = TEXT
lib.example.value = exampleSynchronized Tabs
Tabs with the same name synchronize across the page:
First example:
.. tabs::
.. group-tab:: Composer
Run :bash:`composer require vendor/package`
.. group-tab:: Classic
Download and install manually.
Second example (tabs sync with above):
.. tabs::
.. group-tab:: Composer
Update with :bash:`composer update`
.. group-tab:: Classic
Download the new version.Use Cases
- Multi-language code examples (PHP, TypoScript, Fluid)
- Installation methods (Composer vs Classic)
- TYPO3 version variations
- Platform-specific instructions (Linux, macOS, Windows)
Best Practices
- Use consistent tab names for synchronization
- Keep tab content comparable in scope
- First tab should be the most common/recommended option
- Do NOT nest tabs inside tabs
Tables
Structured data presentation with multiple syntaxes.
Simple Table (Quick)
===== ===== ======
Col 1 Col 2 Col 3
===== ===== ======
A B C
D E F
===== ===== ======Grid Table (Complex)
+------------+------------+-----------+
| Header 1 | Header 2 | Header 3 |
+============+============+===========+
| Cell 1 | Cell 2 | Cell 3 |
+------------+------------+-----------+
| Cell 4 | Merged cell |
+------------+------------+-----------+CSV Table (Data-Heavy)
.. csv-table:: Example Data
:header: "Name", "Value", "Description"
:widths: 20, 10, 70
"Option A", "1", "First option"
"Option B", "2", "Second option"t3-field-list-table (TYPO3 Specific)
For TCA field documentation:
.. t3-field-list-table::
:header-rows: 1
- :Field: Name
:Description: Purpose
- :Field: `title`
:Description: The page title
- :Field: `hidden`
:Description: Visibility flagTable Options
| Option | Purpose |
|---|---|
:header-rows: | Number of header rows |
:widths: | Column width ratios |
:width: | Total table width |
:class: | CSS classes |
:name: | Reference label |
Decision Guide
| Scenario | Table Type |
|---|---|
| Quick 2-3 column | Simple table |
| Complex merging | Grid table |
| External data | csv-table |
| TCA/field docs | t3-field-list-table |
Version Directives
Document version-specific changes.
versionadded
New features or additions:
.. versionadded:: 12.0
The `newMethod()` was added for improved performance.versionchanged
Modified behavior:
.. versionchanged:: 13.0
The default value changed from `false` to `true`.deprecated
Features to be removed:
.. deprecated:: 12.4
Use :php:`NewClass` instead. Will be removed in TYPO3 14.0.Placement
Version directives should appear:
- After the heading they relate to
- Before the detailed description
- At the beginning of the relevant section
Example
Configuration options
=====================
.. confval:: legacyMode
:name: ext-myext-legacyMode
:type: bool
:default: false
.. deprecated:: 13.0
This option will be removed in TYPO3 15.0.
Use the new :confval:`modernMode` instead.
Enable legacy compatibility mode.ViewHelper Documentation
Document Fluid ViewHelpers using the typo3:viewhelper directive.
Syntax
.. typo3:viewhelper:: f:format.html
Renders the content as HTML.
.. rubric:: Example
.. code-block:: html
<f:format.html>{content}</f:format.html>
.. rubric:: Arguments
.. include:: /CodeSnippets/ViewHelpers/Format/HtmlArguments.rst.txtArgument Documentation
.. confval:: parseFuncTSPath
:name: f-format-html-parseFuncTSPath
:type: string
:default: 'lib.parseFunc_RTE'
Path to TypoScript parseFunc configuration.Best Practices
- Document all arguments with
confval - Include code examples
- Show common use cases
- Link to related ViewHelpers
Comments
RST comments are not rendered:
.. This is a comment.
It can span multiple lines
as long as they are indented.
Regular content continues here.Use comments for:
- TODO notes during development
- Explanatory notes for other authors
- Temporarily hiding content
Special Characters
UTF-8 encoding supports all Unicode characters directly:
The em dash — is commonly used.
Arrows: → ← ↑ ↓
Check marks: ✓ ✗
Copyright: ©No escape sequences needed with UTF-8 encoding.
Pre-Commit Checklist
1. ✅ Admonitions use correct type for message severity 2. ✅ Cards have consistent structure in grid 3. ✅ Tabs use matching names for synchronization 4. ✅ Tables use appropriate syntax for complexity 5. ✅ Version directives include version number 6. ✅ Deprecated items mention replacement and removal version 7. ✅ Accordion items have unique names 8. ✅ All directives properly indented (4 spaces)
References
- Accordion: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Accordion.html
- Admonitions: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Admonitions.html
- Cards: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Cards.html
- Tabs: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Tabs.html
- Tables: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Tables.html
- Versions: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Versions.html
- ViewHelper: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/Content/Viewhelper.html
Documentation Coverage Analysis
Purpose
Provide context-aware documentation coverage assessment based on actual extension features rather than static file count thresholds.
Problem with Static Thresholds
Traditional conformance scoring uses fixed RST file count thresholds:
- 50-99 files: +1 point
- 100-149 files: +2 points
- 150+ files: +3 points
This approach is flawed because: 1. Extension scope varies dramatically (focused vs. comprehensive) 2. File count doesn't reflect feature coverage quality 3. Penalizes well-scoped extensions with complete user documentation 4. Based on large CMS extensions (georgringer/news) as "excellence" reference
Improved Methodology: Feature Coverage Analysis
Step 1: Identify Extension Features
Categorize features into two groups:
User-Facing Features:
- Installation & configuration
- Backend modules & dashboards
- End-user workflows
- Integration guides
- Troubleshooting
Developer Features:
- CLI commands
- Scheduler tasks
- Reports/widgets
- Event listeners
- PHP API (public methods)
- Extension points
Step 2: Assess Documentation Coverage
For each feature category, calculate coverage percentage:
User Coverage = Documented User Features / Total User Features
Developer Coverage = Documented Developer Features / Total Developer Features
Overall Coverage = (User + Developer) / (Total User + Total Developer)Step 3: Quality Assessment
Evaluate documentation quality beyond mere existence:
Quality Indicators:
- ✅ Uses TYPO3 directives (confval, versionadded, php:method)
- ✅ Includes code examples and integration patterns
- ✅ Modern tooling (guides.xml, card-grid navigation)
- ✅ Proper cross-references and interlinking
- ✅ Screenshots or visual aids where appropriate
- ✅ No page exceeds 250 lines (split into focused sub-pages)
- ✅ No
mailto:links in guides.xml or documentation - ❌ Pages over 250 lines indicate poor information architecture
- ❌ Email addresses in public documentation are a privacy/spam risk
Step 4: Context-Aware Scoring
Score based on extension scope and feature coverage:
Small/Focused Extensions (10-30 classes):
- User coverage 100% + modern tooling = EXCELLENT (3-4 points)
- User coverage 80-99% = GOOD (2-3 points)
- User coverage 60-79% = ADEQUATE (1-2 points)
- User coverage <60% = INSUFFICIENT (0-1 points)
Medium Extensions (31-100 classes):
- User coverage 100% + developer coverage 80%+ = EXCELLENT (3-4 points)
- User coverage 100% + developer coverage 40-79% = GOOD (2-3 points)
- User coverage 80-99% = ADEQUATE (1-2 points)
- User coverage <80% = INSUFFICIENT (0-1 points)
Large Extensions (100+ classes):
- Comprehensive documentation (user + developer 90%+) = EXCELLENT (3-4 points)
- Good user docs + partial developer docs = GOOD (2-3 points)
- User docs 80%+ = ADEQUATE (1-2 points)
- User docs <80% = INSUFFICIENT (0-1 points)
Analysis Workflow
1. Count Extension Features
# User-facing features
echo "User Features:"
echo " - Installation: $(ls -1 Documentation/Installation/*.rst 2>/dev/null | wc -l)"
echo " - Configuration: $(ls -1 Documentation/Configuration/*.rst 2>/dev/null | wc -l)"
echo " - Backend Module: $(ls -1 Documentation/Backend/*.rst 2>/dev/null | wc -l)"
echo " - Guides: $(ls -1 Documentation/Guides/*.rst 2>/dev/null | wc -l)"
# Developer features
echo "Developer Features:"
echo " - CLI Commands: $(find Classes/Command -name "*.php" 2>/dev/null | wc -l)"
echo " - Scheduler Tasks: $(find Classes/Task -name "*.php" 2>/dev/null | wc -l)"
echo " - Reports: $(find Classes/Report -name "*.php" 2>/dev/null | wc -l)"
echo " - Event Listeners: $(find Classes/EventListener -name "*.php" 2>/dev/null | wc -l)"2. Map Documentation to Features
Create feature-to-documentation mapping:
User Features:
✓ Installation & Setup → Documentation/Installation/Index.rst
✓ Configuration → Documentation/Configuration/*.rst
✓ Backend Module → Documentation/Backend/*.rst
⚠️ Troubleshooting → Documentation/Troubleshooting/Index.rst (partial)
Developer Features:
⚠️ CLI: FlushCachesCommand → mentioned but no API reference
⚠️ CLI: ShowTransitionCommand → mentioned but no API reference
❌ Task: FlushExpiredCachesTask → not documented
❌ Report: CacheStatusReport → not documented
❌ EventListener: CacheLifetimeListener → not documented3. Calculate Coverage Scores
User Coverage: 3/4 features = 75%
Developer Coverage: 0/5 features = 0%
Overall Coverage: 3/9 features = 33%4. Assess Quality
Quality Indicators:
✅ Modern tooling (guides.xml)
✅ TYPO3 directives (confval)
✅ Card-grid navigation
✅ Code examples
✅ No page exceeds 250 lines
⚠️ Screenshots mentioned but not included
Quality Score: 5/6 = 83%Page length penalty: Any RST page exceeding 250 lines MUST reduce the quality score. Pages over 250 lines indicate poor information architecture and MUST be split before the documentation can score GOOD or above.
5. Determine Final Rating
For a focused extension (30 classes):
- User coverage: 75% (3/4) → ADEQUATE
- Developer coverage: 0% (0/5) → gap acceptable for user-focused extensions
- Quality: 80% → HIGH
- Modern tooling: YES
Final Rating: GOOD (2-3 points)
- User documentation is COMPREHENSIVE for critical features
- Developer API documentation is a nice-to-have
- Quality is HIGH with modern TYPO3 13.x patterns
Comparison: Static vs. Feature-Based Scoring
Example Extension Analysis
Extension: Temporal Cache (focused, 30 classes)
Static Threshold Scoring:
RST Files: 22
Threshold: Need 50+ for points
Score: 1/4 (modern tooling bonus only)
Rating: INSUFFICIENTFeature-Based Scoring:
User Features: 6/6 = 100% coverage ✅
Developer Features: 0/5 = 0% coverage (acceptable for scope)
Quality: 4/5 = 80% (modern tooling, directives, examples)
Extension Scope: Focused (30 classes)
Score: 3/4 points
Rating: EXCELLENT for scopeKey Insight
22 RST files can be EXCELLENT for a focused extension with:
- 100% user feature coverage
- High-quality modern documentation
- Proper TYPO3 directives and examples
- Appropriate scope matching
150+ RST files may be INSUFFICIENT for a large CMS extension with:
- Incomplete feature coverage
- Missing integration guides
- No API reference
- Outdated patterns
Recommendations for TYPO3 Conformance Skill
Update Scoring Logic
Replace static thresholds with feature-based analysis:
def calculate_documentation_score(extension):
"""
Calculate documentation excellence score based on feature coverage.
Returns: 0-4 points
"""
# Determine extension scope
class_count = count_php_classes(extension)
scope = classify_scope(class_count) # small/medium/large
# Calculate feature coverage
user_coverage = calculate_user_feature_coverage(extension)
dev_coverage = calculate_developer_feature_coverage(extension)
# Assess quality
quality_score = assess_documentation_quality(extension)
# Score based on scope
if scope == "small":
if user_coverage >= 0.90 and quality_score >= 0.80:
return 3 # EXCELLENT
elif user_coverage >= 0.75:
return 2 # GOOD
elif user_coverage >= 0.60:
return 1 # ADEQUATE
else:
return 0 # INSUFFICIENT
elif scope == "medium":
if user_coverage >= 0.90 and dev_coverage >= 0.80:
return 4 # OUTSTANDING
elif user_coverage >= 0.90 and dev_coverage >= 0.40:
return 3 # EXCELLENT
elif user_coverage >= 0.80:
return 2 # GOOD
else:
return 1 if user_coverage >= 0.60 else 0
else: # large
total_coverage = (user_coverage + dev_coverage) / 2
if total_coverage >= 0.90:
return 4 # OUTSTANDING
elif total_coverage >= 0.75:
return 3 # EXCELLENT
elif total_coverage >= 0.60:
return 2 # GOOD
else:
return 1 if total_coverage >= 0.40 else 0Provide Clear Feedback
Documentation assessment should include: 1. Feature coverage breakdown (user vs. developer) 2. Quality assessment (directives, examples, tooling) 3. Scope-appropriate recommendations 4. Specific missing documentation items
Example Output
## Documentation Excellence Assessment
**Extension Scope:** Small/Focused (30 classes)
**User Feature Coverage:** 6/6 (100%) ✅
✓ Installation & Setup
✓ Configuration (3 strategies)
✓ Backend Module
✓ Performance Guide
✓ Architecture
✓ Phases Roadmap
**Developer Feature Coverage:** 0/5 (0%) ⚠️
❌ CLI Commands API reference (2 commands)
❌ Scheduler Tasks reference (1 task)
❌ Reports reference (1 report)
❌ EventListener docs
❌ PHP API method-level docs
**Quality Assessment:** 4/5 (80%) ✅
✅ Modern tooling (guides.xml, card-grid)
✅ TYPO3 directives (confval throughout)
✅ Code examples extensive
✅ Cross-references proper
⚠️ Screenshots mentioned but not included
**Score:** 3/4 points (EXCELLENT for extension scope)
**Recommendation:**
Your user documentation is COMPREHENSIVE (100% coverage). Developer API
documentation is optional for this extension's scope. Consider adding
API reference if you expect other developers to extend your extension.
**Impact of Adding Developer Docs:**
- Current: 22 RST files (100% user coverage, 0% developer)
- With API reference: ~30 RST files (100% user + 100% developer)
- Score change: 3/4 → 4/4 (OUTSTANDING)Summary
Key Principles: 1. Documentation quality > file quantity 2. Feature coverage > arbitrary thresholds 3. Scope-appropriate expectations 4. User-facing docs prioritized over developer API docs 5. Context-aware scoring avoids penalizing focused extensions 6. No RST page may exceed 250 lines — pages MUST be split into sub-pages 7. No email addresses in public documentation — use GitHub URLs
Benefits:
- Accurate assessment of documentation completeness
- Fair scoring across extension scopes
- Actionable recommendations
- Recognizes excellent documentation regardless of file count
- Aligns with TYPO3 documentation best practices
Documentation Extraction Patterns
Comprehensive guide for automated extraction of documentation content from TYPO3 extension source code, configuration files, and repository metadata.
Overview
The TYPO3 documentation skill supports assisted documentation generation through:
1. Multi-Source Extraction: Extract from code, configs, repository metadata 2. Gap Analysis: Identify missing or outdated documentation 3. Template Generation: Create RST scaffolds with extracted data 4. Non-Destructive Updates: Suggest changes, never auto-modify existing docs
Extraction Architecture
Source Files → Extraction Scripts → Structured JSON → RST Templates → Human Review → Documentation/Data Flow
1. Extract Phase
├─ PHP code → data/php_apis.json
├─ Extension configs → data/extension_meta.json, data/config_options.json
├─ TYPO3 configs → data/tca_tables.json, data/typoscript.json
├─ Build configs → data/ci_matrix.json, data/testing.json
└─ Repository → data/repo_metadata.json (optional)
2. Analysis Phase
├─ Parse existing Documentation/**/*.rst → data/existing_docs.json
└─ Compare extracted vs existing → Documentation/ANALYSIS.md
3. Generation Phase (Optional)
└─ Create RST templates → Documentation/GENERATED/PHP Code Extraction
Source: Classes/*/.php
What to Extract:
<?php
/**
* Controller for the image select wizard.
*
* @author Christian Opitz
* @license https://www.gnu.org/licenses/agpl-3.0.de.html
*/
class SelectImageController extends ElementBrowserController
{
/**
* Maximum allowed image dimension in pixels.
*
* Prevents resource exhaustion: 10000x10000px ≈ 400MB memory worst case.
*/
private const IMAGE_MAX_DIMENSION = 10000;
/**
* Retrieves image information and processed file details.
*
* @param ServerRequestInterface $request PSR-7 server request
* @return ResponseInterface JSON response with image data
*/
public function infoAction(ServerRequestInterface $request): ResponseInterface
{
// ...
}
}Extracted Data Structure:
{
"classes": [
{
"name": "SelectImageController",
"namespace": "Netresearch\\RteCKEditorImage\\Controller",
"file": "Classes/Controller/SelectImageController.php",
"description": "Controller for the image select wizard.",
"author": "Christian Opitz",
"license": "https://www.gnu.org/licenses/agpl-3.0.de.html",
"extends": "TYPO3\\CMS\\Backend\\Controller\\ElementBrowserController",
"constants": [
{
"name": "IMAGE_MAX_DIMENSION",
"value": 10000,
"visibility": "private",
"description": "Maximum allowed image dimension in pixels.",
"notes": "Prevents resource exhaustion: 10000x10000px ≈ 400MB memory worst case."
}
],
"methods": [
{
"name": "infoAction",
"visibility": "public",
"description": "Retrieves image information and processed file details.",
"parameters": [
{
"name": "request",
"type": "Psr\\Http\\Message\\ServerRequestInterface",
"description": "PSR-7 server request"
}
],
"return": {
"type": "Psr\\Http\\Message\\ResponseInterface",
"description": "JSON response with image data"
}
}
]
}
]
}RST Mapping:
API/SelectImageController.rst:
.. php:namespace:: Netresearch\RteCKEditorImage\Controller
.. php:class:: SelectImageController
Controller for the image select wizard.
**Author:** Christian Opitz
**License:** https://www.gnu.org/licenses/agpl-3.0.de.html
Extends: :php:`TYPO3\CMS\Backend\Controller\ElementBrowserController`
.. important::
Maximum allowed image dimension: 10000 pixels
Prevents resource exhaustion: 10000x10000px ≈ 400MB memory worst case.
.. php:method:: infoAction(ServerRequestInterface $request): ResponseInterface
Retrieves image information and processed file details.
:param \\Psr\\Http\\Message\\ServerRequestInterface $request: PSR-7 server request
:returns: JSON response with image data
:returntype: \\Psr\\Http\\Message\\ResponseInterfaceExtension Configuration Extraction
Source: ext_emconf.php
What to Extract:
$EM_CONF[$_EXTKEY] = [
'title' => 'CKEditor Rich Text Editor Image Support',
'description' => 'Adds FAL image support to CKEditor for TYPO3',
'category' => 'be',
'author' => 'Christian Opitz, Rico Sonntag',
'author_email' => 'christian.opitz@netresearch.de',
'state' => 'stable',
'version' => '14.0.0',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-14.3.99',
'php' => '8.2.0-8.5.99',
],
],
];RST Mapping:
Introduction/Index.rst:
=================================
CKEditor Rich Text Editor Image Support
=================================
:Extension Key: rte_ckeditor_image
:Version: 14.0.0
:Author: Christian Opitz, Rico Sonntag
:Email: christian.opitz@netresearch.de
:Status: stable
Adds FAL image support to CKEditor for TYPO3.
Requirements
------------
- TYPO3 12.4.0 - 14.3.99 (v14.3 LTS = gold standard)
- PHP 8.2.0 - 8.5.99Source: ext_conf_template.txt
What to Extract:
# cat=basic/enable; type=boolean; label=Fetch External Images: Controls whether external image URLs are automatically fetched and uploaded to the current backend user's upload folder. When enabled, pasting image URLs will trigger automatic download and FAL integration. WARNING: Enabling this setting fetches arbitrary URLs from the internet.
fetchExternalImages = 1
# cat=advanced; type=int+; label=Maximum Image Size (px): Maximum allowed dimension for images in pixels
maxImageSize = 5000Extracted Data:
{
"configOptions": [
{
"key": "fetchExternalImages",
"category": "basic",
"subcategory": "enable",
"type": "boolean",
"label": "Fetch External Images",
"description": "Controls whether external image URLs are automatically fetched and uploaded to the current backend user's upload folder. When enabled, pasting image URLs will trigger automatic download and FAL integration.",
"default": true,
"security_warning": "Enabling this setting fetches arbitrary URLs from the internet."
},
{
"key": "maxImageSize",
"category": "advanced",
"type": "int+",
"label": "Maximum Image Size (px)",
"description": "Maximum allowed dimension for images in pixels",
"default": 5000
}
]
}RST Mapping:
Integration/Configuration.rst:
.. confval:: fetchExternalImages
:type: boolean
:Default: true
:Path: $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['rte_ckeditor_image']['fetchExternalImages']
Controls whether external image URLs are automatically fetched and uploaded
to the current backend user's upload folder. When enabled, pasting image
URLs will trigger automatic download and FAL integration.
.. warning::
Enabling this setting fetches arbitrary URLs from the internet.
.. confval:: maxImageSize
:type: integer
:Default: 5000
:Path: $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['rte_ckeditor_image']['maxImageSize']
Maximum allowed dimension for images in pixels.Composer Dependencies Extraction
Source: composer.json
What to Extract:
{
"require": {
"typo3/cms-core": "^12.4 || ^13.0 || ^14.3",
"typo3/cms-backend": "^12.4 || ^13.0 || ^14.3"
},
"require-dev": {
"typo3/testing-framework": "^8.0"
}
}RST Mapping:
Installation/Index.rst:
Installation
============
Composer Installation
---------------------
.. code-block:: bash
composer require netresearch/rte-ckeditor-image
Dependencies
------------
**Required:**
- typo3/cms-core: ^12.4 || ^13.0 || ^14.3
- typo3/cms-backend: ^12.4 || ^13.0 || ^14.3
**Development:**
- typo3/testing-framework: ^8.0TYPO3 Configuration Extraction
Source: Configuration/TCA/*.php
What to Extract:
return [
'ctrl' => [
'title' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_db.xlf:tx_myext_domain_model_product',
'label' => 'name',
],
'columns' => [
'name' => [
'label' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_db.xlf:tx_myext_domain_model_product.name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
],
];RST Mapping:
Developer/DataModel.rst:
Database Tables
===============
tx_myext_domain_model_product
------------------------------
Product table with the following fields:
**name**
- Type: input
- Size: 30
- Validation: trim, requiredSource: Configuration/TypoScript/*.typoscript
What to Extract:
plugin.tx_myext {
settings {
itemsPerPage = 20
enableCache = 1
}
}RST Mapping:
Configuration/TypoScript.rst:
.. code-block:: typoscript
plugin.tx_myext {
settings {
# Number of items to display per page
itemsPerPage = 20
# Enable frontend caching
enableCache = 1
}
}Repository Metadata Extraction
Source: GitHub API (Optional)
Commands:
gh api repos/netresearch/t3x-rte_ckeditor_image
gh api repos/netresearch/t3x-rte_ckeditor_image/releases
gh api repos/netresearch/t3x-rte_ckeditor_image/contributorsExtracted Data:
{
"repository": {
"description": "Image support for CKEditor in TYPO3",
"topics": ["typo3", "ckeditor", "fal"],
"created_at": "2017-03-15",
"stars": 45,
"issues_open": 3
},
"releases": [
{
"tag": "13.1.0",
"date": "2024-12-01",
"notes": "Added TYPO3 v13 compatibility"
}
],
"contributors": [
{"name": "Christian Opitz", "commits": 120},
{"name": "Rico Sonntag", "commits": 45}
]
}RST Mapping:
Introduction/Index.rst:
Repository
----------
- GitHub: https://github.com/netresearch/t3x-rte_ckeditor_image
- Issues: 3 open issues
- Stars: 45
Contributors
------------
- Christian Opitz (120 commits)
- Rico Sonntag (45 commits)Build Configuration Extraction
Source: .github/workflows/*.yml
What to Extract:
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
typo3: ['12.4', '13.0']
database: ['mysqli', 'pdo_mysql']RST Mapping:
Developer/Testing.rst:
Tested Configurations
---------------------
The extension is continuously tested against:
- PHP: 8.1, 8.2, 8.3
- TYPO3: 12.4, 13.0
- Database: MySQL (mysqli), MySQL (PDO)Project Files Extraction
Source: README.md
What to Extract:
- Project description → Introduction overview
- Installation instructions → Installation section
- Usage examples → User guide sections
- Troubleshooting → Troubleshooting section
Strategy:
Parse markdown structure, map headings to RST sections, convert markdown code blocks to RST code-block directives.
Source: CHANGELOG.md
What to Extract:
## [13.1.0] - 2024-12-01
### Added
- TYPO3 v13 compatibility
- New image processing options
### Fixed
- Image upload validationRST Mapping:
Throughout documentation:
.. versionadded:: 13.1.0
TYPO3 v13 compatibility support added.
.. versionadded:: 13.1.0
New image processing options available.Gap Analysis Workflow
1. Extract All Data
Run extraction scripts to populate .claude/docs-extraction/data/*.json
2. Parse Existing Documentation
Scan Documentation/**/*.rst files:
- Identify existing
.. php:class::directives → List documented classes - Identify existing
.. confval::directives → List documented config options - Identify existing API sections → List documented methods
- Collect version markers → Track documented version changes
3. Compare
Missing Documentation:
Classes in php_apis.json NOT in existing_docs.json
→ Undocumented classes
Config options in config_options.json NOT in existing_docs.json
→ Undocumented configuration
Methods in php_apis.json NOT in existing_docs.json
→ Undocumented API methodsOutdated Documentation:
confval default value != config_options.json default
→ Outdated configuration documentation
Method signature mismatch
→ Outdated API documentation
ext_emconf.php version > documented version markers
→ Missing version change documentation4. Generate ANALYSIS.md Report
# Documentation Analysis Report
Generated: 2024-12-15 10:30:00
## Summary
- Total Classes: 15
- Documented Classes: 12
- **Missing: 3**
- Total Config Options: 8
- Documented Options: 6
- **Missing: 2**
- Total Public Methods: 45
- Documented Methods: 38
- **Missing: 7**
## Missing Documentation
### Undocumented Classes
1. **Classes/Service/ImageProcessor.php**
- `ImageProcessor` class - Image processing service
- Suggested location: `API/ImageProcessor.rst`
2. **Classes/Utility/SecurityUtility.php**
- `SecurityUtility` class - Security validation utilities
- Suggested location: `API/SecurityUtility.rst`
### Undocumented Configuration
1. **fetchExternalImages** (ext_conf_template.txt)
- Type: boolean
- Default: true
- Suggested location: `Integration/Configuration.rst`
- Template: See `Documentation/GENERATED/Configuration/fetchExternalImages.rst`
2. **maxImageSize** (ext_conf_template.txt)
- Type: int+
- Default: 5000
- Suggested location: `Integration/Configuration.rst`
### Undocumented Methods
1. **SelectImageController::processImage()**
- Parameters: File $file, array $options
- Return: ProcessedFile
- Suggested location: Add to `API/SelectImageController.rst`
## Outdated Documentation
### Configuration Mismatches
1. **uploadFolder** - Default value mismatch
- Code: `user_upload/rte_images/`
- Docs: `user_upload/`
- File: `Integration/Configuration.rst:45`
- Action: Update default value
### API Changes
1. **SelectImageController::infoAction()** - Parameter added
- Code signature: `infoAction(ServerRequestInterface $request, ?array $context = null)`
- Docs signature: `infoAction(ServerRequestInterface $request)`
- File: `API/SelectImageController.rst:78`
- Action: Add `$context` parameter documentation
## Recommendations
1. Generate missing RST templates: `scripts/generate-templates.sh`
2. Review generated templates in `Documentation/GENERATED/`
3. Complete [TODO] sections with usage examples
4. Move completed files to appropriate Documentation/ folders
5. Update outdated sections based on mismatches above
6. Re-run analysis: `scripts/analyze-docs.sh`
7. Validate: `scripts/validate_docs.sh`
8. Render: `scripts/render_docs.sh`
## Next Steps
**Priority 1 (Required for completeness):**
- Document ImageProcessor class
- Document SecurityUtility class
- Add fetchExternalImages configuration
- Add maxImageSize configuration
**Priority 2 (Outdated content):**
- Fix uploadFolder default value
- Update infoAction signature
**Priority 3 (Enhancement):**
- Add usage examples for all config options
- Add code examples for all API methodsTemplate Generation
Hybrid Template Approach
Generated RST files include:
1. Extracted Data: Automatically populated from source 2. [TODO] Markers: Placeholders for human completion 3. Example Sections: Pre-structured but empty 4. Guidance Comments: Help text for completion
Example Generated Template
Documentation/GENERATED/Configuration/fetchExternalImages.rst:
.. confval:: fetchExternalImages
:type: boolean
:Default: true
:Path: $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['rte_ckeditor_image']['fetchExternalImages']
Controls whether external image URLs are automatically fetched and uploaded
to the current backend user's upload folder. When enabled, pasting image
URLs will trigger automatic download and FAL integration.
.. warning::
Enabling this setting fetches arbitrary URLs from the internet.
**[TODO: Add usage example]**
Example
-------
.. code-block:: typoscript
:caption: EXT:my_site/Configuration/TsConfig/Page/RTE.tsconfig
# [TODO: Add TypoScript configuration example]
**[TODO: Add use cases]**
Use Cases
---------
- [TODO: When to enable this setting]
- [TODO: When to disable this setting]
- [TODO: Security considerations]
**[TODO: Add troubleshooting]**
Troubleshooting
---------------
- [TODO: Common issues and solutions]
<!--
EXTRACTION METADATA:
Source: ext_conf_template.txt:15
Generated: 2024-12-15 10:30:00
Review Status: PENDING
-->Extraction Scripts Reference
scripts/extract-all.sh
Main orchestration script:
#!/usr/bin/env bash
# Extract all documentation data from project sources
scripts/extract-php.sh
scripts/extract-extension-config.sh
scripts/extract-typo3-config.sh
scripts/extract-composer.sh
scripts/extract-project-files.sh
scripts/extract-build-configs.sh # Optional
scripts/extract-repo-metadata.sh # Optional, requires networkscripts/extract-php.sh
Extract PHP class information:
#!/usr/bin/env bash
# Parse PHP files in Classes/ directory
# Output: .claude/docs-extraction/data/php_apis.jsonscripts/analyze-docs.sh
Compare extracted data with existing documentation:
#!/usr/bin/env bash
# Compare data/*.json with Documentation/**/*.rst
# Output: Documentation/ANALYSIS.mdscripts/generate-templates.sh
Generate RST templates from extracted data:
#!/usr/bin/env bash
# Read data/*.json
# Generate RST templates
# Output: Documentation/GENERATED/**/*.rstQuality Standards
Extraction Quality
- ✅ 95%+ accuracy in data extraction
- ✅ All public APIs captured
- ✅ All configuration options captured
- ✅ Docblock formatting preserved
- ✅ Security warnings identified
Template Quality
- ✅ Valid RST syntax
- ✅ Proper TYPO3 directive usage
- ✅ Clear [TODO] markers
- ✅ Helpful completion guidance
- ✅ Extraction metadata included
Analysis Quality
- ✅ All gaps identified
- ✅ Clear action items
- ✅ Specific file locations
- ✅ Priority recommendations
- ✅ Actionable next steps
Integration with AI Assistants
AGENTS.md Documentation
When AI assistants work with Documentation/:
1. Read ANALYSIS.md for current gaps 2. Check GENERATED/ for pending templates 3. Complete [TODO] sections with context 4. Move completed RST to Documentation/ 5. Re-run analyze-docs.sh to verify
Workflow Integration
User: "Document the ImageProcessor class"
→ AI reads: .claude/docs-extraction/data/php_apis.json
→ AI checks: Documentation/ANALYSIS.md (confirms missing)
→ AI generates: Documentation/API/ImageProcessor.rst
→ AI completes [TODO] sections with usage examples
→ AI runs: scripts/validate_docs.sh
→ AI runs: scripts/render_docs.sh
→ User reviews rendered outputCode Example Accuracy Validation
Every PHP code example in documentation MUST reference methods that actually exist in the Classes/ source tree. This section covers common mistakes found during TYPO3 v13 extension documentation reviews and the validation approach to prevent them.
Common Method Name Mistakes
Documentation authors frequently invent plausible-sounding method names that do not match the actual implementation. Always verify against source code before publishing.
| Incorrect (used in docs) | Correct (actual source) | Context |
|---|---|---|
getTranslation() | translate() | Language service / translation models |
importXliffFile() | importFile() | XLIFF import services |
findByIdentifier() | findByName() | Repository lookup methods |
findByComponent() | findAllByComponentTypePlaceholderValueAndLanguage() | Component repository queries |
getKey() | getPlaceholder() | Migration / model accessor methods |
getValue() | getTranslation() | Migration / model accessor methods |
CLI Command Documentation
CLI command documentation must match the actual Symfony Console argument and option registration. Always check the configure() method in the Command class:
// Verify docs against actual configure() registration
protected function configure(): void
{
$this->addArgument('file', InputArgument::REQUIRED, 'Path to import file');
$this->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'Output format', 'json');
}Common CLI mistakes:
- Documenting arguments that are not registered in
configure() - Wrong argument order (positional arguments are order-sensitive)
- Missing or incorrect option short names (
-fvs--format) - Default values that do not match the
configure()registration
Migration Example Accuracy
Migration code examples must use actual model method names. When documenting data migration or upgrade wizards:
- Verify getter/setter names against the domain model class (e.g.,
getPlaceholder()notgetKey(),getValue()notgetTranslation()) - Check that repository method signatures match (argument count, types, return types)
- Confirm that injected services use the correct class names
Version Number Consistency
Version numbers appearing in documentation must match the canonical source:
guides.xmlversion attribute must matchext_emconf.phpversion- Code examples referencing
versionaddedorversionchangedmust use released versions - Composer
branch-aliasversions must be consistent acrosscomposer.json,ext_emconf.php, and docs
Validation Approach
Before publishing any documentation containing PHP code examples, run these checks:
# 1. Extract all method names referenced in documentation
grep -rhoP '\b[a-z][a-zA-Z]+\(\)' Documentation/ | sort -u > /tmp/doc_methods.txt
# 2. Extract all actual method names from source
grep -rhoP 'function\s+\K[a-zA-Z]+(?=\s*\()' Classes/ | sort -u > /tmp/src_methods.txt
# 3. Find methods in docs that do not exist in source
comm -23 /tmp/doc_methods.txt /tmp/src_methods.txtFor CLI commands:
# Verify documented arguments against configure() method
grep -A 20 'function configure' Classes/Command/*.phpFor model methods in migration examples:
# Verify getter/setter names in domain models
grep -rn 'function get\|function set\|function is\|function has' Classes/Domain/Model/Rule: If a method name from the documentation does not appear in Classes/, the code example is wrong and must be corrected before publishing.
Best Practices
DO:
- Run extraction scripts before manual documentation
- Review ANALYSIS.md regularly to track coverage
- Use generated templates as starting points
- Complete [TODO] sections with real examples
- Re-run analysis after updates
DON'T:
- Auto-commit generated templates without review
- Skip [TODO] completion (templates are incomplete without it)
- Ignore ANALYSIS.md warnings
- Modify extraction data JSON manually
- Delete extraction metadata comments
Troubleshooting
Empty extraction data:
- Check file paths and permissions
- Verify PHP syntax is valid
- Check ext_conf_template.txt format
Inaccurate gap analysis:
- Ensure existing RST uses proper directive syntax
- Check cross-references are using :ref: not hardcoded paths
- Verify confval names match exactly
Template generation failures:
- Validate extraction JSON syntax
- Check RST template syntax
- Verify output directory exists and is writable
Future Enhancements
Planned Features:
1. Incremental Extraction: Only extract changed files 2. Smart Merging: Suggest specific line changes in existing RST 3. Example Generation: AI-generated usage examples for APIs 4. Auto-Screenshots: Generate UI screenshots for editor documentation 5. Translation Support: Multi-language documentation extraction 6. CI Integration: Fail builds if documentation coverage < threshold
Resources
- PHP Parser: nikic/php-parser for accurate PHP analysis
- RST Parser: docutils for existing documentation parsing
- TYPO3 Docs: https://docs.typo3.org/m/typo3/docs-how-to-document/
- GitHub API: https://docs.github.com/en/rest
- GitLab API: https://docs.gitlab.com/ee/api/
Scripts Guide
Detailed usage for documentation extraction and analysis scripts.
Documentation Extraction
To extract documentation data from all sources:
scripts/extract-all.sh /path/to/extensionTo extract from specific sources:
# Extract PHP API documentation
scripts/extract-php.sh /path/to/extension
# Extract extension configuration (ext_emconf.php, ext_localconf.php)
scripts/extract-extension-config.sh /path/to/extension
# Extract Composer metadata
scripts/extract-composer.sh /path/to/extension
# Extract build configurations (CI, testing)
scripts/extract-build-configs.sh /path/to/extension
# Extract project files (README, CHANGELOG)
scripts/extract-project-files.sh /path/to/extension
# Extract repository metadata (GitHub/GitLab)
scripts/extract-repo-metadata.sh /path/to/extensionDocumentation Analysis
To analyze documentation coverage and identify gaps:
scripts/analyze-docs.sh /path/to/extensionAI Context Setup
To add AGENTS.md template to Documentation/ folder:
scripts/add-agents-md.sh /path/to/extension