Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Skills for AI assistants (Claude Code, Cursor, and any tool that reads the Claud

| Skill | Invoke | What it does |
|---|---|---|
| [`init/`](init/SKILL.md) | `/init` | Turn this cloned skeleton into a named project and manage it afterwards: rename the starter tokens, keep/remove the example sets, toggle optional features (Tailwind, HMR, Dev Tools). Drives `npm run init`. |
| [`init/`](init/SKILL.md) | `/init` | Turn this cloned skeleton into a named project and manage it afterwards: rename the starter tokens, keep/remove the example sets, toggle optional features (Tailwind, HMR, DevTools). Drives `npm run init`. |
| [`scaffold/`](scaffold/SKILL.md) | `/scaffold` | Add one feature (CPT, taxonomy, block, REST controller, shortcode, cron, CLI, settings page, user role, service, CI workflow) via `npx wp-tooling add`, TDD-first. |
| [`setup/`](setup/SKILL.md) | `/setup` | Generic tooling bootstrap for plugins and themes, shipped with `@rtcamp/wp-tooling`. Not a personalization path for this skeleton; use `/init`. |

Expand Down
15 changes: 8 additions & 7 deletions .claude/skills/init/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Two jobs: **bootstrap + setup** a fresh clone into a real plugin, or **manage**
## Use for
- First run: install dependencies, rename starter tokens, pick capabilities to keep.
- First run WITH a feature brief: after rename + capabilities, implement the described features by chaining to the **scaffold** skill (TDD), replacing the matching `Example*` placeholders (step 5).
- Later: rename / re-prefix, toggle features (Tailwind, HMR, Dev Tools).
- Later: rename / re-prefix, toggle features (Tailwind, HMR, DevTools).

## Do not use for
- Adding a feature class → the **scaffold** skill (`npx wp-tooling add`).
Expand Down Expand Up @@ -46,18 +46,18 @@ Then verify a clean working tree (`git status`) - init rewrites files irreversib
### 3. Ask, confirm, run - one step
`npm run init` is a single command; don't turn gathering its inputs into a multi-round-trip wizard.

**Setup:** in ONE message ask for project name (required, e.g. `Acme Blog` → namespace `Acme_Blog\Features`, package `rtcamp/acme-blog-features`, text domain, prefixes, main file - show these back), version (default `1.0.0`), which capability sets to remove, and which features to enable (defaults: keep all sets, `hmr` on, `tailwind` off - see Capability model). The engine derives the tokens itself; do not read the engine source (`identity.js` etc.) - the mapping above is the contract, and the graph answers any deeper question (see the graphify policy in `AGENTS.md`).
**Setup:** in ONE message ask for project name (required, e.g. `Acme Blog` → namespace `Acme_Blog\Features`, package `rtcamp/acme-blog-features`, text domain, prefixes, main file - show these back), version (default `1.0.0`), which capability sets to remove, and which features to enable (defaults: keep all sets, `hmr` on, `tailwind` and `dev-tools` off - see Capability model). The engine derives the tokens itself; do not read the engine source (`identity.js` etc.) - the mapping above is the contract, and the graph answers any deeper question (see the graphify policy in `AGENTS.md`).

**Manage:** ask which of identity / features to change. It's a single flag on an existing project - no wizard needed.

Get explicit consent on the resolved values (init is destructive), then run:
```bash
# Setup:
npm run init -- --name="Acme Blog" --version=1.0.0 --yes \
--remove-examples=cron,rest --features=hmr,tailwind
--remove-examples=cron,rest --features=hmr,tailwind,dev-tools
# Manage:
npm run init -- --list
npm run init -- --enable=tailwind --yes
npm run init -- --enable=dev-tools --yes
npm run init -- --features=hmr --yes # exact enabled set (empty = none)
```
- `--keep-examples` keeps all; `--remove-examples` (no value) removes all; `--remove-examples=a,b` removes listed keys.
Expand All @@ -69,6 +69,7 @@ npm run init -- --features=hmr --yes # exact enabled set (empty = none)

### 4. After init
- Tailwind enabled → developer runs `npm install` (it added `src/css/tailwind.css`, `postcss.config.js`, and pinned `@rtcamp/tailwind-config`).
- DevTools enabled → it's still a private package (`rtcamp/wp-devtools`, VCS-sourced): developer runs `composer update rtcamp/wp-devtools`, which may need GitHub auth, then `npm run dev:connect`.
- `composer dump-autoload` (engine runs it when `composer.json` is present).
- Trust the engine's own output to verify (it reports the removed sets, drops their `Main::CLASSES` lines and tests, and regenerates the autoloader). To confirm a symbol or reference, run a single `graphify query`/`affected` against the graph - never grep `Main.php`/`inc/` to check removal.
- If you hand-edited PHP and are NOT handing off to scaffold (e.g. a manage-mode dangling `Main::CLASSES` cleanup), run `composer lint` on the change and fix it. When a brief follows (step 5), leave the lint/PHPStan/test gates to the scaffold skill - init does not run them.
Expand Down Expand Up @@ -96,9 +97,9 @@ ONE "Select the capabilities to include" prompt. Each is keep-or-remove; removin
| APIs & Automation | `rest`, `cli`, `cron` |
| Admin | `settings`, `admin`, `roles` |
| Utilities | `cache`, `transients` |
| Developer Tooling | `test-measure` (CI workflow), `hmr` (feature) |
| Developer Tooling | `test-measure` (CI workflow), `hmr` (feature), `dev-tools` (feature) |

Sets are kept by default; pass keys to `--remove-examples` to drop. Features: `hmr` on, `tailwind` off; toggle via `--features`/`--enable`/`--disable`. Everything here installs from public registries.
Sets are kept by default; pass keys to `--remove-examples` to drop. Features: `hmr` on, `tailwind` and `dev-tools` off; toggle via `--features`/`--enable`/`--disable`. `dev-tools` (`rtcamp/wp-devtools`, runtime telemetry over MCP - Query Monitor + the MCP Adapter) is the one feature still sourced from a private VCS repo; enabling it needs GitHub auth on `composer update` (see step 4). Everything else here installs from public registries.

### Changing capabilities after setup
Add later → scaffold skill / `npx wp-tooling add <category>/<slug>` (writes the class, wires the module). Remove later → delete its `inc/Modules/<X>/` classes + `Main::CLASSES` line by hand. Toggle a feature any time via `npm run init -- --enable=<key>`/`--disable=<key>`. Do not re-run init to change the capability set.
Expand All @@ -112,6 +113,6 @@ Add later → scaffold skill / `npx wp-tooling add <category>/<slug>` (writes th
- Never invent flags. Supported: `--name`, `--version`, `--yes`, `--keep-examples`, `--remove-examples[=...]`, `--features`, `--enable`, `--disable`, `--reinit`, `--list`, `--clean`, `--help`. Run `npm run init -- --help` if unsure.

## Reference
- Engine: `@rtcamp/wp-tooling/init` (via `bin/init.js`). Capability map: `bin/scaffold.config.js`.
- Engine: `@rtcamp/wp-tooling/init` (via `bin/init.js`). Capability map: `bin/scaffold.config.js`. DevTools feature: `bin/features/dev-tools.js`.
- Conventions renamed into: `AGENTS.md`, `.github/instructions/structure.instructions.md`.
- Graphify policy: `AGENTS.md`.
13 changes: 7 additions & 6 deletions .github/prompts/init.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Copilot must gather inputs BEFORE acting. Do not assume any value.

## Use for
- First run: install dependencies, rename starter tokens, pick capabilities to keep.
- Later: rename / re-prefix, toggle features (Tailwind, HMR, Dev Tools).
- Later: rename / re-prefix, toggle features (Tailwind, HMR, DevTools).

## Do not use for
- Adding a feature class → the `/scaffold` prompt.
Expand All @@ -45,15 +45,15 @@ Then verify a clean working tree (`git status`) - init rewrites files irreversib
### 3. Ask, confirm, run - one step
`npm run init` is a single command; don't turn gathering its inputs into a multi-round-trip wizard.

**Setup:** in ONE message ask for project name (required, e.g. `Acme Blog` → namespace `Acme_Blog\Features`, package `rtcamp/acme-blog-features`, text domain, prefixes, main file - show these back), version (default `1.0.0`), which capability sets to remove, and which features to enable (defaults: keep all sets, `hmr` on, `tailwind` off - see Capability model).
**Setup:** in ONE message ask for project name (required, e.g. `Acme Blog` → namespace `Acme_Blog\Features`, package `rtcamp/acme-blog-features`, text domain, prefixes, main file - show these back), version (default `1.0.0`), which capability sets to remove, and which features to enable (defaults: keep all sets, `hmr` on, `tailwind` and `dev-tools` off - see Capability model).
**Manage:** ask which of identity / features to change - it's a single flag on an existing project, no wizard needed.

Get explicit consent on the resolved values (init is destructive), then run:
```bash
npm run init -- --name="Acme Blog" --version=1.0.0 --yes --remove-examples=cron,rest --features=hmr,tailwind
npm run init -- --name="Acme Blog" --version=1.0.0 --yes --remove-examples=cron,rest --features=hmr,tailwind,dev-tools
# Manage:
npm run init -- --list
npm run init -- --enable=tailwind --yes
npm run init -- --enable=dev-tools --yes
npm run init -- --features=hmr --yes # exact enabled set (empty = none)
```
- `--keep-examples` keeps all; `--remove-examples` (no value) removes all; `--remove-examples=a,b` removes listed keys.
Expand All @@ -62,6 +62,7 @@ npm run init -- --features=hmr --yes # exact enabled set (empty = none)

### 4. After init
- Tailwind enabled → developer runs `npm install` (added `src/css/tailwind.css`, `postcss.config.js`, pinned `@rtcamp/tailwind-config`).
- DevTools enabled → still a private package (`rtcamp/wp-devtools`, VCS-sourced): developer runs `composer update rtcamp/wp-devtools` (may need GitHub auth), then `npm run dev:connect`.
- Suggest `composer dump-autoload`.
- If you hand-edited PHP under `inc/`, run `composer format` → `composer lint` → `composer phpstan` and resolve every finding. Never silence a real issue; if unclear, STOP and ask.
- Refresh the LOCAL knowledge graph with `graphify update .`. Never commit `graphify-out/graph.json`, and never run the cross-repo `/graphify . --update` or `merge-graphs`. If not installed, say so in one line; do not block. See `AGENTS.md` (graphify).
Expand All @@ -77,9 +78,9 @@ ONE keep-or-remove prompt; removing deletes the capability entirely (classes, `i
| APIs & Automation | `rest`, `cli`, `cron` |
| Admin | `settings`, `admin`, `roles` |
| Utilities | `cache`, `transients` |
| Developer Tooling | `test-measure` (CI workflow), `hmr` (feature) |
| Developer Tooling | `test-measure` (CI workflow), `hmr` (feature), `dev-tools` (feature) |

Sets kept by default; pass keys to `--remove-examples` to drop. Features: `hmr` on, `tailwind` off. Everything installs from public registries.
Sets kept by default; pass keys to `--remove-examples` to drop. Features: `hmr` on, `tailwind` and `dev-tools` off. `dev-tools` is the one feature still sourced from a private VCS repo (see step 4); everything else installs from public registries.

## Hard rules
- Package managers only with consent: `npm install`, `composer install` (step 2), and `npm run init`. Otherwise surface install commands as developer actions.
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ To add a feature: write the test, create the concrete class extending the right
- PHP: `composer lint` (PHPCS) · `composer format` (phpcbf) · `composer phpstan`; the PHPUnit suite runs under `wp-env` via `npm run test:php`.
- JS/build: `npm run build:dev` · `npm run build:prod` · `npm run lint` · `npm run test`.
- Setup / features: `npm run init` (setup + manage wizard) · `npx wp-tooling add <category>/<slug>` (add a feature).
- DevTools (opt-in): `npm run init -- --enable=dev-tools` then `npm run dev:connect` exposes runtime telemetry over MCP — [demo](docs/dev-tools-demo.md) · `bash bin/dev-tools-e2e.sh` checks the setup.

Human documentation: [README.md](README.md) → [docs/index.md](docs/index.md) (developer guides), [DEVELOPMENT.md](DEVELOPMENT.md) (extending by hand), [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/internal/](docs/internal/README.md) (skeleton maintainers). Framework API detail is linked, not copied, from the `rtcamp/wp-primitives` docs at the locked tag.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Then follow [Getting Started](docs/getting-started.md): prerequisites, getting t

- **Infrastructure** that stays in every project: bootstrap and loader, asset registration, theme-overridable templates and components, a shared logger, an encryption service, activation and deactivation handling, and PHPUnit, PHPCS, PHPStan, ESLint and Stylelint setups.
- **Twelve example sets**, one per feature domain (post types, taxonomies, blocks, REST, WP-CLI, cron, settings pages, admin pages, user roles, shortcodes, cache, transients). Each is a working, tested reference you keep or remove at setup.
- **Optional development features**: HMR live reload (on by default), Tailwind CSS, and Dev Tools runtime telemetry over MCP.
- **Optional development features**: HMR live reload (on by default), Tailwind CSS, and DevTools runtime telemetry over MCP.

See [Included features](docs/features.md) for where each one lives and how to see it working.

Expand Down
Loading
Loading