new-repository
Add a new SQLKit repository to persistence-repositories.ts and a corresponding Drizzle schema table to schemas.ts
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new SQLKit repository to persistence-repositories.ts and a corresponding Drizzle schema table to schemas.ts
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a semver-compliant release note from git history; on user confirmation, bump version, update CHANGELOG, create git tag, and publish a GitHub Release with gh
Scaffold a new backend server action with auth check, Zod input validation, repository call, and error handling
Scaffold a typed React client component with props interface, Tailwind styling, and shadcn/ui primitives
Scaffold a React Hook Form with Zod validation, useMutation, and toast notifications
Create a Zod input schema file in src/backend/services/inputs/ for a domain entity
Scaffold a Next.js App Router page with optional server-side session check, metadata, and layout
| name | new-repository |
| description | Add a new SQLKit repository to persistence-repositories.ts and a corresponding Drizzle schema table to schemas.ts |
Add a new database entity to techdiary.dev: Drizzle schema table + SQLKit repository.
src/backend/persistence/schemas.ts (Drizzle, used for migrations only)src/backend/persistence/persistence-repositories.tssrc/backend/persistence/persistence-contracts.tssrc/backend/models/domain-models.tsbun run db:generate then bun run db:push after schema changespgTable from drizzle-orm/pg-core for the schema definitionnew Repository<DomainModel>(DatabaseTableName.<entity>, pgClient)persistenceRepository export objectschemas.tsimport { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
export const <entity>Table = pgTable("<table_name>", {
id: text("id").primaryKey().default(sql`gen_random_uuid()`),
// fields here
created_at: timestamp("created_at").defaultNow(),
updated_at: timestamp("updated_at").defaultNow(),
});
persistence-contracts.tsexport enum DatabaseTableName {
// existing entries...
<entity> = "<table_name>",
}
domain-models.tsexport interface <DomainModel> {
id: string;
// fields matching schema
created_at: Date;
updated_at: Date;
}
persistence-repositories.tsimport { <DomainModel> } from "../models/domain-models";
const <entity>Repository = new Repository<<DomainModel>>(
DatabaseTableName.<entity>,
pgClient,
{ logging: false },
);
export const persistenceRepository = {
// existing repositories...
<entity>: <entity>Repository,
};
bun run db:generate
bun run db:push