wordpress-agent-kit 0.4.0 → 0.6.0

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 (153) hide show
  1. package/.agents/skills/wp-bootstrap/SKILL.md +314 -0
  2. package/.agents/skills/wp-bootstrap/references/composer-setup.md +275 -0
  3. package/.agents/skills/wp-bootstrap/references/monorepo-patterns.md +184 -0
  4. package/.agents/skills/wp-bootstrap/scripts/bootstrap.sh +151 -0
  5. package/.agents/skills/wp-bootstrap/scripts/detect-structure.mjs +466 -0
  6. package/.agents/skills/wp-bootstrap/scripts/package-wp.sh +173 -0
  7. package/.agents/skills/wp-bootstrap/scripts/playground-start.sh +148 -0
  8. package/.agents/skills/wp-bootstrap/scripts/playground-verify.sh +165 -0
  9. package/.agents/skills/wp-bootstrap/scripts/setup-github.sh +417 -0
  10. package/{.github → .agents}/skills/wp-wpcli-and-ops/SKILL.md +11 -9
  11. package/.agents/skills/wp-wpengine/SKILL.md +462 -0
  12. package/.agents/skills/wp-wpengine/references/ci-gate.md +469 -0
  13. package/.agents/skills/wp-wpengine/references/github-actions-deploy.md +743 -0
  14. package/.agents/skills/wp-wpengine/scripts/ci-gate.sh +118 -0
  15. package/.agents/skills/wp-wpengine/scripts/wpe-check.sh +89 -0
  16. package/.agents/skills/wp-wpengine/scripts/wpe-preflight.sh +104 -0
  17. package/.github/agents/wp-architect.agent.md +1 -2
  18. package/.github/copilot-instructions.md +1 -1
  19. package/.github/instructions/wordpress-workflow.instructions.md +3 -3
  20. package/AGENTS.md +22 -10
  21. package/AGENTS.template.md +20 -10
  22. package/README.md +89 -85
  23. package/dist/cli.js +7 -1
  24. package/dist/commands/bootstrap.js +105 -0
  25. package/dist/commands/clean-skills.js +64 -0
  26. package/dist/commands/setup.js +6 -2
  27. package/dist/commands/sync-skills.js +3 -0
  28. package/dist/lib/api.js +165 -5
  29. package/dist/lib/bootstrap.js +352 -0
  30. package/dist/lib/installer.js +166 -2
  31. package/extensions/wp-agent-kit/index.ts +325 -10
  32. package/package.json +10 -14
  33. package/skills-custom/wp-bootstrap/SKILL.md +314 -0
  34. package/skills-custom/wp-bootstrap/references/composer-setup.md +275 -0
  35. package/skills-custom/wp-bootstrap/references/monorepo-patterns.md +184 -0
  36. package/skills-custom/wp-bootstrap/scripts/bootstrap.sh +151 -0
  37. package/skills-custom/wp-bootstrap/scripts/detect-structure.mjs +466 -0
  38. package/skills-custom/wp-bootstrap/scripts/package-wp.sh +173 -0
  39. package/skills-custom/wp-bootstrap/scripts/playground-start.sh +148 -0
  40. package/skills-custom/wp-bootstrap/scripts/playground-verify.sh +165 -0
  41. package/skills-custom/wp-bootstrap/scripts/setup-github.sh +417 -0
  42. package/skills-custom/wp-wpengine/SKILL.md +362 -27
  43. package/skills-custom/wp-wpengine/references/ci-gate.md +469 -0
  44. package/skills-custom/wp-wpengine/references/github-actions-deploy.md +743 -0
  45. package/skills-custom/wp-wpengine/scripts/ci-gate.sh +118 -0
  46. package/skills-custom/wp-wpengine/scripts/wpe-check.sh +89 -0
  47. package/skills-custom/wp-wpengine/scripts/wpe-preflight.sh +104 -0
  48. package/.github/skills/wp-wpengine/SKILL.md +0 -127
  49. package/.github/workflows/ci.yml +0 -44
  50. package/.husky/pre-commit +0 -7
  51. package/CLI_REVIEW.md +0 -250
  52. package/biome.json +0 -39
  53. /package/{.github → .agents}/skills/blueprint/SKILL.md +0 -0
  54. /package/{.github → .agents}/skills/wordpress-router/SKILL.md +0 -0
  55. /package/{.github → .agents}/skills/wordpress-router/references/decision-tree.md +0 -0
  56. /package/{.github → .agents}/skills/wp-abilities-api/SKILL.md +0 -0
  57. /package/{.github → .agents}/skills/wp-abilities-api/references/delegate-helper-pattern.md +0 -0
  58. /package/{.github → .agents}/skills/wp-abilities-api/references/domain-vs-projection.md +0 -0
  59. /package/{.github → .agents}/skills/wp-abilities-api/references/error-code-vocabulary.md +0 -0
  60. /package/{.github → .agents}/skills/wp-abilities-api/references/grouping-heuristic.md +0 -0
  61. /package/{.github → .agents}/skills/wp-abilities-api/references/input-schema-gotchas.md +0 -0
  62. /package/{.github → .agents}/skills/wp-abilities-api/references/php-registration.md +0 -0
  63. /package/{.github → .agents}/skills/wp-abilities-api/references/plugin-family-patterns.md +0 -0
  64. /package/{.github → .agents}/skills/wp-abilities-api/references/rest-api.md +0 -0
  65. /package/{.github → .agents}/skills/wp-abilities-api/references/shared-core-service.md +0 -0
  66. /package/{.github → .agents}/skills/wp-abilities-audit/SKILL.md +0 -0
  67. /package/{.github → .agents}/skills/wp-abilities-audit/references/audit-schema.md +0 -0
  68. /package/{.github → .agents}/skills/wp-abilities-audit/references/capability-gate-tracing.md +0 -0
  69. /package/{.github → .agents}/skills/wp-abilities-audit/references/controller-enumeration.md +0 -0
  70. /package/{.github → .agents}/skills/wp-abilities-verify/SKILL.md +0 -0
  71. /package/{.github → .agents}/skills/wp-abilities-verify/references/annotation-correctness.md +0 -0
  72. /package/{.github → .agents}/skills/wp-abilities-verify/references/audit-schema-validation.md +0 -0
  73. /package/{.github → .agents}/skills/wp-abilities-verify/references/permission-roundtrip.md +0 -0
  74. /package/{.github → .agents}/skills/wp-abilities-verify/references/runtime-harness.md +0 -0
  75. /package/{.github → .agents}/skills/wp-abilities-verify/references/schema-lints.md +0 -0
  76. /package/{.github → .agents}/skills/wp-abilities-verify/references/static-enumeration.md +0 -0
  77. /package/{.github → .agents}/skills/wp-block-development/SKILL.md +0 -0
  78. /package/{.github → .agents}/skills/wp-block-development/references/attributes-and-serialization.md +0 -0
  79. /package/{.github → .agents}/skills/wp-block-development/references/block-json.md +0 -0
  80. /package/{.github → .agents}/skills/wp-block-development/references/creating-new-blocks.md +0 -0
  81. /package/{.github → .agents}/skills/wp-block-development/references/debugging.md +0 -0
  82. /package/{.github → .agents}/skills/wp-block-development/references/deprecations.md +0 -0
  83. /package/{.github → .agents}/skills/wp-block-development/references/dynamic-rendering.md +0 -0
  84. /package/{.github → .agents}/skills/wp-block-development/references/inner-blocks.md +0 -0
  85. /package/{.github → .agents}/skills/wp-block-development/references/registration.md +0 -0
  86. /package/{.github → .agents}/skills/wp-block-development/references/supports-and-wrappers.md +0 -0
  87. /package/{.github → .agents}/skills/wp-block-development/references/tooling-and-testing.md +0 -0
  88. /package/{.github → .agents}/skills/wp-block-development/scripts/list_blocks.mjs +0 -0
  89. /package/{.github → .agents}/skills/wp-block-themes/SKILL.md +0 -0
  90. /package/{.github → .agents}/skills/wp-block-themes/references/creating-new-block-theme.md +0 -0
  91. /package/{.github → .agents}/skills/wp-block-themes/references/debugging.md +0 -0
  92. /package/{.github → .agents}/skills/wp-block-themes/references/patterns.md +0 -0
  93. /package/{.github → .agents}/skills/wp-block-themes/references/style-variations.md +0 -0
  94. /package/{.github → .agents}/skills/wp-block-themes/references/templates-and-parts.md +0 -0
  95. /package/{.github → .agents}/skills/wp-block-themes/references/theme-json.md +0 -0
  96. /package/{.github → .agents}/skills/wp-block-themes/scripts/detect_block_themes.mjs +0 -0
  97. /package/{.github → .agents}/skills/wp-interactivity-api/SKILL.md +0 -0
  98. /package/{.github → .agents}/skills/wp-interactivity-api/references/debugging.md +0 -0
  99. /package/{.github → .agents}/skills/wp-interactivity-api/references/directives-quickref.md +0 -0
  100. /package/{.github → .agents}/skills/wp-interactivity-api/references/server-side-rendering.md +0 -0
  101. /package/{.github → .agents}/skills/wp-performance/SKILL.md +0 -0
  102. /package/{.github → .agents}/skills/wp-performance/references/autoload-options.md +0 -0
  103. /package/{.github → .agents}/skills/wp-performance/references/cron.md +0 -0
  104. /package/{.github → .agents}/skills/wp-performance/references/database.md +0 -0
  105. /package/{.github → .agents}/skills/wp-performance/references/http-api.md +0 -0
  106. /package/{.github → .agents}/skills/wp-performance/references/measurement.md +0 -0
  107. /package/{.github → .agents}/skills/wp-performance/references/object-cache.md +0 -0
  108. /package/{.github → .agents}/skills/wp-performance/references/query-monitor-headless.md +0 -0
  109. /package/{.github → .agents}/skills/wp-performance/references/server-timing.md +0 -0
  110. /package/{.github → .agents}/skills/wp-performance/references/wp-cli-doctor.md +0 -0
  111. /package/{.github → .agents}/skills/wp-performance/references/wp-cli-profile.md +0 -0
  112. /package/{.github → .agents}/skills/wp-performance/scripts/perf_inspect.mjs +0 -0
  113. /package/{.github → .agents}/skills/wp-phpstan/SKILL.md +0 -0
  114. /package/{.github → .agents}/skills/wp-phpstan/references/configuration.md +0 -0
  115. /package/{.github → .agents}/skills/wp-phpstan/references/third-party-classes.md +0 -0
  116. /package/{.github → .agents}/skills/wp-phpstan/references/wordpress-annotations.md +0 -0
  117. /package/{.github → .agents}/skills/wp-phpstan/scripts/phpstan_inspect.mjs +0 -0
  118. /package/{.github → .agents}/skills/wp-playground/SKILL.md +0 -0
  119. /package/{.github → .agents}/skills/wp-playground/references/blueprints.md +0 -0
  120. /package/{.github → .agents}/skills/wp-playground/references/cli-commands.md +0 -0
  121. /package/{.github → .agents}/skills/wp-playground/references/debugging.md +0 -0
  122. /package/{.github → .agents}/skills/wp-playground/references/e2e-playwright.md +0 -0
  123. /package/{.github → .agents}/skills/wp-plugin-development/SKILL.md +0 -0
  124. /package/{.github → .agents}/skills/wp-plugin-development/references/data-and-cron.md +0 -0
  125. /package/{.github → .agents}/skills/wp-plugin-development/references/debugging.md +0 -0
  126. /package/{.github → .agents}/skills/wp-plugin-development/references/lifecycle.md +0 -0
  127. /package/{.github → .agents}/skills/wp-plugin-development/references/security.md +0 -0
  128. /package/{.github → .agents}/skills/wp-plugin-development/references/settings-api.md +0 -0
  129. /package/{.github → .agents}/skills/wp-plugin-development/references/structure.md +0 -0
  130. /package/{.github → .agents}/skills/wp-plugin-development/scripts/detect_plugins.mjs +0 -0
  131. /package/{.github → .agents}/skills/wp-plugin-directory-guidelines/SKILL.md +0 -0
  132. /package/{.github → .agents}/skills/wp-plugin-directory-guidelines/references/gpl-compliance.md +0 -0
  133. /package/{.github → .agents}/skills/wp-plugin-directory-guidelines/references/guideline-review-checklist.md +0 -0
  134. /package/{.github → .agents}/skills/wp-plugin-directory-guidelines/references/naming-rules.md +0 -0
  135. /package/{.github → .agents}/skills/wp-project-triage/SKILL.md +0 -0
  136. /package/{.github → .agents}/skills/wp-project-triage/references/triage.schema.json +0 -0
  137. /package/{.github → .agents}/skills/wp-project-triage/scripts/detect_wp_project.mjs +0 -0
  138. /package/{.github → .agents}/skills/wp-rest-api/SKILL.md +0 -0
  139. /package/{.github → .agents}/skills/wp-rest-api/references/authentication.md +0 -0
  140. /package/{.github → .agents}/skills/wp-rest-api/references/custom-content-types.md +0 -0
  141. /package/{.github → .agents}/skills/wp-rest-api/references/discovery-and-params.md +0 -0
  142. /package/{.github → .agents}/skills/wp-rest-api/references/responses-and-fields.md +0 -0
  143. /package/{.github → .agents}/skills/wp-rest-api/references/routes-and-endpoints.md +0 -0
  144. /package/{.github → .agents}/skills/wp-rest-api/references/schema.md +0 -0
  145. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/automation.md +0 -0
  146. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/cron-and-cache.md +0 -0
  147. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/debugging.md +0 -0
  148. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/multisite.md +0 -0
  149. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/packages-and-updates.md +0 -0
  150. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/safety.md +0 -0
  151. /package/{.github → .agents}/skills/wp-wpcli-and-ops/references/search-replace.md +0 -0
  152. /package/{.github → .agents}/skills/wp-wpcli-and-ops/scripts/wpcli_inspect.mjs +0 -0
  153. /package/{.github → .agents}/skills/wpds/SKILL.md +0 -0
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env bash
2
+ # ci-gate.sh — run the full CI gate locally before pushing.
3
+ #
4
+ # Mirrors what GitHub Actions ci-gate.yml runs. Use this before any push
5
+ # to a branch that triggers a WP Engine deploy.
6
+ #
7
+ # Usage:
8
+ # bash scripts/ci-gate.sh # run both gates
9
+ # bash scripts/ci-gate.sh --php-only # PHP gate only
10
+ # bash scripts/ci-gate.sh --js-only # JS/TS gate only
11
+ #
12
+ # Exit code: 0 = all passed, 1 = at least one check failed.
13
+
14
+ set -uo pipefail
15
+ root="$(git rev-parse --show-toplevel)"
16
+ cd "$root"
17
+
18
+ PHP_ONLY=false
19
+ JS_ONLY=false
20
+ for arg in "$@"; do
21
+ [[ "$arg" == "--php-only" ]] && PHP_ONLY=true
22
+ [[ "$arg" == "--js-only" ]] && JS_ONLY=true
23
+ done
24
+
25
+ PASS=0
26
+ FAIL=0
27
+
28
+ run() {
29
+ local label="$1"; shift
30
+ echo "▶ $label"
31
+ if "$@" 2>&1; then
32
+ echo " ✓ $label"
33
+ ((PASS++))
34
+ else
35
+ echo " ✗ FAILED: $label"
36
+ ((FAIL++))
37
+ return 1
38
+ fi
39
+ }
40
+
41
+ # ── PHP gate ──────────────────────────────────────────────────────────────────
42
+ if ! $JS_ONLY; then
43
+ echo ""
44
+ echo "── PHP gate ──────────────────────────────────────────────────────────"
45
+ if command -v composer >/dev/null 2>&1 && [ -f composer.json ]; then
46
+ if [ ! -d vendor ]; then
47
+ echo "▶ composer install"
48
+ composer install --no-interaction --quiet
49
+ fi
50
+
51
+ run "php -l (all tracked PHP files)" \
52
+ bash -c 'git ls-files "*.php" | xargs -P4 php -l > /dev/null'
53
+
54
+ if [ -x vendor/bin/phpcs ]; then
55
+ run "phpcs (WordPress coding standards)" composer run phpcs
56
+ else
57
+ echo " ⚠ phpcs not found — run: composer install"
58
+ fi
59
+
60
+ if [ -x vendor/bin/phpstan ]; then
61
+ run "phpstan (static analysis)" composer run phpstan
62
+ else
63
+ echo " ⚠ phpstan not found — run: composer install"
64
+ fi
65
+ else
66
+ echo " ⚠ composer not available or no composer.json — skipping PHP gate"
67
+ fi
68
+ fi
69
+
70
+ # ── JS/TS gate ────────────────────────────────────────────────────────────────
71
+ if ! $PHP_ONLY; then
72
+ echo ""
73
+ echo "── JS/TS gate ────────────────────────────────────────────────────────"
74
+ if [ -f package.json ]; then
75
+ if [ ! -d node_modules ]; then
76
+ echo "▶ npm install"
77
+ npm install --silent
78
+ fi
79
+
80
+ if [ -x node_modules/.bin/biome ]; then
81
+ run "biome check (lint + format)" npx biome check .
82
+ else
83
+ echo " ⚠ biome not installed — run: npm install"
84
+ fi
85
+
86
+ if npm run typecheck --if-present 2>/dev/null; then
87
+ ((PASS++))
88
+ elif command -v tsc >/dev/null 2>&1 || [ -x node_modules/.bin/tsc ]; then
89
+ run "tsc --noEmit (type check)" npx tsc --noEmit
90
+ fi
91
+
92
+ if npm run test --if-present 2>/dev/null; then
93
+ ((PASS++))
94
+ fi
95
+
96
+ if npm run build --if-present 2>/dev/null; then
97
+ ((PASS++))
98
+ fi
99
+ else
100
+ echo " ⚠ No package.json — skipping JS/TS gate"
101
+ fi
102
+ fi
103
+
104
+ # ── Summary ───────────────────────────────────────────────────────────────────
105
+ echo ""
106
+ echo "── CI Gate Result ────────────────────────────────────────────────────"
107
+ echo " Passed : $PASS"
108
+ echo " Failed : $FAIL"
109
+ echo ""
110
+
111
+ if [[ "$FAIL" -eq 0 ]]; then
112
+ echo "✅ Gate green — safe to push."
113
+ exit 0
114
+ else
115
+ echo "❌ Gate failed — fix the issues above before pushing."
116
+ echo " --no-verify is not a valid workaround; CI will catch the same failures."
117
+ exit 1
118
+ fi
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env bash
2
+ # wpe-check.sh — verify SSH connectivity to all configured WP Engine environments.
3
+ #
4
+ # Reads installs from wp-cli.yml @aliases (ssh: field) or from WPE_INSTALLS env var.
5
+ # Useful after first-time machine setup or when debugging SSH issues.
6
+ #
7
+ # Usage:
8
+ # bash scripts/wpe-check.sh
9
+ # WPE_INSTALLS="mysite mysitestg mysitedev" bash scripts/wpe-check.sh
10
+ #
11
+ # Exit code: 0 = all connected, 1 = at least one failed.
12
+
13
+ set -uo pipefail
14
+ root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
15
+ cd "$root"
16
+
17
+ SSH_OPTS="-o BatchMode=yes -o ConnectTimeout=8 -o StrictHostKeyChecking=accept-new"
18
+
19
+ # ── Discover installs from wp-cli.yml @aliases ────────────────────────────────
20
+ declare -A ALIAS_MAP # install → alias label
21
+ CURRENT_ALIAS=""
22
+
23
+ if [ -f wp-cli.yml ]; then
24
+ while IFS= read -r line; do
25
+ if [[ "$line" =~ ^@([a-zA-Z0-9_-]+): ]]; then
26
+ CURRENT_ALIAS="${BASH_REMATCH[1]}"
27
+ elif [[ "$line" =~ ^[[:space:]]+ssh:[[:space:]]+([^@[:space:]]+)@[^[:space:]]+ && -n "$CURRENT_ALIAS" ]]; then
28
+ INSTALL="${BASH_REMATCH[1]}"
29
+ ALIAS_MAP["$INSTALL"]="@${CURRENT_ALIAS}"
30
+ CURRENT_ALIAS=""
31
+ fi
32
+ done < wp-cli.yml
33
+ fi
34
+
35
+ # Fallback: WPE_INSTALLS env var
36
+ if [ "${#ALIAS_MAP[@]}" -eq 0 ] && [ -n "${WPE_INSTALLS:-}" ]; then
37
+ for slug in $WPE_INSTALLS; do
38
+ ALIAS_MAP["$slug"]="$slug"
39
+ done
40
+ fi
41
+
42
+ if [ "${#ALIAS_MAP[@]}" -eq 0 ]; then
43
+ echo "No WP Engine installs found."
44
+ echo ""
45
+ echo "Options:"
46
+ echo " 1. Add @aliases with 'ssh: <install>@<install>.ssh.wpengine.net' to wp-cli.yml"
47
+ echo " 2. Set WPE_INSTALLS='slug1 slug2 slug3' environment variable"
48
+ exit 1
49
+ fi
50
+
51
+ echo ""
52
+ echo "── WP Engine SSH connectivity ────────────────────────────────────────"
53
+ printf " %-25s %-15s %-12s %s\n" "Install" "Alias" "Status" "WP version"
54
+ echo " ─────────────────────────────────────────────────────────────────"
55
+
56
+ PASS=0
57
+ FAIL=0
58
+
59
+ for INSTALL in "${!ALIAS_MAP[@]}"; do
60
+ ALIAS="${ALIAS_MAP[$INSTALL]}"
61
+ SSH_HOST="${INSTALL}.ssh.wpengine.net"
62
+
63
+ WP_VERSION=$(ssh $SSH_OPTS "${INSTALL}@${SSH_HOST}" \
64
+ wp core version --skip-plugins --skip-themes 2>/dev/null || echo "")
65
+
66
+ if [ -n "$WP_VERSION" ]; then
67
+ printf " %-25s %-15s %-12s %s\n" "$INSTALL" "$ALIAS" "✓ connected" "$WP_VERSION"
68
+ ((PASS++))
69
+ else
70
+ printf " %-25s %-15s %-12s %s\n" "$INSTALL" "$ALIAS" "✗ FAILED" "—"
71
+ ((FAIL++))
72
+ fi
73
+ done
74
+
75
+ echo ""
76
+ echo " $PASS connected | $FAIL failed"
77
+
78
+ if [[ "$FAIL" -gt 0 ]]; then
79
+ echo ""
80
+ echo "Troubleshooting:"
81
+ echo " • Confirm key exists: ls -la ~/.ssh/wpengine_ed25519"
82
+ echo " • Confirm permissions: chmod 600 ~/.ssh/wpengine_ed25519"
83
+ echo " • Trust the host: ssh-keyscan -H ssh.wpengine.net >> ~/.ssh/known_hosts"
84
+ echo " • Check portal: https://my.wpengine.com/ssh_keys"
85
+ echo " • Verify git access: ssh git@git.wpengine.com info"
86
+ fi
87
+
88
+ echo ""
89
+ [[ "$FAIL" -eq 0 ]] && exit 0 || exit 1
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env bash
2
+ # wpe-preflight.sh — pre-deploy sanity checks for a WP Engine environment.
3
+ #
4
+ # Verifies SSH access, WP-CLI, site URL consistency, HTTP health, and
5
+ # active plugin count before any deploy touches production or staging.
6
+ #
7
+ # Usage:
8
+ # INSTALL=mysite bash scripts/wpe-preflight.sh [staging|production]
9
+ # WPE_INSTALL=mysite bash scripts/wpe-preflight.sh production
10
+ #
11
+ # Exit code: 0 = all checks passed (safe to deploy), 1 = at least one failed.
12
+
13
+ set -uo pipefail
14
+
15
+ ENV="${1:-production}"
16
+ INSTALL="${WPE_INSTALL:-${INSTALL:-}}"
17
+
18
+ if [ -z "$INSTALL" ]; then
19
+ echo "❌ Usage: INSTALL=<slug> bash scripts/wpe-preflight.sh [staging|production]"
20
+ echo " The install slug is the WP Engine environment name (e.g., 'mysite', 'mysitestg')."
21
+ exit 1
22
+ fi
23
+
24
+ SSH_HOST="${INSTALL}.ssh.wpengine.net"
25
+ SSH_OPTS="-o BatchMode=yes -o ConnectTimeout=15 -o StrictHostKeyChecking=accept-new"
26
+ WP="ssh $SSH_OPTS ${INSTALL}@${SSH_HOST} wp"
27
+
28
+ PASS=0
29
+ FAIL=0
30
+
31
+ check() {
32
+ local label="$1"; shift
33
+ printf " %-50s" "$label"
34
+ local output
35
+ if output=$("$@" 2>&1); then
36
+ echo "✓ $output"
37
+ ((PASS++))
38
+ else
39
+ echo "✗ FAILED"
40
+ echo " $output" >&2
41
+ ((FAIL++))
42
+ fi
43
+ }
44
+
45
+ echo ""
46
+ echo "── WP Engine preflight: ${INSTALL} (${ENV}) ─────────────────────"
47
+ echo ""
48
+
49
+ # ── SSH ───────────────────────────────────────────────────────────────────────
50
+ echo "SSH"
51
+ check "SSH gateway reachable" \
52
+ ssh $SSH_OPTS "${INSTALL}@${SSH_HOST}" echo "connected"
53
+
54
+ check "WP-CLI available" \
55
+ $WP --info --skip-plugins --skip-themes
56
+
57
+ # ── WordPress ─────────────────────────────────────────────────────────────────
58
+ echo ""
59
+ echo "WordPress"
60
+ check "WP core version" \
61
+ $WP core version --skip-plugins --skip-themes
62
+
63
+ check "siteurl option readable" \
64
+ $WP option get siteurl --skip-plugins --skip-themes
65
+
66
+ check "Active plugins present (count > 0)" \
67
+ bash -c "COUNT=\$(${WP} plugin list --status=active --format=count --skip-plugins --skip-themes 2>&1); echo \"\$COUNT active\"; [[ \"\$COUNT\" -gt 0 ]]"
68
+
69
+ check "No pending DB upgrades" \
70
+ $WP core update-db --dry-run --skip-plugins --skip-themes
71
+
72
+ # ── HTTP health ───────────────────────────────────────────────────────────────
73
+ echo ""
74
+ echo "HTTP health"
75
+ SITE_URL=$(ssh $SSH_OPTS "${INSTALL}@${SSH_HOST}" \
76
+ wp option get home --skip-plugins --skip-themes 2>/dev/null || echo "")
77
+
78
+ if [ -n "$SITE_URL" ]; then
79
+ check "Homepage returns 2xx/3xx" \
80
+ bash -c "STATUS=\$(curl -s -o /dev/null -w '%{http_code}' -L --max-time 15 '${SITE_URL}'); echo \"HTTP \$STATUS\"; [[ \"\$STATUS\" -ge 200 && \"\$STATUS\" -lt 400 ]]"
81
+
82
+ check "No PHP errors in homepage body" \
83
+ bash -c "BODY=\$(curl -sL --max-time 15 '${SITE_URL}'); echo \"\${#BODY} chars\"; ! echo \"\$BODY\" | grep -qi 'fatal error\|parse error\|warning: '"
84
+
85
+ check "wp-json REST API responds" \
86
+ bash -c "STATUS=\$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 '${SITE_URL}/wp-json/wp/v2/'); echo \"HTTP \$STATUS\"; [[ \"\$STATUS\" -ge 200 && \"\$STATUS\" -lt 400 ]]"
87
+ else
88
+ echo " ⚠ Could not retrieve site URL — skipping HTTP checks"
89
+ fi
90
+
91
+ # ── Result ────────────────────────────────────────────────────────────────────
92
+ echo ""
93
+ echo "── Preflight result ──────────────────────────────────────────────────"
94
+ echo " Passed : $PASS"
95
+ echo " Failed : $FAIL"
96
+ echo ""
97
+
98
+ if [[ "$FAIL" -eq 0 ]]; then
99
+ echo "✅ All checks passed — safe to deploy to ${ENV}."
100
+ exit 0
101
+ else
102
+ echo "❌ Preflight failed — resolve the issues above before deploying to ${ENV}."
103
+ exit 1
104
+ fi
@@ -14,8 +14,7 @@ When a task is assigned, you must retrieve information in this sequence:
14
14
 
15
15
  1. **Local Project Instructions**: Read `.github/instructions/wordpress-workflow.instructions.md` to understand the specific prefix, folder structure, and dev workflow for this repo.
16
16
 
17
- 2. **Agent Skills**: Consult the `.github/skills/` directory.
18
-
17
+ 2. **Agent Skills**: Consult the `.agents/skills/` directory.
19
18
  - Reference `wp-project-triage` to confirm if you are in a Plugin or Theme context.
20
19
  - Reference `wp-block-development` for any Gutenberg/React tasks.
21
20
  - Reference `wp-playground` to provide testable blueprints for your code.
@@ -1,2 +1,2 @@
1
1
  @workspace /AGENTS.md
2
- @workspace / .github/instructions/wordpress-workflow.instructions.md
2
+ @workspace / .github/instructions/wordpress-workflow.instructions.md
@@ -1,10 +1,10 @@
1
1
  \# WordPress Agent Skills Workflow
2
2
 
3
- This repo uses a local, filesystem-based set of WordPress agent skills under `.github/skills/`. Follow these procedures for every interaction.
3
+ This repo uses a local, filesystem-based set of WordPress agent skills under `.agents/skills/`. Follow these procedures for every interaction.
4
4
 
5
5
  \## 1. Skill Discovery & Activation
6
6
 
7
- \- \*\*Always start by scanning \`.github/skills/\`\*\* to see which specialized modules are active.
7
+ \- \*\*Always start by scanning \`.agents/skills/\`\*\* to see which specialized modules are active.
8
8
 
9
9
  \- If the user asks for a Block, explicitly activate the \`wp-block-development\` skill.
10
10
 
@@ -38,4 +38,4 @@ Before finalizing a response:
38
38
 
39
39
  2\. Check if a [WordPress.org Plugin Handbook]\(https://developer.wordpress.org) rule supersedes a generic community pattern.
40
40
 
41
- 3\. State which skill was used (e.g., \*"Applied patterns from wp-block-development"\*).
41
+ 3\. State which skill was used (e.g., \*"Applied patterns from wp-block-development"\*).
package/AGENTS.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Project: WordPress Agent Kit (CLI)
2
2
 
3
- This is a Node.js CLI tool (`wp-agent-kit`) designed to scaffold AI agent configuration for WordPress projects. It helps developers quickly set up `AGENTS.md` and `.github` skills/instructions in their repositories.
3
+ This is a Node.js CLI tool (`wp-agent-kit`) designed to scaffold AI agent configuration for WordPress projects. It helps developers quickly set up `AGENTS.md` and `.agents/skills/` in their repositories.
4
4
 
5
5
  ## Tech Stack
6
+
6
7
  - **Language**: TypeScript (Node.js)
7
8
  - **Framework**: Commander.js
8
9
  - **Prompting**: `@clack/prompts`
@@ -11,20 +12,24 @@ This is a Node.js CLI tool (`wp-agent-kit`) designed to scaffold AI agent config
11
12
  - **Lint/Format**: Biome + ESLint
12
13
 
13
14
  ## Architecture
15
+
14
16
  - **Entry Point**: `src/cli.ts`
15
17
  - **Commands**: `src/commands/*.ts` (e.g., `install`, `setup`, `sync-skills`, `playground`, `upgrade`)
16
18
  - **Core Logic**: `src/lib/*.ts` (e.g., `installer.ts` for file copying, `triage-mapper.ts` for project detection, `api.ts` for programmatic API)
17
19
  - **Utilities**: `src/utils/*.ts` (e.g., `paths.ts`, `run.ts`, `output.ts`, `exit-codes.ts`)
18
- - **Assets**:
20
+ - **Assets**:
19
21
  - `AGENTS.template.md`: The template file copied to user projects.
20
- - `.github/`: The source of skills (14 WordPress skills), instructions, agents, and prompts copied to user projects.
21
- - `vendor/wp-agent-skills/`: Submodule containing upstream skills.
22
+ - `.github/`: Platform-specific agents, instructions, and prompts (copied to target platform dir).
23
+ - `.agents/skills/`: Universal skills directory (AgentSkills.io convention), copied to target `.agents/skills/`.
24
+ - `skills-custom/`: Custom skills that survive upstream syncs, merged into `.agents/skills/` on install.
22
25
 
23
26
  ## Package Exports
27
+
24
28
  - `wordpress-agent-kit` → CLI entry (`dist/cli.js`)
25
29
  - `wordpress-agent-kit/api` → Programmatic API (`dist/lib/api.js`)
26
30
 
27
31
  ## Development Workflow
32
+
28
33
  - **Run locally**: `npm run dev` (uses `tsx src/cli.ts`)
29
34
  - **Build**: `npm run build` (outputs to `dist/`)
30
35
  - **TypeCheck**: `npm run check` (no-emit type checking)
@@ -34,29 +39,36 @@ This is a Node.js CLI tool (`wp-agent-kit`) designed to scaffold AI agent config
34
39
  - **Pre-commit**: Husky runs lint:check + test:run
35
40
 
36
41
  ## Key Commands
37
- - `install`: Copies `.github` and `AGENTS.md` template to a target directory. Supports `--json`, `--dry-run`, `--ndjson`.
42
+
43
+ - `install`: Copies `.agents/skills/` (universal convention), platform agents/instructions, and `AGENTS.md` template to a target directory. Supports `--json`, `--dry-run`, `--ndjson`. Merges custom skills from `skills-custom/`.
38
44
  - `setup`: Interactive wizard that detects project type and configures the kit. Supports `--auto`, `--project-type`, `--tech-stack`, `--yes`.
39
- - `sync-skills`: Pulls skills from `WordPress/agent-skills` into `.github/skills`. Supports `--json`, `--dry-run`.
45
+ - `sync-skills`: Pulls skills from `WordPress/agent-skills` into `.agents/skills/` (canonical, AgentSkills.io convention), merging custom skills from `skills-custom/`. Supports `--json`, `--dry-run`.
46
+ - `clean-skills`: Detects and removes orphaned skills that are no longer part of the kit. Supports `--dry-run`, `--remove`, `--json`.
40
47
  - `playground`: Launches a local WordPress Playground instance using a blueprint.
41
48
  - `upgrade`: Checks for and applies newer versions. Supports `--check-only`, `--force`, `--json`.
42
49
 
43
50
  ## Agent-Friendly Features (v0.3.0+)
51
+
44
52
  - `--json`: Structured JSON output with success/data/error/time fields
45
53
  - `--dry-run`: Preview mode showing what would happen without making changes
46
54
  - `--ndjson`: Newline-delimited JSON for streaming long operations
47
55
  - `--quiet`: Suppress non-essential output
48
56
  - **Semantic exit codes**: 0=OK, 2=Invalid Args, 3=Not Found, 4=Permission Denied, 5=Already Exists, 6=Git Error, 7=Network Error, 8=Validation Error, 130=Cancelled
49
- - **Programmatic API**: `import { installKitApi, syncSkillsApi, runTriageApi, configureAgentsMdApi } from 'wordpress-agent-kit/api'`
57
+ - **Programmatic API**: `import { installKitApi, syncSkillsApi, runTriageApi, configureAgentsMdApi, cleanSkillsApi } from 'wordpress-agent-kit/api'`
50
58
 
51
59
  ## Notes for Agents
60
+
52
61
  - When modifying commands, ensure you update the corresponding JSDoc comments.
53
62
  - The `src/lib/installer.ts` file is critical as it handles the file copying logic.
54
63
  - The `src/lib/triage-mapper.ts` file contains logic for mapping project detection results to configuration options.
55
64
  - The `src/lib/api.ts` file exposes the programmatic API — all changes to command logic should flow through to the API.
56
- - The `vendor` directory is gitignored and populated via submodule or script.
57
- - The `.github/skills/` directory contains 14 WordPress skills following the AgentSkills.io spec.
65
+ - The `vendor` directory is gitignored and populated via submodule or script. Upstream skills sync to `.github/skills/` (sync buffer) then copy to `.agents/skills/` (canonical).
66
+ - The `.agents/skills/` directory contains 18 WordPress skills (17 upstream + 1 custom `wp-wpengine`) following the AgentSkills.io spec. Skills are installed to `.agents/skills/` (universal convention) instead of platform-specific directories.
58
67
  - CI runs on every push: lint, typecheck, test, build. No publish workflow (manual npm publish only).
59
68
 
60
69
  ## Pi Extension (Package)
70
+
61
71
  - `pi.extensions`: `./extensions/wp-agent-kit` — registers WordPress agent tools
62
- - `pi.skills`: `./.github/skills` — 14 WordPress skills discoverable by Pi
72
+ - `pi.skills`: `./.agents/skills` — 18 WordPress skills discoverable by Pi (17 upstream + `wp-wpengine` custom from `skills-custom/`). Uses AgentSkills.io convention.
73
+ - Tools: `wp_triage`, `wp_install_kit`, `wp_sync_skills`, `wp_upgrade`, `wp_clean_skills`
74
+ - Commands: `/wp-triage`, `/wp-install`, `/wp-sync-skills`, `/wp-upgrade`, `/wp-clean-skills`
@@ -6,23 +6,33 @@ This repository is WordPress-centric (plugin, theme, block theme, or site). Agen
6
6
 
7
7
  - **Core Agent**: `.github/agents/wp-architect.agent.md` — the primary agent persona
8
8
  - **Workflow Instructions**: `.github/instructions/wordpress-workflow.instructions.md` — project-specific conventions
9
- - **Skills**: `.github/skills/` — specialized agent skills for WordPress development
9
+ - **Skills**: `.agents/skills/` — specialized agent skills for WordPress development
10
10
 
11
11
  ## Project Discovery (Required Before Changes)
12
12
 
13
13
  1. **Run project triage** to classify the codebase:
14
+
14
15
  ```bash
15
- node .github/skills/wp-project-triage/scripts/detect_wp_project.mjs
16
+ node .agents/skills/wp-project-triage/scripts/detect_wp_project.mjs
16
17
  ```
18
+
17
19
  This outputs a JSON report with project kind, signals, and tooling.
18
20
 
19
21
  2. **Route to the right skill**:
20
- - If routing is unclear, consult `.github/skills/wordpress-router/references/decision-tree.md`
22
+ - If routing is unclear, consult `.agents/skills/wordpress-router/references/decision-tree.md`
21
23
  - For plugins: `wp-plugin-development`
22
24
  - For block themes: `wp-block-themes`
23
25
  - For Gutenberg blocks: `wp-block-development`
24
26
  - For REST API work: `wp-rest-api`
27
+ - For Interactivity API: `wp-interactivity-api`
28
+ - For Abilities API: `wp-abilities-api` / `wp-abilities-audit` / `wp-abilities-verify`
25
29
  - For WP-CLI operations: `wp-wpcli-and-ops`
30
+ - For Playground testing (PHPUnit, E2E, CI): `wp-playground`
31
+ - For Performance profiling: `wp-performance`
32
+ - For PHPStan static analysis: `wp-phpstan`
33
+ - For WP Engine hosting: `wp-wpengine` (optional, requires env vars)
34
+ - For Design System components: `wpds`
35
+ - For plugin directory submission: `wp-plugin-directory-guidelines`
26
36
 
27
37
  3. **Update repo-specific guidance** based on triage results:
28
38
  - Confirm the project prefix (functions, classes, constants)
@@ -43,13 +53,13 @@ This repository is WordPress-centric (plugin, theme, block theme, or site). Agen
43
53
 
44
54
  <!-- Populated by project triage — do not remove -->
45
55
 
46
- | Purpose | Command |
47
- |---------|---------|
48
- | Build | <!-- e.g., npm run build --> |
49
- | Lint (PHP) | <!-- e.g., composer lint --> |
50
- | Lint (JS/CSS) | <!-- e.g., npm run lint --> |
51
- | Test | <!-- e.g., npm test, composer test --> |
52
- | Dev server | <!-- e.g., npm start --> |
56
+ | Purpose | Command |
57
+ | ------------- | -------------------------------------- |
58
+ | Build | <!-- e.g., npm run build --> |
59
+ | Lint (PHP) | <!-- e.g., composer lint --> |
60
+ | Lint (JS/CSS) | <!-- e.g., npm run lint --> |
61
+ | Test | <!-- e.g., npm test, composer test --> |
62
+ | Dev server | <!-- e.g., npm start --> |
53
63
 
54
64
  ## Code Conventions
55
65