flask-developer
2
总安装量
2
周安装量
#63340
全站排名
安装命令
npx skills add https://github.com/ai-engineer-agent/ai-engineer-skills --skill flask-developer
Agent 安装分布
trae
2
gemini-cli
2
claude-code
2
codex
2
kiro-cli
2
cursor
2
Skill 文档
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
flask.gfor request-scoped data - Use
@app.errorhandlerfor custom error pages - Use
flask.current_appfor app config access - Use
flask-wtffor form validation with CSRF - Use
flask-loginor Flask-JWT-Extended for auth
API Development
- Use
flask-smorestorflask-restxfor REST APIs - Use Marshmallow schemas for serialization/validation
- Return JSON with proper status codes
- Use
@bp.routewith explicitmethods=
Configuration
- Use class-based config:
Config,DevelopmentConfig,TestingConfig - Load secrets from environment variables
- Use
python-dotenvfor.envfiles
Testing
- Use
pytestwithapp.test_client()fixture - Use
app.test_request_context()for unit tests - Use
factory_boyfor model factories - Test routes, services, and models separately