Quick reference for seeding the SkillX database with AI agent skills.
- Set
ADMIN_SECRETenvironment variable - Ensure web app is running (local) or deployed (production)
# Start dev server
pnpm dev
# Seed database (in another terminal)
ADMIN_SECRET=your-secret-here pnpm seedAPI_URL=https://skillx.sh ADMIN_SECRET=your-prod-secret pnpm seed- 30 curated AI agent skills
- 5 categories: devops, implementation, testing, security, planning
- 23 free + 7 paid skills ($24.99-$79.99)
- ~127 vectors (avg 4.2 chunks per skill)
seed-skills.mjs
↓
POST /api/admin/seed (X-Admin-Secret: xxx)
↓
For each skill:
1. Upsert to D1 database (Drizzle ORM)
2. Chunk text (512 tokens, 10% overlap)
3. Generate embeddings (Workers AI)
4. Index vectors (Vectorize)
{
"skills": 30,
"vectors": 127
}Safe to run multiple times:
- D1 upserts on
slugconflict - Vectorize replaces vectors by ID
- scripts/seed-data.json - 30 curated skills
- scripts/seed-skills.mjs - Seed script
- scripts/README.md - Full documentation
401 Unauthorized
- Check
ADMIN_SECRETmatches wrangler.jsonc
Connection refused
- Ensure
pnpm devis running (local) - Check
API_URLis correct (production)
No data returned from AI model
- Workers AI binding not configured
- Check wrangler.jsonc has
ai.binding = "AI"
For detailed docs, see scripts/README.md