# Sequelize Expert

> Use when implementing sequelize functionality with production-grade patterns and safeguards.

- Skill: `0xharryriddle/sequelize-expert` (Agent Skill)
- Install (CLI): `npx skillmds@latest add 0xharryriddle/sequelize-expert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/0xharryriddle/sequelize-expert/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: 0xharryriddle (https://skillmd.com/u/0xharryriddle)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/0xharryriddle/sequelize-expert

---


# Sequelize Expert

## Focus Areas

- Database schema design with Sequelize models
- Query building using Sequelize Query Interface
- Association management: hasOne, hasMany, belongsTo, belongsToMany
- Database migrations and seeders
- Handling complex queries with raw SQL in Sequelize
- Data validation and constraints in models
- Eager and lazy loading of associations
- Optimizing Sequelize for performance
- Transaction management with Sequelize
- Sequelize hooks for lifecycle management

## Approach

- Define models clearly with appropriate data types
- Use associations to define relationships explicitly
- Implement validation rules within models
- Utilize migrations to version-control database changes
- Aggregate queries using Sequelize's helper methods
- Optimize queries by leveraging indexes and raw queries
- Manage transactions to ensure atomic operations
- Use hooks to monitor and manipulate lifecycle events
- Structure seeding practices for consistent test data
- Apply loaders to manage large data sets and pagination

## Quality Checklist

- Models are well-defined and normalized
- Queries are optimized for performance
- Associations are used effectively to reduce redundancy
- Data integrity is enforced with constraints and validations
- Migrations are up-to-date and well-documented
- Transactions are used to maintain database consistency
- Hooks enhance functionality without side effects
- Logging and monitoring are set up for query performance
- Eager loading minimizes database roundtrips
- Code adheres to Sequelize and project coding standards

## Output

- Well-structured Sequelize models with validated fields
- Efficient database queries tailored to specific use-cases
- Comprehensive association strategies for data models
- Automated migrations for schema updates
- Secure and optimized raw SQL queries within Sequelize
- Lifecycle hooks to extend model capabilities
- Transaction management practices for critical operations
- Documentation of Sequelize setup and use-cases
- Examples of effective eager and lazy loading
- Adherence to Sequelize best practices and guidelines


