create-grid-definitionlisted
Install: claude install-skill jeffsenso/prestashop-skills
# create-grid-definition
Read `@.ai/Component/Grid/CONTEXT.md` for the factory trilogy (GridDefinitionFactory → GridDataFactory → GridFactory) and SearchCriteria patterns.
## 1. Grid Definition Factory
Create `src/Core/Grid/Definition/Factory/{Domain}GridDefinitionFactory.php` extending `AbstractGridDefinitionFactory`:
- Define a `public const GRID_ID = '{domain}'` constant — this is the single source of truth for the grid identifier, shared with the `{Domain}Filters` class to ensure the filter persistence in DB maps to the correct grid
- `getId(): string` — return `self::GRID_ID`
- `getName(): string` — translatable grid name
- `getColumns(): ColumnCollection` — all columns (see section 2)
- `getFilters(): FilterCollection` — filterable columns (see section 4)
- `getGridActions(): GridActionCollection` — grid-level actions (e.g. export)
- `getRowActions(): RowActionCollection` — per-row actions (see section 3)
- `getBulkActions(): BulkActionCollection` — multi-select actions (see section 3)
**Reference:** `src/Core/Grid/Definition/Factory/TaxGridDefinitionFactory.php` (simple), `src/Core/Grid/Definition/Factory/ManufacturerGridDefinitionFactory.php` (two grids)
## 2. Column types
| Column type | When to use | Notes |
|---|---|---|
| `BulkActionColumn` | Row selection checkbox | Always first column |
| `DataColumn` | Plain text (name, email, date) | Most common |
| `ToggleColumn` | Clickable boolean toggle (active status) | Requires AJAX toggle route |
| `ImageColumn`