create-grid-definition — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited create-grid-definition (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Read @.ai/Component/Grid/CONTEXT.md for the factory trilogy (GridDefinitionFactory → GridDataFactory → GridFactory) and SearchCriteria patterns.
Create src/Core/Grid/Definition/Factory/{Domain}GridDefinitionFactory.php extending AbstractGridDefinitionFactory:
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 gridgetId(): string — return self::GRID_IDgetName(): string — translatable grid namegetColumns(): 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)
| 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 | Image thumbnail (logo) | |
LinkColumn | Text with hyperlink | |
PositionColumn | Drag handle for reordering | See create-position-column skill |
ActionColumn | Row actions dropdown | Always last column |
See Grid/CONTEXT.md for column ordering and naming conventions.
Add in getRowActions():
LinkRowAction for edit — links to admin_{domain}s_edit route with {id} parameterSubmitRowAction pre-wired with the standard delete confirmation modal (translatable title, confirm/cancel buttons, danger styling). Prefer it over building the action manually: use PrestaShop\PrestaShop\Core\Grid\Definition\Factory\DeleteActionTrait;
class {Domain}GridDefinitionFactory extends AbstractGridDefinitionFactory
{
use DeleteActionTrait;
protected function getRowActions(): RowActionCollection
{
return (new RowActionCollection())
->add(/* edit LinkRowAction */)
->add($this->buildDeleteAction(
'admin_{domain}s_delete', // route
'{domain}Id', // route param name
'{domain}Id', // row field providing the value
));
}
}Add in getBulkActions():
SubmitBulkAction for each bulk operation (delete, enable, disable, or any other)confirm_bulk_action: true)Route names in actions must exactly match the routing YAML.
Filters are defined in the grid definition via getFilters(): FilterCollection (see Grid/CONTEXT.md for conventions). Each filter specifies:
TextType, ChoiceType, DateRangeType)Create src/Core/Search/Filters/{Domain}Filters.php extending Filters:
SearchCriteriaInterface — it is NOT a form typeGRID_ID constant from the definition factory to ensure the filter ID matches the grid — this is critical for filter persistence in DBindexAction via argument resolverCommonController::searchGridAction)class {Domain}Filters extends Filters
{
protected $filterId = {Domain}GridDefinitionFactory::GRID_ID;
public static function getDefaults(): array
{
return [
'limit' => static::LIST_LIMIT,
'offset' => 0,
'orderBy' => 'id_{domain}',
'sortOrder' => 'asc',
'filters' => [],
];
}
}Reference: src/Core/Search/Filters/TaxFilters.php (simple)
Register in DI YAML:
{Domain}GridDefinitionFactory — with parent prestashop.core.grid.definition.factory.abstract_grid_definition and grid ID{Domain}Filters — with autoconfigure: truephp bin/console debug:container | grep {domain}Conventions (column ordering, toggle route, Filters as SearchCriteria) are in Grid/CONTEXT.md. Skill-specific reminder:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.