# Create Admin Routing

> >

- **Type:** Skill
- **Install:** `agentstack add skill-jeffsenso-prestashop-skills-create-admin-routing`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [jeffsenso](https://agentstack.voostack.com/s/jeffsenso)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [jeffsenso](https://github.com/jeffsenso)
- **Source:** https://github.com/jeffsenso/prestashop-skills/tree/main/skills/prestashop-module-development/ps9-core-ai/Component/Controller/skills/create-admin-routing

## Install

```sh
agentstack add skill-jeffsenso-prestashop-skills-create-admin-routing
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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:
   ```yaml
   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](../../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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [jeffsenso](https://github.com/jeffsenso)
- **Source:** [jeffsenso/prestashop-skills](https://github.com/jeffsenso/prestashop-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jeffsenso-prestashop-skills-create-admin-routing
- Seller: https://agentstack.voostack.com/s/jeffsenso
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
