Add studio ai CLI command with interactive AI agent#2632
Add studio ai CLI command with interactive AI agent#2632youknowriad wants to merge 12 commits intotrunkfrom
studio ai CLI command with interactive AI agent#2632Conversation
b82b416 to
cf74c03
Compare
|
This is not just a Proof of concept in my mind but yeah still early :P |
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? |
|
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. |
|
This PR is starting to generate really cool sites (great designs, all blocks valid...). I think it's time to start getting some feedback for the generated sites. Next, I'm going to focus on the UI of the command and to make the PR shippable. |
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>
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>
…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>
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>
- 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>
Add a branded welcome header with Wapuu ASCII art in a cyan bordered box, showing version, model, and working directory. Restyle the prompt editor to match Claude Code's layout (top/bottom borders, > prefix, placeholder text). Improve spacing with embedded newlines, add inverse background for user messages, and support max-turns continuation flow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the conditional Node version check for --experimental-wasm-jspi (trunk requires Node 22+). Add a step to check for HTML block abuse before taking screenshots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9a0b92d to
af42f5c
Compare
Related issues
Proposed Changes
Add a new
studio aicommand — an interactive AI-powered WordPress assistant running in the terminal. Uses the Claude Agent SDK with a pi-tui chat interface. The agent can manage sites, run WP-CLI, create blocks/themes, validate block markup, and take screenshots.Testing Instructions
npm install && npm run cli:buildnode apps/cli/dist/cli/main.js aiPre-merge Checklist