Flask expert
Builds, modernizes and audits Flask 3.x applications.
Safety check
- Not rated by Claude yet. We only sell skills Claude has read and rated 7 out of 10 or higher, so this one is a free link to its author.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: flask-expert
description: "Builds, modernizes and audits Flask 3.x applications: application factories and blueprints, Flask-SQLAlchemy 3.1 with SQLAlchemy 2.x typed models and Flask-Migrate, JSON APIs validated with Pydantic or marshmallow and JSON errors, Jinja templates with Flask-WTF CSRF, Flask-Login and Flask-JWT-Extended auth, pytest fixtures over the factory, and gunicorn or waitress deployment with Celery, RQ or APScheduler jobs. Use when code imports from flask or flask_* extensions (create_app, Blueprint, app.route, flask_sqlalchemy, flask_login, flask_wtf), when adding login, an API endpoint, forms, tests, background jobs or production deployment to a Flask app, when reviewing or upgrading an existing Flask project, or when diagnosing Flask errors such as 'Working outside of application context' or a 500 that only appears under gunicorn. Not for Django or FastAPI projects."
license: MIT
metadata:
author: https://github.com/Saifullah1999Pk
version: "1.0.0"
domain: backend
triggers: Flask, Flask app, Flask API, create_app, Blueprint, Flask-SQLAlchemy, Flask-Migrate, Flask-Login, Flask-WTF, Flask-JWT-Extended, Jinja2, Werkzeug, gunicorn, application context
role: expert
scope: implementation
output-format: code
related-skills: django-expert, fastapi-expert
---
# Flask Expert
Senior Flask engineer for Flask 3.1 and SQLAlchemy 2.x on Python 3.11+: factory-built apps that start only with real configuration, typed models, JSON APIs that never answer in HTML, and tests that build a fresh app per test.
## When to Use This Skill
- Building a new Flask JSON API or server-rendered Flask app
- Adding models, migrations, login, JWT auth, forms or validation to an existing Flask app
- Writing pytest tests for a Flask app, or making an existing suite isolate its tests
- Preparing a Flask app for production: gunicorn or waitress, reverse proxy, secure cookies, background jobs
- Reviewing or modernizing legacy Flask code (module-level `app`, `db.Column`, `Model.query`, removed 2.x APIs)
## Core Workflow
1. **Structure** — Check the pinned Flask and Flask-SQLAlchemy versions and the existing layout; build new apps with `create_app(test_config=None)`, unbound extensions and blueprints, settings from `FLASK_*` environment variables
2. **Data** — `Mapped`/`mapped_column` models and `select()` queries with eager loading; schema changes go through Flask-Migrate
3. **Interface** — JSON blueprints with schema validation (Pydantic, or the project's marshmallow) and an app-level JSON error handler, or Jinja templates with Flask-WTF forms and Post/Redirect/Get
4. **Secure** — `CSRFProtect` for browser forms, Flask-Login sessions or Flask-JWT-Extended tokens, ownership checks on every row, production cookie flags
5. **Test & deploy** — pytest fixtures that call the factory with a fresh database per test, or the project's existing fixtures (run them before calling the work done), then gunicorn behind `ProxyFix` (waitress on Windows) and jobs that run in an app context
## Reference Guide
| Topic | Reference | Load When |
| --- | --- | --- |
| App structure | `references/app-structure.md` | Factory, config and secrets, extensions, blueprints, error handlers, CLI commands, Flask 3.x removals |
...From Jeffallan's repository, MIT licence.