flask-python
Skill266 starsChanged 10 months agoApache-2.0View on GitHub
Guidelines for Flask Python development with best practices for blueprints, RESTful APIs, and application factories.
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 21 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
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 12
Write concise, technical responses with accurate Python examples
- Distinctive: line 13
Use functional, declarative programming.
- Distinctive: line 14
Prefer iteration and modularization over code duplication
- Very specific: line 15
Use descriptive variable names with auxiliary verbs (e.g., is_active, has_permission)
- Very specific: line 16
Use lowercase with underscores for directories and files (e.g., blueprints/user_routes.py)
- Very specific: line 22
Use def for function definitions
- Distinctive: line 26
Use concise one-line syntax for simple conditional statements
- Distinctive: line 31
Use early returns for error conditions to prevent deep nesting
- Distinctive: line 32
Place successful logic last in functions for improved readability
- Very specific: line 33
Avoid unnecessary else statements.
- Distinctive: line 36
Use custom error types or error factories for consistent handling
- Distinctive: line 49
Use Flask application factories for modularity and testing
- Very specific: line 53
Use Flask decorators: before_request, after_request, teardown_request
- Distinctive: line 61
Use Flask-Caching for frequently accessed data
- Distinctive: line 65
Use background tasks for time-consuming operations (e.g., Celery)
- Distinctive: line 69
Use Flask's application context and request context appropriately
- Distinctive: line 75
Use Flask-SQLAlchemy for ORM operations
- Distinctive: line 81
Use Marshmallow for object serialization/deserialization and input validation
- Distinctive: line 82
Create schema classes for each model for consistent handling
- Distinctive: line 87
Use decorators for protecting routes requiring authentication
- Distinctive: line 91
Write unit tests using pytest
- Distinctive: line 92
Use Flask's test client for integration testing
- Distinctive: line 97
Use Flask-RESTX or Flasgger for Swagger/OpenAPI documentation
- Distinctive: line 98
Document all endpoints with request/response schemas
- Distinctive: line 102
Use Gunicorn or uWSGI as WSGI HTTP Server
- Distinctive: line 104
Use environment variables for sensitive information and configuration
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flask Python Development
You are an expert in Flask and Python web development. Follow these guidelines when writing Flask code.
Key Principles
- Write concise, technical responses with accurate Python examples
- Use functional, declarative programming; avoid classes except for Flask views
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g.,
is_active,has_permission) - Use lowercase with underscores for directories and files (e.g.,
blueprints/user_routes.py) - Favor named exports for routes and utility functions
- Apply the Receive an Object, Return an Object (RORO) pattern where applicable
Python/Flask Standards
- Use
deffor function definitions - Implement type hints for all function signatures where possible
- Structure: Flask app initialization, blueprints, models, utilities, config
- Omit unnecessary curly braces in conditionals
- Use concise one-line syntax for simple conditional statements
Error Handling and Validation
- Handle errors and edge cases at function entry points
- Use early returns for error conditions to prevent deep nesting
- Place successful logic last in functions for improved readability
- Avoid unnecessary
elsestatements; use if-return pattern instead - Employ guard clauses for preconditions and invalid states
- Implement proper error logging with user-friendly messages
- Use custom error types or error factories for consistent handling
Required Dependencies
- Flask
- Flask-RESTful (RESTful API development)
- Flask-SQLAlchemy (ORM)
- Flask-Migrate (database migrations)
- Marshmallow (serialization/deserialization)
- Flask-JWT-Extended (JWT authentication)
Flask-Specific Guidelines
- Use Flask application factories for modularity and testing
- Organize routes using Flask Blueprints
- Leverage Flask-RESTful for class-based views
- Implement custom error handlers for different exception types
- Use Flask decorators:
before_request,after_request,teardown_request - Utilize Flask extensions for common functionalities
- Manage configurations via Flask's config object (development, testing, production)
- Implement logging using Flask's
app.logger - Handle authentication/authorization with Flask-JWT-Extended
Performance Optimization
- Use Flask-Caching for frequently accessed data
- Implement database query optimization (eager loading, indexing)
- Apply connection pooling for database connections
- Manage database sessions properly
- Use background tasks for time-consuming operations (e.g., Celery)
Key Conventions
- Use Flask's application context and request context appropriately
- Prioritize API performance metrics (response time, latency, throughput)
- Structure application with blueprints, clear separation of concerns, and environment variables
Database Interaction
- Use Flask-SQLAlchemy for ORM operations
- Implement database migrations via Flask-Migrate
- Properly manage SQLAlchemy sessions, ensuring closure after use
Serialization and Validation
- Use Marshmallow for object serialization/deserialization and input validation
- Create schema classes for each model for consistent handling
Authentication and Authorization
- Implement JWT-based authentication using Flask-JWT-Extended
- Use decorators for protecting routes requiring authentication
Testing
- Write unit tests using pytest
- Use Flask's test client for integration testing
- Implement test fixtures for database and application setup
API Documentation
- Use Flask-RESTX or Flasgger for Swagger/OpenAPI documentation
- Document all endpoints with request/response schemas
Deployment
- Use Gunicorn or uWSGI as WSGI HTTP Server
- Implement proper logging and monitoring in production
- Use environment variables for sensitive information and configuration
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.

