jeffsenso/prestashop-skills / skills/prestashop-module-development
prestashop-module-development
VerifiedComplete PrestaShop module development workflow using modern architecture and best practices. Use when: creating new PrestaShop modules, updating legacy modules to modern code, implementing hooks and actions, setting up module configuration pages, adding front office features, handling database operations, implementing security measures, managing translations, creating cart rules and vouchers, building Symfony console commands, or modernizing existing PrestaShop modules from legacy patterns to current standards.
ps9-core-ai/Component/Router/CONTEXT.md
View on GitHub# Router Component
## Purpose
Back-office URL generation with security token injection and legacy route mapping: wraps Symfony's router to append tokens to all admin URLs, maps legacy `Controller:Action` pairs to Symfony routes, and provides entity-specific link builders. Does not handle front-office URL rewriting — that is the Link component.
## Layers
| Layer | Path |
|-------|------|
| Token-injecting router | `src/PrestaShopBundle/Service/Routing/Router.php` |
| Legacy route mapping | `src/PrestaShopBundle/Routing/Converter/` |
| Entity link builder contracts + factory | `src/Core/Routing/` |
| Adapter link builders | `src/Adapter/Routing/` |
| Legacy-compatible URL generator | `src/Adapter/Admin/UrlGenerator.php` |
## Non-obvious patterns
- Token injection is **transparent** — all `generateUrl()` / `redirectToRoute()` calls in back-office controllers get the token automatically via the custom `Router`; no manual token append needed
- Routes marked with `_anonymous_controller` attribute skip token injection — used for login and public API endpoints
- `_legacy_link` route attribute enables the reverse mapping: `RouterProvider` builds `LegacyRoute` objects from this attribute to support old `Link::getAdminLink()` callers during migration
- `_legacy_feature_flag` maps the routing to a specific feature flag. Depending on the feature flag status, the automatic legacy link conversion is enabled/disabled
## Canonical examples
- `src/PrestaShopBundle/Service/Routing/Router.php`
- `src/PrestaShopBundle/Routing/Converter/RouterProvider.php`
- `src/Adapter/Routing/AdminLinkBuilder.php`
## Related
- [Link Component](../Link/CONTEXT.md) — front-office URL generation and legacy `Link` class
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |