Daily Workflow
The LocalWP Devkit is file-first. Build in the project folder, check the project, sync the runtime plugin copy into LocalWP, then verify against the bound Local site.
Edit Project Source
Work under:
projects/<slug>
Common project source paths are:
| Path | Purpose |
|---|---|
src/Site/** | Typed Etch presentation builders and site composition, authored with honestlydesign/etch-builders. |
cms/acf-json/** | Field group JSON that can be synced through WordPress. |
tests/** | Project-local test support. |
AGENTS.project.md | Project brief, Local binding notes, and user-owned runtime expectations. |
Do not use the synced Local plugin copy as the source of truth. It is replaced by sync.
Check Before Sync
Run the project verification gate:
bun run project:check -- --project <slug>
This validates the runtime surface, rejects unsafe links, lints PHP files, runs PHPStan with a default 1G memory limit, and compiles the exact project site definition without writing to WordPress.
If the check reports missing PHPStan dependencies, run the exact composer install --working-dir=... command it prints, then rerun project:check.
Sync to LocalWP
Only sync after the check passes:
bun run localwp:sync -- --project <slug>
Sync writes the project runtime plugin surface into the bound Local site:
wp-content/plugins/oh-my-idetch
It does not sync project notes, tests, tools, package metadata, agent files, local environment files, or user-owned premium plugins.
Sync reruns the no-write project check, copies the runtime surface, and applies the compiled site definition in WordPress. It fails closed when the check, the runtime preflight, the copy, or the apply fails, and a successful sync prints exact applied and unchanged evidence.
After the JSON report, sync prints a short readable summary:
Site apply: 2 changed, 41 unchanged.
Site notices: none
Synced project <slug> to .../wp-content/plugins/oh-my-idetch
- Changed and unchanged. An unchanged project reports its styles as unchanged; only real changes are counted.
- Noteworthy results. Content that was adopted, reclaimed from editors, restored, or handed over and then removed by an editor gets its own line.
- Site notices. Things that need a person, for example content you removed from code (
ETCH_SITE_PERSISTENCE_ORPHAN) or a style copy made in the Etch editor with different CSS. Notices never fail the sync. When content was removed from code, sync also prints the--retire-orphanscommand; see Content Ownership.
Sync also protects the installed plugin:
- If the prepared copy cannot load its Composer dependencies, sync stops, publishes nothing, and leaves the installed plugin untouched.
- If Etch is missing or inactive, sync says so instead of showing WordPress' generic critical error page.
- If WordPress loaded another copy of the plugin folder, such as
oh-my-idetch 2, sync stops instead of running that copy's older code. When such copies only sit next to the plugin, sync warns about them. - Hidden staging folders left by an interrupted sync are removed after the next successful sync.
Verify After Sync
Run the fast read-only runtime verification after every successful sync:
bun run localwp:verify -- --project <slug>
It checks the compiled entity/resource digests, recorded ownership, required active capabilities, and the installed Builder contract, without browser E2E. It prints the same site notices as sync. Content handed over to editors verifies with status handed_over, and content removed from code does not fail verification.
Add a single lightweight frontend availability check only when it is part of the task:
bun run localwp:verify -- --project <slug> --path /
The check uses the address WordPress itself reports as its home URL. With Local's "localhost" router mode that is http://localhost:<port>, not the .local domain. You can also pass a full address with --url, as long as it uses the same origin.
Verify Runtime Behavior
Use the site address WordPress reports, shown by Local or by option get home below. With Local's "localhost" router mode that is http://localhost:<port>; otherwise it is the bound .local domain recorded in project.json. Do not assume a fixed localhost port.
Use WP-CLI through the devkit wrapper:
bun run localwp:wp -- --project <slug> -- plugin list
bun run localwp:wp -- --project <slug> -- option get home
Check site readiness:
bun run localwp:doctor -- --project <slug>
Inspect runtime capabilities:
bun run localwp:capabilities -- --project <slug>
For visual or interactive work, verify in the browser after sync. OhMyEtch CSS, JavaScript, dropdowns, drawers, facets, Woo Store API behavior, checkout gateways, and fixed runtime styles need the active LocalWP site; project checks alone do not prove those runtime behaviors.
Safe Agent Handoff
When handing a project to an agent, include:
- the devkit root path;
- the project slug;
- the exact Local site name;
- the current build brief;
- user-owned dependencies that should be active;
- whether browser automation is available;
- the last
project:check,localwp:sync,localwp:verify,localwp:doctor, andlocalwp:capabilitiesresult, including any site notices.
The agent should start in the devkit root and treat projects/<slug> as the editable source.