with one click
add-menu
Add an admin sidebar menu entry for an existing Sylius Resource
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Add an admin sidebar menu entry for an existing Sylius Resource
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Implement the fix described in a GitHub issue and open a Pull Request that closes it
Apply the latest review feedback to a Pull Request and push it to the PR branch
Add an admin autocomplete form type for a Sylius Resource (translatable or not), optionally injected into another form via an extension
Add an admin FormType for an existing Sylius Resource
Add a Sylius admin grid for an existing Sylius Resource
Add a multiple images collection (OneToMany) to an existing Sylius Resource
| name | add-menu |
| description | Add an admin sidebar menu entry for an existing Sylius Resource |
| argument-hint | [ModelName] |
| allowed-tools | AskUserQuestion, Bash, Read, Edit, Write, Glob, Grep |
Ask the user for the ModelName if not provided.
Ask the user:
library) — used as app.ui.library translation keytabler:books)book)always_open)src/Menu/MenuBuilder.phpCheck if src/Menu/MenuBuilder.php exists.
createMenu() and append the private method.<?php
declare(strict_types=1);
namespace App\Menu;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Sylius\AdminUi\Knp\Menu\MenuBuilderInterface;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
#[AsDecorator(decorates: 'sylius_admin_ui.knp.menu_builder')]
final readonly class MenuBuilder implements MenuBuilderInterface
{
public function __construct(
private FactoryInterface $factory,
) {
}
public function createMenu(array $options): ItemInterface
{
$menu = $this->factory->createItem('root');
$menu
->addChild('dashboard', ['route' => 'sylius_admin_ui_dashboard'])
->setLabel('sylius.ui.dashboard')
->setLabelAttribute('icon', 'tabler:dashboard')
;
$this->add{Section}SubMenu($menu);
return $menu;
}
private function add{Section}SubMenu(ItemInterface $menu): void
{
$section = $menu
->addChild('{section_key}')
->setLabel('app.ui.{section_key}')
->setLabelAttribute('icon', '{section_icon}')
// ->setExtra('always_open', true) // uncomment to expand by default
;
$section
->addChild('{model_snake_plural}', ['route' => 'app_admin_{model_snake}_index'])
->setLabel('app.ui.{model_snake_plural}')
->setLabelAttribute('icon', '{item_icon}')
;
}
}
Create or update translations/messages.en.yaml with the keys used in the menu:
app:
ui:
{section_key}: '{Section label}'
{model_snake_plural}: '{Item label}'
bin/console cache:clear
The menu entry links to the resource's index route — confirm it exists:
bin/console debug:router app_admin_{model_snake}_index
If the route is missing, the index operation has not been added yet — run /sylius-stack:add-operation Index (and /sylius-stack:add-grid before it if the grid does not exist).
Confirm the MenuBuilder decorator is wired:
bin/console debug:container sylius_admin_ui.knp.menu_builder
The service should resolve to App\Menu\MenuBuilder and the Tags row should include container.decorator (id: sylius_admin_ui.knp.menu_builder, ...).