/kivo-wise:compose-wpfrom kivo-wise
Manages Docker Compose environments for WordPress projects using wp-kit contracts. Covers bin/ scripts, lifecycle commands, compose.yaml editing, database import/export, TLS, port conflicts, and devcontainer sessions.
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.
Every project command goes through the bin/ scripts at the project root. This skill says which scripts the contract provides, which lifecycle command applies a change, and how to tell a stopped stack from a broken one.
compose (session context line runner: compose · wp=bin/wp …).bin/up, docker compose up -d, docker compose restart, docker compose build and bin/down after a change.compose.yaml or the personal override (compose.override.yaml, gitignored).https://<project>.localhost on contract 1, https://<host>.kivowp.dev on contract 2), port clashes, the router (bin/router), docker not found, "service is not running", the stack in a cloud agent session or an editor devcontainer.lando-wp), production or staging hosts, CI pipelines, generating the environment (wp-kit owns that).Placeholders below are filled by the session context from the triage JSON. If a placeholder is still literal, read the field yourself:
| Placeholder | Triage field | Example |
|---|---|---|
{{runner.wp}}, {{runner.acorn}}, {{runner.composer}}, {{runner.node}}, {{runner.test}}, {{runner.lint}}, {{runner.cache}}, {{runner.logs}} | runtime.runners | bin/wp, bin/wp acorn, bin/composer, bin/npm, bin/test, bin/mago, bin/flush, bin/logs |
{{php_service}} | runtime.compose.services.php | app |
{{web_service}} | runtime.compose.services.web | app (PHP-FPM and nginx share one image) |
{{db_service}} | runtime.compose.services.database | db |
{{cache_service}} | runtime.compose.services.cache | cache |
{{node_service}} | runtime.compose.services.node | node |
{{session_kind}} | runtime.session.kind | local, cloud, codespaces, devcontainer |
Also needed:
runtime.compose.contract ({ "name": "kivo-wp", "version": 1 }, version 2, or null), runtime.compose.router (contract 2: the global router container and its kivo-wp network; null otherwise), runtime.compose.bin (the scripts that exist) and runtime.compose.files (the Compose file and the overrides Compose merges). The session context line compose: kivo-wp contract <n> · … says which TLS setup applies.proxy service (Caddy) per project on *.localhost, and bin/setup may move it to another port. Contract 2 (wp-kit 6.1): no proxy service; one router per machine (kivo-wp-router) serves https://<host>.<domain> (default domain kivowp.dev) without a port. Never mix the two in one answer.runtime.session.dockerCli: false means this shell cannot reach Docker at all.docker version, docker compose version, docker context ls, and where the repository lives (on WSL2, the Linux filesystem, not /mnt/c).bin/info. The detector never reads .env (it holds secrets), so it does not publish one.bin/down --volumes (deletes the database volume), bin/db-import (replaces the database), docker system prune.Read the stack. Open compose.yaml and, when listed in runtime.compose.files, the override; list the services and the bin/ scripts (ls bin/). bin/ is the only supported entry point: with a known contract the service and script names are wp-kit's (app, db, cache, node, mail, plus proxy on contract 1 only; contract 2 adds bin/router), so trust them instead of guessing from images. Without a contract, use the roles the detector derived from the images and say that the project is not on the kivo-wp contract. Details: references/compose-file.md, references/bin-scripts.md.
Check state before any bin/ command. docker compose ps lists running services and their health. Nothing listed means the stack is stopped: on the first run in a checkout use bin/setup (idempotent: builds, starts with health checks, installs dependencies, seeds synthetic data); afterwards bin/up. Choose the place flag from {{session_kind}} as the contract reference states it: bin/setup --cloud in a cloud agent session, bin/setup --ci in CI, no flag on a developer machine or in a devcontainer. A cloud agent session starts with no running containers, so this step comes first in every such session (references/devcontainer-and-cloud.md).
Run every command from the project root through bin/. The runner paths are relative, so cd to the root first (the directory with compose.yaml).
{{runner.wp}} <cmd>. Acorn: {{runner.acorn}} <cmd> (bin/wp acorn on the contract).{{runner.composer}} <cmd>. Node: {{runner.node}} <cmd>, which runs in {{node_service}}.{{runner.test}}, {{runner.lint}}, {{runner.cache}}; without a cache script, {{runner.wp}} cache flush and {{runner.acorn}} optimize:clear.docker compose exec {{php_service}} <cmd> (add -T when stdin is not a terminal). Never run host wp, composer, php or npm: the host copy is not the container's.The Composer and Node project that owns Acorn is not always the repository root. Paths inside a container start at the mount target of the project in the service that runs the command (read volumes: and working_dir: in compose.yaml; written <mount> below):
sage-theme | acorn-mu-plugin | radicle-app | |
|---|---|---|---|
Acorn's composer.json | theme folder: {{runner.composer}} --working-dir=<mount>/<theme path>; the root one (Bedrock) holds WordPress and plugins | plugin folder: {{runner.composer}} --working-dir=<mount>/<plugin path>; root {{runner.composer}} only installs WordPress and plugins | project root: {{runner.composer}} |
package.json / Vite | theme folder: {{runner.node}} --prefix <mount>/<theme path> <script> | plugin folder: {{runner.node}} --prefix <mount>/<plugin path> <script> | project root, in {{node_service}} |
{{runner.acorn}} answers | only while the theme is active | always | always |
Apply a change with the right lifecycle command (Compose verbs only):
| Change | Command |
|---|---|
compose.yaml, the override, an env_file or environment: value, ports, volumes | docker compose up -d (recreates only the services whose configuration changed; data volumes are kept) |
Dockerfile, build args, PHP extensions baked into the image | docker compose build <service> && docker compose up -d |
| Wedged process, no configuration change (OPcache, a stuck worker) | docker compose restart <service> (does not re-read compose.yaml) |
| Stack stopped, nothing changed | bin/up |
| Empty database wanted, database image major version changed | bin/db-export first, ask, then bin/down --volumes and bin/setup (the volume and its data are deleted) |
Team settings go in compose.yaml; personal ones (an extra port, Xdebug mode) in the gitignored override. The hooks deny edits to a gitignored override: propose the change to the user instead.
Database work. Import with bin/db-import <file>, export with bin/db-export [file], and open a client shell with bin/db. Inside the stack the database host is the service name {{db_service}} (DB_HOST=db), never localhost. Read bin/db-import --help for the formats it accepts and whether it replaces the database; export before importing over data someone needs.
Diagnose. {{runner.logs}} (stdout and stderr of the services); docker compose logs -f {{web_service}} for one service; debug.log inside the container when WP_DEBUG_LOG is on (docker compose exec {{php_service}} tail -f <mount>/<content dir>/debug.log); the health column of docker compose ps and the State.Health.Log entries of docker inspect <container> for a check that never passes. On contract 2, bin/router status shows whether the router runs and which hosts it routes. Symptom table: references/failure-modes.md. TLS and host names per contract: references/tls-and-hosts.md. WSL2 specifics: references/wsl2.md.
Finish. bin/down stops this project's containers and keeps the volumes; other projects are not affected. On contract 2 the router keeps running for the other projects; bin/router stop stops it.
curl -I <site URL> (URL from bin/info: https://<project>.localhost[:port] on contract 1, https://<host>.<domain> with no port on contract 2) answers 200 or a redirect without -k. Trust comes from bin/trust-cert for Caddy's CA (contract 1) or for the machine-local CA (contract 2 without the team certificate); the team's wildcard certificate needs no trust step. Use curl -kI only as a diagnostic to separate "site down" from "certificate not trusted": -k hides exactly the TLS failure this check is meant to catch.{{runner.wp}} core is-installed && {{runner.wp}} option get siteurl matches the URL from bin/info.{{runner.acorn}} --version answers on Acorn projects; {{runner.composer}} --version answers.docker compose ps shows every service running and healthy where a health check exists.docker compose exec {{cache_service}} valkey-cli ping (or redis-cli ping on a Redis image) returns PONG.docker compose up -d for a configuration change: docker compose exec {{php_service}} env shows the new value (names only when the value is a secret; never paste secret values).| Symptom | Cause | Fix |
|---|---|---|
| Contract 1: "port is already allocated" for 443 or 80 | Another stack (or a Lando proxy) holds the port | bin/setup picks a free port; read the chosen one from bin/info; or stop the other stack |
Contract 2: bin/setup stops because 80 or 443 is taken | Lando's proxy or another process holds the port; the router never moves to another port | lando poweroff for Lando's proxy, otherwise stop the process bin/setup names, then bin/setup again |
| Contract 2: the site name resolves to a non-loopback address or not at all | The network's resolver drops public answers that point to loopback (DNS rebinding protection) | Allow the domain on the resolver, or add the /etc/hosts line bin/setup prints; never edit system files without asking |
Contract 2: bin/setup refuses because the host is already routed | Another checkout of the same project (a worktree) runs with the same host name | Set KIVO_WP_HOST=<project>-<branch> in this checkout's .env, then bin/setup |
bin/wp: service "app" is not running | The stack is stopped | docker compose ps, then bin/up |
docker: command not found in an editor devcontainer | The shell is attached to the app container, not the workspace container | Reopen the project in the workspace container that the generated devcontainer.json defines |
| Certificate not trusted in the Windows browser | Caddy's root CA (contract 1) or the machine-local CA (contract 2) lives on the Linux side | bin/trust-cert, then certutil -addstore -f ROOT from an elevated Windows prompt; see references/wsl2.md |
| Stdio MCP server hangs or prints garbage | A TTY was allocated on a pipe | Use bin/wp (it adds -T when stdin is not a terminal) or docker compose exec -T |
| Image pull or package install fails with a proxy 403 in a cloud agent session | The host is not in the session's network allowlist | Add the host listed in references/devcontainer-and-cloud.md to the allowlist |
The full table (ownership, slow I/O, daemon, database health) lives in references/failure-modes.md.
bin/ scripts misbehave or a script the contract names is missing: the contract belongs to wp-kit; collect bin/info, docker compose version, docker compose ps and the failing command, then raise it with the wp-kit maintainers. Do not rewrite generated scripts on your own initiative.docker context ls, docker info, docker system df; ask before any prune.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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-backgroundUse when work must run outside the request, on a schedule, or be logged in an Acorn project - WP-Cron vs Action Scheduler vs Laravel queues (make:job, ShouldQueue, queue:work, failed_jobs), console commands (make:command, wp acorn <command>), Schedule::command and schedule:run from system cron, Laravel Redis and Cache vs transients, logging channels (Log::, LOG_CHANNEL, stderr, storage/logs). For tables use acorn-data; for object cache tuning use wp-performance./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.Other plugins' skills for the same job