Skip to main content
skill CX Codex

form-types-validation — Claude Code skill: how to install

form-types-validation generates Symfony form types, configures DTO validation groups, handles HTTP 422 responses, and sets up multi-step flows.

MIT ★ 234 updated 2026-10-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dev-toolings/superpowers-symfony --skill form-types-validation -a claude-code
Open on GitHub

What form-types-validation does

This skill directs Claude Code when scaffolding Symfony Form Types. Domain validation stays on entities or DTO classes, leaving form-level rules for UI concerns like file uploads. Context-specific rules, such as distinct profile and registration requirements, use validation groups.

When data structures differ between the view and the model, the skill adds form listeners or transformers. If a transformer fails, it throws TransformationFailedException instead of silently passing invalid data. Controllers send the form object directly to render() rather than calling createView() to keep HTTP 422 responses on failure.

Multi-step wizards and custom violation mappers depend on modern Symfony releases. Because of this, the skill verifies your framework version before generating code.

What it helps with

  • split validation constraints across groups for different contexts
  • ensure invalid form submissions respond with HTTP status 422
  • write data transformers throwing TransformationFailedException on errors
  • implement multi-step form sequences with version checks

Example prompts for the agent

  • Create a registration form type backed by a DTO with validation groups
  • Add a data transformer for comma-separated tags and write 422 tests
  • Build a multi-step checkout form flow for Symfony

How to install form-types-validation

1Skills CLI (Vercel)

npx skills add dev-toolings/superpowers-symfony --skill form-types-validation -a claude-code

2Manually: put the files in place

~/.claude/skills/form-types-validation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/form-types-validation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about form-types-validation

How to install form-types-validation in Claude Code?

Run npx skills add dev-toolings/superpowers-symfony --skill form-types-validation -a claude-code in your terminal.

Why pass the form instead of createView to render?

Passing the raw form instance lets the controller return HTTP 422 automatically whenever submitted data fails validation.

What does form-types-validation do?

It structures Symfony forms, separates domain validation from UI checks, registers data transformers, and outputs matching tests.

Source text

SKILL.md · MIT
---
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`

© dev-toolings · MIT · dev-toolings/superpowers-symfony

Similar skills

All skills for Backend and APIs →

From the same set51

The whole set →
controller-cleanup The controller-cleanup skill extracts business logic from fat Symfony controllers into services, handlers and commands. Leaves actions lean, delegating and responding only. CX Codex +1 ★ 234repo stars brainstorming brainstorming structures feature discovery for Symfony projects: clarifies unclear requirements, identifies framework components, and compares architecture designs. CX Codex +1 ★ 234repo stars runner-selection The runner-selection skill detects whether Symfony commands belong in Docker, DDEV, or the host environment. Use it when the right command prefix is unclear or containers may be stopped. CX Codex +1 ★ 234repo stars doctrine-events doctrine-events — a Claude skill for attaching side effects to Doctrine entity events in Symfony: timestamps, slugs, search index updates, notifications. CX Codex +1 ★ 234repo stars tdd-with-phpunit The tdd-with-phpunit skill guides PHPUnit-driven work on Symfony features, from checking a failing test to refactoring after it passes. Use it for command, form, and external-service tests. CX Codex +1 ★ 234repo stars using-symfony-superpowers using-symfony-superpowers is a Claude Code skill that detects the Symfony version, selects a skill, and sequences steps for complex tasks. CX Codex +1 ★ 234repo stars interfaces-and-autowiring interfaces-and-autowiring guides Symfony dependency injection in Claude Code by binding interfaces, configuring #[Target] aliases, and decorating services cleanly. CX Codex +1 ★ 234repo stars symfony-cache Configure Symfony Cache pools, entry expiry, and tag-based invalidation with this skill. It helps when caching costly reads or preventing a burst of recomputations after a key expires. CX Codex +1 ★ 234repo stars

Project sponsors

Companies that keep this analytics open