express-js/skills/skills/db-seed-generator/SKILL.md
Generate database seed files and one-off import/migration scripts for an Express.js + MongoDB API. Creates numbered seed runners in db/seeds/ and standalone scripts in scripts/. Use this skill whenever the user wants to create seed data, import data from CSV or JSON, write a migration script, populate the database, do a bulk update, or says things like "seed the database with test data" or "import products from this JSON" or "write a script to reset all user passwords".
npx skillsauth add spuneiartur/claude-agent-specs db-seed-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates database seed files (db/seeds/) for repeatable initial data and standalone scripts (scripts/) for one-off migrations and imports. Both follow established patterns and connect to MongoDB properly.
db/seeds/)npm run seed001_identities.js, 002_categories.jsdb/resources/db/seeds/index.jsscripts/)node npm.js {script-name} (without .js extension)runScript() from express-goodies/functions for DB connectionCheck existing seeds in db/seeds/ to find the next number:
001_identities.js
002_xxx.js ← next would be 002 or whatever follows
db/resources/{resource}.jsRead references/seed-template.md for the complete pattern.
const {resources} = () => {
return [
{
name: 'Example Item 1',
// fields matching the model schema
},
{
name: 'Example Item 2',
},
];
};
export default {resources};
If data needs async processing (e.g. hashing passwords), make it async:
import bcrypt from 'bcryptjs';
const identities = async () => {
const password = await bcrypt.hash('password123', 10);
return [
{ email: '[email protected]', password, role: 'admin' },
];
};
export default identities;
db/seeds/{NNN}_{resource}.jsimport { {Resource} } from '@models';
import {resources} from '../resources/{resources}';
export async function seed() {
try {
console.log('Planting seeds for {resources}...');
const seeds = await {resources}();
await {Resource}.insertMany(seeds);
console.log('✓');
} catch (err) {
console.warn('Error! Cannot insert {resources}');
console.error(err);
}
}
db/seeds/index.jsexport * as {resources} from './{NNN}_{resources}';
scripts/{action}-{resource}.jsRead references/script-template.md for the complete pattern.
import { {Resource} } from '@models';
import { runScript } from 'express-goodies/functions';
/**
* Usage:
* node npm.js {action}-{resource}
*/
runScript(script);
async function script() {
console.log('Starting {action} for {resources}...');
// Script logic here
console.log('Done!');
}
runScript() handles: connecting to MongoDB, running the script function, disconnecting, and exiting the process. You don't need to manage the DB connection manually.
Import from JSON/array:
async function script() {
console.log('Starting import...');
let created = 0;
let skipped = 0;
for (const item of data) {
const existing = await Resource.findOne({ slug: item.slug });
if (existing) {
console.log(`Skipped (already exists): ${item.slug}`);
skipped++;
continue;
}
await Resource.create(item);
console.log(`Created: ${item.name}`);
created++;
}
console.log(`\nImport complete: ${created} created, ${skipped} skipped`);
}
Bulk update:
async function script() {
console.log('Updating all resources...');
const result = await Resource.updateMany(
{ isActive: { $exists: false } },
{ $set: { isActive: true } }
);
console.log(`Updated ${result.modifiedCount} documents`);
}
Migration (add field/transform data):
async function script() {
console.log('Migrating resources...');
const documents = await Resource.find({});
for (const doc of documents) {
const slug = doc.name.toLowerCase().replace(/\s+/g, '-');
await Resource.findByIdAndUpdate(doc._id, { slug });
console.log(`Migrated: ${doc.name} → ${slug}`);
}
console.log(`Migrated ${documents.length} documents`);
}
insertMany for bulk inserts — fast but no validation hookscreate or findByIdAndUpdate for individual operations — slower but triggers hooks@models alias for model importsrunScript() from express-goodies/functions for scripts — it handles DB connectionreferences/seed-template.md — Complete seed example (identities)references/script-template.md — Complete script example (import-articles)tools
Replace with description of the skill and when Claude should use it.
tools
Comprehensive website performance audit and optimization skill. Identifies and automatically fixes performance issues including image optimization, video compression, lazy loading, Core Web Vitals, bundle size, and rendering strategy. Uses Lighthouse (via CLI or MCP when available), ffmpeg for media processing, and the project's existing Image component with blur-up lazy loading. Use this skill whenever the user mentions: website speed, page load time, performance audit, Core Web Vitals, Lighthouse, optimize images, compress videos, lazy loading, LCP, CLS, FID, INP, slow website, speed up, performance optimization, image compression, video optimization, blur placeholder, WebP conversion, media audit, bundle size, or wants to improve their website's loading performance. Also trigger when the user says "my site is slow", "optimize for speed", "reduce load time", "improve performance", or asks about image/video optimization in any context.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
tools
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.