Create Admin Routing

VerifiedSafe

Create the Symfony routing YAML file declaring all admin routes for a domain.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude CodeCursorWindsurfCopilotCodex
#symfony#routing#prestashop#admin#migration

Recommended for

Automated summary

Generates the Symfony YAML routing file declaring all admin routes for a PrestaShop domain, including the _legacy_controller and _legacy_feature_flag attributes.

Strengths

  • Covers the full expected route set: index, create, edit, delete, status toggle and bulk actions
  • Clearly distinguishes _legacy_controller (permanent) from _legacy_feature_flag (migration-only) and explains why each matters
  • Flags concrete pitfalls: mandatory {id} parameter, POST-only toggle, exact match with the feature flag name
  • Provides a debug:router verification command to confirm the routes are registered

Limitations

  • Tightly coupled to PrestaShop and the PrestaShopBundle architecture, with little reuse outside it
  • Depends on two prerequisite skills (listing and form action controllers) having already run
  • Does not explain how to author feature_flag.xml or create the referenced flag itself
When to use it

Use it when adding the admin routes for a domain that is being migrated to Symfony in PrestaShop.

When not to use it

Avoid it for an already-released, stable page, where routes should be added without _legacy_feature_flag, or outside a PrestaShop codebase.

Security analysis

Safe
Quality score86/100

This skill only instructs the agent to create/edit a Symfony routing YAML file and import it into the admin routing config. The single shell command is a read-only `php bin/console debug:router | grep {domain}` verification. There is no destructive action, no network fetch-and-execute, no secret or token handling, and no instruction to disable safety checks; the emphasis on retaining `_legacy_controller` and correct feature-flag matching is defensive rather than risky.

No concerns found

How this analysis is made

Examples

Routing for a new domain
Create routing for the CustomerGroup domain admin page — include index, create, edit, delete, toggle status and bulk actions.
Migration routing with feature flag
Create routing for {Domain} while the page is under migration, with _legacy_feature_flag set to the matching feature flag name.
Verify registered routes
Add the admin routes for the Supplier domain and verify them with php bin/console debug:router | grep supplier.

name: create-admin-routing description: > Create the Symfony routing YAML file declaring all admin routes for the domain. Trigger: "create routing for {Domain}". needs: [create-controller-listing, create-controller-form-actions] produces: "YAML routing file with all admin routes carrying _legacy_feature_flag and _legacy_controller"

create-admin-routing

Instructions

  1. Create src/PrestaShopBundle/Resources/config/routing/admin/{domain}.yml.
  2. For each action in the controller (listing + form actions), declare a route. Always include _legacy_controller (permanent — see below). While the page is under migration, also include _legacy_feature_flag so requests are dispatched to the new or legacy controller depending on the flag state:
    admin_{domain}s_index:
      path: /{domain}s
      methods: [GET]
      defaults:
        _controller: 'PrestaShopBundle:Admin/{Section}/{Domain}:index'
        _legacy_controller: Admin{Domain}s
        _legacy_feature_flag: {domain}
    
  3. Include routes: index (GET), create (GET+POST), edit (GET+POST with {id} parameter), delete (POST with {id}), toggle status (POST+JSON), bulk delete/enable/disable (POST).
  4. Import this file from the main admin routing file.
  5. CRITICAL: _legacy_feature_flag value must exactly match the name of the feature flag in feature_flag.xml.
  6. Verify with php bin/console debug:router | grep {domain}.

_legacy_controller is permanent

Keep _legacy_controller on every route — it stays for the lifetime of the page, even after full migration. Two consumers depend on it:

  • Permission checks: admin permission rules are keyed by the legacy controller name. Action security expressions like is_granted('read', request.get('_legacy_controller')) rely on this attribute being present
  • Automatic legacy link conversion: third-party modules and old code paths still call Link::getAdminLink('Admin{Domain}s'); the routing layer uses _legacy_controller to resolve those calls to the Symfony route

Removing _legacy_controller after release would silently break permissions and any legacy Link::getAdminLink() callers — never strip it.

_legacy_feature_flag is migration-only

_legacy_feature_flag, in contrast, only exists while the new page coexists with the legacy one. Once the feature flag has been promoted to stable (GA) and the legacy controller is no longer used as a fallback, remove _legacy_feature_flag from the route — but keep _legacy_controller. Routes for fully-released pages have _legacy_controller and no _legacy_feature_flag.

This skill scaffolds routes for pages currently under migration. For routes added or refactored on already-released pages, omit _legacy_feature_flag and keep _legacy_controller.

Rules

Conventions (atomic commit, case-sensitive flag matching, toggle returning JSON, _legacy_controller permanence, post-release flag removal) are in Controller/CONTEXT.md. Skill-specific reminders:

  • Edit and delete routes must include {id} path parameter
  • Toggle status route must allow POST method
  • Never strip _legacy_controller — it remains required for permissions and legacy link conversion long after migration is over

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-admin-routing-mrx3xyi8' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-admin-routing-mrx3xyi8/download' --output '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md.part' && mv '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md.part' '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && test -s '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/create-admin-routing' && cp -R '.skill-downloads/create-admin-routing-mrx3xyi8' '.claude/skills/create-admin-routing'

Cursor
test -f '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && test -s '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/create-admin-routing' && cp -R '.skill-downloads/create-admin-routing-mrx3xyi8' '.cursor/skills/create-admin-routing'

Codex
test -f '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && test -s '.skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/create-admin-routing' && cp -R '.skill-downloads/create-admin-routing-mrx3xyi8' '.agents/skills/create-admin-routing'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-admin-routing-mrx3xyi8'

openskills read 'create-admin-routing-mrx3xyi8'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-admin-routing-mrx3xyi8/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills