Add studio ai CLI command with interactive AI agent#2632
Add studio ai CLI command with interactive AI agent#2632youknowriad wants to merge 10 commits intotrunkfrom
studio ai CLI command with interactive AI agent#2632Conversation
Introduces an AI-powered WordPress assistant accessible via `studio ai`. Uses the Claude Agent SDK with a TUI (pi-tui) for interactive conversations. Features: - REPL chat interface with markdown rendering and bordered editor - MCP tools for site management (list, info, start, stop, WP-CLI) - WordPress development skills via SDK plugins (blocks, themes, patterns) - BYOK authentication with saved API key - Session resume across conversation turns - Escape to interrupt, Ctrl+C to exit - Human-readable tool status in spinner - Tool result output display Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b82b416 to
cf74c03
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Switch to Sonnet model with bypassPermissions mode to prevent tool hanging - Replace old skills (creating-themes, editing-blocks, editing-themes, generating-patterns) with new ones (frontend-design, wordpress-block-theming, wp-interactivity-api) - Forward Logger progress messages to TUI spinner instead of fighting with ora - Add directive workflow in system prompt to ensure site creation vs reuse - Add block markup rules: no HTML blocks, no decorative comments, no emojis - Fix stale PM2 bus cache causing "SUB connection already being closed" errors after site creation by clearing pm2Bus on disconnect Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This is not just a Proof of concept in my mind but yeah still early :P |
…m prompt Remove the SDK plugin/skills system and move block content rules directly into the system prompt. Switch to Sonnet 4.6, add PM2 keepAlive to prevent stale bus connections, fix WP-CLI quoted argument parsing, and fix lint issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ributes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
I used 'Proof of Concept' to signal that we haven't settled on the exact approach yet, not to say the ideas aren't valuable - they are! We're actually about to start a project to integrate Studio with ACP, and what you've built here will definitely help shape that work. Since we don't know the final architecture yet, I'd rather not merge something we might need to rewrite later - but I'd love to keep this PR as a reference as we figure out the direction. Would that work for you? |
Validates WordPress block content against registered save() functions using @wordpress/blocks + @wordpress/block-library with jsdom as DOM polyfill. The agent must now validate every file with block content and loop until 0 invalid blocks remain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Let's discuss a bit after but IMO, We should ship something if it's valuable. I agree with not merging the PR before it's ready though if that's what you meant but if you see this PR as just a "vision PR", this is not my intent, my ultimate intent is to ship the PR. |
- Suppress console.error during block validation to eliminate verbose block type object dumps from WordPress's validation logging - Auto-validate post content in wp_cli post create/update commands, rejecting invalid blocks before execution - Add progress messages to validate_blocks showing file and result status - Track last tool name in UI for context-aware result display - Increase validation result truncation limit to 2000 chars - Increase default max turns from 10 to 30 - Make --experimental-wasm-jspi conditional on Node 22+ to fix site startup on Node 20 - Add emitProgress helper to logger - Update system prompt: restructure validation steps, add block content checklist, note wp_cli content validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a Playwright-based screenshot tool that captures full-page PNG screenshots of URLs with desktop (1040x1248) and mobile (390x844) viewport support. The browser instance is lazily initialized and reused across calls. Returns images in MCP ImageContent format for the agent to analyze visually. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…reenshots Restructure system prompt: add design guidelines section with typography, color, motion, and layout direction. Refine block content rules with explicit core/html allowlist. Screenshot tool now waits for all images to load before capturing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Related issues
Proposed Changes
studio aicommand that launches an interactive AI-powered WordPress assistantmcp__studio__wp_cli)Testing Instructions
Prerequisites
Setup
npm installnpm run cli:buildBasic flow
node dist/cli/main.js aiTest conversations
Try these prompts to exercise different capabilities:
Site management tools:
site_listand display resultswp_cliwithplugin listWordPress development skills:
UI behavior:
↳lines below the spinner✗prefixSession continuity:
Edge cases:
--max-turns 5and give a complex task — should hit the limit with a clear messagePre-merge Checklist