wordpress-agent-kit 0.2.2 → 0.3.2
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.
- package/.github/agents/wp-architect.agent.md +1 -0
- package/.github/skills/blueprint/SKILL.md +418 -0
- package/.github/skills/wordpress-router/SKILL.md +1 -0
- package/.github/skills/wp-abilities-api/SKILL.md +13 -0
- package/.github/skills/wp-abilities-api/references/delegate-helper-pattern.md +241 -0
- package/.github/skills/wp-abilities-api/references/domain-vs-projection.md +113 -0
- package/.github/skills/wp-abilities-api/references/error-code-vocabulary.md +123 -0
- package/.github/skills/wp-abilities-api/references/grouping-heuristic.md +89 -0
- package/.github/skills/wp-abilities-api/references/input-schema-gotchas.md +265 -0
- package/.github/skills/wp-abilities-api/references/php-registration.md +47 -20
- package/.github/skills/wp-abilities-api/references/plugin-family-patterns.md +233 -0
- package/.github/skills/wp-abilities-api/references/shared-core-service.md +184 -0
- package/.github/skills/wp-abilities-audit/SKILL.md +199 -0
- package/.github/skills/wp-abilities-audit/references/audit-schema.md +300 -0
- package/.github/skills/wp-abilities-audit/references/capability-gate-tracing.md +197 -0
- package/.github/skills/wp-abilities-audit/references/controller-enumeration.md +116 -0
- package/.github/skills/wp-abilities-verify/SKILL.md +215 -0
- package/.github/skills/wp-abilities-verify/references/annotation-correctness.md +154 -0
- package/.github/skills/wp-abilities-verify/references/audit-schema-validation.md +131 -0
- package/.github/skills/wp-abilities-verify/references/permission-roundtrip.md +190 -0
- package/.github/skills/wp-abilities-verify/references/runtime-harness.md +462 -0
- package/.github/skills/wp-abilities-verify/references/schema-lints.md +118 -0
- package/.github/skills/wp-abilities-verify/references/static-enumeration.md +126 -0
- package/.github/skills/wp-block-development/SKILL.md +1 -0
- package/.github/skills/wp-block-themes/SKILL.md +1 -0
- package/.github/skills/wp-interactivity-api/SKILL.md +1 -0
- package/.github/skills/wp-performance/SKILL.md +1 -0
- package/.github/skills/wp-phpstan/SKILL.md +1 -0
- package/.github/skills/wp-playground/SKILL.md +1 -0
- package/.github/skills/wp-plugin-development/SKILL.md +1 -0
- package/.github/skills/wp-plugin-directory-guidelines/SKILL.md +133 -0
- package/.github/skills/wp-plugin-directory-guidelines/references/gpl-compliance.md +217 -0
- package/.github/skills/wp-plugin-directory-guidelines/references/guideline-review-checklist.md +592 -0
- package/.github/skills/wp-plugin-directory-guidelines/references/naming-rules.md +121 -0
- package/.github/skills/wp-project-triage/SKILL.md +1 -0
- package/.github/skills/wp-project-triage/scripts/detect_wp_project.mjs +22 -4
- package/.github/skills/wp-rest-api/SKILL.md +1 -0
- package/.github/skills/wp-wpcli-and-ops/SKILL.md +1 -0
- package/.github/skills/wpds/SKILL.md +1 -0
- package/AGENTS.md +33 -10
- package/AGENTS.template.md +63 -18
- package/README.md +226 -124
- package/biome.json +1 -1
- package/dist/commands/install.js +47 -6
- package/dist/commands/upgrade.js +34 -5
- package/dist/lib/api.js +93 -27
- package/dist/lib/installer.js +113 -7
- package/dist/lib/updater.js +260 -0
- package/extensions/wp-agent-kit/index.ts +452 -0
- package/package.json +21 -3
- package/kit-learnings.md +0 -192
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
## Plugin Naming Rules (Guideline 17 + Plugin Check Namer)
|
|
2
|
+
|
|
3
|
+
Sources: [Plugin Header Requirements](https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields) · [Detailed Plugin Guidelines §17](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/) · Plugin Check `Plugin_Header_Fields_Check`, `Trademarks_Check`, and AI Namer prompts.
|
|
4
|
+
|
|
5
|
+
### Technical Name Requirements
|
|
6
|
+
|
|
7
|
+
| Rule | Details | Error Code |
|
|
8
|
+
|------|---------|------------|
|
|
9
|
+
| Must not use placeholder names | `"Plugin Name"` or `"My Basics Plugin"` are rejected | `plugin_header_invalid_plugin_name` |
|
|
10
|
+
| Minimum 5 alphanumeric characters | Name must contain at least 5 latin letters (a–Z) or digits | `plugin_header_unsupported_plugin_name` (new plugins only) |
|
|
11
|
+
| Name must exist in readme | `=== Plugin Name ===` header required and must be valid | `invalid_plugin_name` / `empty_plugin_name` |
|
|
12
|
+
| Name must match across files | Readme and plugin header name must match (case/entity-decoded) | `mismatched_plugin_name` (warning) |
|
|
13
|
+
|
|
14
|
+
**Slug rules:** lowercase, hyphens only, max 50 characters, derived from display name.
|
|
15
|
+
|
|
16
|
+
### Naming Quality Rules (AI Namer)
|
|
17
|
+
|
|
18
|
+
**1. No generic names**
|
|
19
|
+
Names must be specific enough to distinguish the plugin from ~60,000 others.
|
|
20
|
+
- Rejected: "Shipping", "Ecommerce Tracker", "SEO Plugin"
|
|
21
|
+
- Accepted: "ShipGlex Shipping", "Shipping Tracker for UPS"
|
|
22
|
+
- Exception: invented/original terms are allowed if placed at the **beginning** of the name
|
|
23
|
+
|
|
24
|
+
**2. Name must relate to plugin function**
|
|
25
|
+
The display name must correlate with what the plugin actually does. Exception: original invented terms.
|
|
26
|
+
|
|
27
|
+
**3. No keyword stuffing**
|
|
28
|
+
Unnaturally repeating keywords in the name for SEO purposes is not allowed.
|
|
29
|
+
|
|
30
|
+
**4. No names too similar to existing plugins**
|
|
31
|
+
Checked against the WordPress.org Plugin Directory. If similar, suggest a distinctive term (author name, brand, or crafted term) at the beginning.
|
|
32
|
+
|
|
33
|
+
**5. Trademark/project name usage rules**
|
|
34
|
+
Trademarks and project names are allowed **only** after connectors like `for`, `with`, `using`, or `and`:
|
|
35
|
+
- ✅ `"My Plugin for WooCommerce"` — trademark after "for", no affiliation implied
|
|
36
|
+
- ✅ `"Pricing Rates for WooCommerce"` — OK
|
|
37
|
+
- ❌ `"WooCommerce Pricing Rates"` — starts with trademark, implies affiliation
|
|
38
|
+
- ❌ `"Nicedev Paypal for WooCommerce"` — PayPal is not after a no-affiliation structure; correct form: `"Nicedev Payment Gateway with PayPal for WooCommerce"`
|
|
39
|
+
- ❌ `"PricingPress"` — portmanteau using `-Press` (WordPress trademark)
|
|
40
|
+
- Check for portmanteaus: names blending a trademark (e.g., `-Press`, `Woo-`) are not allowed
|
|
41
|
+
|
|
42
|
+
**6. Banned and discouraged terms**
|
|
43
|
+
|
|
44
|
+
Banned/discouraged terms cannot appear **anywhere** in the name — not even after `for`/`with`.
|
|
45
|
+
|
|
46
|
+
#### Banned Terms (hard block)
|
|
47
|
+
|
|
48
|
+
| Term | Reason |
|
|
49
|
+
|------|--------|
|
|
50
|
+
| Facebook, FB, fbook, Whatsapp, WA, Instagram, Insta, Gram, INS, Threads, Oculus | Meta legal request: no use in name, slug, or banners |
|
|
51
|
+
| WordPress, wordpess, wpress | WordPress trademark; redundant in the WP.org directory |
|
|
52
|
+
| WP (as standalone/redundant, e.g., "for WP") | Same as WordPress — redundant in context |
|
|
53
|
+
| Trustpilot | Direct request from trademark holder |
|
|
54
|
+
| Binance Pay | Direct request from trademark holder |
|
|
55
|
+
|
|
56
|
+
#### Discouraged Terms (must be removed)
|
|
57
|
+
|
|
58
|
+
| Term | Reason |
|
|
59
|
+
|------|--------|
|
|
60
|
+
| plugin (when redundant, e.g., "SEO Plugin") | Redundant; forbidden as first word |
|
|
61
|
+
| best, #1, First, Perfect, The most | Superlatives / unverifiable comparative claims |
|
|
62
|
+
| free (when redundant, e.g., "(free)") | All directory plugins are free — redundant |
|
|
63
|
+
| WP, W P (at beginning or end, referring to WordPress) | WordPress abbreviation — redundant |
|
|
64
|
+
| Gutenberg, gberg, guten, berg | Creates confusion; block editor is the current name |
|
|
65
|
+
|
|
66
|
+
### Trademark Slug List (static check — `Trademarks_Check`)
|
|
67
|
+
|
|
68
|
+
The following slugs are statically blocked. Terms ending in `-` cannot **begin** a slug; terms without `-` cannot appear **anywhere** in the slug. `woocommerce` (no dash) is allowed only as `for-woocommerce`, `with-woocommerce`, `using-woocommerce`, or `and-woocommerce`.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
adobe-, adsense-, advanced-custom-fields-, adwords-, akismet-,
|
|
72
|
+
all-in-one-wp-migration, amazon-, android-, apple-, applenews-, applepay-,
|
|
73
|
+
aws-, azon-, bbpress-, bing-, booking-com, bootstrap-, buddypress-,
|
|
74
|
+
chatgpt-, chat-gpt-, cloudflare-, contact-form-7-, cpanel-, disqus-, divi-,
|
|
75
|
+
dropbox-, easy-digital-downloads-, elementor-, envato-,
|
|
76
|
+
fbook, facebook, fb-, fb-messenger, fedex-, feedburner, firefox-,
|
|
77
|
+
fontawesome-, font-awesome-, ganalytics-, gberg, github-, givewp-, google-,
|
|
78
|
+
googlebot-, googles-, gravity-form-, gravity-forms-, gravityforms-, gtmetrix-,
|
|
79
|
+
gutenberg, guten-, hubspot-, ig-, insta-, instagram, internet-explorer-,
|
|
80
|
+
ios-, jetpack-, macintosh-, macos-, mailchimp-, microsoft-,
|
|
81
|
+
ninja-forms-, oculus, onlyfans-, only-fans-, opera-, paddle-, paypal-,
|
|
82
|
+
pinterest-, plugin, skype-, stripe-, tiktok-, tik-tok-, trustpilot,
|
|
83
|
+
twitch-, twitter-, tweet, ups-, usps-, vvhatsapp, vvcommerce, vva-, vvoo,
|
|
84
|
+
wa-, webpush-vn, wh4tsapps, whatsapp, whats-app, watson, windows-,
|
|
85
|
+
wocommerce, woocom-, woocommerce, woocomerce, woo-commerce, woo-, wo-,
|
|
86
|
+
wordpress, wordpess, wpress, wp, wc, wp-mail-smtp-, yandex-, yahoo-,
|
|
87
|
+
yoast, youtube-, you-tube-
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Portmanteaus also blocked:** any slug starting with `woo` (case-insensitive) — e.g., `woopress`, `wooland`.
|
|
91
|
+
|
|
92
|
+
### Naming Examples
|
|
93
|
+
|
|
94
|
+
| Plugin Name | Verdict | Reason |
|
|
95
|
+
|-------------|---------|--------|
|
|
96
|
+
| `Shipping` | ❌ | Too generic |
|
|
97
|
+
| `Ecommerce Tracker` | ❌ | Too generic, no context |
|
|
98
|
+
| `Shipping Tracker for UPS` | ✅ | Descriptive + context |
|
|
99
|
+
| `ShipGlex Shipping` | ✅ | Invented term at beginning |
|
|
100
|
+
| `WooCommerce Pricing Rates` | ❌ | Starts with trademark |
|
|
101
|
+
| `Pricing Rates for WooCommerce` | ✅ | Trademark after "for" |
|
|
102
|
+
| `PricingPress` | ❌ | `-Press` portmanteau |
|
|
103
|
+
| `PRT Text editor for WP` | ❌ | WP is banned/redundant; correct: `PRT Text editor` |
|
|
104
|
+
| `Nicedev Paypal for WooCommerce` | ❌ | PayPal not after no-affiliation structure |
|
|
105
|
+
| `Nicedev Payment Gateway with PayPal for WooCommerce` | ✅ | Correct structure |
|
|
106
|
+
| `Best SEO Plugin for WordPress` | ❌ | Superlative + banned terms |
|
|
107
|
+
| `My Free Slider` | ❌ | "free" is redundant/discouraged |
|
|
108
|
+
|
|
109
|
+
### Naming Review Checklist (pre-submission)
|
|
110
|
+
|
|
111
|
+
- [ ] Name is not a placeholder (`Plugin Name`, `My Basics Plugin`)
|
|
112
|
+
- [ ] Name has at least 5 alphanumeric characters
|
|
113
|
+
- [ ] Name matches between plugin header and readme
|
|
114
|
+
- [ ] Name is specific — not too generic for 60,000+ plugins
|
|
115
|
+
- [ ] Name relates to what the plugin actually does
|
|
116
|
+
- [ ] No keyword stuffing
|
|
117
|
+
- [ ] No banned terms anywhere (Meta brands, WordPress/WP redundant, Trustpilot, Binance Pay)
|
|
118
|
+
- [ ] No discouraged terms (Plugin, Best/#1, Free, Gutenberg, standalone WP)
|
|
119
|
+
- [ ] Trademarks/project names only appear after `for`/`with`/`using`/`and`
|
|
120
|
+
- [ ] No portmanteaus using WordPress or WooCommerce trademarks
|
|
121
|
+
- [ ] Slug is lowercase, hyphens only, max 50 chars, no blocked terms
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wp-project-triage
|
|
3
3
|
description: "Use when you need a deterministic inspection of a WordPress repository (plugin/theme/block theme/WP core/Gutenberg/full site) including tooling/tests/version hints, and a structured JSON report to guide workflows and guardrails."
|
|
4
|
+
license: GPL-2.0-or-later
|
|
4
5
|
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -124,7 +124,8 @@ function findFilesRecursive(repoRoot, predicate, { maxFiles = 6000, maxDepth = 8
|
|
|
124
124
|
function detectPluginHeaderFromPhpFile(filePath) {
|
|
125
125
|
const contents = readFileSafe(filePath, 128 * 1024);
|
|
126
126
|
if (!contents) return null;
|
|
127
|
-
|
|
127
|
+
// Allow leading whitespace and asterisks common in block comments
|
|
128
|
+
const headerMatch = contents.match(/^[ \\t*]*Plugin Name:\s*(.+)\s*$/im);
|
|
128
129
|
if (!headerMatch) return null;
|
|
129
130
|
return headerMatch[1].trim();
|
|
130
131
|
}
|
|
@@ -132,7 +133,8 @@ function detectPluginHeaderFromPhpFile(filePath) {
|
|
|
132
133
|
function detectThemeHeaderFromStyleCss(filePath) {
|
|
133
134
|
const contents = readFileSafe(filePath, 128 * 1024);
|
|
134
135
|
if (!contents) return null;
|
|
135
|
-
|
|
136
|
+
// Allow leading whitespace and asterisks common in block comments
|
|
137
|
+
const headerMatch = contents.match(/^[ \\t*]*Theme Name:\s*(.+)\s*$/im);
|
|
136
138
|
if (!headerMatch) return null;
|
|
137
139
|
return headerMatch[1].trim();
|
|
138
140
|
}
|
|
@@ -397,6 +399,13 @@ function main() {
|
|
|
397
399
|
maxDepth: 8,
|
|
398
400
|
});
|
|
399
401
|
|
|
402
|
+
const restApiScan = scanForTokens(repoRoot, {
|
|
403
|
+
tokens: ["register_rest_route", "register_rest_field", "WP_REST_Controller"],
|
|
404
|
+
exts: [".php"],
|
|
405
|
+
maxFiles: 2500,
|
|
406
|
+
maxDepth: 8,
|
|
407
|
+
});
|
|
408
|
+
|
|
400
409
|
const wpCliConfigBasenames = new Set([
|
|
401
410
|
"wp-cli.yml",
|
|
402
411
|
"wp-cli.yaml",
|
|
@@ -439,6 +448,7 @@ function main() {
|
|
|
439
448
|
|
|
440
449
|
const usesInteractivityApi = pkgHasInteractivity || Object.keys(interactivityScan.matches).length > 0;
|
|
441
450
|
const usesAbilitiesApi = pkgHasAbilities || Object.keys(abilitiesScan.matches).length > 0;
|
|
451
|
+
const usesRestApi = Object.keys(restApiScan.matches).length > 0;
|
|
442
452
|
const usesInnerBlocks = Object.keys(innerBlocksScan.matches).length > 0;
|
|
443
453
|
const usesWpCli = composerHasWpCli || wpCliConfigFiles.length > 0 || Object.keys(wpCliTokenScan.matches).length > 0;
|
|
444
454
|
|
|
@@ -476,6 +486,10 @@ function main() {
|
|
|
476
486
|
);
|
|
477
487
|
|
|
478
488
|
const hasPhpUnit = phpunitXml.length > 0 || Boolean(composerJson?.requireDev?.phpunit || composerJson?.["require-dev"]?.phpunit);
|
|
489
|
+
|
|
490
|
+
const hasPhpStan = existsFile(path.join(repoRoot, "phpstan.neon")) ||
|
|
491
|
+
existsFile(path.join(repoRoot, "phpstan.neon.dist")) ||
|
|
492
|
+
Boolean(composerJson?.requireDev?.["phpstan/phpstan"] || composerJson?.["require-dev"]?.["phpstan/phpstan"]);
|
|
479
493
|
|
|
480
494
|
const signals = {
|
|
481
495
|
paths: {
|
|
@@ -496,8 +510,7 @@ function main() {
|
|
|
496
510
|
isBlockPlugin,
|
|
497
511
|
isBlockTheme,
|
|
498
512
|
usesInteractivityApi,
|
|
499
|
-
usesAbilitiesApi,
|
|
500
|
-
usesInnerBlocks,
|
|
513
|
+
usesAbilitiesApi, usesRestApi, usesInnerBlocks,
|
|
501
514
|
usesWpCli,
|
|
502
515
|
performanceHints: {
|
|
503
516
|
wpConfig: config.source,
|
|
@@ -523,6 +536,10 @@ function main() {
|
|
|
523
536
|
matches: abilitiesScan.matches,
|
|
524
537
|
scanTruncated: abilitiesScan.truncated,
|
|
525
538
|
},
|
|
539
|
+
restApiHints: {
|
|
540
|
+
matches: restApiScan.matches,
|
|
541
|
+
scanTruncated: restApiScan.truncated,
|
|
542
|
+
},
|
|
526
543
|
innerBlocksHints: {
|
|
527
544
|
matches: innerBlocksScan.matches,
|
|
528
545
|
scanTruncated: innerBlocksScan.truncated,
|
|
@@ -552,6 +569,7 @@ function main() {
|
|
|
552
569
|
php: {
|
|
553
570
|
hasComposerJson: existsFile(path.join(repoRoot, "composer.json")),
|
|
554
571
|
hasVendorDir: existsDir(path.join(repoRoot, "vendor")),
|
|
572
|
+
hasPhpStan,
|
|
555
573
|
phpunitXml,
|
|
556
574
|
},
|
|
557
575
|
node: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wp-rest-api
|
|
3
3
|
description: "Use when building, extending, or debugging WordPress REST API endpoints/routes: register_rest_route, WP_REST_Controller/controller classes, schema/argument validation, permission_callback/authentication, response shaping, register_rest_field/register_meta, or exposing CPTs/taxonomies via show_in_rest."
|
|
4
|
+
license: GPL-2.0-or-later
|
|
4
5
|
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wp-wpcli-and-ops
|
|
3
3
|
description: "Use when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export/import, plugin/theme/user/content management, cron, cache flushing, multisite, and scripting/automation with wp-cli.yml."
|
|
4
|
+
license: GPL-2.0-or-later
|
|
4
5
|
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Requires WP-CLI in the execution environment."
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wpds
|
|
3
3
|
description: "Use when building UIs leveraging the WordPress Design System (WPDS) and its components, tokens, patterns, etc."
|
|
4
|
+
license: GPL-2.0-or-later
|
|
4
5
|
compatibility: "Requires WPDS MCP server configured and running. Targets WordPress 6.9+ (PHP 7.2.24+)."
|
|
5
6
|
---
|
|
6
7
|
|
package/AGENTS.md
CHANGED
|
@@ -8,32 +8,55 @@ This is a Node.js CLI tool (`wp-agent-kit`) designed to scaffold AI agent config
|
|
|
8
8
|
- **Prompting**: `@clack/prompts`
|
|
9
9
|
- **Build**: `tsc` (TypeScript Compiler)
|
|
10
10
|
- **Test**: `vitest`
|
|
11
|
+
- **Lint/Format**: Biome + ESLint
|
|
11
12
|
|
|
12
13
|
## Architecture
|
|
13
14
|
- **Entry Point**: `src/cli.ts`
|
|
14
|
-
- **Commands**: `src/commands/*.ts` (e.g., `install`, `setup`, `sync-skills`, `playground`)
|
|
15
|
-
- **Core Logic**: `src/lib/*.ts` (e.g., `installer.ts` for file copying, `triage-mapper.ts` for project detection)
|
|
16
|
-
- **Utilities**: `src/utils/*.ts` (e.g., `paths.ts`, `run.ts`)
|
|
15
|
+
- **Commands**: `src/commands/*.ts` (e.g., `install`, `setup`, `sync-skills`, `playground`, `upgrade`)
|
|
16
|
+
- **Core Logic**: `src/lib/*.ts` (e.g., `installer.ts` for file copying, `triage-mapper.ts` for project detection, `api.ts` for programmatic API)
|
|
17
|
+
- **Utilities**: `src/utils/*.ts` (e.g., `paths.ts`, `run.ts`, `output.ts`, `exit-codes.ts`)
|
|
17
18
|
- **Assets**:
|
|
18
19
|
- `AGENTS.template.md`: The template file copied to user projects.
|
|
19
|
-
- `.github/`: The source of skills
|
|
20
|
+
- `.github/`: The source of skills (14 WordPress skills), instructions, agents, and prompts copied to user projects.
|
|
20
21
|
- `vendor/wp-agent-skills/`: Submodule containing upstream skills.
|
|
21
22
|
|
|
23
|
+
## Package Exports
|
|
24
|
+
- `wordpress-agent-kit` → CLI entry (`dist/cli.js`)
|
|
25
|
+
- `wordpress-agent-kit/api` → Programmatic API (`dist/lib/api.js`)
|
|
26
|
+
|
|
22
27
|
## Development Workflow
|
|
23
28
|
- **Run locally**: `npm run dev` (uses `tsx src/cli.ts`)
|
|
24
29
|
- **Build**: `npm run build` (outputs to `dist/`)
|
|
30
|
+
- **TypeCheck**: `npm run check` (no-emit type checking)
|
|
25
31
|
- **Test**: `npm test` (runs Vitest)
|
|
26
|
-
- **Lint**: `npm run lint`
|
|
32
|
+
- **Lint**: `npm run lint:check` (ESLint + Biome)
|
|
33
|
+
- **Format**: `npm run format` (Prettier + Biome)
|
|
34
|
+
- **Pre-commit**: Husky runs lint:check + test:run
|
|
27
35
|
|
|
28
36
|
## Key Commands
|
|
29
|
-
- `install`: Copies `.github` and `AGENTS.md` template to a target directory.
|
|
30
|
-
- `setup`: Interactive wizard that detects project type and configures the kit.
|
|
31
|
-
- `sync-skills`: Pulls skills from `WordPress/agent-skills` into `.github/skills`.
|
|
37
|
+
- `install`: Copies `.github` and `AGENTS.md` template to a target directory. Supports `--json`, `--dry-run`, `--ndjson`.
|
|
38
|
+
- `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`.
|
|
32
40
|
- `playground`: Launches a local WordPress Playground instance using a blueprint.
|
|
33
|
-
- `
|
|
41
|
+
- `upgrade`: Checks for and applies newer versions. Supports `--check-only`, `--force`, `--json`.
|
|
42
|
+
|
|
43
|
+
## Agent-Friendly Features (v0.3.0+)
|
|
44
|
+
- `--json`: Structured JSON output with success/data/error/time fields
|
|
45
|
+
- `--dry-run`: Preview mode showing what would happen without making changes
|
|
46
|
+
- `--ndjson`: Newline-delimited JSON for streaming long operations
|
|
47
|
+
- `--quiet`: Suppress non-essential output
|
|
48
|
+
- **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'`
|
|
34
50
|
|
|
35
51
|
## Notes for Agents
|
|
36
52
|
- When modifying commands, ensure you update the corresponding JSDoc comments.
|
|
37
53
|
- The `src/lib/installer.ts` file is critical as it handles the file copying logic.
|
|
38
54
|
- The `src/lib/triage-mapper.ts` file contains logic for mapping project detection results to configuration options.
|
|
39
|
-
- The `
|
|
55
|
+
- 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.
|
|
58
|
+
- CI runs on every push: lint, typecheck, test, build. No publish workflow (manual npm publish only).
|
|
59
|
+
|
|
60
|
+
## Pi Extension (Package)
|
|
61
|
+
- `pi.extensions`: `./extensions/wp-agent-kit` — registers WordPress agent tools
|
|
62
|
+
- `pi.skills`: `./.github/skills` — 14 WordPress skills discoverable by Pi
|
package/AGENTS.template.md
CHANGED
|
@@ -1,31 +1,76 @@
|
|
|
1
1
|
# Project: WordPress Codebase
|
|
2
2
|
|
|
3
|
-
This repository is WordPress-centric (plugin, theme, or site). Agents should prioritize local skills and official WordPress standards.
|
|
3
|
+
This repository is WordPress-centric (plugin, theme, block theme, or site). Agents should prioritize local skills and official WordPress standards.
|
|
4
4
|
|
|
5
5
|
## Onboarding
|
|
6
6
|
|
|
7
|
-
- Core
|
|
8
|
-
- Workflow
|
|
9
|
-
- Skills
|
|
7
|
+
- **Core Agent**: `.github/agents/wp-architect.agent.md` — the primary agent persona
|
|
8
|
+
- **Workflow Instructions**: `.github/instructions/wordpress-workflow.instructions.md` — project-specific conventions
|
|
9
|
+
- **Skills**: `.github/skills/` — specialized agent skills for WordPress development
|
|
10
10
|
|
|
11
|
-
## Project Discovery (
|
|
11
|
+
## Project Discovery (Required Before Changes)
|
|
12
12
|
|
|
13
|
-
1. Run project triage:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
13
|
+
1. **Run project triage** to classify the codebase:
|
|
14
|
+
```bash
|
|
15
|
+
node .github/skills/wp-project-triage/scripts/detect_wp_project.mjs
|
|
16
|
+
```
|
|
17
|
+
This outputs a JSON report with project kind, signals, and tooling.
|
|
18
|
+
|
|
19
|
+
2. **Route to the right skill**:
|
|
20
|
+
- If routing is unclear, consult `.github/skills/wordpress-router/references/decision-tree.md`
|
|
21
|
+
- For plugins: `wp-plugin-development`
|
|
22
|
+
- For block themes: `wp-block-themes`
|
|
23
|
+
- For Gutenberg blocks: `wp-block-development`
|
|
24
|
+
- For REST API work: `wp-rest-api`
|
|
25
|
+
- For WP-CLI operations: `wp-wpcli-and-ops`
|
|
26
|
+
|
|
27
|
+
3. **Update repo-specific guidance** based on triage results:
|
|
28
|
+
- Confirm the project prefix (functions, classes, constants)
|
|
29
|
+
- Confirm the folder structure (single-file plugin, `includes/`, blocks, theme, full site)
|
|
30
|
+
- Confirm target WordPress and PHP versions
|
|
31
|
+
|
|
32
|
+
## Architecture
|
|
33
|
+
|
|
34
|
+
<!-- Populated by project triage — do not remove -->
|
|
35
|
+
|
|
36
|
+
- **Project Type**: <!-- plugin | theme | block-theme | site | gutenberg -->
|
|
37
|
+
- **PHP Version**: <!-- minimum PHP version -->
|
|
38
|
+
- **WP Version**: <!-- minimum WordPress version -->
|
|
39
|
+
- **Build Tool**: <!-- webpack | @wordpress/scripts | vite | none -->
|
|
40
|
+
- **Test Framework**: <!-- PHPUnit | Jest | Cypress | none -->
|
|
41
|
+
|
|
42
|
+
## Commands
|
|
43
|
+
|
|
44
|
+
<!-- Populated by project triage — do not remove -->
|
|
45
|
+
|
|
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 --> |
|
|
53
|
+
|
|
54
|
+
## Code Conventions
|
|
55
|
+
|
|
56
|
+
<!-- Populated by project triage — do not remove -->
|
|
57
|
+
|
|
58
|
+
- **Prefix**: <!-- e.g., myplugin_ for functions, MyPlugin\ for namespaces -->
|
|
59
|
+
- **Indentation**: Tabs for PHP, <!-- 2 spaces for JS -->
|
|
60
|
+
- **PHP Standards**: [WordPress PHP Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/)
|
|
61
|
+
- **JS Standards**: <!-- WordPress JS standards -->
|
|
21
62
|
|
|
22
63
|
## Security Baseline
|
|
23
64
|
|
|
24
|
-
- Sanitize input
|
|
25
|
-
-
|
|
26
|
-
-
|
|
65
|
+
- **Sanitize Early**: Validate and sanitize all user input (`sanitize_text_field`, `sanitize_email`, etc.)
|
|
66
|
+
- **Escape Late**: Escape all output (`esc_html`, `esc_attr`, `esc_url`, `wp_kses`)
|
|
67
|
+
- **Use Nonces**: All state-changing requests must include nonce verification (`wp_nonce_field`, `check_admin_referer`)
|
|
68
|
+
- **Check Capabilities**: Privileged actions require capability checks (`current_user_can`)
|
|
69
|
+
- **Validate AJAX/REST**: Use `permission_callback` for REST endpoints and capability checks for AJAX handlers
|
|
27
70
|
|
|
28
71
|
## Output Requirements
|
|
29
72
|
|
|
30
|
-
- Prefer minimal, standards-compliant changes
|
|
31
|
-
- Follow existing conventions in the codebase
|
|
73
|
+
- Prefer minimal, standards-compliant changes over large rewrites
|
|
74
|
+
- Follow existing conventions in the codebase (naming, patterns, architecture)
|
|
75
|
+
- Cite which skill or handbook informed the solution
|
|
76
|
+
- Cross-check against this file (`AGENTS.md`) before finalizing output
|