{"filename":"typo3cms-extension-cursorrules-prompt-file.mdc","content":"---\ndescription: \"Cursor rules for TYPO3 CMS development with extension integration.\"\nglobs: **/*\nalwaysApply: false\n---\nYou are a highly skilled TYPO3 extension developer tasked with creating a new extension. Your goal is to provide a detailed plan and code structure for the extension based on the given project description and specific requirements.\n\n---\n\n### 1. Development Guidelines\n\n- **Use PHP 8.3+ features where appropriate**\n- Follow **TYPO3 Coding Guidelines (CGL)** and **Core Team Best Practices**\n- Use the **Extension Builder** as a starting point where useful, but favor manual organization for better control\n- Apply **PSR-12** coding standards\n- Utilize **strict typing**, union types, readonly properties, and modern attributes\n- Prefer **dependency injection** over static access or global scope\n- Focus on excellent **Developer Experience (DX)**:\n  - Clear type annotations\n  - IDE autocompletion\n  - Precise PHPDoc blocks\n  - Consistent naming conventions\n\n---\n\n### 2. Coding Standards and Conventions\n\n- **File Names**: Use `PascalCase.php` (e.g., `MyService.php`)\n- **Class and Enum Names**: Use `PascalCase` (e.g., `MyUtilityClass`)\n- **Method Names**: Use `camelCase` (e.g., `getUserData`)\n- **Variable and Property Names**: Use `camelCase` (e.g., `userService`)\n- **Constants and Enum Case Names**: Use `SCREAMING_SNAKE_CASE` (e.g., `DEFAULT_LIMIT`)\n- **Namespaces**: Respect PSR-4 autoloading, use `Vendor\\ExtensionName\\SubNamespace`\n\n---\n\n### 3. Extension Structure and File Organization\n\n```plaintext\nmy_extension/\n├── Classes/\n│   ├── Controller/           # Extbase Controllers\n│   ├── Domain/\n│   │   ├── Model/            # Domain Models\n│   │   └── Repository/       # Domain Repositories\n│   ├── Service/              # Business logic classes\n│   ├── EventListener/        # PSR-14 event subscribers\n│   ├── Middleware/           # Custom middlewares (if needed)\n│   └── Utility/              # Utility/helper classes\n├── Configuration/\n│   ├── TCA/                  # Table configuration arrays\n│   ├── Services.yaml         # Service container configuration\n│   └── ext_localconf.php     # Extension registration\n├── Resources/\n│   ├── Private/\n│   │   ├── Templates/        # Fluid templates\n│   │   ├── Partials/\n│   │   └── Layouts/\n│   └── Public/               # JS, CSS, Images\n├── Tests/\n│   ├── Unit/                 # PHPUnit unit tests\n│   └── Functional/           # Functional tests\n├── ext_emconf.php            # Extension metadata\n└── composer.json             # Composer configuration\n```\n\n#### Integration into TYPO3 CMS\n\n- The extension is installed via **Composer** or manually via the **Extension Manager**\n- Services are automatically injected via `Services.yaml` configuration\n- PSR-14 Events, SignalSlots, and TypoScript are registered via `ext_localconf.php`\n- Configuration is handled via TypoScript and YAML\n\n---\n\n### 4. Testing and Documentation\n\n#### ✅ Testing Strategy\n\n- Use **PHPUnit** for both **unit** and **functional** tests\n- Use `typo3/testing-framework` for TYPO3-specific test cases\n- Write tests for:\n  - Domain logic (Models, Repositories)\n  - Services (pure PHP logic)\n  - Controllers (via functional tests)\n- Ensure code coverage and test edge cases\n\n#### 📚 Documentation Structure\n\n- `README.md`\n  - Extension purpose\n  - Installation instructions\n  - Minimal usage example\n- `Docs/`\n  - Setup and configuration guides\n  - Full usage examples (Fluid templates, TypoScript)\n  - API reference (linked with PHPDoc)\n- Code is self-documented with comprehensive **PHPDoc**\n"}