/fullstack-dev-skills:flask-expertfrom fullstack-dev-skills
Builds, modernizes and audits Flask 3.x apps: factories, blueprints, SQLAlchemy 2.x typed models, JSON APIs with Pydantic/marshmallow, Jinja templates with CSRF, Flask-Login/JWT auth, pytest fixtures, and gunicorn/waitress deployment with Celery/RQ/APScheduler jobs.
Ships in fullstack-dev-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
app, db.Column, Model.query, removed 2.x APIs)create_app(test_config=None), unbound extensions and blueprints, settings from FLASK_* environment variablesMapped/mapped_column models and select() queries with eager loading; schema changes go through Flask-MigrateCSRFProtect for browser forms, Flask-Login sessions or Flask-JWT-Extended tokens, ownership checks on every row, production cookie flagsProxyFix (waitress on Windows) and jobs that run in an app context| Topic | Reference | Load When |
|---|---|---|
| App structure | references/app-structure.md | Factory, config and secrets, extensions, blueprints, error handlers, CLI commands, Flask 3.x removals |
| Database | references/database.md | Models, queries, pagination, N+1, transactions, Flask-Migrate, projects pinned to Flask-SQLAlchemy 2.x |
| REST APIs | references/rest-apis.md | JSON responses, Pydantic validation, JSON errors, pagination envelope, CORS, async def views |
| Templates & forms | references/templates-forms.md | Jinja autoescaping, Flask-WTF forms, CSRF, flash messages, session cookie |
| Authentication | references/authentication.md | Password hashing, Flask-Login, Flask-JWT-Extended, cookie flags, ownership and roles |
| Testing | references/testing.md | pytest fixtures over the factory, per-test database, logged-in clients, CSRF-on tests, SQLite vs PostgreSQL |
| Deployment & jobs | references/deployment.md | gunicorn, waitress on Windows, ProxyFix, production config, Celery, RQ, scheduled jobs |
A factory, one blueprint and one typed model, configured from FLASK_SECRET_KEY and FLASK_SQLALCHEMY_DATABASE_URI:
# app.py: run with `flask --app app run --debug`
from flask import Blueprint, Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import String, select
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
class Base(DeclarativeBase):
pass
db = SQLAlchemy(model_class=Base)
bp = Blueprint("notes", __name__)
class Note(db.Model):
id: Mapped[int] = mapped_column(primary_key=True)
title: Mapped[str] = mapped_column(String(200))
@bp.get("/notes")
def list_notes() -> dict:
notes = db.session.scalars(select(Note).order_by(Note.id)).all()
return {"items": [{"id": n.id, "title": n.title} for n in notes]}
def create_app(test_config: dict | None = None) -> Flask:
app = Flask(__name__)
app.config.from_prefixed_env() # FLASK_SECRET_KEY -> SECRET_KEY
if test_config is not None:
app.config.from_mapping(test_config)
for key in ("SECRET_KEY", "SQLALCHEMY_DATABASE_URI"):
if not app.config.get(key):
raise RuntimeError(f"Set FLASK_{key}")
db.init_app(app)
app.register_blueprint(bp, url_prefix="/api")
return app
Tables come from Flask-Migrate (flask db upgrade); only tests call db.create_all(). An API also needs the app-level HTTPException handler from app-structure.md.
First read the pins: on Flask-SQLAlchemy 2.x, items 1 and 3 do not apply (database.md). Run each command from the project root, adding --exclude-dir=.venv (your virtualenv); hits in test files are expected. Ordered by how often unaided code got it wrong:
grep -rnE 'db\.Column\(' --include='*.py' . → no hits; columns are Mapped[...] = mapped_column(...) (database.md).grep -rnE '^[a-z_]*app = (Flask|create_app)\(' --include='*.py' . → only entry points nothing imports (wsgi.py, Celery/RQ worker modules) (app-structure.md).grep -rnE '\b[A-Z]\w*\.query\b' --include='*.py' . → no hits; db.session.get, select(), db.get_or_404, db.paginate(max_per_page=...) (database.md).grep -rnE 'SECRET_KEY["'\'']*\]? *= *["'\'']|SECRET_KEY.*(get(env)?\([^)]*,|\) or |token_(hex|urlsafe|bytes))' --include='*.py' . → no hits: no literal, default or per-process random key; the factory raises when it is missing; and git ls-files | grep -E '(^|/)\.env$' → no output and git check-ignore -q .env succeeds (exit 0): .env is git-ignored, only .env.example is committed (app-structure.md).grep -rnE '(errorhandler|register_error_handler)\(HTTPException' --include='*.py' . → one app-level handler that answers JSON under /api/ (no output = HTML error pages) (rest-apis.md).grep -rnE 'FLASK_ENV|\bapp\.env\b|before_(app_)?first_request|flask\.__version__|from flask import .*\b(Markup|escape)\b' --include='*.py' --include='.env*' --include='.flaskenv' . → no hits (app-structure.md).grep -rn 'request.get_json(' --include='*.py' . → each body goes through one schema (Pydantic model_validate/TypeAdapter with extra="forbid", or the project's existing marshmallow schema): no truthiness checks, Model(**data), silent= or force= (rest-apis.md).grep -rnE 'create_all\(|text\(["'\'']ALTER' --include='*.py' . → only in tests; a migrations/ folder exists and deploys run flask db upgrade (database.md).grep -rn 'CSRFProtect(' --include='*.py' . → initialized in the factory, {{ csrf_token() }} in every POST form, no hand-rolled token check (templates-forms.md).grep -rn 'relationship(' --include='*.py' . → lazy="raise_on_sql" (or per-query raiseload("*", sql_only=True)), and list queries that serialize a relationship use selectinload/joinedload (database.md).grep -rniE '(select|insert|update|delete) .*(" *\+|\+ *"|%s|\.format\()|f["'\''](select|insert|update|delete) ' --include='*.py' . → no hits; text() takes values as :name parameters (database.md).grep -rnE 'debug=True|app\.run\(' --include='*.py' . → no debug=True; production starts gunicorn or waitress, never app.run (deployment.md).grep -rnE 'BackgroundScheduler\(|scheduler\.start\(' --include='*.py' . → never in create_app() or at import: cron plus a flask command, or the Redis lease started from wsgi.py (deployment.md).grep -rn 'async def' --include='*.py' . → flask[async] installed, and nobody expects more throughput: each request still holds a worker (rest-apis.md).create_app(test_config=None); a module-level app lives only in wsgi.py. An existing app keeps its structure and style: add the feature in place and suggest the factory, never convert it unaskedSECRET_KEY and the database URI from the environment, one value shared by every worker, and raise when missingDeclarativeBase + Mapped models and select() queries; match the existing style on a Flask-SQLAlchemy 2.x pinmax_per_page= to every paginateHTTPException handler; validate every JSON body with one schema library, Pydantic by default or the project's existing marshmallow/flask-smorest (422 on failure)CSRFProtect app-wide for browser forms, hash passwords with Werkzeug, filter rows by ownertesting.md)secrets.token_*() value, or commit .env: dev secrets go in a git-ignored .env, with only a placeholder .env.example committedFLASK_ENV, before_first_request, flask.__version__ or from flask import Markupdb.create_all() or ALTER TABLE at import or in create_app()+, % or .format()app.run()/debug=True on a server, or gunicorn on Windows; start APScheduler in create_app()When implementing a Flask feature, provide:
flask db migrate/upgrade commands, and the blueprint viewsasync def view still holds one worker per request), written into the README or a comment by the code, not only the chatFlask 3.1, Werkzeug, application factory, blueprints, Flask-SQLAlchemy 3.1, SQLAlchemy 2.x, Mapped, mapped_column, select(), Flask-Migrate, Alembic, Pydantic v2, marshmallow, flask-smorest, Flask-CORS, Jinja2, Flask-WTF, CSRFProtect, Flask-Login, Flask-JWT-Extended, pytest, gunicorn, waitress, ProxyFix, Celery, RQ, APScheduler
django-expert — batteries-included Python web apps with the Django ORM, admin and DRFfastapi-expert — async-first Python APIs; prefer it over async def Flask views for async-heavy workreferences/app-structure.md (opens in a new tab)references/authentication.md (opens in a new tab)references/database.md (opens in a new tab)references/deployment.md (opens in a new tab)references/rest-apis.md (opens in a new tab)references/templates-forms.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Flask, Python, SQLAlchemy, Pytest, Celery, PostgreSQL, SQLite, MySQL
flask, flask-sqlalchemy, flask-migrate, flask-login, flask-jwt, pytest, gunicorn, celery
Generated from the plugin's indexed repository (jeffallan/claude-skills) — no native marketplace selected
npx claudepluginhub p/jeffallan-fullstack-dev-skills70 skills in this plugin
/angular-architectGenerates Angular 17+ standalone components, configures advanced routing with lazy loading and guards, implements NgRx state management, applies RxJS patterns, and optimizes bundle performance. Use when building Angular 17+ applications with standalone components or signals, setting up NgRx stores, establishing RxJS reactive patterns, performance tuning, or writing Angular tests for enterprise apps./api-designerUse when designing REST or GraphQL APIs, creating OpenAPI specifications, or planning API architecture. Invoke for resource modeling, versioning strategies, pagination patterns, error handling standards./architecture-designer3 plugins in one repository ship this exact skill · first indexed Nov 27, 2026
Other plugins' skills for the same job