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 Apps?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-flask-apps-anvil)
---
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.