/ 目录 / 演练场 / symfony-ux-skills
● 社区 smnandre ⚡ 即开即用

symfony-ux-skills

作者 smnandre · smnandre/symfony-ux-skills

Teach Claude the Symfony UX stack — Live Component, Twig Component, Turbo, Stimulus — so it writes idiomatic full-stack Symfony code.

A bundle of Agent Skills that document the Symfony UX ecosystem (Live Components, Twig Components, Turbo, Stimulus controllers, Autocomplete, React/Vue/Svelte integration). Once cloned into ~/.claude/skills/, Claude loads the relevant skill whenever you ask for a Live Component, a Stimulus controller, or a Turbo Frame, and follows Symfony UX conventions instead of inventing patterns.

为什么要用

核心特性

实时演示

实际使用效果

symfony-ux-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "symfony-ux-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/smnandre/symfony-ux-skills",
        "~/.claude/skills/symfony-ux-skills"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "symfony-ux-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/smnandre/symfony-ux-skills",
        "~/.claude/skills/symfony-ux-skills"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "symfony-ux-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/smnandre/symfony-ux-skills",
        "~/.claude/skills/symfony-ux-skills"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "symfony-ux-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/smnandre/symfony-ux-skills",
        "~/.claude/skills/symfony-ux-skills"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "symfony-ux-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/smnandre/symfony-ux-skills",
        "~/.claude/skills/symfony-ux-skills"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "symfony-ux-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/smnandre/symfony-ux-skills",
          "~/.claude/skills/symfony-ux-skills"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add symfony-ux-skill -- git clone https://github.com/smnandre/symfony-ux-skills ~/.claude/skills/symfony-ux-skills

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: symfony-ux-skills

How to build a Symfony Live Component with Claude

👤 Symfony developers adding real-time UI without writing JS ⏱ ~20 min intermediate

何时使用: You need a reactive form, filter, or list that updates on the server without a full page reload.

前置条件
  • Symfony 6.4+ project with symfony/ux-live-component installed — composer require symfony/ux-live-component
  • Skill cloned into ~/.claude/skills/ — git clone https://github.com/smnandre/symfony-ux-skills ~/.claude/skills/symfony-ux-skills
步骤
  1. Describe the component you need
    Build a Live Component for a product search filter with checkboxes for categories and a text query — updates results live as the user types.✓ 已复制
    → Claude references LiveProp, LiveAction, debounce modifiers from the skill
  2. Let Claude scaffold the PHP + Twig
    Generate the PHP component class and the Twig template. Use attributes, not annotations.✓ 已复制
    → File output follows Symfony UX naming (src/Twig/Components/...)
  3. Ask Claude to wire the parent page
    Show me how to embed this component in an existing Twig page and pass initial state.✓ 已复制
    → Uses {{ component() }} helper correctly

结果: A working Live Component with proper LiveProp typing and no custom JS.

注意事项
  • Claude mixes Live Component and Twig Component concepts — Re-ask naming the package explicitly: 'use symfony/ux-live-component, not twig-component'
搭配使用: filesystem · git

Refactor legacy JS into a Stimulus controller

👤 Developers modernizing a Symfony app's front-end ⏱ ~15 min beginner

何时使用: Your app has jQuery or vanilla JS sprinkled in Twig — you want to move to Stimulus cleanly.

前置条件
  • Symfony UX + Stimulus configured (importmap or Webpack Encore) — symfony console importmap:require @hotwired/stimulus if missing
步骤
  1. Paste the legacy snippet and ask for a Stimulus conversion
    Convert this jQuery snippet to an idiomatic Stimulus controller with targets and values.✓ 已复制
    → Controller with static targets, static values, clear actions
  2. Update the Twig template
    Show me the data-controller, data-*-target, and data-action attributes for the Twig side.✓ 已复制
    → Correct data attributes, no inline handlers

结果: A clean Stimulus controller plus Twig wiring, ready to commit.

注意事项
  • Controller name mismatch between file and data-controller attribute — Remind Claude of the naming rule: hello_controller.js → data-controller=hello
搭配使用: filesystem

Add Turbo-powered pagination without a page reload

👤 Symfony devs who want SPA-like UX with minimal JS ⏱ ~15 min intermediate

何时使用: You have a paginated list and want Next/Prev to swap content in-place.

步骤
  1. Ask Claude to wrap the list in a Turbo Frame
    Wrap my paginated product list in a turbo-frame and make pagination links target that frame.✓ 已复制
    → Uses <turbo-frame id=...> and frame-targeted links
  2. Handle the partial response
    Update the controller to render only the frame when the request has the Turbo-Frame header.✓ 已复制
    → Controller checks request header and picks the right template

结果: Pagination swaps in-place with no full-page reload.

注意事项
  • Full page keeps reloading — Frame id on the link target must match frame id on the page — repeat it to Claude
搭配使用: filesystem

组合

与其他 MCP 搭配,撬动十倍杠杆

symfony-ux-skill + filesystem

Claude reads your existing Twig/PHP and writes components matching codebase style

Read src/Entity/Product.php and src/Twig/Components/, then add a new LiveComponent for a product filter following the same patterns.✓ 已复制
symfony-ux-skill + github

Open a PR with the new component once files are on disk

Commit the new LiveComponent files to a branch and open a PR titled 'Live product filter'.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
live-component-authoring component intent, props, actions You need a reactive UI piece in Symfony 0 — prompt-only
twig-component-authoring UI primitive description Reusable presentational block with no live server interactions 0
stimulus-controller-authoring behavior + targets/values Client-side interactivity that doesn't need the server 0
turbo-integration frame/stream intent Partial-page updates and form responses 0

成本与限制

运行它的成本

API 配额
none — skill is local markdown
每次调用 Token 数
adds ~2–8k tokens of context when the skill activates
费用
free, MIT-licensed
提示
Keep the skill dir small — clone only the subskills you use if context-constrained

安全

权限、密钥、影响范围

凭据存储: none — no credentials needed
数据出站: none — pure instruction bundle, no network calls

故障排查

常见错误与修复

Skill doesn't activate

Confirm the directory is ~/.claude/skills/symfony-ux-skills/ and contains SKILL.md at the root. Restart Claude Code.

验证: ls ~/.claude/skills/symfony-ux-skills/SKILL.md
Claude uses generic PHP instead of Symfony UX

Prompt explicitly: 'use the symfony-ux-skills you have loaded'

Generated code references UX packages you don't have installed

composer require the package, or tell Claude which packages are installed

验证: composer show | grep symfony/ux

替代方案

symfony-ux-skills 对比其他方案

替代方案何时用它替代权衡
sivalabs-agent-skillsYou work in Spring Boot instead of SymfonyDifferent stack entirely
claude-wordpress-skillsYou work in WordPress / PHP but not SymfonyWordPress-specific patterns, no Twig/Turbo

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills