一键导入
code-style
PublishPress Future code style
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
PublishPress Future code style
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Launch coding agent for PublishPress Future
Prep CHANGELOG.md for release
WP plugin security + code quality audit
WP plugin security audit
Bump plugin version via composer set:version
基于 SOC 职业分类
| name | code-style |
| description | PublishPress Future code style |
Communication: Apply /caveman mode (full) to all responses and status updates when this skill is active. Drop articles/filler. Fragments OK. Technical terms exact. Code/commits/PR bodies stay normal unless user says otherwise.
PublishPress Future (Post Expirator): schedule automatic post/page/content changes — expiration, workflows, scheduled content management.
post-expirator | Text Domain: post-expirator | Namespace: PublishPress\Futurepost-expirator.php or PUBLISHPRESS_FUTURE_VERSIONPHP ≥7.4 | WP ≥6.7 | JSX admin UI (assets/) | CSS | MySQL/MariaDB
lib/vendor/woocommerce/action-scheduler/lib/vendor/publishpress/psr-container/lib/vendor/publishpress/wordpress-reviews/Composer | npm/Yarn | Webpack | Codeception (Unit/Integration/Acceptance) | WP-Browser | Docker | PHPCS | PHPStan | PHP-CS-Fixer
dev-workspace/scripts/ | dev-workspace/docker/compose.yaml | Webpack | composer.json scripts
PSR-12 Extended | 4 spaces not tabs | braces next line | control-structure spacing per PSR-12 | UPPER_SNAKE constants | camelCase methods/properties | ~120 char soft limit | namespace PublishPress\Future\{Module}\{SubFolder}; | grouped alphabetical imports | no trailing whitespace | single trailing newline | omit ?> in pure PHP | method docblocks with @since | type hints (PHP 7.4+)
/**
Layered Core/Framework/Modules/Views | feature modules in Modules/ | cohesion per module | DI container | descriptive names | separate infrastructure from features
Core/ | Framework/ | Modules/{Name}/ | Views/ Module: Module.php, HooksAbstract.php, Controllers/, Models/, DBTableSchemas/, Migrations/ Framework: WordPress/Facade/, Database/, Logger/, … tests/: Unit/, Integration/, Acceptance/features/, EndToEnd/, Support/
Each feature module follows a consistent structure:
ModuleName/
├── Module.php # Module entry point & registration
├── HooksAbstract.php # Hook name constants
├── CapabilitiesAbstract.php # Capability constants (if needed)
├── Controllers/ # Controllers for UI and API
├── Models/ # Data models
├── DBTableSchemas/ # Database table definitions
├── Migrations/ # Database migration scripts
├── Interfaces/ # Module-specific interfaces
├── Views/ # Module-specific view templates
└── ... (other module-specific folders)
ExpirationActions/, classic/Gutenberg/bulk/quick editDomain/Engine/, REST API, workflow editor UIController (BlockEditorController, RestAPIController)Model | Facades: WP area + Facade | Interfaces: contract + InterfaceAbstract suffix | Schemas: table + Schema | Migrations: V{version}{description} (e.g. V40000WorkflowScheduledStepsSchema)PHP (*.php): follow .cursor/rules/php.mdc — clean code, design patterns, no god files
React/JSX (*.jsx, *.tsx): follow .cursor/rules/react.mdc — functional components, hooks, thin UI
src/Core/DI/Container.php, services.php, constructor injectionServiceProvider.php, ServiceProviderInterfacePostTypeDefaultDataModelFactory), lazy closuressrc/Framework/WordPress/Facade/ (HooksFacade, DatabaseFacade, …)CronToWooActionSchedulerAdapter in Adapters/)ModuleInterface self-contained features (Expirator/Module.php)ExpirationActions/ + ExpirationActionInterfaceHooksFacade / HookableInterface; names in HooksAbstractModels/ (WorkflowModel, ExpirablePostModel)Domain/ dirs (e.g. Workflows/Domain/Engine/)Views/ templates + ControllersCodeception — Unit, Integration, Acceptance, EndToEnd.
Behavior not implementation | test_should_* names | AAA | mock WP/DB | 80%+ domain coverage | WPTestCase or PHPUnit TestCase
Component + WP integration | real test DB | REST + controller/model flows | WPTestCase / NoTransactionWPTestCase | critical workflows
Gherkin Given/When/Then | browser tests | tests/Acceptance/features/ | steps in tests/Support/GherkinSteps/ | admin/classic/Gutenberg/bulk/quick edit
Lifecycle (activate/deactivate) | WP core interaction | real-world scenarios
Docker dev-workspace/docker/compose.yaml — db_test, test-wp, test-wpcli | composer test:up / test:clean | test:db-export / test:db-import
Classes: {ClassName}Test.php / {ClassName}Cest.php | PHPUnit: test_should_do_something_when_condition() | Codeception: testShouldDoSomethingWhenCondition() | features: kebab-case.feature
Grouped one-liners — see composer.json for full definitions.
| Group | Commands |
|---|---|
| env | composer up, dev:up, test:up, down, dev:clean, test:clean |
| build | composer build, build:js, build:lang, build:all, watch:js |
| check | composer check, check:cs, fix:cs, fix:php, check:stan, check:longpath |
| test | composer test, test:all, test Unit|Integration|Acceptance|EndToEnd, test Unit:Core/DI/ContainerTest, test Integration:Modules/…, test:debug, test:steps, test:snippets |
| wp/db | composer wp:dev -- …, wp:tests -- …, test:db-export, test:db-import, test:db-logs |
| version | composer get:version, set:version, pre-release |
src/Modules/NewFeature/ → Module.php (ModuleInterface) → HooksAbstract.php → Controllers//Models//Views/ → services.php → Unit + Integration tests.
DBTableSchemas/ + DBTableSchemaInterface → Migrations/ V{version}{description}.php → register in Module.php.
Controllers/ → routes in initialize() → /publishpress-future/v1/endpoint → permissions → Integration tests in tests/Integration/Modules/{Module}/Rest/.
ExpirationActions/ + ExpirationActionInterface → ExpirationActionsAbstract → ExpirationActionsModel → tests + i18n labels.
WPCS where no PSR-12 conflict | WP via Facades | Never use global WP functions in business logic — facades | $wpdb->prefix on tables | nonces | sanitize in / escape out | wp_enqueue_script/style
Hook constants in HooksAbstract | inject hook deps | register via HooksFacade/HookableInterface | focused callbacks | document hooks in PHPDoc
DatabaseFacade / facaded $wpdb | schemas in DBTableSchemas/ | DBTableSchemaHandler | Migrations/ V30000 style | $wpdb->prepare() for dynamic SQL
Keys in PostMetaAbstract / option constants | OptionsFacade | sanitize before save | correct meta types
CapabilitiesAbstract | check before privileged ops | UsersFacade for current_user_can() | document caps on controllers
/publishpress-future/v1/ prefix | permission callbacks | validate/sanitize params | REST schema | correct HTTP codes
WP admin patterns + colors | core JS when possible | NoticeFacade | Settings API for settings pages
Text domain post-expirator | __(), _e(), esc_html__() + translator comments | composer build:lang | languages/
Transients (TransientsAbstract) | Action Scheduler not WP-Cron | minimize queries + cache | load assets only where needed | object cache when available
post-expirator | proper asset enqueue