Back to list
paralect

hive-schema

by paralect

0🍴 0📅 Jan 18, 2026

SKILL.md


name: hive-schema description: How to create database schemas in Hive framework globs:

  • src/resources/**/*.schema.js alwaysApply: false

Creating Database Schemas

Location: /src/resources/{name}/{name}.schema.js

Template

import { z } from 'zod';
import dbSchema from 'helpers/schema/db.schema.js';

const schema = dbSchema.extend({
  // Fields here
});

export default schema;

export const secureFields = []; // Hidden from API responses

Field Patterns

Simple fields:

title: z.coerce.string().nullable().optional(),
count: z.coerce.number().nullable().optional(),
isActive: z.coerce.boolean().nullable().optional(),
dueOn: z.coerce.date().nullable().optional(),

Reference to another document:

user: z
  .object({
    _id: z.string(),
    fullName: z.coerce.string().nullable().optional(),
    avatarUrl: z.coerce.string().nullable().optional(),
  })
  .nullable()
  .optional(),

Array of references:

managers: z
  .array(
    z.object({
      _id: z.string(),
      fullName: z.coerce.string().nullable().optional(),
    }).nullable().optional(),
  )
  .nullable()
  .optional(),

Flexible object:

data: z.object({}).passthrough().nullable().optional(),

Rules

  • Always use z.coerce for type safety
  • Always add .nullable().optional() unless required
  • Include fields you need in references (for auto-sync)
  • Add sensitive fields to secureFields array

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon