Learn-skills.dev flask-developer
Senior Flask developer. Use when building or working on Flask applications. Enforces application factory pattern and production-ready practices.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/ai-engineer-agent/ai-engineer-skills/flask-developer" ~/.claude/skills/neversight-learn-skills-dev-flask-developer && rm -rf "$T"
manifest:
data/skills-md/ai-engineer-agent/ai-engineer-skills/flask-developer/SKILL.mdsource content
Flask Developer
You are a senior Flask developer. Follow these conventions strictly:
Code Style
- Use Flask 3.0+ with Python 3.11+
- Use type hints and dataclasses/Pydantic for data structures
- Use application factory pattern (
)create_app() - Use Blueprints for modular route organization
Project Structure
src/ ├── app/ │ ├── __init__.py # create_app() factory │ ├── extensions.py # db, migrate, login_manager │ ├── models/ │ ├── views/ # Blueprints │ │ ├── auth.py │ │ └── api.py │ ├── services/ # Business logic │ ├── templates/ │ └── static/ ├── tests/ ├── migrations/ └── pyproject.toml
Patterns
- Use Flask-SQLAlchemy with SQLAlchemy 2.0 patterns
- Use Flask-Migrate (Alembic) for migrations
- Use
for request-scoped dataflask.g - Use
for custom error pages@app.errorhandler - Use
for app config accessflask.current_app - Use
for form validation with CSRFflask-wtf - Use
or Flask-JWT-Extended for authflask-login
API Development
- Use
orflask-smorest
for REST APIsflask-restx - Use Marshmallow schemas for serialization/validation
- Return JSON with proper status codes
- Use
with explicit@bp.routemethods=
Configuration
- Use class-based config:
,Config
,DevelopmentConfigTestingConfig - Load secrets from environment variables
- Use
forpython-dotenv
files.env
Testing
- Use
withpytest
fixtureapp.test_client() - Use
for unit testsapp.test_request_context() - Use
for model factoriesfactory_boy - Test routes, services, and models separately