prestashop
Use when building, reviewing, or debugging a PrestaShop 9 module — its structure, hooks, controllers, configuration page, services, persistence, cron, or packaging. Triggers on: "PrestaShop", a module main class or `getContent()`, hook registration (`registerHook`, `hookDisplay*`/`hookAction*`), `config/services.yml` inside a module, a module ZIP that will not install, or a Back Office configuration page that 404s.
- License 许可
- Unlicense
- 最近更新
- 2026-10-28
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- prestashop
- scope
- prestashop
- description
- Use when building, reviewing, or debugging a PrestaShop 9 module — its structure, hooks, controllers, configuration page, services, persistence, cron, or packaging. Triggers on: "PrestaShop", a module main class or `getContent()`, hook registration (`registerHook`, `hookDisplay*`/`hookAction*`), `config/services.yml` inside a module, a module ZIP that will not install, or a Back Office configuration page that 404s.
- source_basis
- official docs
- last_verified
- 1773878400000
- target_versions
- PrestaShop 9.x, PHP 8.2+
02 资源文件 13
- 参考文档evals/evals.json2.7 KB
- 参考文档evals/trigger-evals.json3.1 KB
- 参考文档references/configuration-pages.md4.3 KB
- 参考文档references/controllers-routing.md4.0 KB
- 参考文档references/data-persistence.md3.5 KB
- 参考文档references/external-apis-cron.md4.0 KB
- 参考文档references/hooks-widgets.md3.6 KB
- 参考文档references/main-module-class.md4.6 KB
- 参考文档references/module-structure.md3.8 KB
- 参考文档references/prestashop-9-gotchas.md2.6 KB
- 参考文档references/services-dependency-injection.md3.7 KB
- 参考文档references/testing-release-checklist.md2.9 KB
- 参考文档references/translations-templates-assets.md2.6 KB
03 SKILL.md 正文
PrestaShop 9 Module Development Reference
Use this skill for PrestaShop 9 modules. In PrestaShop terminology, these are modules, not "plugins". If the task says plugin, translate it mentally to module and implement it as a module. Read only the reference files relevant to the task.
Critical Rules
- Use real PrestaShop structure — main module file in the module root, legacy controllers in
controllers/, modern Symfony controllers insrc/Controller, config inconfig/, assets/templates inviews/. - Build only from documented PrestaShop 9 conventions — when a class, hook contract, service, or extension point is not in these references or the official docs, stop and say so instead of inventing it. Never ship your own
PrestaShopBundle,Symfony\Component\..., or other classes inside host namespaces to patch missing knowledge. - Keep the main module class thin — constructor, metadata, install/uninstall, hook registration, and configuration entrypoint only. Put API clients, repositories, sync services, and form handlers into
src/orclasses/. - Prefer modern BO configuration — for a real configuration page in PrestaShop 9, use a Symfony form/controller/route.
getContent()should normally redirect to the module’s modern config route, not render a giant PHP string. - Respect controller boundaries — front-office module controllers live in
controllers/front/and must be named<ModuleClassName><FileName>ModuleFrontController. Modern admin controllers go insrc/Controllerand require routing + services/autoload. - Do not guess hooks — verify the hook exists and confirm whether it is display/action/array-return. If the hook contract is unclear, stop guessing and check the docs or core.
- Use
Configurationonly for settings — scalar module settings belong in configuration. Operational data, sync state, mappings, logs, or queues do not. - Model remote identifiers explicitly — external integrations must store or resolve remote IDs correctly. Email is not a universal surrogate key.
- Secure cron/sync entrypoints — if using a front controller as a cron endpoint, require a token and limit the surface area. Prefer a Symfony console command when CLI access is available.
- Composer must not shadow core dependencies — set
"prepend-autoloader": false, packagevendor/, and do not rely on libraries removed from PrestaShop 9 core. - Avoid overrides — use hooks, services, modern extension points, or controller routes first. Overrides are risky and should be the last resort.
- Do not put HTML in PHP — render through Smarty or Twig. The module class is not a view layer.
- Prefix everything you own — config keys, service IDs, table names, CSS/JS handles, routes, tabs, cron tokens, and PHP namespaces.
- Set realistic compatibility — declare only the versions you actually tested. Do not pretend a module is compatible with versions you never ran.
- A module is not done because it installs — installation success proves almost nothing. You still need to validate routing, hooks, configuration save/load, external I/O, uninstall cleanup, and packaging.
Reference Map
| File | Domain | Use when you need |
|---|---|---|
module-structure.md |
Layout & naming | Correct folder layout, naming, bootstrap, composer/autoload |
main-module-class.md |
Main class | Constructor, metadata, install/uninstall, getContent(), tabs |
configuration-pages.md |
Settings UI | Modern Symfony config page, forms, providers, handlers, redirect pattern |
controllers-routing.md |
Routing & controllers | Front controllers, admin controllers, routes, AJAX, cron endpoints |
hooks-widgets.md |
Extension points | Hook registration, display/action hooks, widgets, moduleRoutes |
services-dependency-injection.md |
Services | config/services.yml, DI, service design, commands |
data-persistence.md |
Data model | Configuration, DB tables, Doctrine, upgrade scripts, multistore considerations |
external-apis-cron.md |
Integrations | API clients, id mapping, sync architecture, retries, destructive actions |
translations-templates-assets.md |
UI output | Translation domains, Smarty/Twig, CSS/JS loading, mail/templates |
testing-release-checklist.md |
Validation | Lint, static analysis, install/uninstall, release packaging, debug flow |
prestashop-9-gotchas.md |
Version pitfalls | Removed dependencies, product page changes, common breakages |
Task Routing
- Create a new module skeleton or fix structure/autoload/naming →
references/module-structure.md - Write the main module file or review install/uninstall metadata →
references/main-module-class.md - Build a settings page in Back Office →
references/configuration-pages.md - Create FO/BO endpoints, AJAX, routes, or cron URL →
references/controllers-routing.md - Use hooks, widgets, or custom routes →
references/hooks-widgets.md - Move logic into services or define DI/commands →
references/services-dependency-injection.md - Persist settings, custom entities, mappings, or migrations →
references/data-persistence.md - Integrate an external API or sync data →
references/external-apis-cron.md - Handle translations, templates, assets, or UI text →
references/translations-templates-assets.md - Debug release failures or prepare a distributable ZIP →
references/testing-release-checklist.md - Target PrestaShop 9 specifically or review upgrade risks →
references/prestashop-9-gotchas.md
When Not To Use This Skill
- Framework-generic Symfony questions — PrestaShop 9 embeds Symfony, but form/DI/routing questions outside a module's extension points belong to the Symfony docs.
- Generic PHP or Composer tooling — language-level or dependency questions that are not about module autoload/packaging rules.
- Shop operation, theming, and core upgrades — store configuration, theme development, and PrestaShop core work are not module development.
- Containerized dev environments — load the docker skills for the environment PrestaShop runs in.
04 同仓库更多 Skills
wizard
Generate an interactive bash wizard that walks a human through a manual procedure — third-party setup, credential provisioning, a one-off migration — opening URLs, capturing values, confirming each step, and writing .env files and CI secrets (GitHub and Gitea/Forgejo Actions).
restore-test-pyramid
Analyze the project's E2E suite and push every assertion that doesn't need a real browser down to a faster integration or unit test, proving each migration honest before thinning E2E.
ponytail-debt
Harvest SHORTCUT markers from the codebase and report them grouped by file, flagging any missing upgrade paths.
humanify
Repair an inherited or human-blocked ticket for agent implementation, or finish its explicit human-only outcome.
fix-pr
Repair an existing pull request's review findings and target-branch conflicts, verify the result, and update the same open PR.
feature-milestones
Reconstruct a fragmented backlog as finishable feature milestones with explicit delivery boundaries and an approval-gated tracker update.