new-repository

Generate Drizzle schema tables and SQLKit repositories in TypeScript projects.

13|5|Updated May 18, 2024
One-click install
npx skills add https://github.com/techdiary-dev/techdiary.dev --skill new-repository
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-repository
Source: https://github.com/techdiary-dev/techdiary.dev/tree/main/.claude/skills/new-repository
Command: npx skills add https://github.com/techdiary-dev/techdiary.dev --skill new-repository

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add a new database entity to techdiary.dev by generating the Drizzle schema table and the SQLKit repository, coordinating multiple core files.

Core Features & Use Cases

  • Automated schema and repository creation: Generate a Drizzle schema entry and a corresponding SQLKit repository to persist data.
  • Cross-file consistency: Update schemas.ts, persistence-contracts.ts, domain-models.ts, and persistence-repositories.ts in a coordinated, error-checked workflow.
  • Migration-ready output: Include the necessary code scaffolding and guidance to run bun run db:generate followed by bun run db:push.

Quick Start

Provide the entity name, table name, and fields to generate the full Drizzle schema, persistence contracts, domain models, and repositories.

Frequently Asked Questions about new-repository

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Drizzle schema table and repository to a TypeScript backend project?

Adding a new Drizzle schema table and SQLKit repository requires providing the entity name, table name, and fields to generate coordinated updates across schemas.ts, persistence-contracts.ts, domain-models.ts, and persistence-repositories.ts in your TypeScript project.

What files need to be updated when creating a new SQLKit repository?

Creating a new SQLKit repository requires updating schemas.ts, persistence-contracts.ts, domain-models.ts, and persistence-repositories.ts. This cross-file coordination ensures the Drizzle schema and persistence layers remain synchronized across the TypeScript project.

How do I run database migrations after generating a Drizzle schema with bun?

After generating a Drizzle schema with bun, run database migrations by executing bun run db:generate followed by bun run db:push. This migration-ready workflow applies the newly generated schema changes directly to your database.

Can I use this repository generation workflow without an existing SQLKit setup?

This repository generation workflow applies specifically to backend codebases using Drizzle ORM and SQLKit. Without an existing SQLKit setup, the coordinated updates to persistence contracts and repositories cannot be properly applied.

What is the best way to maintain cross-file consistency when adding a new database entity?

The best way to maintain cross-file consistency when adding a database entity is automating the generation of the Drizzle schema and SQLKit repository. This coordinates error-checked changes across schemas, contracts, models, and repositories simultaneously.

Why does my Drizzle schema migration fail after manually adding a new table?

Drizzle schema migrations can fail after manually adding a table due to cross-file inconsistencies. Generating the schema and repository together ensures persistence-contracts.ts and domain-models.ts are properly aligned before running bun run db:generate.