Shopware AI Agent

Autonomous Plugin Development with LLMs

SCUC 2026 ยท @jankal ยท nuonic Digital

๐Ÿง  Why?

  • ๐Ÿ” Plugin development is repetitive
    • boilerplate: composer.json, Plugin class, services.xml...
    • same patterns over and over
  • ๐Ÿ”€ Context switching is costly
    • docs, Admin API, CLI, code, browser
  • ๐Ÿค– LLMs are great at code generation
    • but they lack execution context

๐Ÿง  The Gap

An LLM that can only generate code is a fancy autocomplete.

An LLM that can write, execute, validate, and see the result
is an autonomous agent.

โ†’ We gave Claude a Shopware instance to play with.

๐Ÿธ What?

Architecture: Sidecar Pattern

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Kubernetes Pod โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ shopware-app  โ”‚    โ”‚   ai-agent     โ”‚  โ”‚
โ”‚  โ”‚               โ”‚    โ”‚                โ”‚  โ”‚
โ”‚  โ”‚ PHP / Apache  โ”‚    โ”‚ Nuxt 4 / Bun   โ”‚  โ”‚
โ”‚  โ”‚ Shopware 6    โ”‚    โ”‚ Claude SDK     โ”‚  โ”‚
โ”‚  โ”‚ :80           โ”‚    โ”‚ :8000          โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚         โ”‚     Shared PVC      โ”‚           โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€ /var/www/html โ”€โ”€โ”˜           โ”‚
โ”‚                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚                        โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”            โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ MariaDB  โ”‚            โ”‚ Postgres โ”‚
   โ”‚ (Shop)   โ”‚            โ”‚ (Agent)  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why a Sidecar?

  • Shared Volume = zero-latency file I/O
    • Agent writes PHP โ†’ instantly visible to Shopware
  • ReadWriteOnce PVC is sufficient (same Pod)
    • no expensive RWX network storage needed
  • K8s Exec API for command execution
    • no SSH, no network hops
  • Independent lifecycle
    • Shopware crashes? Agent still runs.

Tech Stack

Component Technology
Agent Runtime Nuxt 4 + Bun
LLM Claude Opus 4 (Anthropic SDK)
Tool Bridge MCP (Model Context Protocol)
K8s Integration @kubernetes/client-node
Conversations PostgreSQL + Drizzle ORM
Validation shopware-cli (PHPStan, CS)
Screenshots Playwright (Chromium)
Frontend Nuxt UI + Tailwind CSS

โš™๏ธ How?

Native Tools

The agent has 6 built-in tools for direct Shopware interaction:

Tool What it does
write_file Write to shared volume (with diff)
read_file Read from shared volume
list_directory Browse the filesystem
search_files Glob + content search
exec_command Shell commands via K8s Exec API
validate_extension PHPStan, code style via shopware-cli

All paths relative to /var/www/html with path traversal prevention.

K8s Exec API

// k8s-exec.ts (simplified)
export async function execInContainer(command: string) {
  const kc = new k8s.KubeConfig()
  kc.loadFromCluster()

  const exec = new k8s.Exec(kc)

  await exec.exec(
    NAMESPACE,            // from Downward API
    POD_NAME,             // from Downward API
    'shopware-app',       // target container
    ['/bin/sh', '-c',
     `cd /var/www/html && su -s /bin/sh www-data -c '${command}'`],
    stdout, stderr,
    null,                 // no stdin
    false,                // no tty
    (status) => resolve(status)
  )
}

No SSH. No network hops. Just the Kubernetes API.

MCP Server Tools

Three MCP servers extend the agent's capabilities:

admin-mcp (@shopware-ag/admin-mcp)
โ†’ Products, categories, orders, themes, media via Admin API

docs-mcp (custom, Algolia)
โ†’ Search developer.shopware.com documentation

screenshot-mcp (custom, Playwright)
โ†’ Take screenshots, click elements, fill forms

MCP = Model Context Protocol โ€” open standard for LLM tool integration

MCP Bridge

            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚  Claude LLM  โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚ tool_use
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚  MCP Bridge  โ”‚
            โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜
               โ”‚   โ”‚   โ”‚  StdioClientTransport
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ–ผ            โ–ผ            โ–ผ
 admin-mcp    docs-mcp   screenshot-mcp
      โ”‚            โ”‚            โ”‚
      โ–ผ            โ–ผ            โ–ผ
 Shopware     developer.    Playwright
 Admin API    shopware.com  Chromium

Tools are discovered dynamically โ€” the bridge merges all MCP tools into the LLM tool palette at runtime.

The Agentic Loop

  User Prompt
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Claude generates response   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  + tool_use blocks           โ”‚           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
           โ”‚ tool_use?                     โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”                         โ”‚
     โ”‚ yes       โ”‚ no โ†’ done               โ”‚
     โ–ผ                                     โ”‚
  Execute tools                            โ”‚
  (write, exec, screenshot...)             โ”‚
     โ”‚                                     โ”‚
     โ””โ”€โ”€ tool_results โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Up to 25 rounds per conversation turn.
SSE streaming for real-time UI updates.

Tool Tracking & Revert

Every write_file is tracked with full diffs:

// dispatchTool (simplified)
case 'write_file': {
  const result = await writeFileOp(input.path, input.content)
  // result.diff โ†’ unified diff
  // result.previousContent โ†’ for revert

  await db.insert(toolActions).values({
    conversationId,
    toolName: 'write_file',
    diff: result.diff,
    previousContent: result.previousContent,
    isReversible: true,
  })
}

โ†’ Users can revert any file write from the UI.

System Prompt

The agent has a detailed German system prompt with:

  • โœ… Shopware plugin directory structure
  • โœ… Required composer.json fields
  • โœ… CLI command reference (plugin:refresh, cache:clear, ...)
  • โœ… Best practices (strict_types, PSR-4, namespaces)
  • โœ… Admin API tool documentation
  • โœ… Validation workflow (validate โ†’ fix โ†’ repeat)
  • โœ… Screenshot workflow (compile โ†’ screenshot โ†’ show)

~100 lines of domain knowledge baked into every request

๐ŸŽฌ Demo

"Create a plugin that adds a custom CMS element"

What Happens Behind the Scenes

  1. ๐Ÿ’ฌ User sends prompt via SSE stream
  2. ๐Ÿง  Claude plans the plugin structure
  3. ๐Ÿ“ write_file ร— 5โ€“8 calls
    composer.json, Plugin.php, services.xml, CmsElement, ...
  4. โšก exec_command: plugin:refresh && plugin:install
  5. โšก exec_command: plugin:activate && cache:clear
  6. โœ… validate_extension: PHPStan + code style
  7. ๐Ÿ”ง Auto-fix any validation errors
  8. ๐Ÿ“ธ screenshot: verify result in storefront
  9. ๐Ÿ’ฌ Claude reports back with screenshot

Embedded in Shopware Admin

The agent UI runs as a Shopware App (not a plugin):

  • manifest.xml with <admin><module>
  • Zero PHP code โ€” purely declarative
  • iframe in Shopware Admin under Settings
  • postMessage('sw-app-loaded') handshake
  • Works even if Shopware is broken
    (agent runs in a separate container)

Security

Filesystem

  • Path traversal prevention (safePath())
  • All paths relative to /var/www/html

Kubernetes

  • Namespace-scoped RBAC (ServiceAccount)
  • Only pods/exec permission in own namespace
  • Resource limits (500m CPU, 512Mi RAM)

Agent

  • Max 25 tool rounds per turn
  • 5-minute request timeout
  • Full audit trail in PostgreSQL

Lessons Learned

  • ๐ŸŽฏ Context is everything
    Tools > more tokens. Let the LLM do, not just say.
  • ๐Ÿ”„ Validation loops are essential
    LLMs make mistakes. Automated validation catches them.
  • ๐Ÿ“ธ Visual feedback closes the loop
    Screenshots let the LLM self-correct UI issues.
  • ๐Ÿ—๏ธ MCP is the right abstraction
    Swappable tool servers, standardized protocol.
  • โšก Sidecar > microservice
    Shared volumes beat API calls for file I/O.

What's Next?

  • ๐ŸŒ Multi-tenant SaaS (scale-to-zero with KEDA)
  • ๐Ÿ” Auth between Shopware โ†” Agent
  • ๐Ÿ“ฆ Git export to production repos
  • ๐Ÿงช Automated test generation
  • ๐Ÿ”Œ More MCP servers (GitHub, CI/CD, monitoring)

Questions?

@jankal ยท nuonic Digital ยท SCUC 2026