/fuse-astro:astro-dbfrom fuse-astro
Implements Astro DB (@astrojs/db) for type-safe SQL database operations in Astro projects, including schema definition, CRUD, seeding, and Turso deployment. Also covers migration off the deprecated package to Drizzle, Kysely, or node:sqlite.
Ships in fuse-astro. 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.
Read when SKILL.md points to them.
Also covers integration with Astro Actions for end-to-end type-safe form-to-database flows. @astrojs/db is deprecated on npm (last release v0.21.3, June 2026) and listed as Removed in the official Astro v7 upgrade guide — for new projects this skill recommends Drizzle, Kysely, node:sqlite, or a direct libSQL client instead; existing Astro 6 projects must migrate off it before upgrading to Astro 7.
Type-safe SQL database built into Astro, powered by libSQL/Turso. Use for structured data without external backend services.
⚠️ Removal notice:
@astrojs/dbis deprecated on npm ("Use a database client (Drizzle, Kysely, etc.) directly instead"; last release v0.21.3) and the official Astro v7 upgrade guide lists it under "Removed" — remove it from dependencies when upgrading. Replacements: Node's built-innode:sqlite(Node adapter), Drizzle directly, Kysely, or a libSQL/Turso client. The content below documents the legacy Astro 6 API for maintaining/migrating existing projects.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
db/
├── config.ts # Schema definition (defineDb, defineTable)
└── seed.ts # Development data seeding
Define tables in db/config.ts using defineDb and defineTable. Export tables for use in pages and actions. Column types: column.text(), column.number(), column.boolean(), column.date(), column.json().
Import db and table from astro:db. All operations are async and type-safe based on your schema definition.
Set ASTRO_DB_REMOTE_URL and ASTRO_DB_APP_TOKEN environment variables. Run astro db push to sync schema to Turso. Use astro db execute to run seed scripts against remote DB.
Combine with astro:actions for end-to-end type safety: Zod input validation → DB operation → typed response.
| Topic | Reference | When to Consult |
|---|---|---|
| Schema Definition | schema-definition.md | Table structure, column types |
| CRUD Operations | crud-operations.md | select, insert, update, delete |
| Seed Data | seed-data.md | db/seed.ts, remote seeding |
| Turso Production | turso-production.md | Deployment, env vars, push |
| Actions Integration | actions-integration.md | Type-safe form → DB flow |
| Template | When to Use |
|---|---|
| db-config.md | Complete db/config.ts + seed.ts |
| crud-example.md | Full CRUD with Actions |
.returning() after insert - Get back inserted rowsastro db push in CI/CDnode:sqlite/libSQL instead - @astrojs/db is deprecated and listed as removed in the Astro v7 upgrade guide; migrate existing projects before upgrading to Astro 7references/actions-integration.md (opens in a new tab)references/crud-operations.md (opens in a new tab)references/schema-definition.md (opens in a new tab)references/seed-data.md (opens in a new tab)references/templates/crud-example.md (opens in a new tab)references/templates/db-config.md (opens in a new tab)references/turso-production.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/astro-7Use when building Astro 7 sites, choosing an output mode (static/server, hybrid via per-route prerender), configuring middleware, or upgrading from Astro 5/6./astro-actionsUse when handling form submissions, mutations, or server-side logic with type safety in Astro via defineAction / astro:actions./astro-assetsUse when optimizing images or other assets in Astro — <Image />, <Picture />, getImage(), Fonts API, or OG image generation.npx claudepluginhub fusengine/claude-plugins --plugin fuse-astroOther plugins' skills for the same job