flask-forms-validation
Securely handling user input using Flask-WTF and robust validation patterns.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "flask-forms-validation"
description: "Securely handling user input using Flask-WTF and robust validation patterns."
license: "MIT"
---
# Flask Forms & Validation
User input is the most dangerous part of a web app. Flask-WTF provides a secure, Pythonic layer of protection.
## Form Definitions
- **WTForms**: Define forms as Python classes (e.g., `LoginForm(FlaskForm)`).
- **Validators**: Use `DataRequired()`, `Email()`, `Length()`, and custom methods to ensure data integrity.
## CSRF Protection
Flask-WTF automatically handles Cross-Site Request Forgery tokens. Ensure `{{ form.hidden_tag() }}` is present in your templates.
## File Uploads
Use `FileField` and `FileRequired` with `secure_filename()` to safely handle user-uploaded media.
## Best Practices
- **Feedback**: Display clear error messages next to invalid fields using `form.errors`.
- **POST/Redirect/GET Pattern**: Always redirect after a successful form submission to prevent duplicate data.More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

