Skip to content
Development
Skill

/twig-components

Build reusable UI components with Symfony UX Twig Components (props, slots, anonymous components, CVA) for clean templates

From plugin
superpowers-symfony
23344 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill twig-components --agent claude-code

SKILL.md

twig-components.SKILL.md
name: twig-components
description: Build reusable UI components with Symfony UX Twig Components (props, slots, anonymous components, CVA) for clean templates
capabilities: [read, search]
tags: [architecture, ui]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep

Twig Components (Symfony)

Use when

  • Extracting a repeated piece of Twig into a reusable component.
  • Building a component with props, slots, computed logic, or CVA variants.
  • Making a component reactive with Live Components (search, counters, forms).

Default workflow

1. Choose the kind: anonymous (template only), class-based `#[AsTwigComponent]`, or `#[AsLiveComponent]`. 2. Declare props as public mutable properties; use `mount()` for derived values. 3. Expose content injection through blocks (slots) rather than more props. 4. For Live Components, mark writable state with `#[LiveProp(writable: true)]` and debounce user input. 5. Test the PHP class with `InteractsWithTwigComponents`.

Guardrails

  • Never make public props `readonly`: they are assigned after instantiation.
  • Inject services as `private readonly`, never as public props.
  • Only mark a `LiveProp` writable when the browser must change it.
  • Keep one responsibility per component.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • Component classes and templates, with their props and slots.
  • Live state and actions, when the component is reactive.
  • A component test for mount and render.

References

  • `reference.md`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

23344 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
233
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about twig-components.

Which coding agents can use twig-components?
twig-components installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.