/dobeutech-claude-code-custom:database-patternsfrom dobeutech-claude-code-custom
Use when designing schemas, modeling data, choosing or using an ORM, writing indexes and optimizing slow queries, planning migrations, or handling transactions and relations.
Ships in dobeutech-claude-code-custom. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Comprehensive patterns for database design, optimization, and management.
// ✅ Model-based operations
const user = await User.findById(id);
user.name = 'New Name';
await user.save();
// ✅ Abstract data access
class UserRepository {
async findById(id: string): Promise<User | null> {
return db.users.findOne({ where: { id } });
}
async create(data: CreateUserData): Promise<User> {
return db.users.create(data);
}
}
-- ✅ Index frequently queried columns
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_posts_user_id ON posts(user_id);
-- ✅ Composite indexes for multi-column queries
CREATE INDEX idx_posts_user_status ON posts(user_id, status);
// ✅ Use select to limit fields
await db.users.findAll({
attributes: ['id', 'name', 'email'],
where: { status: 'active' }
});
// ✅ Eager loading to prevent N+1
await db.users.findAll({
include: [{ model: Post, as: 'posts' }]
});
// ✅ Additive changes first
export async function up(queryInterface) {
await queryInterface.addColumn('users', 'phone', {
type: DataTypes.STRING,
allowNull: true // Allow null initially
});
}
// ✅ Populate data
export async function up(queryInterface) {
await queryInterface.addColumn('users', 'phone', {
type: DataTypes.STRING,
allowNull: true
});
// Populate existing records
await queryInterface.sequelize.query(
`UPDATE users SET phone = '' WHERE phone IS NULL`
);
// Make required
await queryInterface.changeColumn('users', 'phone', {
type: DataTypes.STRING,
allowNull: false
});
}
// ✅ Always provide rollback
export async function down(queryInterface) {
await queryInterface.removeColumn('users', 'phone');
}
-- ✅ Normalized design
users (id, name, email)
posts (id, user_id, title, content)
comments (id, post_id, user_id, content)
-- ✅ Denormalize for read performance
posts (id, user_id, user_name, title, content, comment_count)
// ✅ Use transactions for atomic operations
await db.transaction(async (t) => {
const user = await User.create(data, { transaction: t });
await Profile.create({ userId: user.id }, { transaction: t });
});
/migrate-db - Plan and execute migrationsdatabase-migrator - Database migration specialistWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
10 skills in this plugin
/api-design-patternsUse when designing or reviewing API contracts — REST resource modeling, GraphQL schemas, gRPC services, versioning schemes, auth flows, pagination, error response shapes, or API documentation./backend-patternsUse when building or refactoring server-side code in Node.js, Express, or Next.js API routes — route/controller/service layering, middleware, auth, caching, background jobs, error handling, and database access./clickhouse-ioUse when working with ClickHouse — designing MergeTree tables, partitioning and ordering keys, materialized views, writing or optimizing analytical OLAP queries, or bulk ingest and data-engineering pipelines./coding-standardsUse when writing, reviewing, or refactoring TypeScript, JavaScript, React, or Node.js code and you need the project's baseline conventions — naming, file structure, typing rules, error handling, comments, and code-quality principles./frontend-patternsUse when building React or Next.js UI — component composition, hooks, state management, data fetching, rendering and bundle performance, forms, and accessibility./memory-managementUse when setting up or working with persistent memory and cross-session context retention in Claude Code, including mem0 integration, storing and retrieving memories, and memory hygiene.Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, repository: Invalid input: expected string, received object, commands: Invalid input, agents.0: Invalid string: must start with "./", agents.0: Invalid string: must end with ".md", agents.1: Invalid string: must start with "./", agents.1: Invalid string: must end with ".md", agents.2: Invalid string: must start with "./", agents.2: Invalid string: must end with ".md", agents.3: Invalid string: must start with "./", agents.3: Invalid string: must end with ".md", agents.4: Invalid string: must start with "./", agents.4: Invalid string: must end with ".md", agents.5: Invalid string: must start with "./", agents.5: Invalid string: must end with ".md", agents.6: Invalid string: must start with "./", agents.6: Invalid string: must end with ".md", agents.7: Invalid string: must start with "./", agents.7: Invalid string: must end with ".md", agents.8: Invalid string: must start with "./", agents.8: Invalid st…
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, repository: Invalid input: expected string, received object, commands: Invalid input, agents.0: Invalid string: must start with "./", agents.0: Invalid string: must end with ".md", agents.1: Invalid string: must start with "./", agents.1: Invalid string: must end with ".md", agents.2: Invalid string: must start with "./", agents.2: Invalid string: must end with ".md", agents.3: Invalid string: must start with "./", agents.3: Invalid string: must end with ".md", agents.4: Invalid string: must start with "./", agents.4: Invalid string: must end with ".md", agents.5: Invalid string: must start with "./", agents.5: Invalid string: must end with ".md", agents.6: Invalid string: must start with "./", agents.6: Invalid string: must end with ".md", agents.7: Invalid string: must start with "./", agents.7: Invalid string: must end with ".md", agents.8: Invalid string: must start with "./", agents.8: Invalid st…
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.