flask
Skill15 starsChanged 43 days agoMITView on GitHub
Expert Flask assistance covering Blueprints, application factories, Jinja2 templating, and SQLAlchemy extensions. Use when developing lightweight Python web services and applications.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- ui-iids/claude-skillstheir own version, first seen Jun 11, 2026
- microsoft/debugpytheir own version, first seen Apr 3, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- microsoft/debugpy★ 2.5ksame name
- conjure-3301/skills★ 0same name
- ui-iids/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 115
Use Flask Application Factory pattern:
- Very specific: line 137
Always structure applications using the Application Factory pattern (create_app()) and Blueprints.
- Distinctive: line 138
Run Flask applications behind a production WSGI/ASGI server like Gunicorn or Uvicorn with Gevent workers.
- Very specific: line 139
Use environment variables for SECRET_KEY and database credentials (python-dotenv).
- Very specific: line 140
Use extensions like Flask-SQLAlchemy and Flask-Migrate for relational data management.
- Very specific: line 144
Use the built-in development server (flask run) in production environments.
- Distinctive: line 145
Commit default secret keys to version control.
- Very specific: line 146
Use global state variables to store request-specific user data.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flask
Flask is a lightweight WSGI web framework for Python, offering modular blueprints, extensible request handling, and flexible integration with database ORMs and async handlers.
When to Use
- Lightweight Python Microservices: Rapidly prototyping APIs and small-to-medium web services without boilerplate.
- Machine Learning Inference Wrappers: Wrapping data science pipelines and Scikit-learn/XGBoost models with minimal overhead.
- Custom Architectures: Projects requiring complete freedom to select ORMs, auth libraries, and database drivers.
- Internal Scripting & Admin Utilities: Embedding web dashboards inside automated Python operations tooling.
Quick Start
from flask import Flask
import asyncio
app = Flask(__name__)
@app.route("/")
async def hello():
await asyncio.sleep(1)
return "Hello form Async Flask!"Core Concepts
Application Factory & Blueprint Pattern
Structuring scalable Flask applications:
# app/__init__.py
from flask import Flask
from .routes.users import user_bp
from .routes.orders import order_bp
def create_app(config_object="app.config.ProductionConfig"):
app = Flask(__name__)
app.config.from_object(config_object)
# Register modular blueprints
app.register_blueprint(user_bp, url_prefix="/api/v1/users")
app.register_blueprint(order_bp, url_prefix="/api/v1/orders")
return appType-Safe Request Handling & JSON Responses
Parsing payloads and handling route parameters:
# app/routes/users.py
from flask import Blueprint, request, jsonify, abort
user_bp = Blueprint("users", __name__)
@user_bp.route("/<int:user_id>", methods=["GET"])
def get_user(user_id):
if user_id <= 0:
abort(404, description="User not found")
return jsonify({
"id": user_id,
"name": f"User_{user_id}",
"status": "active"
}), 200
@user_bp.route("/", methods=["POST"])
def create_user():
data = request.get_json()
if not data or "email" not in data:
return jsonify({"error": "Email is required"}), 400
return jsonify({"id": 42, "email": data["email"]}), 201Centralized Error Handling & RFC 7807
Formatting consistent API exceptions:
from flask import jsonify
def register_error_handlers(app):
@app.errorhandler(404)
def resource_not_found(e):
return jsonify({
"error": "Not Found",
"message": str(e.description),
"status": 404
}), 404
@app.errorhandler(500)
def internal_server_error(e):
return jsonify({
"error": "Internal Server Error",
"message": "An unexpected error occurred",
"status": 500
}), 500Common Patterns
Modular Application Factory with Blueprints
Problem: Monolithic app.py script becoming unmaintainable as routes and extensions grow.
Solution: Use Flask Application Factory pattern:
# app/__init__.py
from flask import Flask
from .extensions import db
from .routes.api import api_bp
def create_app(config_name="default"):
app = Flask(__name__)
app.config.from_object(f"config.{config_name}")
db.init_app(app)
app.register_blueprint(api_bp, url_prefix="/api/v1")
return appBest Practices
Do:
- Always structure applications using the Application Factory pattern (
create_app()) and Blueprints. - Run Flask applications behind a production WSGI/ASGI server like Gunicorn or Uvicorn with Gevent workers.
- Use environment variables for
SECRET_KEYand database credentials (python-dotenv). - Use extensions like
Flask-SQLAlchemyandFlask-Migratefor relational data management.
Don't:
- Use the built-in development server (
flask run) in production environments. - Commit default secret keys to version control; use cryptographically random secrets.
- Use global state variables to store request-specific user data; use Flask's
gcontext object.
Troubleshooting
| Error | Cause | Solution |
Working outside of application context | Accessing database or current_app outside request/app context. | Wrap code with with app.app_context():. |
RuntimeError: The session is unavailable | app.secret_key not configured. | Set app.secret_key = "strong-random-key" in config. |
Method Not Allowed (405) | Route does not explicitly permit request method. | Add method to decorator: @app.route('/path', methods=['GET', 'POST']). |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

