wp-cli/scaffold-package-command
A WP-CLI command that scaffolds new WP-CLI packages, generating the package structure, command class, tests, README, and supporting files so developers can quickly start building custom WP-CLI commands.
Ecosystem mismatch (first-order finding). Despite the brief framing this as a Laravel/PHP package, wp-cli/scaffold-package-command is a WordPress tool. It is a WP-CLI package that registers wp scaffold package, a code generator that emits a skeleton for a new WP-CLI command: a command class, a composer.json, a Behat-based functional test suite wired to wp-cli-tests, a README.md, and CI/config scaffolding. There is no Laravel service provider, no facade, no config publishing, no Blade/Artisan integration, and nothing it does at runtime for a Laravel application. Any evaluation must therefore be scoped to "do we build WP-CLI commands?" — if the answer is no, this package is out of scope regardless of its quality.
Architecture fit. The package is a development-time tool, not a runtime dependency. It sits in the toolchain alongside Composer and PHPUnit, is installed into the WP-CLI global package directory (wp package install wp-cli/scaffold-package-command), and its output is committed source code owned by your team. That is architecturally clean: near-zero blast radius, no production artifact, no surface area in the deployed application. The trade-off is that the value is realized once per command package, after which the generated code — not the generator — becomes the maintained asset.
Integration feasibility. High where relevant, low where not:
WP_TESTS_DIR, WordPress core fixtures) plus Behat. That is a materially different testing model from Laravel's PHPUnit/Pest setup, and it is the single largest integration cost for a Laravel-centric team.Technical risk. Low-to-moderate, and concentrated in metadata rather than code:
Key questions.
Stack fit. Adopt only in the WP-CLI lane. Install into the developer/CI environment as a global WP-CLI package (wp package install wp-cli/scaffold-package-command), pinned to an explicit version. Do not add it to any application's composer.json require or require-dev — it is not a library, and doing so creates a phantom dependency and an unnecessary upgrade obligation. Keep it out of production images entirely.
Migration path. There is nothing to migrate; this is a greenfield enablement decision. The realistic path is: run the generator once in a sandbox, inspect the emitted tree, and decide whether the output or an internally curated fork of it becomes your standing template. If the generated scaffolding needs material edits to match our conventions (CI provider, PHP matrix, static analysis, coding standards), the correct endpoint is an internal template repo — the generator then becomes a one-time reference rather than a maintained dependency.
Compatibility. Verify against: WP-CLI v2.x on the Phar we actually run; PHP versions in our supported matrix; Behat 3.x and wp-cli-tests as pulled by the generated composer.json; and the network/proxy posture for wp package install. Confirm the generated composer.json resolves cleanly on day one — stale pins are the most common first failure.
Sequencing.
wp scaffold package sample-command, commit nothing, run the generated test suite locally.Maintenance. Ongoing cost is genuinely small — install-and-forget for the generator itself. The real maintenance burden transfers to the generated code, which becomes a first-class owned asset with its own dependency graph, test suite, and upgrade cadence. Budget for that, not for the scaffolder. Recommend pinning the WP-CLI package version explicitly so environment rebuilds are reproducible.
Support. Community-supported only: WP-CLI GitHub issues, the WP-CLI Slack, and whatever the upstream maintainers respond to. With ~70 stars, expect limited triage bandwidth and no vendor SLA. Internal ownership must be assigned (nominally the platform/tooling engineer who owns WP-CLI), and an exit plan — fork or hand-roll — should be documented up front, since the fork cost is a few files.
Scaling. No runtime scaling dimension; the tool does not execute in production. The scaling concerns are organizational: (a) template drift — if ten teams each run the generator at different times, you get ten divergent command skeletons with inconsistent CI and test setups; mitigate by freezing a single internal template and requiring its use; (b) environment sprawl — each generated package's test harness needs a WordPress test install, so CI cost grows per command repo, not per application.
Failure modes.
composer.json on a fresh checkout.WP_TESTS_DIR; flaky or unprovisioned environments are the most likely day-to-day failure.composer.json and it becomes an accidental runtime dependency.Ramp-up. For engineers with WP-CLI and WordPress plugin experience: under a day to productive use — the command is a single documented invocation, and the generated README is the tutorial. For a Laravel-only team: one to three days, and the friction is almost entirely the testing model (Behat feature files, WordPress fixtures, the WP-CLI test bootstrap) rather than the scaffolder. If that team has no WordPress footprint, ramp-up cost is the strongest argument against adoption — the tool would be solving a problem the team does not have.
How can I help you explore Laravel packages today?