@patrickjs/typo3cms-extension-cursorrules-prompt-file
Typo3cms Extension Cursorrules Prompt File cursor rules
prpm install @patrickjs/typo3cms-extension-cursorrules-prompt-file0 total downloads
š Full Prompt Content
You 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.
---
### 1. Development Guidelines
- **Use PHP 8.3+ features where appropriate**
- Follow **TYPO3 Coding Guidelines (CGL)** and **Core Team Best Practices**
- Use the **Extension Builder** as a starting point where useful, but favor manual organization for better control
- Apply **PSR-12** coding standards
- Utilize **strict typing**, union types, readonly properties, and modern attributes
- Prefer **dependency injection** over static access or global scope
- Focus on excellent **Developer Experience (DX)**:
- Clear type annotations
- IDE autocompletion
- Precise PHPDoc blocks
- Consistent naming conventions
---
### 2. Coding Standards and Conventions
- **File Names**: Use `PascalCase.php` (e.g., `MyService.php`)
- **Class and Enum Names**: Use `PascalCase` (e.g., `MyUtilityClass`)
- **Method Names**: Use `camelCase` (e.g., `getUserData`)
- **Variable and Property Names**: Use `camelCase` (e.g., `userService`)
- **Constants and Enum Case Names**: Use `SCREAMING_SNAKE_CASE` (e.g., `DEFAULT_LIMIT`)
- **Namespaces**: Respect PSR-4 autoloading, use `Vendor\ExtensionName\SubNamespace`
---
### 3. Extension Structure and File Organization
```plaintext
my_extension/
āāā Classes/
ā āāā Controller/ # Extbase Controllers
ā āāā Domain/
ā ā āāā Model/ # Domain Models
ā ā āāā Repository/ # Domain Repositories
ā āāā Service/ # Business logic classes
ā āāā EventListener/ # PSR-14 event subscribers
ā āāā Middleware/ # Custom middlewares (if needed)
ā āāā Utility/ # Utility/helper classes
āāā Configuration/
ā āāā TCA/ # Table configuration arrays
ā āāā Services.yaml # Service container configuration
ā āāā ext_localconf.php # Extension registration
āāā Resources/
ā āāā Private/
ā ā āāā Templates/ # Fluid templates
ā ā āāā Partials/
ā ā āāā Layouts/
ā āāā Public/ # JS, CSS, Images
āāā Tests/
ā āāā Unit/ # PHPUnit unit tests
ā āāā Functional/ # Functional tests
āāā ext_emconf.php # Extension metadata
āāā composer.json # Composer configuration
```
#### Integration into TYPO3 CMS
- The extension is installed via **Composer** or manually via the **Extension Manager**
- Services are automatically injected via `Services.yaml` configuration
- PSR-14 Events, SignalSlots, and TypoScript are registered via `ext_localconf.php`
- Configuration is handled via TypoScript and YAML
---
### 4. Testing and Documentation
#### ā
Testing Strategy
- Use **PHPUnit** for both **unit** and **functional** tests
- Use `typo3/testing-framework` for TYPO3-specific test cases
- Write tests for:
- Domain logic (Models, Repositories)
- Services (pure PHP logic)
- Controllers (via functional tests)
- Ensure code coverage and test edge cases
#### š Documentation Structure
- `README.md`
- Extension purpose
- Installation instructions
- Minimal usage example
- `Docs/`
- Setup and configuration guides
- Full usage examples (Fluid templates, TypoScript)
- API reference (linked with PHPDoc)
- Code is self-documented with comprehensive **PHPDoc**
š” Suggested Test Inputs
Loading suggested inputs...
šÆ Community Test Results
Loading results...
š¦ Package Info
- Format
- cursor
- Type
- rule
- Category
- general
- License
- CC0-1.0