用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/paralect/hive --skill hive-database命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | hive-database |
| description | Database operations in Hive framework |
| globs | ["src/**/*.js"] |
| alwaysApply | false |
import db from 'db';
const taskService = db.services.tasks; // From schema name
// Find many
const { results, pagesCount, count } = await service.find(
{ status: 'active' },
{ page: 1, perPage: 20, sort: '-createdOn', fields: ['_id', 'title'] }
);
// Find one
const doc = await service.findOne({ _id: id });
// Check exists
const exists = await service.exists({ _id: id });
// Count
const total = await service.count({ status: 'active' });
// Distinct values
const statuses = await service.distinct('status');
// Aggregate
const { results } = await service.aggregate([
{ $match: { status: 'done' } },
{ $group: { _id: '$project._id', count: { $sum: 1 } } },
]);
// Create
const doc = await service.create({ title: 'New', user: ctx.state.user });
// Update one (must use function)
const updated = await service.updateOne(
{ _id: id },
(doc) => ({ ...doc, title: 'Updated' })
);
// Update many
await service.updateMany(
{ status: 'pending' },
(doc) => ({ ...doc, status: 'active' })
);
// Remove
await service.remove({ _id: id });
// Generate ID
const newId = service.generateId();
// Silent bulk update
await service.atomic.update(
{ 'project._id': projectId },
{ $set: { 'project.name': newName } },
{ multi: true }
);
import { when } from 'services/utils';
const { results } = await service.find({
// Conditional fields
...when(status, { status }),
...when(userId, { 'user._id': userId }),
// Complex conditions
status: { $in: ['active', 'pending'] },
createdOn: { $gte: startDate, $lt: endDate },
$or: [{ 'user._id': id }, { isPublic: true }],
});
updateOne requires a function, not an objectatomic.update for bulk/silent updateswhen() helper for conditional query building