From superpowers-sage
Creates artisan-style CLI commands with Acorn for WordPress automation, covering data imports, maintenance tasks, scheduled jobs, and theme operations via lando acorn.
npx claudepluginhub codigodoleo/superpowers-sage --plugin superpowers-sageThis skill uses the workspace's default tool permissions.
Acorn commands are artisan-style CLI commands running inside WordPress context with full access to the Laravel container (services, Eloquent, config) **and** all WordPress functions (`get_posts()`, `wp_insert_post()`, etc.).
Manages Roots Sage WordPress themes with Acorn and Lando: environment setup, ACF blocks/fields, Blade components/composers, Tailwind v4/Vite frontend, service providers, CPTs, and generators.
Guides WP-CLI operations for WordPress: safe search-replace, DB export/import, plugin/theme/user/content management, cron events, cache flushing, multisite handling, and wp-cli.yml scripting.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Acorn commands are artisan-style CLI commands running inside WordPress context with full access to the Laravel container (services, Eloquent, config) and all WordPress functions (get_posts(), wp_insert_post(), etc.).
wp post, wp user, wp option — use wp-cli-ops insteadacorn-routes for request-based flowsacorn-queues (Laravel queues) for durable processinglando wp shell or lando wp eval is faster for explorationConsoleServiceProvider registered (default in Acorn skeleton)lando start) — commands execute inside the containerlando acorn make:command ImportProducts
# Generates app/Console/Commands/ImportProducts.php
Scripts: scripts/create-command.sh
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class ImportProducts extends Command
{
protected $signature = 'import:products
{source : The data source (csv or api)}
{--dry-run : Preview changes without writing}
{--limit=100 : Max records to process}
{--tag=* : Tags to assign (repeatable)}';
protected $description = 'Import products from CSV or external API';
public function handle(): int
{
$source = $this->argument('source');
$this->info("Importing from {$source}");
if ($this->option('dry-run')) { $this->warn('Dry-run mode — no writes.'); }
return self::SUCCESS; // 0 = success, 1 = failure
}
}
{format} Required {--with-meta} Boolean flag
{format=csv} Default value {--chunk=500} Option with default
{format?} Nullable {--F|format=csv} Shortcut
{ids*} Array
$this->info('Done.'); $this->warn('Caution.'); $this->error('Failed!');
$this->table(['ID', 'Title'], $rows);
$this->withProgressBar($items, fn ($item) => process($item));
if (! $this->confirm('Continue?')) { return self::FAILURE; }
Inject services into handle() — the container resolves them automatically:
public function handle(ProductImporter $importer): int
{
$results = $importer->run(source: $this->argument('source'), limit: (int) $this->option('limit'));
$this->info("Imported {$results->created} / skipped {$results->skipped}");
return self::SUCCESS;
}
$this->call('cache:clear'); // With output
$this->callSilent('view:clear'); // Silent
$this->call('import:products', ['source' => 'csv', '--dry-run' => true]); // With args
Commands in app/Console/Commands/ are auto-discovered. For commands elsewhere, register in a ServiceProvider's boot(): $this->commands([ImportProducts::class]).
See references/scheduling.md for scheduling setup and lando acorn schedule:run.
See references/practical-examples.md for import/maintenance/cache-warmup patterns.
See references/troubleshooting.md for command not found, DI failures, schedule issues.
lando acorn list and confirm your custom command appears with the correct signature and description.lando acorn <command-name> and verify it completes without errors, returning exit code 0 (self::SUCCESS).--help to confirm the signature matches expectations, then run with sample inputs.lando acorn list)app/Console/Commands/ directory (the auto-discovery path), or the namespace does not match the file location.app/Console/Commands/YourCommand.php with namespace App\Console\Commands. If the command lives elsewhere, register it explicitly in a service provider's boot() method: $this->commands([YourCommand::class]).handle() method type-hints a service that is not bound in the container, or the service's own dependencies cannot be resolved.register() method. Check that all constructor parameters of the injected service are also resolvable. Use lando acorn tinker and app()->make(YourService::class) to test resolution in isolation.sage:roots-sage-lando for correct binding patterns and singleton registration.sage:acorn-queues for job dispatching patterns.