@the-bearded-bear/claude-craft 9.2.0 → 9.2.1-next.06bfe50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dev/i18n/base/Angular/rules/00-project-context.md.template +1 -1
- package/Dev/i18n/base/Angular/rules/03-coding-standards.md +17 -16
- package/Dev/i18n/base/Angular/rules/06-tooling.md +2 -2
- package/Dev/i18n/base/CSharp/rules/06-tooling.md +8 -6
- package/Dev/i18n/base/Common/hooks/scripts/block-dangerous-commands.sh +93 -48
- package/Dev/i18n/base/Common/hooks/scripts/guard-network.sh +58 -0
- package/Dev/i18n/base/Common/hooks/scripts/lib/hook-io.sh +181 -0
- package/Dev/i18n/base/Common/hooks/scripts/notify-slack.sh +21 -32
- package/Dev/i18n/base/Common/hooks/scripts/output-filter.sh +23 -0
- package/Dev/i18n/base/Common/hooks/scripts/output-size-hint.sh +19 -0
- package/Dev/i18n/base/Common/hooks/scripts/post-edit-lint.sh +29 -53
- package/Dev/i18n/base/Common/hooks/scripts/post-tool-failure.sh +50 -0
- package/Dev/i18n/base/Common/hooks/scripts/pre-commit-check.sh +59 -63
- package/Dev/i18n/base/Common/hooks/scripts/pre-compact.sh +52 -0
- package/Dev/i18n/base/Common/hooks/scripts/protect-sensitive-files.sh +16 -0
- package/Dev/i18n/base/Common/hooks/scripts/quality-gate.sh +49 -92
- package/Dev/i18n/base/Common/hooks/scripts/session-end.sh +51 -0
- package/Dev/i18n/base/Common/hooks/scripts/session-init.sh +45 -69
- package/Dev/i18n/base/Common/hooks/templates/examples/README.md +59 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/auto-format.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/block-dangerous-commands.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/context-reinject.json +28 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/output-filter.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/pre-compact.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/protect-files.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/security-block.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/stop-hook.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/user-prompt-submit.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/hooks.default.json +72 -0
- package/Dev/i18n/base/Common/hooks/templates/{settings-hooks.json → hooks.full.json} +22 -23
- package/Dev/i18n/base/Common/hooks/templates/hooks.memory.json +62 -0
- package/Dev/i18n/base/Common/templates/AGENTS.md.template +1 -1
- package/Dev/i18n/base/Common/templates/settings.json.template +46 -0
- package/Dev/i18n/base/Flutter/rules/00-project-context.md.template +9 -9
- package/Dev/i18n/base/Laravel/checks/code-quality.md +1 -1
- package/Dev/i18n/base/Laravel/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Laravel/rules/06-tooling.md +10 -8
- package/Dev/i18n/base/Laravel/rules/07-testing-laravel.md +2 -0
- package/Dev/i18n/base/Laravel/rules/08-quality-tools.md +2 -2
- package/Dev/i18n/base/PHP/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Tauri/rules/02-architecture-tauri.md +1 -0
- package/Dev/i18n/base/Vercel/checks/all.md +1 -1
- package/Dev/i18n/base/Vercel/checks/architecture.md +1 -1
- package/Dev/i18n/base/Vercel/rules/02-architecture-vercel.md +4 -2
- package/Dev/i18n/base/Vercel/rules/06-tooling.md +7 -5
- package/Dev/i18n/base/Vercel/rules/11-security-vercel.md +1 -1
- package/Dev/i18n/base/Vite/rules/06-tooling.md +2 -1
- package/Dev/i18n/base/Vite/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/VueJS/rules/06-tooling.md +3 -3
- package/Dev/i18n/base/VueJS/rules/07-testing-vuejs.md +9 -8
- package/Dev/i18n/base/VueJS/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/WordPress/checklists/new-feature.md +59 -0
- package/Dev/i18n/base/WordPress/checklists/pre-commit.md +125 -0
- package/Dev/i18n/base/WordPress/checks/all.md +257 -0
- package/Dev/i18n/base/WordPress/checks/architecture.md +157 -0
- package/Dev/i18n/base/WordPress/checks/code-quality.md +158 -0
- package/Dev/i18n/base/WordPress/checks/security.md +158 -0
- package/Dev/i18n/base/WordPress/checks/testing.md +157 -0
- package/Dev/i18n/base/WordPress/commands/check.md +28 -0
- package/Dev/i18n/base/WordPress/rules/00-project-context.md.template +169 -0
- package/Dev/i18n/base/WordPress/rules/02-architecture-wordpress.md +174 -0
- package/Dev/i18n/base/WordPress/rules/03-coding-standards.md +98 -0
- package/Dev/i18n/base/WordPress/rules/06-tooling.md +146 -0
- package/Dev/i18n/base/WordPress/rules/07-testing-wordpress.md +150 -0
- package/Dev/i18n/base/WordPress/rules/08-quality-tools.md +161 -0
- package/Dev/i18n/base/WordPress/rules/11-security-wordpress.md +175 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/REFERENCE.md +214 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/SKILL.md +40 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/checklist.md +66 -0
- package/Dev/i18n/base/WordPress/templates/block.md +235 -0
- package/Dev/i18n/base/WordPress/templates/plugin-bootstrap.md +215 -0
- package/Dev/i18n/base/WordPress/templates/rest-endpoint.md +246 -0
- package/Dev/i18n/de/Angular/CLAUDE.md.template +2 -1
- package/Dev/i18n/de/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/de/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/de/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/de/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/de/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/de/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/de/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/de/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/de/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/de/Common/rules/11-security.md +12 -12
- package/Dev/i18n/de/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/de/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/de/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/de/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/de/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/de/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/de/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/de/Paperclip/README.md +1 -1
- package/Dev/i18n/de/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/de/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/de/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/de/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/de/Python/checks/security.md +2 -2
- package/Dev/i18n/de/Python/checks/testing.md +2 -2
- package/Dev/i18n/de/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/de/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/de/Python/templates/repository.md +2 -2
- package/Dev/i18n/de/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/de/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/de/React/templates/component.md +11 -9
- package/Dev/i18n/de/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/de/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/de/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/de/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/de/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/de/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/de/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/de/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/de/Symfony/adr/README.md +1 -1
- package/Dev/i18n/de/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/de/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/de/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/de/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/de/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/de/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/de/Symfony/templates/README.md +1 -1
- package/Dev/i18n/de/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/de/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/de/Vercel/checks/all.md +1 -1
- package/Dev/i18n/de/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/de/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/de/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/de/WordPress/checks/all.md +242 -0
- package/Dev/i18n/de/WordPress/commands/check.md +28 -0
- package/Dev/i18n/de/Workflow/commands/start.md +1 -1
- package/Dev/i18n/en/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/en/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/en/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/en/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/en/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/en/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/en/Common/hooks/HOOKS-QUICKSTART.md +31 -43
- package/Dev/i18n/en/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/en/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/en/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/en/Common/rules/11-security.md +12 -12
- package/Dev/i18n/en/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/en/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/en/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/en/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/en/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/en/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/en/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/en/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/en/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/en/Paperclip/README.md +1 -1
- package/Dev/i18n/en/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/en/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/en/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/en/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/en/Python/checks/security.md +2 -2
- package/Dev/i18n/en/Python/checks/testing.md +2 -2
- package/Dev/i18n/en/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/en/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/en/Python/templates/repository.md +2 -2
- package/Dev/i18n/en/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/en/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/en/React/templates/component.md +11 -9
- package/Dev/i18n/en/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/02-architecture.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/en/ReactNative/rules/07-testing-reactnative.md +1 -1
- package/Dev/i18n/en/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/en/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/en/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/en/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/en/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/en/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/en/Symfony/adr/README.md +1 -1
- package/Dev/i18n/en/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/en/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/en/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/en/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/en/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/en/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/en/Symfony/templates/README.md +1 -1
- package/Dev/i18n/en/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/en/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/en/Vercel/checks/all.md +1 -1
- package/Dev/i18n/en/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/en/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/en/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/en/WordPress/checks/all.md +241 -0
- package/Dev/i18n/en/WordPress/commands/check.md +28 -0
- package/Dev/i18n/en/Workflow/commands/start.md +1 -1
- package/Dev/i18n/es/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/es/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/es/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/es/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/es/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/es/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/es/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/es/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/es/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/es/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/es/Common/rules/11-security.md +12 -12
- package/Dev/i18n/es/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/es/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/es/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/es/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/es/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/es/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/es/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/es/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/es/Paperclip/README.md +1 -1
- package/Dev/i18n/es/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/es/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/es/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/es/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/es/Python/checks/security.md +2 -2
- package/Dev/i18n/es/Python/checks/testing.md +2 -2
- package/Dev/i18n/es/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/es/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/es/Python/templates/repository.md +2 -2
- package/Dev/i18n/es/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/es/React/templates/component.md +11 -9
- package/Dev/i18n/es/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/es/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/es/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/es/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/es/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/es/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/es/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/es/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/es/Symfony/adr/README.md +1 -1
- package/Dev/i18n/es/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/es/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/es/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/es/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/es/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/es/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/es/Symfony/templates/README.md +1 -1
- package/Dev/i18n/es/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/es/Vercel/agents/vercel-reviewer.md +2 -1
- package/Dev/i18n/es/Vercel/checks/all.md +1 -1
- package/Dev/i18n/es/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/es/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/es/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/es/WordPress/checks/all.md +241 -0
- package/Dev/i18n/es/WordPress/commands/check.md +28 -0
- package/Dev/i18n/es/Workflow/commands/start.md +1 -1
- package/Dev/i18n/fr/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/fr/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/fr/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/fr/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/fr/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/fr/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/fr/Common/hooks/HOOKS-QUICKSTART.md +32 -44
- package/Dev/i18n/fr/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/fr/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/fr/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/fr/Common/rules/11-security.md +12 -12
- package/Dev/i18n/fr/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/fr/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/fr/Flutter/rules/02-architecture.md +4 -4
- package/Dev/i18n/fr/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/fr/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/fr/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/fr/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/fr/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/fr/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/fr/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/fr/Paperclip/README.md +1 -1
- package/Dev/i18n/fr/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/fr/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/fr/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/fr/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/fr/Python/checks/security.md +2 -2
- package/Dev/i18n/fr/Python/checks/testing.md +2 -2
- package/Dev/i18n/fr/Python/commands/dependency-audit.md +1 -2
- package/Dev/i18n/fr/Python/commands/generate-endpoint.md +7 -11
- package/Dev/i18n/fr/Python/commands/generate-model.md +6 -6
- package/Dev/i18n/fr/Python/rules/02-architecture.md +9 -24
- package/Dev/i18n/fr/Python/rules/03-coding-standards.md +19 -7
- package/Dev/i18n/fr/Python/templates/repository.md +9 -10
- package/Dev/i18n/fr/React/commands/generate-component.md +52 -51
- package/Dev/i18n/fr/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/fr/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/fr/React/templates/component.md +11 -9
- package/Dev/i18n/fr/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/fr/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/fr/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/fr/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/fr/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/fr/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/fr/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/fr/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/fr/Symfony/adr/README.md +1 -1
- package/Dev/i18n/fr/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/fr/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/fr/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/fr/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/fr/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/fr/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/fr/Symfony/templates/README.md +1 -1
- package/Dev/i18n/fr/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/fr/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/fr/Vercel/checks/all.md +1 -1
- package/Dev/i18n/fr/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/fr/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/fr/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/fr/WordPress/checks/all.md +242 -0
- package/Dev/i18n/fr/WordPress/commands/check.md +28 -0
- package/Dev/i18n/fr/Workflow/commands/start.md +1 -1
- package/Dev/i18n/pt/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/pt/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/pt/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/pt/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/pt/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/pt/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/pt/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/pt/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/pt/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/pt/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/pt/Common/rules/11-security.md +12 -12
- package/Dev/i18n/pt/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/pt/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/pt/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/pt/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/pt/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/pt/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/pt/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/pt/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/pt/Paperclip/README.md +1 -1
- package/Dev/i18n/pt/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/pt/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/pt/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/pt/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/pt/Python/checks/security.md +2 -2
- package/Dev/i18n/pt/Python/checks/testing.md +2 -2
- package/Dev/i18n/pt/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/pt/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/pt/Python/templates/repository.md +2 -2
- package/Dev/i18n/pt/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/pt/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/pt/React/templates/component.md +12 -10
- package/Dev/i18n/pt/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/pt/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/pt/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/pt/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/pt/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/pt/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/pt/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/pt/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/pt/Symfony/adr/README.md +1 -1
- package/Dev/i18n/pt/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/pt/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/pt/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/pt/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/pt/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/pt/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/pt/Symfony/templates/README.md +1 -1
- package/Dev/i18n/pt/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/pt/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/pt/Vercel/checks/all.md +1 -1
- package/Dev/i18n/pt/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/pt/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/pt/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/pt/WordPress/checks/all.md +241 -0
- package/Dev/i18n/pt/WordPress/commands/check.md +28 -0
- package/Dev/i18n/pt/Workflow/commands/start.md +1 -1
- package/Dev/scripts/check-config.sh +1 -1
- package/Dev/scripts/install-common-rules.sh +65 -0
- package/Dev/scripts/install-from-config.sh +3 -0
- package/Dev/scripts/install-paperclip-rules.sh +1 -1
- package/Dev/scripts/install-wordpress-rules.sh +153 -0
- package/Dev/scripts/lib/install-tech-common.sh +39 -39
- package/Dev/scripts/lib/merge-hooks.mjs +110 -0
- package/Dev/scripts/memory-lifecycle/README.md +10 -9
- package/Dev/scripts/memory-lifecycle/_db.sh +1 -1
- package/Dev/scripts/memory-lifecycle/post-tool.sh +1 -1
- package/Dev/scripts/memory-lifecycle/pre-compact.sh +5 -5
- package/Dev/scripts/memory-lifecycle/prompt-submit.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-end.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-start.sh +5 -4
- package/Dev/scripts/tcl-common.sh +23 -23
- package/Dev/stack-profiles/wordpress/permissions.txt +10 -0
- package/Dev/stack-profiles/wordpress/quality.md +4 -0
- package/Dev/stack-profiles/wordpress/stack.txt +2 -0
- package/Infra/i18n/de/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/de/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/de/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/de/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/de/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/de/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/de/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/de/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-architect.md +16 -14
- package/Infra/i18n/de/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/de/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-security.md +1 -1
- package/Infra/i18n/de/Hcloud/commands/architecture.md +2 -2
- package/Infra/i18n/de/Hcloud/commands/debug.md +3 -3
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/de/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/de/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/de/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/en/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/en/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/en/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/en/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/en/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/en/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/en/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Hcloud/agents/hcloud-architect.md +10 -8
- package/Infra/i18n/en/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/en/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/en/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/en/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/en/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/es/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/es/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/es/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/es/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/es/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/es/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/es/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Hcloud/agents/hcloud-architect.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/es/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/es/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/es/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/es/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/fr/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/fr/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/fr/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Hcloud/agents/hcloud-architect.md +7 -5
- package/Infra/i18n/fr/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/fr/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/fr/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/fr/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/pt/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/pt/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/pt/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Hcloud/agents/hcloud-architect.md +9 -7
- package/Infra/i18n/pt/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/pt/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/architecture.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/pt/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/pt/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/install-ansible-rules.sh +26 -26
- package/Infra/install-coolify-rules.sh +26 -26
- package/Infra/install-docker-rules.sh +26 -26
- package/Infra/install-frankenphp-rules.sh +26 -26
- package/Infra/install-hcloud-rules.sh +26 -26
- package/Infra/install-kubernetes-rules.sh +26 -26
- package/Infra/install-opentofu-rules.sh +26 -26
- package/Infra/install-pgbouncer-rules.sh +26 -26
- package/Project/i18n/de/templates/sprint-status.md +4 -0
- package/Project/i18n/en/templates/sprint-status.md +4 -0
- package/Project/i18n/es/templates/sprint-status.md +4 -0
- package/Project/i18n/fr/templates/sprint-status.md +4 -0
- package/Project/i18n/pt/templates/sprint-status.md +4 -0
- package/Project/install-project-commands.sh +9 -9
- package/Project/templates/sprint-status.yaml.template +4 -0
- package/README.md +32 -16
- package/Tools/PluginExport/export-plugin.sh +15 -17
- package/Tools/ProjectConfig/claude-projects.sh +2 -2
- package/Tools/RTK/install-rtk.sh +1 -1
- package/Tools/Ralph/README.md +17 -7
- package/Tools/Ralph/hooks/lib/ralph-common.sh +101 -0
- package/Tools/Ralph/hooks/pre-tool-context.sh +28 -0
- package/Tools/Ralph/hooks/session-restore.sh +94 -0
- package/Tools/Ralph/hooks/stop-dod-gate.sh +60 -0
- package/Tools/Ralph/lib/hooks-generator.sh +109 -93
- package/Tools/Ralph/lib/metrics-exporter.sh +3 -3
- package/Tools/Ralph/lib/parallel-manager.sh +1 -1
- package/Tools/Ralph/lib/recovery-engine.sh +2 -1
- package/Tools/Ralph/lib/sprint-conductor.sh +20 -7
- package/bundles/cursor/.cursorrules +11 -10
- package/bundles/windsurf/.windsurfrules +11 -10
- package/cli/index.js +1 -0
- package/cli/kanban/client/dist/assets/{BurndownView-B6D7QRcK.css → BurndownView-CnsZ1jie.css} +1 -1
- package/cli/kanban/client/dist/assets/BurndownView-s2wpjiqE.js +3 -0
- package/cli/kanban/client/dist/assets/DepsView-Bo8sRS7i.js +1 -0
- package/cli/kanban/client/dist/assets/DocsView-QjjjfhpV.js +1 -0
- package/cli/kanban/client/dist/assets/SprintsView-B4toxGc4.css +1 -0
- package/cli/kanban/client/dist/assets/SprintsView-BSh9XshU.js +1 -0
- package/cli/kanban/client/dist/assets/actions-D0g4C88h.js +2 -0
- package/cli/kanban/client/dist/assets/de-CpCArOVg.js +1 -0
- package/cli/kanban/client/dist/assets/es-CnARpMvm.js +1 -0
- package/cli/kanban/client/dist/assets/fr-CIeAvktE.js +1 -0
- package/cli/kanban/client/dist/assets/index-BimcLpOz.css +1 -0
- package/cli/kanban/client/dist/assets/index-CdlYlxD5.js +2 -0
- package/cli/kanban/client/dist/assets/palette.svelte-BymgBiMI.js +1 -0
- package/cli/kanban/client/dist/assets/pt-Cs89lHuV.js +1 -0
- package/cli/kanban/client/dist/assets/router.svelte-CKx0fx-k.js +1 -0
- package/cli/kanban/client/dist/index.html +4 -2
- package/cli/kanban/client/src/App.svelte +212 -105
- package/cli/kanban/client/src/app.css +234 -62
- package/cli/kanban/client/src/components/Avatar.svelte +6 -4
- package/cli/kanban/client/src/components/CapacityBar.svelte +57 -0
- package/cli/kanban/client/src/components/CloseSprintDialog.svelte +114 -0
- package/cli/kanban/client/src/components/ConfirmDialog.svelte +125 -0
- package/cli/kanban/client/src/components/FilterBar.svelte +179 -0
- package/cli/kanban/client/src/components/KeyboardShortcuts.svelte +16 -0
- package/cli/kanban/client/src/components/MoveMenu.svelte +42 -0
- package/cli/kanban/client/src/components/NotFound.svelte +10 -0
- package/cli/kanban/client/src/components/Points.svelte +8 -2
- package/cli/kanban/client/src/components/PriorityChip.svelte +4 -1
- package/cli/kanban/client/src/components/ProgressRing.svelte +7 -4
- package/cli/kanban/client/src/components/PromptDialog.svelte +95 -54
- package/cli/kanban/client/src/components/SprintForm.svelte +189 -0
- package/cli/kanban/client/src/components/StoryCreateDialog.svelte +133 -0
- package/cli/kanban/client/src/components/StoryDetail.svelte +744 -76
- package/cli/kanban/client/src/components/StoryForm.svelte +340 -0
- package/cli/kanban/client/src/components/StoryRow.svelte +45 -0
- package/cli/kanban/client/src/components/TaskProgress.svelte +4 -2
- package/cli/kanban/client/src/components/TddPip.svelte +10 -8
- package/cli/kanban/client/src/components/Toasts.svelte +52 -0
- package/cli/kanban/client/src/components/TweaksPanel.svelte +86 -32
- package/cli/kanban/client/src/components/WipSettings.svelte +130 -0
- package/cli/kanban/client/src/lib/actions.js +49 -0
- package/cli/kanban/client/src/lib/announce.js +28 -0
- package/cli/kanban/client/src/lib/api.js +77 -0
- package/cli/kanban/client/src/lib/backlog.js +38 -4
- package/cli/kanban/client/src/lib/board-card.js +50 -0
- package/cli/kanban/client/src/lib/board-nav.js +111 -0
- package/cli/kanban/client/src/lib/burndown.js +15 -0
- package/cli/kanban/client/src/lib/config.js +8 -0
- package/cli/kanban/client/src/lib/deps-style.js +5 -2
- package/cli/kanban/client/src/lib/deps-table.js +51 -0
- package/cli/kanban/client/src/lib/detail.svelte.js +31 -23
- package/cli/kanban/client/src/lib/docs-tree.js +30 -0
- package/cli/kanban/client/src/lib/events.js +73 -8
- package/cli/kanban/client/src/lib/filter.js +68 -0
- package/cli/kanban/client/src/lib/health.svelte.js +19 -0
- package/cli/kanban/client/src/lib/i18n/index.svelte.js +73 -0
- package/cli/kanban/client/src/lib/i18n/locales/de.js +587 -0
- package/cli/kanban/client/src/lib/i18n/locales/en.js +588 -0
- package/cli/kanban/client/src/lib/i18n/locales/es.js +584 -0
- package/cli/kanban/client/src/lib/i18n/locales/fr.js +584 -0
- package/cli/kanban/client/src/lib/i18n/locales/pt.js +583 -0
- package/cli/kanban/client/src/lib/i18n/translate.js +86 -0
- package/cli/kanban/client/src/lib/icons.js +0 -5
- package/cli/kanban/client/src/lib/leave-guard.js +29 -0
- package/cli/kanban/client/src/lib/markdown.js +99 -0
- package/cli/kanban/client/src/lib/opener.js +12 -0
- package/cli/kanban/client/src/lib/optimistic.js +44 -0
- package/cli/kanban/client/src/lib/palette.svelte.js +10 -0
- package/cli/kanban/client/src/lib/points.js +6 -0
- package/cli/kanban/client/src/lib/query.js +92 -0
- package/cli/kanban/client/src/lib/router.svelte.js +70 -11
- package/cli/kanban/client/src/lib/shell.js +56 -0
- package/cli/kanban/client/src/lib/sprint-actions.svelte.js +151 -0
- package/cli/kanban/client/src/lib/sprint-plan.js +141 -0
- package/cli/kanban/client/src/lib/sprints.js +38 -1
- package/cli/kanban/client/src/lib/store.svelte.js +195 -78
- package/cli/kanban/client/src/lib/story-actions.svelte.js +236 -0
- package/cli/kanban/client/src/lib/story-form.js +205 -0
- package/cli/kanban/client/src/lib/toasts.js +84 -0
- package/cli/kanban/client/src/lib/tweaks.svelte.js +6 -9
- package/cli/kanban/client/src/lib/velocity.js +35 -0
- package/cli/kanban/client/src/lib/wip.js +17 -0
- package/cli/kanban/client/src/views/BacklogView.svelte +206 -91
- package/cli/kanban/client/src/views/BurndownView.svelte +203 -104
- package/cli/kanban/client/src/views/DepsView.svelte +176 -100
- package/cli/kanban/client/src/views/DocsView.svelte +170 -122
- package/cli/kanban/client/src/views/KanbanView.svelte +377 -356
- package/cli/kanban/client/src/views/SprintsView.svelte +313 -179
- package/cli/kanban/client/src/views.css +1518 -305
- package/cli/kanban/server/app.js +38 -241
- package/cli/kanban/server/cli-options.js +58 -0
- package/cli/kanban/server/middleware/security.js +28 -2
- package/cli/kanban/server/routes/http-errors.js +55 -0
- package/cli/kanban/server/routes/settings.js +24 -0
- package/cli/kanban/server/routes/sprints.js +364 -0
- package/cli/kanban/server/routes/stories.js +565 -0
- package/cli/kanban/server/services/event-bus.js +3 -2
- package/cli/kanban/server/services/file-scanner.js +2 -1
- package/cli/kanban/server/services/file-watcher.js +27 -10
- package/cli/kanban/server/services/file-writer.js +12 -58
- package/cli/kanban/server/services/frontmatter.js +44 -6
- package/cli/kanban/server/services/idempotency.js +77 -0
- package/cli/kanban/server/services/kanban-config.js +122 -0
- package/cli/kanban/server/services/lock.js +138 -0
- package/cli/kanban/server/services/markdown-metadata.js +27 -13
- package/cli/kanban/server/services/repository.js +268 -165
- package/cli/kanban/server/services/sprint-cache.js +24 -136
- package/cli/kanban/server/services/sprint-ops.js +223 -0
- package/cli/kanban/server/services/state-machine.js +8 -11
- package/cli/kanban/server/services/status-store.js +385 -0
- package/cli/kanban/server/services/story-files.js +282 -0
- package/cli/kanban/shared/ids.js +42 -0
- package/cli/kanban/shared/schemas.js +106 -12
- package/cli/kanban/shared/transitions.js +25 -0
- package/cli/lib/doctor.js +8 -7
- package/cli/lib/help.js +1 -0
- package/cli/lib/installer.js +3 -3
- package/cli/lib/kanban.js +11 -7
- package/cli/lib/parse-args.js +12 -0
- package/cli/lib/tech-registry.js +15 -5
- package/package.json +3 -1
- package/Dev/i18n/de/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/de/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/de/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/de/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/en/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/en/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/en/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/en/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/es/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/es/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/es/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/es/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/fr/Common/hooks/scripts/post-tool-failure.sh +0 -88
- package/Dev/i18n/fr/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/fr/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/fr/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/pt/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/pt/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/pt/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/pt/Common/templates/settings.json.template +0 -128
- package/Tools/Ralph/.ralph/hooks/pre-tool-context.sh +0 -100
- package/Tools/Ralph/.ralph/hooks/session-restore.sh +0 -118
- package/Tools/Ralph/.ralph/hooks/status-injector.sh +0 -147
- package/Tools/Ralph/.ralph/hooks/stop-dod-gate.sh +0 -137
- package/cli/kanban/client/dist/assets/BurndownView-BBl1LOfu.js +0 -3
- package/cli/kanban/client/dist/assets/DepsView-D0N9Tg4d.css +0 -1
- package/cli/kanban/client/dist/assets/DepsView-DXREli3v.js +0 -1
- package/cli/kanban/client/dist/assets/DocsView--bhcgCS3.js +0 -1
- package/cli/kanban/client/dist/assets/DocsView-CBBzt7Ru.css +0 -1
- package/cli/kanban/client/dist/assets/SprintsView-8AMci9M2.css +0 -1
- package/cli/kanban/client/dist/assets/SprintsView-CLKf2BTm.js +0 -1
- package/cli/kanban/client/dist/assets/index-DI89vrQ2.js +0 -4
- package/cli/kanban/client/dist/assets/index-DRj2q7mf.css +0 -1
- package/cli/kanban/client/src/lib/kanban-nav.js +0 -119
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# WordPress Architecture
|
|
2
|
+
|
|
3
|
+
> Scope: WordPress 7.1 line (PHP 7.4 minimum, 8.3+ recommended), plugins and block themes. Out of scope: Bedrock, hosting and multi-environment deployment, generic PHP design (see the `php` stack), frontend frameworks outside the block editor. WooCommerce specifics are in the optional `woocommerce` skill, not here.
|
|
4
|
+
|
|
5
|
+
## Principle
|
|
6
|
+
|
|
7
|
+
Extend core through its public APIs (hooks, blocks, REST, Settings API); keep the plugin a thin wiring layer over plain, testable PHP classes. Never edit core or other plugins; if behavior must change, use or provide a filter.
|
|
8
|
+
|
|
9
|
+
## Plugin Bootstrap
|
|
10
|
+
|
|
11
|
+
The main file carries the header and bootstraps; nothing else. See `templates/plugin-bootstrap.md` for the full skeleton.
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
<?php
|
|
15
|
+
/**
|
|
16
|
+
* Plugin Name: Acme Reports
|
|
17
|
+
* Version: 1.0.0
|
|
18
|
+
* Requires at least: 6.6
|
|
19
|
+
* Requires PHP: 7.4
|
|
20
|
+
* Requires Plugins: some-dependency
|
|
21
|
+
* Text Domain: acme-reports
|
|
22
|
+
* Domain Path: /languages
|
|
23
|
+
* License: GPL-2.0-or-later
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
defined( 'ABSPATH' ) || exit;
|
|
27
|
+
|
|
28
|
+
require_once __DIR__ . '/vendor/autoload.php';
|
|
29
|
+
|
|
30
|
+
add_action( 'plugins_loaded', array( new Acme\Reports\Plugin( __FILE__ ), 'boot' ) );
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `Requires at least` and `Requires PHP` reflect what CI tests, not what is wished; `Requires Plugins` lists hard dependencies by WordPress.org slug (WordPress blocks activation if they are missing)
|
|
34
|
+
- One PSR-4 namespace and one function/option/hook prefix per plugin; the text domain equals the plugin slug
|
|
35
|
+
- Activation, deactivation and uninstall are separate, idempotent entry points (`register_activation_hook`, `register_deactivation_hook`, `uninstall.php`)
|
|
36
|
+
|
|
37
|
+
## Suggested Layout
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
my-plugin/
|
|
41
|
+
├── my-plugin.php
|
|
42
|
+
├── uninstall.php
|
|
43
|
+
├── readme.txt
|
|
44
|
+
├── src/
|
|
45
|
+
│ ├── Plugin.php # boot(): registers features
|
|
46
|
+
│ ├── Admin/ # Settings pages, admin notices
|
|
47
|
+
│ ├── Rest/ # WP_REST_Controller subclasses
|
|
48
|
+
│ ├── Cli/ # WP-CLI commands
|
|
49
|
+
│ ├── Domain/ # Plain PHP, no WordPress calls
|
|
50
|
+
│ └── Blocks/<block>/ # block.json, render.php, edit.js, view.js
|
|
51
|
+
├── build/ # Generated by wp-scripts
|
|
52
|
+
├── languages/
|
|
53
|
+
└── tests/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use Vertical Slices per feature when the plugin grows; do not add layers a 500-line plugin does not need (YAGNI).
|
|
57
|
+
|
|
58
|
+
## Hooks
|
|
59
|
+
|
|
60
|
+
- Register hooks in one `register()` / `boot()` method per feature, on the earliest hook that has what you need: `plugins_loaded` (wiring), `init` (post types, taxonomies, blocks, shortcodes), `admin_init`, `rest_api_init`, `wp_enqueue_scripts`, `admin_enqueue_scripts`
|
|
61
|
+
- Callbacks are public methods or named functions so integrators can `remove_action()` them; document priority when order matters
|
|
62
|
+
- Provide your own prefixed `apply_filters()` / `do_action()` points for behavior integrators may change; document each with a docblock (`@since`, `@param`)
|
|
63
|
+
- Keep callbacks thin: map hook arguments to a domain method
|
|
64
|
+
|
|
65
|
+
```php
|
|
66
|
+
add_action( 'save_post_acme_report', array( $this->handler, 'on_save' ), 10, 2 );
|
|
67
|
+
// Later, from another plugin:
|
|
68
|
+
remove_action( 'save_post_acme_report', array( $handler, 'on_save' ), 10 );
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Data
|
|
72
|
+
|
|
73
|
+
| Need | Use |
|
|
74
|
+
|------|-----|
|
|
75
|
+
| Configuration | `register_setting()` + Settings API; one array option per feature; `autoload` false when not read on every request |
|
|
76
|
+
| Content | Custom post types and taxonomies registered on `init`, `show_in_rest` when the editor needs them |
|
|
77
|
+
| Per-object data | Registered meta (`register_post_meta()` with `show_in_rest`, `sanitize_callback`, `auth_callback`) |
|
|
78
|
+
| Large or relational data | Custom table created by `dbDelta()`, versioned with a `db_version` option and upgrade routine |
|
|
79
|
+
| Expensive results | Transients, or the object cache (`wp_cache_get/set` with a group) with explicit expiry and invalidation |
|
|
80
|
+
|
|
81
|
+
Always use `$wpdb->prefix` for table names and `$wpdb->prepare()` for SQL.
|
|
82
|
+
|
|
83
|
+
## Queries and Performance
|
|
84
|
+
|
|
85
|
+
- Never `posts_per_page => -1` on user-reachable code; paginate or cap
|
|
86
|
+
- `no_found_rows => true` when the total is unused; `fields => 'ids'` when only ids are needed; disable meta/term cache priming when unused
|
|
87
|
+
- Avoid `meta_query` and `orderby => meta_value` on large sites (the `wp_postmeta` table is not indexed for value lookups); prefer taxonomies or a custom table
|
|
88
|
+
- Do not query inside loops; prime caches or batch
|
|
89
|
+
- Modify the main query with `pre_get_posts`, never `query_posts()`; restore with `wp_reset_postdata()` after secondary loops
|
|
90
|
+
- Keep early hooks cheap; defer to the relevant context (`is_admin()`, `wp_doing_ajax()`, REST)
|
|
91
|
+
- Schedule background work with `wp_schedule_event()` guarded by `wp_next_scheduled()`; unschedule on deactivation; chunk long jobs
|
|
92
|
+
|
|
93
|
+
## Blocks
|
|
94
|
+
|
|
95
|
+
- One folder per block with a `block.json` (`apiVersion` 3, namespaced `name`, `textdomain`, `attributes`, `supports`). See `templates/block.md`
|
|
96
|
+
- Register all blocks at once from the build manifest (recommended since WordPress 6.8): `wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' )` on `init`; `wp-scripts build --blocks-manifest` or `wp-scripts build-blocks-manifest` generates the manifest. For a single block, `register_block_type( __DIR__ . '/build/my-block' )` remains valid
|
|
97
|
+
- Dynamic blocks render in PHP (`render.php`, or `render_callback`): the `$attributes`, `$content` and `$block` variables are available, output is escaped late, and the wrapper uses `get_block_wrapper_attributes()`
|
|
98
|
+
- Static blocks save markup in JS; any change to saved markup needs a `deprecated` entry so existing content keeps validating
|
|
99
|
+
- Front-end interactivity uses the Interactivity API: `viewScriptModule` in `block.json`, `data-wp-interactive`, directives such as `data-wp-on--click` and `data-wp-bind--*`, a namespaced `store()` from `@wordpress/interactivity`, and server state via `wp_interactivity_state()`. Script modules need the `--experimental-modules` flag on `wp-scripts build`/`start` unless your scaffold already sets it
|
|
100
|
+
- Block bindings and patterns are preferred over custom shortcodes for new content structures
|
|
101
|
+
- SVG Icon API (7.1): `wp_register_icon_collection( $name, $args )`, `wp_register_icon( 'collection/icon-name', [ 'label' => ..., 'content' | 'file_path' => ... ] )`, `wp_get_icon( $name, [ 'size', 'class', 'label' ] )` (empty string when unregistered), REST `GET /wp/v2/icons`. Source: https://make.wordpress.org/core/2026/07/24/registering-and-rendering-svg-icons-in-wordpress-7-1/
|
|
102
|
+
- The post editor is always iframed in 7.1, including on sites with legacy meta boxes: JS/CSS that reaches across the editor document boundary must be tested (jQuery UI is 1.14.2). Source: https://make.wordpress.org/core/2026/08/03/iframed-editor-changes-in-wordpress-7-1/
|
|
103
|
+
|
|
104
|
+
## Block Themes
|
|
105
|
+
|
|
106
|
+
- `style.css` (header), `theme.json` with `"version": 3`, `templates/*.html`, `parts/*.html`, `patterns/*.php` (with a pattern header: `Title`, `Slug`, `Categories`), `styles/` for variations
|
|
107
|
+
- Put design decisions (palette, typography, spacing, layout, per-block styles) in `theme.json`; use CSS only for what `theme.json` cannot express
|
|
108
|
+
- Declare `templateParts` and `customTemplates` in `theme.json`; keep PHP in `functions.php` minimal (enqueue, patterns, block style registration)
|
|
109
|
+
- Child themes inherit templates and `theme.json`; override sparingly
|
|
110
|
+
|
|
111
|
+
## REST API
|
|
112
|
+
|
|
113
|
+
- `register_rest_route()` on `rest_api_init`, vendor namespace and version (`acme/v1`), `permission_callback` on every route, `args` with `type`, `required`, `sanitize_callback`, `validate_callback` (or a JSON schema). See `templates/rest-endpoint.md`
|
|
114
|
+
- Prefer `WP_REST_Controller` conventions (`get_item_schema()`, `prepare_item_for_response()`); return `WP_REST_Response` or `WP_Error` with the right HTTP status
|
|
115
|
+
- Reuse domain services; the controller only maps request to call to response
|
|
116
|
+
|
|
117
|
+
## WP-CLI
|
|
118
|
+
|
|
119
|
+
```php
|
|
120
|
+
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
|
121
|
+
WP_CLI::add_command( 'acme reports', Acme\Reports\Cli\Reports_Command::class );
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- Commands reuse the same domain classes as hooks and REST; they never duplicate logic
|
|
126
|
+
- Document arguments with the PHPDoc synopsis (`## OPTIONS`, `## EXAMPLES`); use `WP_CLI::success()`, `warning()`, `error()` and `WP_CLI\Utils\make_progress_bar()` for batches
|
|
127
|
+
|
|
128
|
+
## Internationalization
|
|
129
|
+
|
|
130
|
+
- Literal strings and a literal text domain in every call: `__( 'Report', 'acme-reports' )`, `esc_html__()`, `_x()`, `_n()`; never concatenate or interpolate translatable strings, use `sprintf()` with placeholders and translator comments
|
|
131
|
+
- Since WordPress 4.6 translations are loaded from WordPress.org for hosted plugins; for bundled translations set `Domain Path` and call `load_plugin_textdomain()` only if needed
|
|
132
|
+
- JavaScript: `import { __ } from '@wordpress/i18n'` and `wp_set_script_translations( $handle, 'acme-reports', plugin_dir_path( __FILE__ ) . 'languages' )`; blocks registered from `block.json` get script translations when `textdomain` is set
|
|
133
|
+
- Generate the template with `wp i18n make-pot`
|
|
134
|
+
|
|
135
|
+
## Assets
|
|
136
|
+
|
|
137
|
+
- Register and enqueue with `wp_register_script()` / `wp_enqueue_script()`; read `build/*.asset.php` for `dependencies` and `version`
|
|
138
|
+
- Enqueue only where needed (block `style` / `viewScriptModule`, conditional `wp_enqueue_scripts`, `admin_enqueue_scripts` with the hook suffix)
|
|
139
|
+
- Use `wp_add_inline_script()` / `wp_add_inline_style()` instead of inline tags; load in the footer or with `strategy` => `defer` where possible
|
|
140
|
+
|
|
141
|
+
```php
|
|
142
|
+
$asset = include plugin_dir_path( __FILE__ ) . 'build/admin.asset.php';
|
|
143
|
+
wp_enqueue_script( 'acme-admin', plugins_url( 'build/admin.js', __FILE__ ), $asset['dependencies'], $asset['version'], array( 'in_footer' => true ) );
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Settings API
|
|
147
|
+
|
|
148
|
+
- `register_setting()` with `type`, `sanitize_callback`, `default`; `add_settings_section()` / `add_settings_field()`; render with `settings_fields()` and `do_settings_sections()`
|
|
149
|
+
- The admin menu entry declares a capability; the settings form relies on the Settings API's built-in nonce and the `options.php` handler, so no hand-rolled save code is needed
|
|
150
|
+
|
|
151
|
+
## Anti-Patterns
|
|
152
|
+
|
|
153
|
+
| Anti-pattern | Fix |
|
|
154
|
+
|--------------|-----|
|
|
155
|
+
| Logic and side effects at file scope | Bootstrap class on `plugins_loaded` / `init` |
|
|
156
|
+
| Generic global names (`save_data()`) | Namespace or unique prefix |
|
|
157
|
+
| `query_posts()`, `posts_per_page => -1` | `pre_get_posts`, pagination |
|
|
158
|
+
| Inline `<script>` / `<style>` in templates | `wp_enqueue_*` and `wp_add_inline_*` |
|
|
159
|
+
| Direct DB writes to core tables | Core APIs (`wp_insert_post`, `update_user_meta`) |
|
|
160
|
+
| Editing another plugin's files | Use or add a hook |
|
|
161
|
+
| Many scalar autoloaded options | One array option, `autoload` false |
|
|
162
|
+
|
|
163
|
+
## Sources
|
|
164
|
+
|
|
165
|
+
- https://developer.wordpress.org/plugins/plugin-basics/header-requirements/
|
|
166
|
+
- https://developer.wordpress.org/plugins/plugin-basics/best-practices/
|
|
167
|
+
- https://developer.wordpress.org/plugins/hooks/
|
|
168
|
+
- https://developer.wordpress.org/block-editor/getting-started/fundamentals/registration-of-a-block/
|
|
169
|
+
- https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
|
|
170
|
+
- https://developer.wordpress.org/block-editor/reference-guides/interactivity-api/
|
|
171
|
+
- https://developer.wordpress.org/themes/global-settings-and-styles/
|
|
172
|
+
- https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
|
|
173
|
+
- https://developer.wordpress.org/plugins/settings/settings-api/
|
|
174
|
+
- https://developer.wordpress.org/cli/commands/
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# WordPress Coding Standards
|
|
2
|
+
|
|
3
|
+
> Scope: PHP, JavaScript and CSS written for WordPress 7.1-line plugins and block themes. Generic PHP style (PER-CS, SOLID) follows the `php` stack; this file lists what is specific to WordPress. WPCS 3.4.1 is the reference PHPCS ruleset.
|
|
4
|
+
|
|
5
|
+
## Principle
|
|
6
|
+
|
|
7
|
+
Follow the WordPress Coding Standards (WPCS) through PHPCS, not by memory. Where the project deliberately deviates (for example short array syntax or PSR-4 file names), declare the exclusion once in `.phpcs.xml.dist` with a comment, and keep it consistent.
|
|
8
|
+
|
|
9
|
+
## PHP
|
|
10
|
+
|
|
11
|
+
| Topic | Rule |
|
|
12
|
+
|-------|------|
|
|
13
|
+
| Indentation | Tabs for indentation, spaces for alignment (WPCS default) |
|
|
14
|
+
| Spacing | Spaces inside parentheses: `if ( $a ) { foo( $b ); }` |
|
|
15
|
+
| Braces | Always, on the same line as the control structure |
|
|
16
|
+
| Yoda conditions | `if ( true === $enabled )`; required by WPCS for comparisons with literals |
|
|
17
|
+
| Arrays | `array()` is the WPCS default; short `[]` allowed via a ruleset decision, applied consistently |
|
|
18
|
+
| Naming | `snake_case` functions and variables; `Capitalized_Words` classes in WPCS file-naming mode, or PSR-4 `PascalCase` with the `WordPress.Files.FileName` exclusion; `UPPER_CASE` constants |
|
|
19
|
+
| Prefixing | Every global (function, class outside a namespace, constant, hook, option, post type, handle) is prefixed or namespaced; configure `WordPress.NamingConventions.PrefixAllGlobals` with your prefixes |
|
|
20
|
+
| Strictness | `in_array( $x, $list, true )`, `array_search( ..., true )`; no loose comparisons on user data |
|
|
21
|
+
| Docblocks | Public functions, classes and hooks documented: `@since`, `@param`, `@return` |
|
|
22
|
+
| Files | `defined( 'ABSPATH' ) || exit;` at the top of directly reachable files |
|
|
23
|
+
| Forbidden | `eval()`, `extract()`, `create_function()`, error suppression `@`, runtime `ini_set()`, `error_reporting()`, `query_posts()`, `$wpdb` queries concatenated with variables |
|
|
24
|
+
|
|
25
|
+
### Minimum PHP Compatibility
|
|
26
|
+
|
|
27
|
+
`Requires PHP` in the plugin header, `composer.json` (`"php": ">=7.4"`) and the PHPCS `testVersion` must agree. PHP 7.4 is the WordPress minimum; 8.3+ is recommended for hosting. If the minimum is 7.4, do not use `match`, enums, readonly properties, union types or constructor promotion; raise the minimum deliberately and everywhere at once.
|
|
28
|
+
|
|
29
|
+
### WordPress Idioms
|
|
30
|
+
|
|
31
|
+
```php
|
|
32
|
+
// Late escaping of translated output
|
|
33
|
+
printf(
|
|
34
|
+
/* translators: %s: report title. */
|
|
35
|
+
esc_html__( 'Report: %s', 'acme-reports' ),
|
|
36
|
+
esc_html( $title )
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// Capability, nonce, unslash, sanitize
|
|
40
|
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
|
41
|
+
wp_die( esc_html__( 'Not allowed.', 'acme-reports' ), '', array( 'response' => 403 ) );
|
|
42
|
+
}
|
|
43
|
+
check_admin_referer( 'acme_save_report_' . $post_id );
|
|
44
|
+
$title = isset( $_POST['title'] ) ? sanitize_text_field( wp_unslash( $_POST['title'] ) ) : '';
|
|
45
|
+
|
|
46
|
+
// Safe errors
|
|
47
|
+
$result = $service->save( $post_id, $title );
|
|
48
|
+
if ( is_wp_error( $result ) ) {
|
|
49
|
+
return $result;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Return `WP_Error` for recoverable failures; check with `is_wp_error()`; use exceptions inside domain code and convert at the hook/REST boundary
|
|
54
|
+
- Use core functions rather than native equivalents when they exist: `wp_remote_get()` (not cURL), `wp_json_encode()`, `wp_parse_args()`, `wp_list_pluck()`, `wp_mkdir_p()`, `WP_Filesystem` for file writes, `current_time()` / `wp_date()` for site-timezone dates
|
|
55
|
+
- Debug logging goes through a guarded helper that checks `WP_DEBUG` and `WP_DEBUG_LOG`; no `var_dump` or `print_r` in committed code
|
|
56
|
+
|
|
57
|
+
### Complexity
|
|
58
|
+
|
|
59
|
+
Cognitive complexity < 10, nesting <= 3, methods < 20 lines (target 10), at most 4 parameters. Early returns and guard clauses; extract validation into small methods.
|
|
60
|
+
|
|
61
|
+
## JavaScript
|
|
62
|
+
|
|
63
|
+
- Lint with `@wordpress/eslint-plugin` through `wp-scripts lint-js`; format with `wp-scripts format` (Prettier config from `@wordpress/prettier-config`)
|
|
64
|
+
- Use `@wordpress/*` packages as externals (`@wordpress/element`, `@wordpress/components`, `@wordpress/data`, `@wordpress/block-editor`, `@wordpress/i18n`); `wp-scripts` generates `*.asset.php` with the dependency list
|
|
65
|
+
- Functional components and hooks; `useBlockProps()` on the root element in `edit`, `useBlockProps.save()` in `save`
|
|
66
|
+
- `edit` and `save` must be pure; side effects belong in hooks (`useEffect`) or data stores
|
|
67
|
+
- Strings through `__()`, `_x()`, `_n()` from `@wordpress/i18n` with the plugin text domain
|
|
68
|
+
- No jQuery in new code; use the Interactivity API for front-end behavior and `@wordpress/api-fetch` for REST calls (it adds the REST nonce middleware)
|
|
69
|
+
- TypeScript is optional: strict mode, typed block attributes, no `any`
|
|
70
|
+
|
|
71
|
+
## CSS / SCSS
|
|
72
|
+
|
|
73
|
+
- Prefix class names with the block or plugin namespace (`wp-block-acme-report`, `acme-report__title`); prefer BEM-like names
|
|
74
|
+
- Use `theme.json` presets through CSS variables (`var(--wp--preset--color--primary)`) rather than hard-coded values
|
|
75
|
+
- Lint with `wp-scripts lint-style` (`@wordpress/stylelint-config`)
|
|
76
|
+
- No `!important` unless overriding third-party output, with a comment
|
|
77
|
+
|
|
78
|
+
## HTML, Templates and Patterns
|
|
79
|
+
|
|
80
|
+
- Block theme templates and parts are block-markup HTML; patterns are PHP files with a header and `esc_html_e()` / `esc_attr_e()` for strings
|
|
81
|
+
- Classic PHP templates: output escaped late, no logic beyond presentation, `get_template_part()` for reuse
|
|
82
|
+
- Use semantic HTML and accessible markup (landmarks, labels, focus states); follow the WordPress accessibility coding standards
|
|
83
|
+
|
|
84
|
+
## Documentation
|
|
85
|
+
|
|
86
|
+
- `readme.txt` in WordPress.org format (`Stable tag`, `Tested up to`, `Requires at least`, `Requires PHP`, changelog); keep it consistent with the main plugin header
|
|
87
|
+
- Code comments explain why, not what; hooks documented with `@since` and `@param` descriptions
|
|
88
|
+
- `CHANGELOG.md` in Keep a Changelog format, or the `readme.txt` changelog section when the plugin is distributed through WordPress.org
|
|
89
|
+
|
|
90
|
+
## Sources
|
|
91
|
+
|
|
92
|
+
- https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/
|
|
93
|
+
- https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/
|
|
94
|
+
- https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/
|
|
95
|
+
- https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
|
|
96
|
+
- https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/
|
|
97
|
+
- https://github.com/WordPress/WordPress-Coding-Standards
|
|
98
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-eslint-plugin/
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# WordPress Tooling
|
|
2
|
+
|
|
3
|
+
> Scope: local environment, build, PHP and JS toolchain for plugins and block themes (WordPress 7.1 line). Hosting, Bedrock and deployment pipelines are out of scope. Always run tools in Docker; `wp-env` itself runs on Docker.
|
|
4
|
+
|
|
5
|
+
## Version Reference
|
|
6
|
+
|
|
7
|
+
| Component | Reference version | Notes |
|
|
8
|
+
|-----------|-------------------|-------|
|
|
9
|
+
| WordPress core | 7.1.4 (registry line 7.1) | Latest stable at the time of writing |
|
|
10
|
+
| PHP | 7.4 minimum, 8.3+ recommended | WordPress minimum and hosting recommendation |
|
|
11
|
+
| WooCommerce (optional) | 11.2.2 | Only when the project extends it; see the `woocommerce` skill |
|
|
12
|
+
| `@wordpress/scripts` | 37.1.0 | Build, lint, unit tests |
|
|
13
|
+
| `@wordpress/env` | 12.1.0 | Docker-based local site and test site |
|
|
14
|
+
| `@wordpress/create-block` | 5.1.0 | Block scaffolding |
|
|
15
|
+
| `@wordpress/eslint-plugin` | 28.1.0 | JS lint rules |
|
|
16
|
+
| `@wordpress/e2e-test-utils-playwright` | 3.2.0 | E2E helpers |
|
|
17
|
+
| `@playwright/test` | 1.65.0 | E2E runner |
|
|
18
|
+
| `wp-coding-standards/wpcs` | 3.4.1 | PHPCS ruleset |
|
|
19
|
+
| `szepeviktor/phpstan-wordpress` | 2.0.4 | PHPStan extension |
|
|
20
|
+
| `php-stubs/wordpress-stubs` | 7.1.2 | WordPress function and class stubs |
|
|
21
|
+
| `yoast/phpunit-polyfills` | 4.0.0 | Required by the WordPress test suite |
|
|
22
|
+
| `wp-cli/wp-cli-bundle` | 2.12.0 | WP-CLI |
|
|
23
|
+
|
|
24
|
+
Pin exact versions in lockfiles (`composer.lock`, `package-lock.json`) and the PHP version in `.wp-env.json`.
|
|
25
|
+
|
|
26
|
+
## Local Environment: wp-env
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"core": null,
|
|
31
|
+
"phpVersion": "8.3",
|
|
32
|
+
"plugins": [ "." ],
|
|
33
|
+
"themes": [],
|
|
34
|
+
"config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true, "SCRIPT_DEBUG": true },
|
|
35
|
+
"env": {
|
|
36
|
+
"tests": { "port": 8889 }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Command | Purpose |
|
|
42
|
+
|---------|---------|
|
|
43
|
+
| `npx wp-env start` | Start the development site (port 8888) and the tests site (port 8889) |
|
|
44
|
+
| `npx wp-env stop` / `destroy` | Stop or remove containers and data |
|
|
45
|
+
| `npx wp-env run cli wp <command>` | Run WP-CLI against the development site |
|
|
46
|
+
| `npx wp-env run tests-cli wp <command>` | Run WP-CLI against the tests site |
|
|
47
|
+
| `npx wp-env run tests-cli --env-cwd=wp-content/plugins/<slug> vendor/bin/phpunit` | Run PHPUnit inside the environment |
|
|
48
|
+
| `npx wp-env clean all` | Reset databases |
|
|
49
|
+
|
|
50
|
+
Set `core` to a version, branch or ZIP URL to test other WordPress versions (`null` means latest production release); use `env.development` / `env.tests` to override per site. Commit `.wp-env.json`, put personal overrides in the git-ignored `.wp-env.override.json`.
|
|
51
|
+
|
|
52
|
+
## Scaffolding
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx @wordpress/create-block@latest my-block # Block plugin
|
|
56
|
+
npx @wordpress/create-block@latest my-block --template @wordpress/create-block-interactive-template # Interactivity API block
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Review the generated `block.json`, `render.php` and build scripts and trim what you do not need. Pin `@latest` to the 5.1.0 release in CI scripts if you need reproducibility.
|
|
60
|
+
|
|
61
|
+
## Build: @wordpress/scripts
|
|
62
|
+
|
|
63
|
+
| Script | Purpose |
|
|
64
|
+
|--------|---------|
|
|
65
|
+
| `wp-scripts start` | Watch and build with source maps |
|
|
66
|
+
| `wp-scripts build` | Production build to `build/` (generates `*.asset.php`) |
|
|
67
|
+
| `wp-scripts build --blocks-manifest` / `wp-scripts build-blocks-manifest` | Generate `build/blocks-manifest.php` for `wp_register_block_types_from_metadata_collection()` |
|
|
68
|
+
| `wp-scripts lint-js` / `lint-style` / `format` | ESLint, Stylelint, Prettier |
|
|
69
|
+
| `wp-scripts test-unit-js` | Jest unit tests |
|
|
70
|
+
| `wp-scripts plugin-zip` | Package the distributable ZIP (respects `files` in `package.json` or `.distignore`) |
|
|
71
|
+
|
|
72
|
+
Typical `package.json` scripts:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"scripts": {
|
|
77
|
+
"start": "wp-scripts start --blocks-manifest",
|
|
78
|
+
"build": "wp-scripts build --blocks-manifest",
|
|
79
|
+
"lint:js": "wp-scripts lint-js",
|
|
80
|
+
"lint:css": "wp-scripts lint-style",
|
|
81
|
+
"format": "wp-scripts format",
|
|
82
|
+
"test:unit": "wp-scripts test-unit-js",
|
|
83
|
+
"test:e2e": "playwright test",
|
|
84
|
+
"env": "wp-env",
|
|
85
|
+
"plugin-zip": "wp-scripts plugin-zip"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
For Interactivity API blocks, `viewScriptModule` builds need `--experimental-modules` on `build` and `start` unless the template already sets it. Script modules and classic scripts get their dependencies from the generated `*.asset.php`.
|
|
91
|
+
|
|
92
|
+
## Composer
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"require": { "php": ">=7.4" },
|
|
97
|
+
"require-dev": {
|
|
98
|
+
"wp-coding-standards/wpcs": "^3.4",
|
|
99
|
+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
|
100
|
+
"phpstan/phpstan": "^2.3",
|
|
101
|
+
"szepeviktor/phpstan-wordpress": "^2.0",
|
|
102
|
+
"php-stubs/wordpress-stubs": "^7.1",
|
|
103
|
+
"yoast/phpunit-polyfills": "^4.0"
|
|
104
|
+
},
|
|
105
|
+
"autoload": { "psr-4": { "Acme\\Reports\\": "src/" } },
|
|
106
|
+
"config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } }
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- `core: null` uses the latest production WordPress; set a version, branch or ZIP URL to test others
|
|
111
|
+
- Add `phpcompatibility/phpcompatibility-wp` (PHPCompatibilityWP) when you enforce `testVersion` in PHPCS; check its current stable constraint and the `phpstan/phpstan` major compatible with `szepeviktor/phpstan-wordpress` on Packagist before pinning
|
|
112
|
+
- `composer.lock` is committed; `vendor/` is shipped in the plugin ZIP only with the production autoloader (`composer install --no-dev --optimize-autoloader`)
|
|
113
|
+
- When other plugins may load different versions of the same library, prefix your vendor code (Strauss or PHP-Scoper)
|
|
114
|
+
|
|
115
|
+
## WP-CLI
|
|
116
|
+
|
|
117
|
+
Install through `wp-cli/wp-cli-bundle` 2.12.0 or use the one inside `wp-env`. Useful commands during development:
|
|
118
|
+
|
|
119
|
+
| Command | Purpose |
|
|
120
|
+
|---------|---------|
|
|
121
|
+
| `wp scaffold plugin-tests <plugin>` | Generate the PHPUnit bootstrap and config (adapt to `wp-env`) |
|
|
122
|
+
| `wp i18n make-pot` / `make-json` | Extract strings; convert JS translations |
|
|
123
|
+
| `wp plugin check <plugin>` | Run Plugin Check (requires the Plugin Check plugin) |
|
|
124
|
+
| `wp cron event list`, `wp transient delete --all` | Inspect cron, clear transients |
|
|
125
|
+
| `wp eval-file`, `wp shell` | Run scripts and explore with WordPress loaded |
|
|
126
|
+
| `wp db query` | Read-only inspection of the test database |
|
|
127
|
+
|
|
128
|
+
## Plugin Check
|
|
129
|
+
|
|
130
|
+
Plugin Check (the WordPress.org Plugin Check plugin) validates plugin guidelines, security and i18n rules. Install it in `wp-env` (`"plugins": [ ".", "https://downloads.wordpress.org/plugin/plugin-check.latest-stable.zip" ]`) and run `wp plugin check <slug>` or use its admin screen; run it in CI before every release.
|
|
131
|
+
|
|
132
|
+
## Distribution
|
|
133
|
+
|
|
134
|
+
- `.distignore` (or the `files` array in `package.json`) excludes `node_modules/`, `tests/`, `.github/`, dev configs, source maps and `src/` JavaScript when only `build/` is needed
|
|
135
|
+
- Verify the ZIP installs on a clean `wp-env` site and activates without notices (`WP_DEBUG` on)
|
|
136
|
+
|
|
137
|
+
## Sources
|
|
138
|
+
|
|
139
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/
|
|
140
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/
|
|
141
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/
|
|
142
|
+
- https://developer.wordpress.org/block-editor/reference-guides/interactivity-api/
|
|
143
|
+
- https://wordpress.org/plugins/plugin-check/
|
|
144
|
+
- https://make.wordpress.org/cli/handbook/
|
|
145
|
+
- https://api.wordpress.org/core/version-check/1.7/
|
|
146
|
+
- https://registry.npmjs.org/ and https://packagist.org/ (version verification, 2026-11-10)
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# WordPress Testing
|
|
2
|
+
|
|
3
|
+
> Scope: tests for plugins and block themes (WordPress 7.1 line, PHP 7.4 minimum, 8.3+ recommended). TDD (Red, Green, Refactor) and 80% minimum coverage apply; pyramid 70% unit / 20% integration / 10% E2E. Generic PHP testing follows the `php` stack.
|
|
4
|
+
|
|
5
|
+
## Test Surfaces
|
|
6
|
+
|
|
7
|
+
| Surface | Tooling | Runs in |
|
|
8
|
+
|---------|---------|---------|
|
|
9
|
+
| Pure PHP logic | PHPUnit, optionally Brain Monkey or Mockery for a few WordPress functions | Plain PHP container, no WordPress |
|
|
10
|
+
| WordPress integration | PHPUnit + `WP_UnitTestCase`, `yoast/phpunit-polyfills` 4.0.0 | `wp-env` tests site (`tests-cli`) |
|
|
11
|
+
| JavaScript / blocks | Jest through `wp-scripts test-unit-js` | Node container |
|
|
12
|
+
| End-to-end | Playwright 1.65.0 + `@wordpress/e2e-test-utils-playwright` 3.2.0 | Against the `wp-env` tests site |
|
|
13
|
+
|
|
14
|
+
Keep domain logic free of WordPress calls so most tests are fast unit tests; use integration tests for hooks, REST routes, database access, capabilities and rendering.
|
|
15
|
+
|
|
16
|
+
## PHPUnit Setup
|
|
17
|
+
|
|
18
|
+
`composer.json`: `phpunit/phpunit` (the major supported by the WordPress test suite you target) and `yoast/phpunit-polyfills` in `require-dev`. `phpunit.xml.dist` defines separate test suites.
|
|
19
|
+
|
|
20
|
+
```xml
|
|
21
|
+
<phpunit bootstrap="tests/bootstrap.php" colors="true">
|
|
22
|
+
<testsuites>
|
|
23
|
+
<testsuite name="unit"><directory>tests/php/unit</directory></testsuite>
|
|
24
|
+
<testsuite name="integration"><directory>tests/php/integration</directory></testsuite>
|
|
25
|
+
</testsuites>
|
|
26
|
+
</phpunit>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```php
|
|
30
|
+
<?php
|
|
31
|
+
// tests/bootstrap.php
|
|
32
|
+
$_tests_dir = getenv( 'WP_TESTS_DIR' ) ?: '/wordpress-phpunit';
|
|
33
|
+
|
|
34
|
+
require_once $_tests_dir . '/includes/functions.php';
|
|
35
|
+
|
|
36
|
+
tests_add_filter(
|
|
37
|
+
'muplugins_loaded',
|
|
38
|
+
static function () {
|
|
39
|
+
require dirname( __DIR__ ) . '/my-plugin.php';
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
require $_tests_dir . '/includes/bootstrap.php';
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Inside `wp-env`, `WP_TESTS_DIR` and the polyfills path are provided by the tests container; set `WP_TESTS_PHPUNIT_POLYFILLS_PATH` when your setup requires it. Run:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx wp-env run tests-cli --env-cwd=wp-content/plugins/my-plugin vendor/bin/phpunit --testsuite integration
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## WP_UnitTestCase Patterns
|
|
53
|
+
|
|
54
|
+
```php
|
|
55
|
+
class Report_Rest_Test extends WP_UnitTestCase {
|
|
56
|
+
|
|
57
|
+
public function set_up(): void {
|
|
58
|
+
parent::set_up();
|
|
59
|
+
do_action( 'rest_api_init' );
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public function test_create_report_rejects_subscriber(): void {
|
|
63
|
+
wp_set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );
|
|
64
|
+
|
|
65
|
+
$request = new WP_REST_Request( 'POST', '/acme/v1/reports' );
|
|
66
|
+
$request->set_body_params( array( 'title' => 'Q4' ) );
|
|
67
|
+
$response = rest_do_request( $request );
|
|
68
|
+
|
|
69
|
+
$this->assertSame( 403, $response->get_status() );
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public function test_create_report_sanitizes_title(): void {
|
|
73
|
+
wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) );
|
|
74
|
+
|
|
75
|
+
$request = new WP_REST_Request( 'POST', '/acme/v1/reports' );
|
|
76
|
+
$request->set_body_params( array( 'title' => '<script>x</script>Q4' ) );
|
|
77
|
+
$response = rest_do_request( $request );
|
|
78
|
+
|
|
79
|
+
$this->assertSame( 201, $response->get_status() );
|
|
80
|
+
$this->assertSame( 'Q4', $response->get_data()['title'] );
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- Name the hooks `set_up()` / `tear_down()` (the polyfills make them available on every PHPUnit version); call `parent::` first
|
|
86
|
+
- `WP_UnitTestCase` wraps each test in a database transaction and restores globals; create data with `self::factory()->post|user|term|attachment|comment->create()`
|
|
87
|
+
- Always test denied paths: logged-out, wrong role, missing or invalid nonce, invalid arguments, then the success path
|
|
88
|
+
- Assert behavior through state (`get_post_meta`, `get_option`, `did_action`, `has_filter`), not through private calls
|
|
89
|
+
- Mock remote HTTP with the `pre_http_request` filter; control time through injected clocks or `current_time` filters; never depend on the network
|
|
90
|
+
- For AJAX handlers use `WP_Ajax_UnitTestCase`; for multisite tests use the `ms-required` group and run with `WP_TESTS_MULTISITE`/a multisite `wp-env`
|
|
91
|
+
- Test activation and uninstall: create state, run the routine, assert it is cleaned up
|
|
92
|
+
|
|
93
|
+
## Block and JavaScript Tests
|
|
94
|
+
|
|
95
|
+
- Name files `*.test.js` / `*.test.ts(x)` next to the code or in `__tests__/`; run with `wp-scripts test-unit-js` (Jest with the WordPress preset)
|
|
96
|
+
- Use Testing Library queries by role and text for `edit` components; assert `save()` output so changes to markup trigger a `deprecated` entry
|
|
97
|
+
- Keep fixtures of previously saved markup to make sure old content still validates
|
|
98
|
+
- Test `@wordpress/data` stores (actions, reducers, selectors) and Interactivity API stores (actions and derived state) as plain functions
|
|
99
|
+
|
|
100
|
+
## End-to-End (Playwright)
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { test, expect } from '@wordpress/e2e-test-utils-playwright';
|
|
104
|
+
|
|
105
|
+
test.describe( 'Report block', () => {
|
|
106
|
+
test.beforeEach( async ( { admin } ) => {
|
|
107
|
+
await admin.createNewPost();
|
|
108
|
+
} );
|
|
109
|
+
|
|
110
|
+
test( 'inserts and renders on the front end', async ( { editor, page } ) => {
|
|
111
|
+
await editor.insertBlock( { name: 'acme/report' } );
|
|
112
|
+
const preview = await editor.openPreviewPage();
|
|
113
|
+
await expect( preview.getByRole( 'region', { name: 'Report' } ) ).toBeVisible();
|
|
114
|
+
} );
|
|
115
|
+
} );
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- Use the fixtures `admin`, `editor`, `pageUtils`, `requestUtils`, and a global setup that authenticates once (`requestUtils` creates sessions and content through REST)
|
|
119
|
+
- Create the content each test needs and delete it afterward; tests must not depend on order or on leftovers
|
|
120
|
+
- Locators by role, label or test id; no `waitForTimeout`; retries only in CI with traces, screenshots and videos kept on failure
|
|
121
|
+
- Add accessibility checks with `@axe-core/playwright` on key screens
|
|
122
|
+
- Cover the critical journeys: activation, settings save, block insertion and configuration, front-end rendering, and Site Editor flows for block themes
|
|
123
|
+
|
|
124
|
+
## Coverage and CI
|
|
125
|
+
|
|
126
|
+
- Coverage >= 80% on `src/` for PHP (Xdebug or PCOV in the test container) and JavaScript (`--coverage`), 100% on authorization, nonce, sanitization and uninstall paths
|
|
127
|
+
- Mutation testing (Infection for PHP, Stryker for JS) on critical logic: coverage lies, mutation scores tell the truth
|
|
128
|
+
- CI matrix: minimum and latest PHP (7.4 and the 8.3+ line), minimum, latest and optionally trunk WordPress, plus multisite when supported
|
|
129
|
+
- Fast gate on every commit (unit suites, lint); integration and E2E on every pull request
|
|
130
|
+
|
|
131
|
+
## Anti-Patterns
|
|
132
|
+
|
|
133
|
+
| Anti-pattern | Fix |
|
|
134
|
+
|--------------|-----|
|
|
135
|
+
| Tests that hit the network or the real clock | `pre_http_request`, injected clock |
|
|
136
|
+
| Asserting private methods or hook internals | Assert resulting state and public hooks |
|
|
137
|
+
| State leaking through options, globals or the current user | `tear_down()` cleanup, `wp_set_current_user( 0 )` |
|
|
138
|
+
| Only happy-path REST tests | Add 401/403/400 cases |
|
|
139
|
+
| `test.only`, `markTestSkipped` without ticket | Fix or remove |
|
|
140
|
+
| `waitForTimeout` in Playwright | Web-first assertions |
|
|
141
|
+
| Mocking WordPress extensively when an integration test is cheap | `WP_UnitTestCase` with factories |
|
|
142
|
+
|
|
143
|
+
## Sources
|
|
144
|
+
|
|
145
|
+
- https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/
|
|
146
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/
|
|
147
|
+
- https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/#test-unit-js
|
|
148
|
+
- https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils-playwright
|
|
149
|
+
- https://github.com/Yoast/PHPUnit-Polyfills
|
|
150
|
+
- https://playwright.dev/docs/best-practices
|