Flask patterns for app factories, blueprints, the debugger, secret keys, escaping, sessions, file serving, and 3.1 changes. Load before any edit in a Flask app, however small, and for Flask questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Flask Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-flask-patterns)
---
name: flask-patterns
description: Flask patterns for app factories, blueprints, the debugger, secret keys, escaping, sessions, file serving, and 3.1 changes. Load before any edit in a Flask app, however small, and for Flask questions.
---
# Flask patterns
Default assumption: Flask 3.1 on Werkzeug 3.1, per the Flask changelog. 3.2 is unreleased.
A row applies when the Flask or Werkzeug version the project pins, in `pyproject.toml`, a requirements file, or the lockfile, is at least the row's version.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing Flask code, or raising the Flask or Werkzeug version | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing Flask code, templates, or deployment | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Writing the app factory, a blueprint, config, logging, a context, an error handler, a response header, an async view, or a test | [reference/practices.md](reference/practices.md) |
| Configuring ruff for a Flask app | [reference/tooling.md](reference/tooling.md) |