@wp-operations/wp-ops 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +30 -27
  2. package/bin/wp-app.js +2 -0
  3. package/bin/wp-code.js +2 -0
  4. package/bin/wp-ide.js +2 -0
  5. package/package.json +12 -3
  6. package/src/commands/platform.js +16 -2
  7. package/src/commands/sandbox.js +3 -3
  8. package/src/main.js +10 -4
  9. package/wp-operations/CHANGELOG.md +14 -0
  10. package/wp-operations/README.md +39 -0
  11. package/wp-operations/agents/builder/AGENT.md +15 -0
  12. package/wp-operations/assets/admin.css +631 -0
  13. package/wp-operations/assets/admin.js +614 -0
  14. package/wp-operations/assets/app/app.css +1 -0
  15. package/wp-operations/assets/app/app.js +70 -0
  16. package/wp-operations/assets/app/fonts/inter-medium.woff +0 -0
  17. package/wp-operations/assets/app/fonts/inter-regular.woff +0 -0
  18. package/wp-operations/assets/app/fonts/inter-semibold.woff +0 -0
  19. package/wp-operations/assets/app/login.css +42 -0
  20. package/wp-operations/assets/brand/icon.svg +20 -0
  21. package/wp-operations/assets/brand/mark.svg +19 -0
  22. package/wp-operations/assets/editors/audiobook.css +311 -0
  23. package/wp-operations/assets/editors/audiofile.css +286 -0
  24. package/wp-operations/assets/editors/course.css +701 -0
  25. package/wp-operations/assets/editors/course.js +698 -0
  26. package/wp-operations/assets/editors/faq.css +258 -0
  27. package/wp-operations/assets/editors/faq.js +196 -0
  28. package/wp-operations/assets/editors/interactive.css +220 -0
  29. package/wp-operations/assets/editors/interactive.js +378 -0
  30. package/wp-operations/assets/editors/media-sources.css +3 -0
  31. package/wp-operations/assets/editors/media-sources.js +40 -0
  32. package/wp-operations/assets/editors/open-media.css +114 -0
  33. package/wp-operations/assets/editors/open-media.js +182 -0
  34. package/wp-operations/assets/editors/thumbnails.css +335 -0
  35. package/wp-operations/assets/editors/thumbnails.js +447 -0
  36. package/wp-operations/assets/editors/translator.css +818 -0
  37. package/wp-operations/functions.php +24 -0
  38. package/wp-operations/index.php +14 -0
  39. package/wp-operations/platform.json +1836 -0
  40. package/wp-operations/skills/ai-development-guardrails/SKILL.md +49 -0
  41. package/wp-operations/skills/gutenberg-reference/SKILL.md +45 -0
  42. package/wp-operations/skills/js-tooling-for-themes/SKILL.md +51 -0
  43. package/wp-operations/skills/tailwind-for-wp/SKILL.md +62 -0
  44. package/wp-operations/skills/wp-clean-classic-themes/SKILL.md +112 -0
  45. package/wp-operations/skills/wp-psr4-plugins/SKILL.md +2043 -0
  46. package/wp-operations/skills/wp-security/SKILL.md +90 -0
  47. package/wp-operations/src/Admin.php +78 -0
  48. package/wp-operations/src/App/Access.php +57 -0
  49. package/wp-operations/src/App/Admin.php +442 -0
  50. package/wp-operations/src/App/App.php +157 -0
  51. package/wp-operations/src/App/Apps.php +379 -0
  52. package/wp-operations/src/App/Bundle.php +111 -0
  53. package/wp-operations/src/App/Contents.php +676 -0
  54. package/wp-operations/src/App/Engine.php +554 -0
  55. package/wp-operations/src/App/Github.php +308 -0
  56. package/wp-operations/src/App/Module.php +23 -0
  57. package/wp-operations/src/App/Ops.php +470 -0
  58. package/wp-operations/src/App/Packages.php +289 -0
  59. package/wp-operations/src/App/Rest.php +539 -0
  60. package/wp-operations/src/App/Sandboxes.php +206 -0
  61. package/wp-operations/src/App/Store.php +104 -0
  62. package/wp-operations/src/App/Usage.php +268 -0
  63. package/wp-operations/src/Config.php +249 -0
  64. package/wp-operations/src/Content/Editor.php +223 -0
  65. package/wp-operations/src/Content/Fields.php +681 -0
  66. package/wp-operations/src/Content/Scoring.php +253 -0
  67. package/wp-operations/src/Content/Structure.php +293 -0
  68. package/wp-operations/src/Content/Types.php +150 -0
  69. package/wp-operations/src/Content/Uploads.php +50 -0
  70. package/wp-operations/src/Editors/AudiobookAuthor.php +61 -0
  71. package/wp-operations/src/Editors/AudiobookChapters.php +632 -0
  72. package/wp-operations/src/Editors/AudiobookCover.php +235 -0
  73. package/wp-operations/src/Editors/Audiofile.php +462 -0
  74. package/wp-operations/src/Editors/Course.php +784 -0
  75. package/wp-operations/src/Editors/Ebook.php +242 -0
  76. package/wp-operations/src/Editors/Editors.php +44 -0
  77. package/wp-operations/src/Editors/Faq.php +237 -0
  78. package/wp-operations/src/Editors/Files.php +139 -0
  79. package/wp-operations/src/Editors/Interactive/Builder.php +103 -0
  80. package/wp-operations/src/Editors/Interactive/Card.php +76 -0
  81. package/wp-operations/src/Editors/Interactive/Editor.php +42 -0
  82. package/wp-operations/src/Editors/Interactive/Field.php +272 -0
  83. package/wp-operations/src/Editors/Interactive/Map.php +84 -0
  84. package/wp-operations/src/Editors/Interactive/Models.php +227 -0
  85. package/wp-operations/src/Editors/Interactive/Report.php +59 -0
  86. package/wp-operations/src/Editors/Interactive/Save.php +323 -0
  87. package/wp-operations/src/Editors/Interactive/Scoring.php +244 -0
  88. package/wp-operations/src/Editors/Interactive/Structure.php +195 -0
  89. package/wp-operations/src/Editors/Legal.php +235 -0
  90. package/wp-operations/src/Editors/OpenMedia.php +140 -0
  91. package/wp-operations/src/Editors/OriginalTitle.php +112 -0
  92. package/wp-operations/src/Editors/Sources.php +28 -0
  93. package/wp-operations/src/Editors/Thumbnails/Admin.php +306 -0
  94. package/wp-operations/src/Editors/Thumbnails/Ajax.php +163 -0
  95. package/wp-operations/src/Editors/Thumbnails/Box.php +188 -0
  96. package/wp-operations/src/Editors/Thumbnails/Storage.php +228 -0
  97. package/wp-operations/src/Editors/Translator/Admin.php +913 -0
  98. package/wp-operations/src/Editors/Translator/Api.php +63 -0
  99. package/wp-operations/src/Editors/Translator/Bar.php +83 -0
  100. package/wp-operations/src/Editors/Translator/Fields.php +273 -0
  101. package/wp-operations/src/Editors/Translator/Storage.php +131 -0
  102. package/wp-operations/src/Editors/Translator/Thumbnail.php +215 -0
  103. package/wp-operations/src/Identity.php +104 -0
  104. package/wp-operations/src/Languages.php +45 -0
  105. package/wp-operations/src/Lockdown.php +85 -0
  106. package/wp-operations/src/Modules/Apps/Admin.php +472 -0
  107. package/wp-operations/src/Modules/Apps/Api.php +193 -0
  108. package/wp-operations/src/Modules/Apps/Apps.php +279 -0
  109. package/wp-operations/src/Modules/Apps/Formatters.php +478 -0
  110. package/wp-operations/src/Modules/Apps/Schemes.php +248 -0
  111. package/wp-operations/src/Modules/Apps/Table.php +101 -0
  112. package/wp-operations/src/Modules/Thumbnails.php +68 -0
  113. package/wp-operations/src/Modules/Translations.php +133 -0
  114. package/wp-operations/src/Platform.php +59 -0
  115. package/wp-operations/src/Setup.php +273 -0
  116. package/wp-operations/src/Status.php +99 -0
  117. package/wp-operations/src/Storage/Client.php +168 -0
  118. package/wp-operations/src/Storage/Offload.php +120 -0
  119. package/wp-operations/src/Storage/Settings.php +166 -0
  120. package/wp-operations/src/Storage/Storage.php +35 -0
  121. package/wp-operations/src/Updates.php +151 -0
  122. package/wp-operations/style.css +11 -0
package/README.md CHANGED
@@ -1,19 +1,26 @@
1
1
  # @wp-operations/wp-ops
2
2
 
3
- The operations CLI for wp-operations platform repositories: the GitHub repository the wp-operations theme manages, holding every app (WordPress theme) and every plugin.
3
+ The wp-operations tool. One install gives you all four commands:
4
4
 
5
5
  ```bash
6
6
  npm install -g @wp-operations/wp-ops
7
7
  ```
8
8
 
9
- Requires Node.js 20.10 or later and git. Composer is needed for plugins.
9
+ | Command | What it is |
10
+ |---|---|
11
+ | `wp-ops` | Platform repository: init, apps, plugins, composer, sandbox |
12
+ | `wp-app` | Local WordPress / ClassicPress server ([wp-app](../wp-app)) |
13
+ | `wp-ide` | Local browser editor with live preview ([wp-ide](../wp-ide)) |
14
+ | `wp-code` | Coding agent in the terminal ([wp-code](../wp-code)) |
15
+
16
+ Requires Node.js 20.10 or later and git. Composer is needed for plugins. If you installed `@wp-operations/wp-app`, `wp-ide` or `wp-code` globally on their own before, uninstall them first, since wp-ops now provides those commands.
10
17
 
11
- ## Platform repository
18
+ ## Commands
12
19
 
13
20
  ```bash
14
- wp-ops init my-platform --platform=path/to/wp-operations-theme # layout + composer.yml + git init
21
+ wp-ops init my-platform --platform=path/to/wp-operations # the theme folder, for its platform.json
15
22
  cd my-platform
16
- wp-ops new plugin acme/forms # packages/acme/forms (type psr4-plugin)
23
+ wp-ops new plugin acme/forms
17
24
  wp-ops new app service-apps shop --server=prod-1 --app-path=/var/www/shop
18
25
  wp-ops composer add --apps=service-apps/shop --packages="acme/forms"
19
26
  wp-ops apps
@@ -23,35 +30,31 @@ wp-ops doctor
23
30
 
24
31
  | Command | What it does |
25
32
  |---|---|
26
- | `init [dir] [--platform=]` | Creates `.github/platform.json`, the kind manifests, the `packages/` and kind folders, `.github/workflows/composer.yml` and `.gitignore`, then runs `git init` (branch `main`). It never overwrites a file. `--platform` copies the theme's `platform.json` to the root. |
27
- | `new app <kind> <slug>` | Creates the app folder: composer.json `type: wp-app`, style.css, index.php, and a functions.php that boots every installed plugin. It also adds the slug to the kind's manifest, with `--server`, `--app-path` and `--theme-slug`. |
28
- | `new plugin <vendor/name>` | Creates `packages/<vendor>/<name>` with composer.json `type: psr4-plugin`, version 0.1.0, PSR-4 autoload and `extra.wp-operations.plugin-class`, plus `src/Plugin.php` with `init()`. |
29
- | `apps`, `plugins` | List what is in the repository, with deploy targets, which apps use which plugin, and any contract problems. |
30
- | `composer <add\|remove\|update> --apps= --packages=` | Makes the same composer.json edit the theme commits (a no-op when the theme already did it), then refreshes `composer.lock` without installing anything. `update` with no `--apps` covers every app that requires the plugins. This is what `composer.yml` runs on GitHub Actions. |
31
- | `sandbox` | The preview runtime. See below. |
32
- | `edit` | Opens the wp-ide editor for this repository. |
33
- | `doctor` | Checks the environment and the repository contract. |
33
+ | `init [dir] [--platform=]` | Creates `.github/platform.json`, the app manifests, `packages/`, the app folders, `.github/workflows/composer.yml` and `.gitignore`, then runs `git init`. Never overwrites a file. `--platform` copies the theme's `platform.json` to the root. |
34
+ | `new app <kind> <slug>` | Creates the app (composer type `wp-app`) and adds it to the kind's manifest. |
35
+ | `new plugin <vendor/name>` | Creates `packages/<vendor>/<name>` (composer type `psr4-plugin`) with `src/Plugin.php`. |
36
+ | `apps`, `plugins` | Lists apps and plugins, which app uses which plugin, and any problems. |
37
+ | `composer <add\|remove\|update> --apps= --packages=` | Edits the apps' composer.json the same way the platform does and refreshes `composer.lock`. This is what `composer.yml` runs. |
38
+ | `sandbox` | Preview runtime for the platform. See below. |
39
+ | `edit` | Opens wp-ide for this repository. |
40
+ | `start`, `dev`, `build` | Runs one app with wp-app. |
41
+ | `doctor` | Checks the environment and the repository. |
42
+
43
+ Running `wp-ops` with no arguments opens a menu.
34
44
 
35
- ## Sandbox runtime
45
+ ## Sandbox
36
46
 
37
47
  ```bash
38
48
  SANDBOX_TOKEN=… wp-ops sandbox --port=8080 --url=https://sandbox.example.com --git
39
49
  ```
40
50
 
41
- One server for every app, matching the theme's sandbox contract:
42
-
43
- - **Health.** `GET /` (change it with `--health`) answers 200. When `$SANDBOX_TOKEN` is set (or the variable named by `--token-env`), health checks need `Authorization: Bearer <token>`. In Settings → Operations → Sandboxes, set the token constant to the same value.
44
- - **Preview.** Each app runs at `/{kind}/{slug}/` on its own WordPress site (wp-app engine, SQLite), with the app active as the theme. Its plugins are installed with `composer install` and booted.
45
- - **Framing.** `X-Frame-Options` is removed and `Content-Security-Policy: frame-ancestors` is set from `--frame-ancestors` (default `*`; use the platform's origin in production).
46
- - **Git mode.** With `--git`, the runtime must be a clone with a remote. Each app is served from its own worktree under `.local/sandbox/`, refreshed on every page load: from `vibe/{slug}` (the AI work branch; change it with `--work-branch`) when that branch exists on the remote, otherwise from the deploy branch (`--branch`, default the remote's default branch). New commits show up when the preview reloads.
47
- - **Without `--git`.** The runtime serves your working tree as it is.
48
- - **Memory.** At most `--max` sites (default 3) stay running. The least recently used idle site is stopped and starts again on its next request.
49
-
50
- `--url` must be the public address the platform loads previews from, because WordPress builds its links from it.
51
-
52
- ## Single app
51
+ - Serves every app at `/{kind}/{slug}/`, each on its own WordPress site.
52
+ - `GET /` is the health check. With `SANDBOX_TOKEN` set, it needs `Authorization: Bearer <token>`; set the same value in the platform under Settings → Operations → Sandboxes.
53
+ - The platform shows previews in an iframe: `--frame-ancestors` sets who may do that (default `*`; use the platform's address in production).
54
+ - With `--git`, each app follows `platform/{slug}` (the AI work branch) when it exists on the remote, otherwise the deploy branch (`--branch`). New commits show on the next reload. Without `--git`, it serves your working tree.
55
+ - At most `--max` sites (default 3) run at once.
53
56
 
54
- `wp-ops start [dir]`, `wp-ops dev [dir]` and `wp-ops build` delegate to [`wp-app`](../wp-app). Running `wp-ops` with no arguments opens the interactive menu.
57
+ `--url` must be the public address the platform loads previews from.
55
58
 
56
59
  ## License
57
60
 
package/bin/wp-app.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@wp-operations/wp-app/cli.js';
package/bin/wp-code.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@wp-operations/wp-code/cli.js';
package/bin/wp-ide.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@wp-operations/wp-ide/cli.js';
package/package.json CHANGED
@@ -1,18 +1,26 @@
1
1
  {
2
2
  "name": "@wp-operations/wp-ops",
3
- "version": "0.2.0",
4
- "description": "Operations CLI and TUI for wp-operations platform repositories: init, apps, plugins, composer, sandbox runtime, start, build, doctor.",
3
+ "version": "0.3.1",
4
+ "description": "The wp-operations tool. One install gives the platform and wp-ops, wp-app, wp-ide and wp-code.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
- "wp-ops": "cli.js"
8
+ "wp-ops": "cli.js",
9
+ "wp-app": "bin/wp-app.js",
10
+ "wp-ide": "bin/wp-ide.js",
11
+ "wp-code": "bin/wp-code.js"
9
12
  },
10
13
  "files": [
11
14
  "cli.js",
15
+ "bin",
12
16
  "src",
17
+ "wp-operations",
13
18
  "LICENSE",
14
19
  "README.md"
15
20
  ],
21
+ "scripts": {
22
+ "prepublishOnly": "node scripts/bundle-theme.js"
23
+ },
16
24
  "license": "GPL-2.0-or-later",
17
25
  "author": "de-er-kid",
18
26
  "repository": {
@@ -31,6 +39,7 @@
31
39
  "dependencies": {
32
40
  "@clack/prompts": "0.7.0",
33
41
  "@wp-operations/wp-app": "^0.4.1",
42
+ "@wp-operations/wp-code": "^0.1.1",
34
43
  "@wp-operations/wp-ide": "^0.3.0",
35
44
  "picocolors": "1.1.1"
36
45
  },
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import { execFileSync, spawnSync } from 'child_process';
4
+ import { fileURLToPath } from 'url';
4
5
  import pc from 'picocolors';
5
6
  import { ide } from '../deps.js';
6
7
  import { UsageError } from '../args.js';
@@ -69,6 +70,7 @@ export async function init({ dir = process.cwd(), platform, version, log = conso
69
70
  writeNew(path.join(root, '.github', 'workflows', 'composer.yml'), composerWorkflow(version), created);
70
71
  writeNew(path.join(root, '.gitignore'), GITIGNORE, created);
71
72
 
73
+ platform = platform || bundledPlatform();
72
74
  if (platform) {
73
75
  const source = path.resolve(platform);
74
76
  const file = fs.existsSync(source) && fs.statSync(source).isDirectory() ? path.join(source, 'platform.json') : source;
@@ -89,12 +91,24 @@ export async function init({ dir = process.cwd(), platform, version, log = conso
89
91
  if (gitInit) log(` ${pc.green('+')} git repository (branch main)`);
90
92
  if (!created.length && !gitInit) log(' Already a platform repository; nothing to add.');
91
93
  if (!fs.existsSync(path.join(root, 'platform.json'))) {
92
- log(pc.yellow(`\n platform.json is missing at the root. Copy the theme's platform.json here, or run: wp-ops init --platform=<path to the theme>`));
94
+ log(pc.yellow(`\n platform.json is missing at the root. Run: wp-ops init --platform=<path to the theme>`));
93
95
  }
94
- log(pc.dim('\n Deploy workflows (deploy-apps.yml, deploy-platform.yml) are yours to add under .github/workflows/.'));
96
+ log(`\n Next: ${pc.bold(`cd ${path.relative(process.cwd(), root) || '.'}`)} and ${pc.bold('wp-ops platform')} to run the platform locally.`);
95
97
  return { root, created, gitInit };
96
98
  }
97
99
 
100
+ /**
101
+ * The platform theme shipped inside this package (packages/wp-ops/wp-operations),
102
+ * or the repository's theme/ folder when running from the monorepo.
103
+ */
104
+ export function bundledPlatform() {
105
+ const here = path.dirname(fileURLToPath(import.meta.url));
106
+ for (const dir of [path.resolve(here, '..', '..', 'wp-operations'), path.resolve(here, '..', '..', '..', '..', 'theme')]) {
107
+ if (fs.existsSync(path.join(dir, 'style.css')) && fs.existsSync(path.join(dir, 'platform.json'))) return dir;
108
+ }
109
+ return '';
110
+ }
111
+
98
112
  function composerName(value) {
99
113
  return value.toLowerCase().replace(/[^a-z0-9_.-]+/g, '-').replace(/^[-_.]+|[-_.]+$/g, '');
100
114
  }
@@ -74,11 +74,11 @@ function sendJson(res, status, body) {
74
74
  * The sandbox runtime the platform theme leases: one HTTP server that
75
75
  * answers health checks at --health (Bearer token optional) and serves
76
76
  * every app of the platform repository at /{kind}/{slug}/ on its own
77
- * wp-app WordPress site, framable from the platform.
77
+ * wp-app WordPress site, which the platform can show in an iframe.
78
78
  *
79
79
  * Without --git it serves the working tree as it is. With --git it serves
80
80
  * each app from its own worktree, refreshed from the remote on every page
81
- * load: the app's work branch (--work-branch, default vibe/{slug}) when it
81
+ * load: the app's work branch (--work-branch, default platform/{slug}) when it
82
82
  * exists, else the deploy branch.
83
83
  */
84
84
  export async function sandbox(options) {
@@ -96,7 +96,7 @@ export async function sandbox(options) {
96
96
  const max = Math.max(1, Number(options.max ?? 3));
97
97
  const useGit = Boolean(options.git);
98
98
  const remote = options.remote || 'origin';
99
- const workBranch = options.workBranch === false ? '' : String(options.workBranch || 'vibe/{slug}');
99
+ const workBranch = options.workBranch === false ? '' : String(options.workBranch || 'platform/{slug}');
100
100
 
101
101
  readLayout(root);
102
102
  if (!process.env.WP_APP_HOME) useLocalData(root);
package/src/main.js CHANGED
@@ -6,7 +6,7 @@ import { parseArgs, UsageError } from './args.js';
6
6
  import { startApp } from './commands/start.js';
7
7
  import { buildAll } from './commands/build.js';
8
8
  import { doctor } from './commands/doctor.js';
9
- import { apps, composer, init, newApp, newPlugin, platformRoot, plugins } from './commands/platform.js';
9
+ import { apps, bundledPlatform, composer, init, newApp, newPlugin, platformRoot, plugins } from './commands/platform.js';
10
10
  import { sandbox } from './commands/sandbox.js';
11
11
  import { tui } from './tui.js';
12
12
 
@@ -19,15 +19,15 @@ Usage:
19
19
  wp-ops interactive menu
20
20
 
21
21
  Platform repository:
22
- wp-ops init [dir] [--platform=<theme dir or platform.json>]
23
- lay out a platform repository and git init it
22
+ wp-ops init [dir] lay out a platform repository and git init it
23
+ wp-ops platform [--port=] run the wp-operations platform locally (admin / password)
24
24
  wp-ops apps list apps (<kind>/<slug>) and their deploy targets
25
25
  wp-ops plugins list plugins and the apps that use them
26
26
  wp-ops new app <kind> <slug> [--server= --app-path= --theme-slug=]
27
27
  wp-ops new plugin <vendor/name> [--description=]
28
28
  wp-ops composer <add|remove|update> --apps=<a,b> --packages="<x y>" [--constraint=*] [--no-lock]
29
29
  edit composer.json and refresh composer.lock (what composer.yml runs)
30
- wp-ops sandbox [--port=8080] [--url=<public url>] [--git] [--branch=] [--work-branch=vibe/{slug}]
30
+ wp-ops sandbox [--port=8080] [--url=<public url>] [--git] [--branch=] [--work-branch=platform/{slug}]
31
31
  [--health=/] [--token-env=SANDBOX_TOKEN] [--frame-ancestors="*"] [--max=3] [--php=] [--wp=]
32
32
  serve every app at /{kind}/{slug}/ for the platform's previews
33
33
  wp-ops edit [--port=4500] [--preview=<sandbox url>]
@@ -61,6 +61,12 @@ async function run() {
61
61
  case 'init':
62
62
  await init({ dir: positional[0] ?? process.cwd(), platform: options.platform, version: pkg.version });
63
63
  return;
64
+ case 'platform': {
65
+ const theme = bundledPlatform();
66
+ if (!theme) throw new UsageError('The platform theme is missing from this wp-ops install. Reinstall: npm install -g @wp-operations/wp-ops');
67
+ startApp({ appDir: theme, flags });
68
+ return;
69
+ }
64
70
  case 'apps':
65
71
  await apps({ root: await platformRoot() });
66
72
  return;
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - The theme now lives in the wp-operations repository and updates itself from its releases, with this changelog in Dashboard → Updates.
6
+ - Skills and agents ship with the theme and appear in CMS → Skills and CMS → Agents.
7
+ - The AI work branch is now `platform/{slug}` (was `vibe/{slug}`). Saved settings, options and user data move over on their own.
8
+ - The platform's settings in platform.json are under `app` (was `vibe`), and its REST API is `platform/v1`.
9
+ - Sign-in screen: shows your Site Title and Site Logo, nothing else.
10
+ - License: GPL-2.0-or-later.
11
+
12
+ ## 0.0.1
13
+
14
+ - First version: content engine, CMS, app builder and operations.
@@ -0,0 +1,39 @@
1
+ # wp-operations theme
2
+
3
+ The platform. People with the `prompt` capability use it at the site root (`/`); everyone else signs in at `wp-login.php` as usual. Plugins are switched off: apps get their plugins through composer in the platform repository.
4
+
5
+ Requires WordPress 6.4+ and PHP 8.0+ (with sodium, standard in PHP 8).
6
+
7
+ ## wp-config.php
8
+
9
+ Add only what you use. No key, token or secret is ever stored in the database.
10
+
11
+ ```php
12
+ define( 'PLATFORM_GITHUB_TOKEN', 'github_pat_…' ); // fine-grained token on the platform repository: Contents, Actions, Secrets, Environments (read/write)
13
+ define( 'PLATFORM_OPENAI_KEY', 'sk-…' ); // one constant per AI model; you choose its name in Settings → AI Models
14
+ define( 'PLATFORM_SANDBOX_TOKEN', '…' ); // optional, per sandbox (same value as SANDBOX_TOKEN for wp-ops sandbox)
15
+ define( 'PLATFORM_STORAGE_BUCKET', '…' ); // optional S3/R2 storage: PLATFORM_STORAGE_ENDPOINT, _BUCKET, _ACCESS_KEY, _SECRET_KEY, _PUBLIC_URL
16
+ define( 'PLATFORM_CONFIG', '/path/to/platform.json' ); // optional: use another platform.json than the theme's
17
+ ```
18
+
19
+ ## Settings
20
+
21
+ - **Settings → Operations:** the platform repository, app folders, secrets, workflows and sandboxes.
22
+ - **Settings → AI Models:** models for Build, Plan and Chat, image models, and the work branch (default `platform/{slug}`).
23
+ - **Users → Prompt Users:** who can use the platform, and monthly credits.
24
+
25
+ ## platform.json
26
+
27
+ Content types, fields, languages, the admin screens, the platform's look (`app.theme.colors`) and its usage limits. The platform repository keeps a copy at its root (`wp-ops init --platform=<this folder>`).
28
+
29
+ ## Skills and agents
30
+
31
+ `skills/<name>/SKILL.md` and `agents/<name>/AGENT.md` ship with the theme and appear in the platform under CMS → Skills and CMS → Agents. Each theme update refreshes them, except the ones you edited there. Skills you add in the CMS are yours and are never touched.
32
+
33
+ ## Updates
34
+
35
+ New versions appear in Dashboard → Updates, with the changelog ([CHANGELOG.md](CHANGELOG.md)). They come from the `theme-v*` releases of [wordpress-operations/wordpress-operations](https://github.com/wordpress-operations/wordpress-operations/releases).
36
+
37
+ ## Building the UI
38
+
39
+ The platform UI source is in `ui/`. `npm install && npm run build` inside `ui/` writes `assets/app/`.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Builder
3
+ description: Builds and changes apps in the platform repository the way this platform expects.
4
+ role: builder
5
+ skills:
6
+ - ai-development-guardrails
7
+ - wp-security
8
+ ---
9
+
10
+ You change one app in the platform repository at a time.
11
+
12
+ - Themes are classic WordPress themes. No blocks, no theme.json styling, no Full Site Editing.
13
+ - Backend code belongs in plugins under `packages/<vendor>/<name>` (composer type `psr4-plugin`), written to the `wp-psr4-plugins` skill. Apps get plugins through composer, never by copying code into the app.
14
+ - Every request handler follows capability, nonce, sanitize, escape.
15
+ - Keep to the app's existing structure, names and style. Change only what the request needs.