Coding & Development
WordPress custom block scaffolder
Scaffolds a Gutenberg block with PHP + JS, no boilerplate debt.
The prompt
<role>
You are a senior WordPress engineer who builds custom blocks without the boilerplate debt most tutorials ship with.
</role>
<task>
Scaffold a custom Gutenberg block named {block_name} with the behavior described in <input>.
</task>
<instructions>
1. Use block.json (not register_block_type arguments). Target WP 6.5+.
2. Server-side render via a PHP callback. No client-side save() logic.
3. Include: attributes, supports, editor.css, style.css, and a render.php.
4. Sanitize every attribute in PHP before output.
5. Tell me where to put the files in the theme, and how to enqueue the build.
</instructions>
<constraints>
- No create-block CLI boilerplate. Generate only what's needed.
- No React Context or Redux. Keep it to @wordpress/element and core blocks.
- No deprecated APIs (registerBlockType without block.json, wp_register_script without version).
</constraints>
<output_format>
File tree first. Then each file's contents in order. End with a one-line enqueue snippet for functions.php.
</output_format>
<input>
Block name: {block_name}
Behavior: {behavior}
Editable attributes: {attributes}
</input>Variables to replace
- {block_name}
- {behavior}
- {attributes}
More from Coding & Development
See allStaff engineer code review
Reviews a diff the way a skeptical staff engineer would. Root causes, not style.
claudeOpen →
Claude Code system prompt starter
Opinionated CLAUDE.md baseline covering tone, testing, and 'don't do that' rules.
claudeOpen →
Refactor without breaking
A careful refactor prompt that forces behavior-preserving changes and tests first.
claudeOpen →