scaffold-block
Skill19 starsChanged 12 days agoMITView on GitHub
Scaffold a Gutenberg custom block (block.json, edit/save JS, optional render callback, PHPUnit stub)
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- block-pattern-creationSkill
- canva-to-fse-autonomous-workflowSkill
- create-blog-articleSkill
- figma-to-fse-autonomous-workflowSkill
- fse-block-theme-developmentSkill
- fse-pattern-first-architectureSkill
- indesign-conversionSkill
- lintSkill
- testSkill
- visual-qa-verificationSkill
- wordpress-hook-integrationSkill
- wordpress-internationalizationSkill
- wordpress-security-hardeningSkill
- wordpress-testing-workflowsSkill
- wp-cli-workflowsSkill
The file
Files
Scaffold a Gutenberg Custom Block
Generate a self-contained, activatable custom block plugin under
plugins/<block-name>/ using scripts/scaffold-block.sh. No build step is
required — the generated index.js uses the WordPress runtime globals and
index.asset.php declares the package dependencies.
Arguments provided
$ARGUMENTS
Inputs (collect these before generating)
The generator accepts three core inputs from the v2.0.0 milestone. If any are
missing from $ARGUMENTS and cannot be sensibly defaulted, ask the user with
AskUserQuestion:
- Block name (required, positional) — kebab-case slug, e.g.
pricing-table. - Namespace (
--namespace, defaultflavian) — becomes the block.jsonnameas<namespace>/<block-name>. - Supported attributes (
--attributes) — comma-separatedname:type[:default]. Types:string,number,boolean,array,object. Example:heading:string:Our Plans,count:number:3,featured:boolean.
Optional: --dynamic (server-rendered render.php; otherwise a static
save()), --title, --description, --category, --icon, --keywords,
--text-domain, --author, --php-namespace, --version, --dest,
--force, --dry-run.
Steps
- Parse
$ARGUMENTS. Identify the block name, namespace, and attributes. Decide static vs dynamic: choose--dynamicwhen the block's output depends on PHP/server data (latest posts, current user, options); otherwise leave it static. If the choice is ambiguous, ask. Preview with
--dry-runso the user can confirm the file list:bash scripts/scaffold-block.sh <block-name> --namespace <ns> \ --attributes "<spec>" [--dynamic] --dry-run- Generate by re-running without
--dry-run(or viapnpm run scaffold:block <block-name> -- --namespace <ns> ...). - Report the created tree and the generated block name
<namespace>/<block-name>. Offer the smoke test (requires the Docker stack running):
docker compose up -d wordpress db bash scripts/smoke-block.sh <block-name> --namespace <ns>This scaffolds, validates assets, activates the plugin, asserts the block is registered, and renders it on a throwaway page.
Outputs
plugins/<block-name>/
├── <block-name>.php # Plugin header + register_block_type()
├── blocks/<block-name>/
│ ├── block.json # Metadata, attributes, supports
│ ├── index.js # edit() + save() (no build step)
│ ├── index.asset.php # Script dependencies + version
│ ├── editor.css / style.css # Styles
│ └── render.php # Dynamic render callback (--dynamic only)
├── tests/<BlockClass>Test.php # PHPUnit stub
├── tests/bootstrap.php # Lightweight WP stubs
├── phpunit.xml.dist
└── README.mdSee docs/blocks/README.md for the full reference.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

