# How it actually works.

For the people who read documentation before buying. Here's the architecture, the code output, and the security model.

## The Conversation → Code Pipeline

1. **You describe what you need**  
   Type a description in the WPCursor chat inside WordPress admin. "Build a pricing table with 3 tiers, Pro highlighted, monthly/annual toggle."

2. **The AI agent interprets your intent**  
   WPCursor’s agent breaks your description into components: HTML structure, CSS styling, JavaScript interactions, responsive breakpoints, accessibility attributes.

3. **Production code is generated**  
   Not a template. Not a shortcode. Custom HTML, CSS, and JavaScript — written specifically for your description. Scoped to your widget, no conflicts with other elements.

4. **Live on your site instantly**  
   The widget appears in your WordPress editor immediately. Add it to any page. It renders server-side via Twig — fast, SEO-friendly, no JavaScript dependency for content.

## What the AI Actually Builds

Every widget WPCursor creates is production code, not a template or page builder element.

### Custom Widgets

HTML templates (Twig), scoped CSS, optional JavaScript. Each widget is self-contained with its own styles that can’t leak to other elements.

### Design Systems

CSS variable-based themes. Define colors, fonts, spacing once — every widget inherits. Change a token, everything updates.

### PHP Snippets

Custom post types, ACF field groups, REST endpoints, WooCommerce hooks. Server-side logic that runs as WordPress native code.

### Components

Reusable primitives: buttons, cards, badges. Used inside widgets via the component() function for consistent UI across the site.

## Security Model

Your code, your server, your control.

### No External Dependencies

WPCursor generates code that runs natively in WordPress. No CDN calls, no external APIs at runtime, no vendor lock-in.

### Sandboxed Execution

PHP snippets run in an isolated sandbox with a security allow-list. No eval(), no shell commands, no file system access outside WordPress.

### Code You Can Read

Every widget, snippet, and template is readable, editable, and exportable. You can modify anything WPCursor creates.

### Your WordPress, Your Data

WPCursor connects to your existing WordPress installation via a plugin. Your content, your database, your hosting.

## The Stack

**Frontend:** Twig templates, scoped CSS, vanilla JavaScript. Tailwind CSS v4 available for utility classes. Heroicons for SVG icons.

**Backend:** WordPress REST API, ACF Pro for structured data, custom post types via PHP snippets.

**AI Layer:** Claude (Anthropic) processes your descriptions and generates code through MCP (Model Context Protocol) tools that connect directly to your WordPress site.

**No build step.** No npm. No webpack. No deployment pipeline. You describe, it builds, it’s live.
