Skip to content
Back to skills

Flask Apps

ASecurity

Structure Flask web apps cleanly with application factories, blueprints, validated config, and test clients

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentpythonflaskapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill flask-apps --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Flask Apps?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Flask Apps
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-flask-apps-anvil/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-flask-apps-anvil)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: flask-apps
description: Structure Flask web apps cleanly with application factories, blueprints, validated config, and test clients
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# Flask apps

Use when building or modifying Python Flask services or blueprints.

## Structure
- Use an application factory (`create_app(config=None)`) so tests and CLI commands boot isolated instances without global state.
- Group routes by domain into `Blueprint` modules; keep business logic in service functions outside request handlers.
- Load secrets and database URLs from environment variables, never hardcoded `SECRET_KEY` defaults.

## Requests and errors
- Set explicit JSON error handlers for `400`, `404`, and `500` so callers never receive HTML stack pages in API routes.
- Validate request JSON with explicit schemas (Pydantic/Marshmallow) before touching database models.
- Never run the Werkzeug reloader or `debug=True` in production; serve behind Gunicorn or Waitress with worker timeouts.

## Verify
Run `pytest` using `app.test_client()` covering blueprint routes, validation failures, and teardown cleanup.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.