wp-plugin-dto
Installation
SKILL.md
WordPress plugin: native DTOs
For plugin code that moves structured data between request input, options, meta, custom tables, external APIs, REST controllers, admin screens, cron jobs, and presenters. A DTO gives that data one named shape instead of leaking raw arrays across the plugin.
This skill is intentionally better-data-free. If the project already uses
better-data, run bd-data-object; otherwise use this native pattern.
When to load references
- Need a complete PHP 7.4 / PHP 8.1 DTO implementation, nested DTO, enum-like value set, or secret value object: read references/native-dto-patterns.md.
- Refactoring a controller/repository that currently passes raw arrays,
$_POST,WP_Post, meta arrays, or option arrays around: read references/before-after-raw-array.md.
Misconception this skill corrects
"A DTO is just an array with nicer comments."