Skip to content
Development
Skill

/form-types-validation

Build Symfony forms with custom Form Types, validation constraints, HTTP 422 handling, and multi-step flows

From plugin
superpowers-symfony
23344 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill form-types-validation --agent claude-code

SKILL.md

form-types-validation.SKILL.md
name: form-types-validation
description: Build Symfony forms with custom Form Types, validation constraints, HTTP 422 handling, and multi-step flows
capabilities: [read, search, edit, shell]
tags: [security]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash

Form Types Validation (Symfony)

Use when

  • Building or changing a Symfony form type.
  • Adding validation constraints on an entity, a DTO, or a form field.
  • Different rules per context (registration vs profile) through validation groups.
  • Converting values with a data transformer or reacting with form events.
  • Writing a custom constraint, or a form spread across several steps.

Default workflow

1. Put business constraints on the entity or DTO; keep form-level constraints for UI-only rules such as uploads. 2. Build the form type with explicit field types and options. 3. Split rules into validation groups when contexts differ. 4. Add data transformers or `PRE_SET_DATA`/`PRE_SUBMIT` listeners only where the model and the view disagree. 5. In the controller, check `isSubmitted() && isValid()` and pass the form itself to `render()`.

Guardrails

  • Pass the form, not `createView()`, to `render()` so an invalid submit answers 422.
  • A transformer that cannot convert throws `TransformationFailedException`, it never returns garbage.
  • Do not duplicate the same constraint on the form and on the entity.
  • Multi-step flows and the custom violation mapper are recent: verify the installed Symfony version first.

Progressive disclosure

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

Output contract

  • Form types and the constraints they rely on, with their groups.
  • Transformers, listeners or custom constraints, each with a reason.
  • Tests for a valid submit, an invalid submit (422), and each custom constraint.

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 form-types-validation.

Which coding agents can use form-types-validation?
form-types-validation 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.