Skip to main content

First Project

Start a LocalWP-backed project from the devkit root. The easiest path is to let your agent run the built-in onboarding workflow.

Open the devkit root in your agent and send:

/new-project

The agent should ask for only the missing setup details:

InputHow it is used
Local site nameThe agent matches it against LocalWP sites.
Build briefThe agent records what the site should become.
Project slugUsually inferred from the Local site name. The agent asks only if the inferred slug is invalid, already exists, ambiguous, or you want a custom one.
Fresh or populated siteWhether the Local site already has pages, templates, a static front page, or a posts page. A populated site needs the extra steps below before the first sync.
Browser automation choiceOptional. Used for page previews and screenshots after sync when not already installed.

If the Local site does not exist, create it in Local first. The devkit does not create Local sites, ship premium plugins, provide licenses, or generate Local Blueprints for you.

What /new-project Does​

The workflow creates and binds a project, checks it, looks for content collisions before the first sync, then syncs, activates, and verifies:

bun run localwp:list
bun run project:create -- <slug>
bun run localwp:bind -- --project <slug> --site "<Local site name>"
bun run project:check -- --project <slug>
bun run localwp:doctor -- --project <slug>
bun run localwp:sync -- --project <slug>
bun run localwp:wp -- --project <slug> -- plugin activate oh-my-idetch
bun run localwp:verify -- --project <slug>
bun run localwp:doctor -- --project <slug>
bun run localwp:capabilities -- --project <slug>

If the project's PHPStan dependencies are not installed yet, the agent runs composer install --working-dir=projects/<slug> before the first check.

If WP-CLI is unavailable because Local has not generated a Site Shell entry, open Local, choose the site, select Open Site Shell, and rerun the command or activate the plugin in WordPress admin.

Manual Setup​

Use the manual commands when you do not want the agent onboarding flow:

bun run localwp:list

Create the project:

bun run project:create -- my-site

Bind it to a Local site:

bun run localwp:bind -- --project my-site --site "My Site"

Run the first check, then let doctor look for content the project would collide with:

bun run project:check -- --project my-site
bun run localwp:doctor -- --project my-site

On a fresh site, doctor prints Content collisions: none. Any collision or front page warning means the site already has content: follow Binding a Site That Already Has Content before you sync.

Sync, activate the plugin, and verify:

bun run localwp:sync -- --project my-site
bun run localwp:wp -- --project my-site -- plugin activate oh-my-idetch
bun run localwp:verify -- --project my-site

Inspect readiness and installed capabilities:

bun run localwp:doctor -- --project my-site
bun run localwp:capabilities -- --project my-site

Binding a Site That Already Has Content​

project:create scaffolds a starter demo: home and blog pages, index and single-post templates, a site header and other starter components, and starter patterns. The first sync creates those on the bound site. On a site that already has content, some of them can match pages or templates that exist:

  1. Export the site in the Local app before the first sync.
  2. Run bun run localwp:doctor -- --project <slug>. Each collision line names the project entry (for example page:slug:home or template:slug:index) and the existing post it matches.
  3. Decide per collision:
    • Keep the existing content as the site's own. Remove that starter entry from the project's site registry, or give the project page or template a slug the site does not use yet.
    • Bring it under code. Add adopt_existing() to that page or template. Add hand_over_after_create() as well when its current content must stay as it is. See Content Ownership.
  4. Front page and posts page. If doctor warns that the site already has a static front page, remove the home page from the registry when that front page must stay; otherwise the first sync points the front page at the project home page. If doctor warns about a posts page, change the project's reading settings before syncing; otherwise every sync clears that setting.
  5. Rerun project:check and localwp:doctor until doctor prints Content collisions: none, then sync.

Sync never overwrites content it did not create. Without adopt_existing(), a matching page stops the sync with ETCH_SITE_PERSISTENCE_CONFLICT and nothing is overwritten.

Project Files​

After setup, use the project directory as the site source:

projects/my-site/
project.json
AGENTS.project.md
oh-my-idetch.php
src/
cms/
examples/
tests/
tools/
var/
wpml-config.xml

The template also ships composer.json and composer.lock (pinned to etch-builders 2.1.1), phpstan.neon.dist, and phpunit.xml.dist for project-local PHP tooling, plus runnable typed-builder examples under examples/builders/. wpml-config.xml keeps WPML from copying the Builder's ownership details to translations; it ships in the plugin.

Keep project-specific brief notes, constraints, runtime expectations, and Local binding notes in projects/my-site/AGENTS.project.md so future agent sessions start with the right context.