/kivo-wise:acorn-backgroundfrom kivo-wise
Guides background work decisions in Acorn projects: WP-Cron vs Action Scheduler vs Laravel queues, console commands, scheduler setup, Redis/cache tuning, and logging channels.
Ships in kivo-wise. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acorn brings Laravel's queue, cache, Redis, console, scheduler and log components into WordPress. WordPress already has its own scheduler (WP-Cron), object cache and debug log. Pick the native piece first and add the Laravel piece only for a real gap.
Runner placeholders ({{runner.wp}}, {{runner.acorn}}, {{runner.composer}}, {{runner.test}}, {{runner.cache}}) come from the session context; on Lando they default to lando wp, lando wp acorn, lando composer, the project's test tooling and its cache-clear tooling. Redis tooling and service names come from .lando.yml (read them, do not assume cache or redis).
illuminate/redis and the PHP redis extension (or predis/predis), Action Scheduler (a plugin or woocommerce/action-scheduler), the WordPress Redis drop-in (wp-content/object-cache.php).config/queue.php, config/cache.php, config/database.php (redis), config/logging.php in the base path, merged over Acorn's defaults.| Need | Native first | Laravel piece when |
|---|---|---|
| Run a hook at an interval, low volume, retry not critical | WP-Cron: wp_schedule_event() (wp-includes/cron.php), triggered by traffic unless DISABLE_WP_CRON is set and a system cron calls {{runner.wp}} cron event run --due-now | — |
| Many deferred actions with per-action logs and admin UI, no worker process | Action Scheduler (as_enqueue_async_action, as_schedule_single_action, as_schedule_recurring_action; runs on WP-Cron) when it is already installed | — |
| Retries with backoff, timeouts, unique jobs, batches, chaining, high volume | — | Laravel queue + worker (queue:work) |
| Recurring Laravel commands with overlap control | WP-Cron calling a service | Scheduler (schedule:run every minute from system cron) |
| Cache a computed value | Transients / wp_cache_* (persistent when an object-cache drop-in is installed) | Laravel Cache for tags, locks, remember, or a store separate from WordPress |
| Operator command | WP_CLI::add_command() | Acorn command for DI, Laravel console IO, scheduling |
| Debug output | WP_DEBUG_LOG → debug.log | Laravel Log channels, structured context, stderr in containers |
Details and trade-offs: references/decision-matrix.md.
| Item | sage-theme | acorn-mu-plugin | radicle-app |
|---|---|---|---|
| Jobs, commands | app/Jobs, app/Console/Commands in the theme | same folders in the plugin, plugin namespace | same folders at the root |
routes/console.php | theme base path | plugin base path | project root |
| Config overrides | config/*.php in the theme | config/*.php in the plugin | config/*.php at the root |
| Storage (logs, file cache) | storage/ in the theme if present, else wp-content/cache/acorn | storage/ in the plugin if present, else the same fallback | storage/ at the root |
| Worker command runs from | the site root through WP-CLI, theme active | the site root through WP-CLI (mu-plugins always load) | the project root through WP-CLI |
Commands: write every command with the runner value from the session context filled in (for example lando wp acorn optimize:clear), never a bare wp/composer/php/npm, never the placeholder, never "prefix with lando if you use it". Commands that run in CI or a deploy script go in a separate block labelled with where they run.
QUEUE_CONNECTION defaults to sync (runs inline, nothing is deferred). Choose database or redis per environment.{{runner.acorn}} make:queue-table, make:queue-failed-table (and make:queue-batches-table for batches), then {{runner.acorn}} migrate. Tables get the WordPress prefix.{{runner.acorn}} make:job SyncLead; pass IDs, not objects; set $tries, $backoff, $timeout; make handle() idempotent; call wp_set_current_user() when capability checks run inside the job.SyncLead::dispatch($leadId).{{runner.acorn}} queue:work --tries=3 --max-time=3600. In production keep it alive with the platform's process manager and run {{runner.acorn}} queue:restart after every deploy.{{runner.acorn}} make:command ImportLeads → app/Console/Commands, loaded automatically; run as {{runner.acorn}} leads:import.routes/console.php (Schedule::command('leads:import')->hourly()->withoutOverlapping()) or with ->withSchedule(fn (Schedule $s) => …) on the builder.{{runner.acorn}} schedule:run (on a server without the local runner, the same command through that environment's WP-CLI, from the WordPress root), or keep {{runner.acorn}} schedule:work running.{{runner.composer}} require illuminate/redis in the base path (Acorn does not require it; its provider is skipped while the class is missing) plus the redis PHP extension or predis/predis.{{runner.wp}} cache flush runs FLUSHDB on it; Acorn's Redis default connection is also database 0 (REDIS_DB), cache database 1 (REDIS_CACHE_DB). Put queues and sessions elsewhere, for example REDIS_DB=2, REDIS_CACHE_DB=3.{{runner.acorn}} cache:clear empties the Laravel cache store only; {{runner.wp}} cache flush empties the WordPress object cache only.stack → single → storage/logs/laravel.log under the app's storage path.LOG_CHANNEL=stderr (or add stderr to LOG_STACK) so the platform collects logs.config/logging.php only needs the channels it adds; Laravel merges channels with Acorn's defaults.{{runner.cache}}.{{runner.acorn}} queue:work --once processes it; {{runner.acorn}} queue:failed is empty; with the database driver, the jobs table drains.{{runner.acorn}} schedule:list shows each task with its next run; {{runner.acorn}} schedule:test runs one on demand.{{runner.acorn}} list shows the command; {{runner.acorn}} help <name> matches the signature.{{runner.wp}} eval 'var_dump(app("redis")->connection()->ping());' succeeds; {{runner.wp}} eval 'var_dump(config("database.redis.default.database"), config("database.redis.cache.database"));' shows databases that differ from the object cache's.{{runner.wp}} eval 'logger("kivo-check", ["ok" => true]);' writes to the expected file or stream.{{runner.wp}} cron event list shows the hook and next run.| Symptom | Cause | Fix |
|---|---|---|
| Jobs "dispatch" but run during the request | QUEUE_CONNECTION is sync (default) | Set database or redis and run a worker |
| Jobs pile up, never processed | No worker running, or the worker listens to another queue/connection | Start queue:work with matching --queue; supervise it |
| Worker runs old code after a deploy | Long-running process keeps the old classes | {{runner.acorn}} queue:restart (needs a cache store shared by worker and deploy) |
| Jobs behave as logged out or use stale WordPress state | Workers run in one long WP-CLI process; no request user, globals persist between jobs | wp_set_current_user() in handle(); avoid globals; --max-jobs / --max-time |
Class "Redis" not found / redis binding missing | No redis extension, or illuminate/redis not installed so its provider was skipped | Install the extension or predis/predis (REDIS_CLIENT=predis); require illuminate/redis |
| Sessions, locks or queued jobs vanish after a deploy | {{runner.wp}} cache flush ran FLUSHDB on the database Laravel also uses | Separate databases (REDIS_DB, REDIS_CACHE_DB) or WP_REDIS_SELECTIVE_FLUSH with a prefix |
| Scheduled tasks never run | No system cron calling schedule:run, or it runs outside the site root | Add the cron entry; run through WP-CLI from the WordPress root |
onOneServer() / withoutOverlapping() still overlap across servers | Cache store is per server (file) | Use Redis or database as the cache and lock store |
| WP-Cron events late or never | Low traffic, or DISABLE_WP_CRON without a system cron | System cron with {{runner.wp}} cron event run --due-now |
| No log file appears | Storage folder missing or not writable, or LOG_CHANNEL points to a stream | Check the storage path per profile; stderr output is in the container log |
Command missing from list | Not under app/Console/Commands of the base path, or namespace mismatch with composer.json PSR-4 | Move it, fix the namespace, or register with ->withCommands([...]) |
queue:clear, queue:flush), flushing shared caches, or changing Redis databases on a shared environment: ask first.acorn-data. HTTP entry points that dispatch jobs: acorn-routes-api.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
acorn, wordpress-background, laravel-queues, wp-cron, action-scheduler, logging
npx claudepluginhub hekivo/kivo-wise --plugin kivo-wise25 skills in this plugin
/acf-nativeUse when building or reviewing ACF field behaviour or the post save flow - validate before publish, required/maxlength settings, hiding a field (conditional_logic), dynamic choices, running code after save - acf/validate_value, acf/load_field, acf/prepare_field, acf/save_post, acf.getField, wp_insert_post_data, save_post - including projects where ACF may not be installed (Radicle). Maps each need to the native mechanism verified in local source. For ACF Composer scaffolding use acorn-scaffolding; for escaping ACF output use wp-security-escaping./acorn-dataUse when storing or querying data through Acorn's database layer - Eloquent models (app/Models, models over wp_posts, postmeta, users), custom tables, migrations (make:migration, migrate --force on deploy), seeders and factories, the DB facade, table prefix errors ("Table wp_wp_x doesn't exist"), and choosing post meta vs options vs a post type vs a custom table. For queues use acorn-background; for endpoints use acorn-routes-api; for post type registration use acorn-scaffolding./acorn-livewireUse when creating, wiring or fixing a Livewire 4 component in an Acorn app - make:livewire --class, app/Livewire, wire:model modifiers (.live, .blur, .debounce), wire:key, attributes (#[Locked]/#[Computed]/#[Validate]/#[On]), lifecycle hooks, @livewireScripts, the /livewire-<hash>/update route, installing livewire/livewire on Radicle. For errors that start after a deploy (419, RangeError, stale HTML) use roots-debugging; for JSON endpoints use acorn-routes-api; for Alpine-only UI use tailwind-vite-assets./acorn-routes-apiUse when adding or fixing an HTTP endpoint or virtual page in an Acorn project - Acorn routes (routes/web.php, routes/api.php, withRouting, Route::get, controllers, middleware, route:list) versus register_rest_route (permission_callback, /wp-json, X-WP-Nonce); webhooks, JSON APIs, CORS, throttle, API-key or JWT auth, "Target class [auth] does not exist", 404 on a defined route. For Livewire use acorn-livewire; for models use acorn-data; for nonces and capabilities in depth use wp-security-escaping./acorn-scaffoldingUse when generating a new artifact in an Acorn project - a Gutenberg block (ACF Composer acf:block, InnerBlocks, $styles, or a native block.json block via make:block), a post type or taxonomy (Poet config/poet.php, config/post-types.php), an ACF field group, partial or options page (acf:field, acf:options), a provider, View Composer, Blade component or command (make:provider, make:composer, make:component). For changing existing Acorn code use acorn-stack; for ACF hooks use acf-native; for block CSS and JS use tailwind-vite-assets./acorn-stackUse when changing how Acorn boots or is wired on a Sage theme, Acorn mu-plugin or Radicle root - Application::configure(), withProviders(), withRouting(), ACORN_BASEPATH, base_path(), provider register() vs boot(), where providers are registered (functions.php, config/app.php, composer.json extra.acorn.providers), config publishing, optimize:clear, "'acorn' is not a registered wp command". For generating providers, blocks or composers use acorn-scaffolding; for hook timing use wp-hooks-lifecycle; for unexplained breakage use roots-debugging.Other plugins' skills for the same job