wordpress-agent-kit 0.2.1 → 0.2.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/workflows/ci.yml +44 -0
- package/.husky/pre-commit +7 -0
- package/CLI_REVIEW.md +250 -0
- package/README.md +124 -51
- package/biome.json +39 -0
- package/dist/cli.js +75 -4
- package/dist/commands/install.js +43 -10
- package/dist/commands/run-playground.js +59 -14
- package/dist/commands/setup.js +222 -163
- package/dist/commands/sync-skills.js +33 -60
- package/dist/commands/upgrade.js +182 -0
- package/dist/lib/api.js +456 -0
- package/dist/lib/triage-mapper.js +18 -20
- package/dist/utils/exit-codes.js +60 -0
- package/dist/utils/output.js +96 -0
- package/dist/utils/paths.js +1 -1
- package/dist/utils/run.js +1 -1
- package/kit-learnings.md +192 -0
- package/package.json +7 -2
package/dist/utils/run.js
CHANGED
|
@@ -11,7 +11,7 @@ export function run(command, args, cwd = process.cwd()) {
|
|
|
11
11
|
const result = spawnSync(command, args, {
|
|
12
12
|
cwd,
|
|
13
13
|
stdio: 'inherit',
|
|
14
|
-
shell: process.platform === 'win32'
|
|
14
|
+
shell: process.platform === 'win32',
|
|
15
15
|
});
|
|
16
16
|
if (result.status !== 0) {
|
|
17
17
|
console.error(`Command failed with status ${result.status}: ${command} ${args.join(' ')}`);
|
package/kit-learnings.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# WordPress Agent Kit - Installation & Usage Learnings
|
|
2
|
+
|
|
3
|
+
**Package:** `wordpress-agent-kit@0.2.1` (published on npm)
|
|
4
|
+
**Author:** Kyle Brodeur
|
|
5
|
+
**Repo:** https://github.com/kylebrodeur/wordpress-agent-kit
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start (What Actually Works)
|
|
10
|
+
|
|
11
|
+
### For Pi (Recommended)
|
|
12
|
+
```bash
|
|
13
|
+
pnpm dlx wordpress-agent-kit@latest install --platform pi
|
|
14
|
+
```
|
|
15
|
+
- Installs skills to `.pi/agent/skills/` (17 skills)
|
|
16
|
+
- Non-interactive, no TTY needed
|
|
17
|
+
- Works in headless/CI environments
|
|
18
|
+
|
|
19
|
+
### For Other Platforms
|
|
20
|
+
```bash
|
|
21
|
+
# GitHub Copilot / VS Code
|
|
22
|
+
pnpm dlx wordpress-agent-kit@latest install --platform github
|
|
23
|
+
|
|
24
|
+
# Cursor IDE
|
|
25
|
+
pnpm dlx wordpress-agent-kit@latest install --platform cursor
|
|
26
|
+
|
|
27
|
+
# Generic agent format
|
|
28
|
+
pnpm dlx wordpress-agent-kit@latest install --platform agent
|
|
29
|
+
|
|
30
|
+
# Claude (interactive - requires TTY)
|
|
31
|
+
pnpm dlx wordpress-agent-kit@latest install --platform claude
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## What DOESN'T Work (Common Pitfalls)
|
|
37
|
+
|
|
38
|
+
### `setup` command requires TTY
|
|
39
|
+
```bash
|
|
40
|
+
pnpm dlx wordpress-agent-kit@latest setup # FAILS in non-interactive shells
|
|
41
|
+
```
|
|
42
|
+
**Error:** `ERR_TTY_INIT_FAILED: uv_tty_init returned EINVAL (invalid argument)`
|
|
43
|
+
|
|
44
|
+
The `setup` command uses `@clack/prompts` for interactive prompts, which requires a real TTY. It fails in:
|
|
45
|
+
- CI/CD pipelines
|
|
46
|
+
- Docker containers without `-it`
|
|
47
|
+
- Non-interactive SSH sessions
|
|
48
|
+
- Most AI agent execution environments
|
|
49
|
+
|
|
50
|
+
**Workaround:** Use `install --platform <platform>` instead.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Platform Comparison
|
|
55
|
+
|
|
56
|
+
| Platform | Target Dir | Interactive? | Best For |
|
|
57
|
+
|----------|------------|--------------|----------|
|
|
58
|
+
| `pi` | `.pi/agent/skills/` | ❌ No | **Pi Coding Agent** (this project) |
|
|
59
|
+
| `github` | `.github/skills/` | ❌ No | GitHub Copilot, VS Code |
|
|
60
|
+
| `cursor` | `.cursor/skills/` | ❌ No | Cursor IDE |
|
|
61
|
+
| `agent` | `.agent/skills/` | ❌ No | Generic `.agent` workflows |
|
|
62
|
+
| `claude` | `.claude/skills/` | ✅ Yes | Claude Code (interactive only) |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Skills Installed (17 Total)
|
|
67
|
+
|
|
68
|
+
All synced from `WordPress/agent-skills` trunk:
|
|
69
|
+
|
|
70
|
+
1. `wp-abilities-api` - Abilities API registration & consumption
|
|
71
|
+
2. `wp-abilities-audit` - Audit plugin REST surface for Abilities
|
|
72
|
+
3. `wp-abilities-verify` - Verify Abilities registrations
|
|
73
|
+
4. `wp-block-development` - Gutenberg blocks: block.json, attributes, rendering
|
|
74
|
+
5. `wp-block-themes` - Block themes: theme.json, templates, patterns
|
|
75
|
+
6. `wp-interactivity-api` - data-wp-* directives & stores
|
|
76
|
+
7. `wp-performance` - Profiling, caching, DB optimization
|
|
77
|
+
8. `wp-phpstan` - PHPStan config for WordPress
|
|
78
|
+
9. `wp-playground` - WordPress Playground for instant environments
|
|
79
|
+
10. `wp-plugin-development` - Plugin architecture, hooks, Settings API, security
|
|
80
|
+
11. `wp-plugin-directory-guidelines` - WP Plugin Directory requirements
|
|
81
|
+
12. `wp-project-triage` - Auto-detect project type, tooling, versions
|
|
82
|
+
13. `wp-rest-api` - REST API routes, schema, auth, response shaping
|
|
83
|
+
14. `wp-wpcli-and-ops` - WP-CLI commands, automation, multisite
|
|
84
|
+
15. `wpds` - WordPress Design System
|
|
85
|
+
16. `blueprint` - Playground Blueprints for declarative setup
|
|
86
|
+
17. `wordpress-router` - Classifies WP repos, routes to right workflow
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Verification Commands
|
|
91
|
+
|
|
92
|
+
After installation, verify everything works:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 1. Check skills installed
|
|
96
|
+
ls -la .pi/agent/skills/
|
|
97
|
+
|
|
98
|
+
# 2. Run project triage (detects WP project type)
|
|
99
|
+
node .pi/agent/skills/wp-project-triage/scripts/detect_wp_project.mjs
|
|
100
|
+
|
|
101
|
+
# 3. Run design-system tests (if applicable)
|
|
102
|
+
cd design-system && pnpm test && pnpm run typecheck
|
|
103
|
+
|
|
104
|
+
# 4. PHP syntax check
|
|
105
|
+
find wpaos wpaos-blocks -name '*.php' -exec php -l {} \;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Key Files & Locations
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
wordpress-agent-kit/
|
|
114
|
+
├── package.json # Package definition (name: wordpress-agent-kit)
|
|
115
|
+
├── src/
|
|
116
|
+
│ ├── cli.ts # Main CLI entry
|
|
117
|
+
│ ├── commands/
|
|
118
|
+
│ │ ├── install.ts # Non-interactive install (USE THIS)
|
|
119
|
+
│ │ ├── setup.ts # Interactive setup (NEEDS TTY)
|
|
120
|
+
│ │ ├── sync-skills.ts # Pulls from WordPress/agent-skills
|
|
121
|
+
│ │ └── playground.ts # Local WP Playground
|
|
122
|
+
│ └── utils/
|
|
123
|
+
│ └── platforms.ts # Platform definitions (pi, github, cursor, agent, claude)
|
|
124
|
+
├── dist/bundles/ # Pre-built tarballs (legacy method)
|
|
125
|
+
└── vendor/wp-agent-skills/ # Synced upstream skills (gitignored)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Syncing Latest Upstream Skills
|
|
131
|
+
|
|
132
|
+
The kit bundles skills at release time. To get latest:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# From kit repo (if contributing)
|
|
136
|
+
pnpm sync:skills
|
|
137
|
+
pnpm build:bundles
|
|
138
|
+
|
|
139
|
+
# Or just reinstall (pulls latest from npm)
|
|
140
|
+
pnpm dlx wordpress-agent-kit@latest install --platform pi --force
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Integration with This Project (wp-agent-os)
|
|
146
|
+
|
|
147
|
+
### AGENTS.md References
|
|
148
|
+
The project's `AGENTS.md` still references `.github/skills/` but we use `.pi/agent/skills/`. The skills are the same - just different install locations.
|
|
149
|
+
|
|
150
|
+
### wp-abilities-api Verification
|
|
151
|
+
Verified that `wpaos/includes/abilities.php` uses correct arg keys per the skill:
|
|
152
|
+
- `label`, `description`, `category`, `input_schema`, `output_schema`
|
|
153
|
+
- `permission_callback`, `execute_callback`, `meta`
|
|
154
|
+
- `meta.show_in_rest: true`, `meta.mcp.public: true`
|
|
155
|
+
|
|
156
|
+
### CI/CD Usage
|
|
157
|
+
```yaml
|
|
158
|
+
# GitHub Actions example
|
|
159
|
+
- name: Install WordPress Agent Kit
|
|
160
|
+
run: pnpm dlx wordpress-agent-kit@latest install --platform github
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Troubleshooting
|
|
166
|
+
|
|
167
|
+
### "Command not found" / 404 on npm
|
|
168
|
+
- Package name is `wordpress-agent-kit` (NOT `wp-agent-kit`)
|
|
169
|
+
- Published to npm as `kylebrodeur` scope would be `@kylebrodeur/wordpress-agent-kit` but it's unscoped
|
|
170
|
+
|
|
171
|
+
### Skills not showing up
|
|
172
|
+
- Check install location matches your agent's config (`.pi/agent/skills/` for Pi)
|
|
173
|
+
- Run with `--force` to overwrite existing
|
|
174
|
+
|
|
175
|
+
### Old placeholder skills remain
|
|
176
|
+
- Delete old skill directories before reinstall:
|
|
177
|
+
```bash
|
|
178
|
+
rm -rf .claude/skills .github/skills .cursor/skills .agent/skills
|
|
179
|
+
pnpm dlx wordpress-agent-kit@latest install --platform pi
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Summary: Recommended Workflow for This Project
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# One-liner for clean install in any environment
|
|
188
|
+
rm -rf .claude/skills .github/skills .cursor/skills .agent/skills .pi/agent/skills && \
|
|
189
|
+
pnpm dlx wordpress-agent-kit@latest install --platform pi
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Then the skills live in `.pi/agent/skills/` and are available to Pi automatically.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wordpress-agent-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "WordPress-focused AGENTS.md + Agent Skills starter kit for AI coding agents.",
|
|
5
5
|
"license": "GPL-2.0-or-later",
|
|
6
6
|
"author": "Kyle Brodeur <kyle@brodeur.me> (https://brodeur.me)",
|
|
@@ -26,10 +26,12 @@
|
|
|
26
26
|
"commander": "^13.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@biomejs/biome": "1.9.4",
|
|
29
30
|
"@eslint/js": "^9.17.0",
|
|
30
31
|
"@types/node": "^22.10.1",
|
|
31
32
|
"@vitest/coverage-v8": "^2.1.8",
|
|
32
33
|
"eslint": "^9.16.0",
|
|
34
|
+
"husky": "^9.1.6",
|
|
33
35
|
"prettier": "^3.4.1",
|
|
34
36
|
"ts-node": "^10.9.2",
|
|
35
37
|
"tsx": "^4.19.2",
|
|
@@ -42,7 +44,10 @@
|
|
|
42
44
|
"dev": "tsx src/cli.ts",
|
|
43
45
|
"build": "tsc",
|
|
44
46
|
"check": "tsc --noEmit",
|
|
45
|
-
"lint": "eslint src/ --fix",
|
|
47
|
+
"lint": "eslint src/ tests/ --fix && biome check --write .",
|
|
48
|
+
"lint:check": "eslint src/ tests/ && biome check .",
|
|
49
|
+
"format": "prettier --write . && biome format --write .",
|
|
50
|
+
"format:check": "prettier --check . && biome format --check .",
|
|
46
51
|
"test": "vitest",
|
|
47
52
|
"test:run": "vitest run",
|
|
48
53
|
"test:coverage": "vitest run --coverage",
|