shopware6-best-practices by bartundmett/skills
npx skills add https://github.com/bartundmett/skills --skill shopware6-best-practices适用于 Shopware 6.6+ 开发的全面最佳实践指南,专为协助机构开发人员的 AI 代理和 LLM 设计。包含 22 个类别下的 77 条规则,按影响优先级排序,以指导自动化重构和代码生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 插件架构 | 关键 | plugin- |
| 2 | 自定义与扩展 | 关键 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
custom- |
| 3 | 性能与缓存 | 关键 | perf- |
| 4 | 安全 | 关键 | security- |
| 5 | 数据抽象层 | 高 | dal- |
| 6 | API 开发 | 高 | api- |
| 7 | 测试 | 高 | test- |
| 8 | 事件系统 | 中高 | event- |
| 9 | 数据库与迁移 | 中高 | db- |
| 10 | 消息队列 | 中 | queue- |
| 11 | 依赖注入 | 中 | di- |
| 12 | 日志记录 | 中 | logging- |
| 13 | 配置 | 中 | config- |
| 14 | 计划任务 | 中 | scheduled- |
| 15 | 店面开发 | 高 | storefront- |
| 16 | 管理后台开发 | 高 | admin- |
| 17 | 应用系统 | 高 | app- |
| 18 | 集成模式 | 高 | integration- |
| 19 | CLI 命令 | 中 | cli- |
| 20 | 多渠道与 B2B | 中高 | multichannel- |
| 21 | DevOps 与工具 | 中 | devops- |
| 22 | 通用模式 | 高 | pattern- |
plugin-structure - 遵循正确的插件目录结构和 composer.jsonplugin-services - 使用正确的标签注册服务custom-decorator-pattern - 使用装饰器模式进行可安全升级的服务自定义custom-event-subscribers - 以正确的优先级实现事件订阅者perf-http-cache - 正确配置 HTTP 缓存及适当的失效机制perf-dal-optimization - 优化 DAL 查询以防止 N+1 问题perf-elasticsearch - 正确使用 Elasticsearch 处理大型商品目录security-input-validation - 使用 RequestDataBag 和验证器验证所有输入security-authentication - 实现正确的路由认证security-authorization - 使用 ACL 进行权限检查security-csrf-protection - 为店面实现 CSRF 保护security-sql-injection - 使用 DAL 或参数化查询dal-criteria-usage - 正确使用 Criteria 对象进行过滤和分页dal-associations - 显式加载关联以避免 N+1 查询dal-write-operations - 使用批量操作和正确的同步模式dal-entity-extensions - 在不修改核心的情况下扩展实体dal-custom-entities - 正确创建自定义实体定义api-store-api-routes - 创建可装饰的 Store API 路由api-admin-api-routes - 创建带有适当 ACL 的 Admin API 端点api-response-handling - 一致地处理响应和错误api-rate-limiting - 配置速率限制以进行保护api-versioning - 对 API 进行版本控制以保持向后兼容性test-unit-tests - 使用适当的模拟编写单元测试test-integration-tests - 正确使用 IntegrationTestBehaviourtest-store-api-tests - 使用 HTTP 测试测试 Store API 路由test-fixtures - 创建可重用的测试夹具event-business-events - 创建与 Flow Builder 兼容的事件event-flow-actions - 实现可配置的流程操作db-migrations - 实现安全的数据库迁移queue-message-handlers - 实现异步消息处理queue-worker-config - 为生产环境配置工作进程queue-low-priority - 分离低优先级的后台任务di-service-container - 正确使用 Symfony DIlogging-best-practices - 实现结构化日志记录config-plugin-settings - 正确实现插件配置scheduled-tasks - 实现可靠的计划任务storefront-controller-pattern - 使用页面加载器扩展 StorefrontControllerstorefront-twig-extension - 使用 sw_extends 和 blocks 进行模板继承storefront-js-plugins - JavaScript 插件注册和生命周期storefront-themes - 主题结构、继承和配置storefront-scss-variables - SCSS 变量和响应式混合宏storefront-http-client - 来自 JavaScript 的 AJAX 请求和 Store API 调用admin-module-structure - 模块注册、路由和导航admin-components - Vue 组件模式和模板admin-data-handling - 管理后台中的 Repository 工厂和 Criteria APIadmin-acl-permissions - 基于 ACL 的 UI 可见性和操作admin-mixins-composables - 混合、指令和可扩展性admin-extension-api - 应用 iframe 模块和 Extension SDKapp-manifest - 完整的 manifest.xml 配置app-webhooks - Webhook 处理和签名验证app-custom-actions - 带有通知、模态框、重定向的操作按钮app-payment-methods - 用于支付/完成/捕获/退款的应用支付处理器app-custom-fields - 通过清单定义自定义字段app-scripts - 基于 Twig 的应用脚本和钩子点integration-payment-handler - 同步/异步支付处理器模式integration-shipping-method - 运费计算器和交货时间integration-cms-elements - 带有数据解析器的 CMS 元素创建integration-import-export - 导入/导出配置文件和转换器integration-external-api - 带有重试和缓存的 HTTP 客户端模式cli-commands - 创建带有参数和选项的自定义命令cli-command-lifecycle - 配置/初始化/交互/执行生命周期cli-progress-output - SymfonyStyle、进度条和格式化multichannel-saleschannel - 销售渠道感知和可见性multichannel-b2b-patterns - 公司处理、角色和预算multichannel-pricing - 货币、客户组和税务处理multichannel-context - 上下文类型、作用域和权限devops-development-setup - Dockware、docker-compose、Makefile 模式devops-deployment - 部署脚本、构建和回滚devops-static-analysis - PHPStan、PHP-CS-Fixer、Rector 配置devops-debugging - 性能分析器、Xdebug、日志记录和数据收集器devops-ci-cd - GitHub Actions 和 GitLab CI 工作流pattern-error-handling - 自定义异常和错误页面pattern-translations - 代码片段和实体翻译pattern-media-handling - 媒体服务、上传和缩略图pattern-rule-builder - 用于定价/物流的自定义规则条件pattern-upgrade-migration - 版本感知代码和更新迁移永远不要修改核心文件。始终使用:
使用 Shopware 的数据抽象层,而不是原始 SQL:
如果使用不当,Shopware 可能会变慢:
阅读各个规则文件以获取详细说明和代码示例:
rules/plugin-structure.md
rules/custom-decorator-pattern.md
rules/perf-http-cache.md
rules/security-input-validation.md
rules/dal-criteria-usage.md
每个规则文件包含:
获取包含所有扩展规则的完整指南:AGENTS.md
每周安装数
105
代码仓库
GitHub 星标
7
首次出现
2026年1月24日
安全审计
安装于
github-copilot84
opencode67
gemini-cli65
claude-code64
codex64
amp50
Comprehensive best practices guide for Shopware 6.6+ development, designed for AI agents and LLMs helping agency developers. Contains 77 rules across 22 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Plugin Architecture | CRITICAL | plugin- |
| 2 | Customization & Extension | CRITICAL | custom- |
| 3 | Performance & Caching | CRITICAL | perf- |
| 4 | Security | CRITICAL | security- |
| 5 | Data Abstraction Layer | HIGH | dal- |
| 6 | API Development | HIGH | api- |
| 7 | Testing | HIGH | test- |
| 8 | Event System | MEDIUM-HIGH | event- |
| 9 | Database & Migrations | MEDIUM-HIGH | db- |
| 10 | Message Queue | MEDIUM | queue- |
| 11 | Dependency Injection | MEDIUM | di- |
| 12 | Logging | MEDIUM | logging- |
| 13 | Configuration | MEDIUM | config- |
| 14 | Scheduled Tasks | MEDIUM | scheduled- |
| 15 | Storefront Development | HIGH | storefront- |
| 16 | Administration Development | HIGH | admin- |
| 17 | App System | HIGH | app- |
| 18 | Integration Patterns | HIGH | integration- |
| 19 | CLI Commands | MEDIUM | cli- |
| 20 | Multi-Channel & B2B | MEDIUM-HIGH | multichannel- |
| 21 | DevOps & Tooling | MEDIUM | devops- |
| 22 | Common Patterns | HIGH | pattern- |
plugin-structure - Follow proper plugin directory structure and composer.jsonplugin-services - Register services correctly with proper tagscustom-decorator-pattern - Use decorator pattern for upgrade-safe service customizationcustom-event-subscribers - Implement event subscribers correctly with proper prioritiesperf-http-cache - Configure HTTP cache correctly with proper invalidationperf-dal-optimization - Optimize DAL queries to prevent N+1 problemsperf-elasticsearch - Use Elasticsearch correctly for large catalogssecurity-input-validation - Validate all inputs with RequestDataBag and validatorssecurity-authentication - Implement proper route authenticationsecurity-authorization - Use ACL for permission checkssecurity-csrf-protection - Implement CSRF protection for storefrontsecurity-sql-injection - Use DAL or parameterized queriesdal-criteria-usage - Use Criteria objects correctly with filters and paginationdal-associations - Load associations explicitly to avoid N+1 queriesdal-write-operations - Use batch operations and proper sync patternsdal-entity-extensions - Extend entities without modifying coredal-custom-entities - Create custom entity definitions properlyapi-store-api-routes - Create decoratable Store API routesapi-admin-api-routes - Create Admin API endpoints with proper ACLapi-response-handling - Handle responses and errors consistentlyapi-rate-limiting - Configure rate limiting for protectionapi-versioning - Version APIs for backwards compatibilitytest-unit-tests - Write unit tests with proper mockingtest-integration-tests - Use IntegrationTestBehaviour correctlytest-store-api-tests - Test Store API routes with HTTP teststest-fixtures - Create reusable test fixturesevent-business-events - Create Flow Builder compatible eventsevent-flow-actions - Implement configurable flow actionsdb-migrations - Implement safe database migrationsqueue-message-handlers - Implement async message handlingqueue-worker-config - Configure workers for productionqueue-low-priority - Separate low-priority background tasksdi-service-container - Use Symfony DI correctlylogging-best-practices - Implement structured loggingconfig-plugin-settings - Implement plugin configuration correctlyscheduled-tasks - Implement reliable scheduled tasksstorefront-controller-pattern - Extend StorefrontController with page loadersstorefront-twig-extension - Template inheritance with sw_extends and blocksstorefront-js-plugins - JavaScript plugin registration and lifecyclestorefront-themes - Theme structure, inheritance, and configurationstorefront-scss-variables - SCSS variables and responsive mixinsstorefront-http-client - AJAX requests and Store API calls from JSadmin-module-structure - Module registration, routes, and navigationadmin-components - Vue component patterns and templatesadmin-data-handling - Repository factory and Criteria API in adminadmin-acl-permissions - ACL-based UI visibility and actionsadmin-mixins-composables - Mixins, directives, and extensibilityadmin-extension-api - App iframe modules and Extension SDKapp-manifest - Complete manifest.xml configurationapp-webhooks - Webhook handling and signature verificationapp-custom-actions - Action buttons with notifications, modals, redirectsapp-payment-methods - App payment handlers for pay/finalize/capture/refundapp-custom-fields - Custom field definitions via manifestapp-scripts - Twig-based app scripts and hook pointsintegration-payment-handler - Sync/async payment handler patternsintegration-shipping-method - Shipping calculators and delivery timesintegration-cms-elements - CMS element creation with data resolversintegration-import-export - Import/export profiles and convertersintegration-external-api - HTTP client patterns with retry and cachingcli-commands - Custom command creation with arguments and optionscli-command-lifecycle - Configure/initialize/interact/execute lifecyclecli-progress-output - SymfonyStyle, progress bars, and formattingmultichannel-saleschannel - Sales channel awareness and visibilitymultichannel-b2b-patterns - Company handling, roles, and budgetsmultichannel-pricing - Currency, customer groups, and tax handlingmultichannel-context - Context types, scopes, and permissionsdevops-development-setup - Dockware, docker-compose, Makefile patternsdevops-deployment - Deployment scripts, builds, and rollbacksdevops-static-analysis - PHPStan, PHP-CS-Fixer, Rector configurationdevops-debugging - Profiler, Xdebug, logging, and data collectorsdevops-ci-cd - GitHub Actions and GitLab CI workflowspattern-error-handling - Custom exceptions and error pagespattern-translations - Snippets and entity translationspattern-media-handling - Media service, uploads, and thumbnailspattern-rule-builder - Custom rule conditions for pricing/shippingpattern-upgrade-migration - Version-aware code and update migrationsNever modify core files. Always use:
Use Shopware's Data Abstraction Layer instead of raw SQL:
Shopware can be slow if misused:
Read individual rule files for detailed explanations and code examples:
rules/plugin-structure.md
rules/custom-decorator-pattern.md
rules/perf-http-cache.md
rules/security-input-validation.md
rules/dal-criteria-usage.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
Weekly Installs
105
Repository
GitHub Stars
7
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
github-copilot84
opencode67
gemini-cli65
claude-code64
codex64
amp50
FilamentPHP 资源生成技能 - 快速创建 Laravel 后台管理面板
1,200 周安装