sequelize-expert — Claude Code subagent: what it does, how to install
sequelize-expert — a Claude subagent for Sequelize work: model design, associations, migrations, seeders and transactions.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/sequelize-expert.mdWhat sequelize-expert does
The agent covers the everyday Sequelize chores. It drafts models with explicit field types, sets up relations, builds queries through the Query Interface, and writes migration and seeder files.
Its definition is one markdown file with four sections: focus areas, approach, a quality checklist, and the output it aims for. The checklist carries the practical rules. Normalised models, validation and constraints on fields, indexes for slow reads, transactions around writes that have to stay atomic, and eager loading to cut round trips.
Raw SQL is fine when the query builder falls short. Hooks are allowed as well, under one condition from the checklist: no side effects. A hook can extend the model and still leave the rest of its behaviour alone.
What it helps with
- model a schema with typed Sequelize models
- wire tables together with
hasManyandbelongsTo - generate a migration and seeder for a schema change
- speed up a slow query with indexes or raw SQL
- wrap a multi-step write in one transaction
Example prompts for the agent
- Look at the
Ordermodel — lookups byuserIdare slow. Suggest indexes. - Write a migration that adds a
statuscolumn toorderswith a default value. - Set up
belongsToManybetweenStudentandCourseand show the eager load.
How to install sequelize-expert
Manually: put the files in place
.claude/agents/sequelize-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/sequelize-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/sequelize-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about sequelize-expert
How do I install sequelize-expert in Claude Code?
Put the subagent file at .claude/agents/sequelize-expert.md in your project; Claude picks up agents from that folder.
What does sequelize-expert do?
It writes Sequelize models, configures associations, builds queries, migrations and seeders, and manages transactions.
Which association types can it set up?
hasOne, hasMany, belongsTo and belongsToMany, with eager and lazy loading of the related rows.
Source text
sequelize-expert.md · MIT
--- name: sequelize-expert description: Expert in Sequelize ORM, proficient in database modeling, querying, associations, and migrations. Optimizes Sequelize usage for performance and data integrity. model: claude-sonnet-4-20250514 --- ## 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
© 0xfurai · MIT · 0xfurai/claude-code-subagents