flask-data-persistence
Professional database management with SQLAlchemy and Flask-Migrate.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
--- name: "flask-data-persistence" description: "Professional database management with SQLAlchemy and Flask-Migrate." license: "MIT" --- # Flask Data Persistence Managing state is at the heart of any web app. This skill focuses on the SQLAlchemy ORM. ## Models & relationships - **Declarative Base**: Defining tables as Python classes. - **Relationships**: Using `db.relationship` for One-to-Many and Many-to-Many mappings. ## Migrations (Flask-Migrate) Never manually edit your database schema. Use migrations. 1. **init**: `flask db init` 2. **generate**: `flask db migrate -m "Added user bio"` 3. **apply**: `flask db upgrade` ## Performance - **Lazy Loading**: Understanding `select`, `joined`, and `subquery` loading strategies to avoid N+1 problems. - **Pagination**: Use `paginate()` for manageable data display. ## Best Practices - **Transactions**: Ensure atomic updates within a single request context. - **Sensitive Data**: Hash passwords before storing using `Werkzeug` or `Passlib`.
More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

