Token导航 LogoToken导航

Agent Skill · 研究检索

bknd-modify-schema(bknd 修改架构)

bknd-modify-schema 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

bknd-modify-schema 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,068。

总安装 306周安装 13GitHub Stars 3下载 107核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bknd-modify-schema(bknd 修改架构)
来源仓库:https://github.com/cameronapak/bknd-skills
仓库路径:skills/bknd-modify-schema
安装命令:
npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-modify-schema
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-modify-schema

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于修改现有 Bknd schema,包括重命名字段或调整约束条件。支持添加字段、变更类型和索引,但需注意破坏性操作风险。建议先备份数据库,并通过代码模式执行变更脚本。非破坏性变更如新增可选字段可直接同步,避免数据丢失。bknd-modify-schema 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/bknd-modify-schema

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-modify-sc…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

bknd-modify-schema 怎么安装?

在终端执行 npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-modify-schema。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

bknd-modify-schema 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

bknd-modify-schema 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

bknd-modify-schema 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

bknd-modify-schema 用的人多吗?

公开数据是累计安装 306 次,近一周安装 13 次,下载 107 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

bknd-modify-schema 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
bknd-modify-schema

bknd 修改架构 · 本页

3063需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Modify Schema

Modify existing schema in Bknd: rename entities/fields, change field types, or alter constraints.

Prerequisites

  • Existing Bknd app with entities (see bknd-create-entity)
  • For code mode: Access to bknd.config.ts
  • Backup your database before destructive changes

Critical Concept: Destructive vs Non-Destructive Changes

Bknd's schema sync detects differences between your code and database. Some changes are safe; others cause data loss.

Non-Destructive (Safe)

  • Adding new entities
  • Adding new fields (nullable or with default)
  • Adding new indices
  • Loosening constraints (removing .required())

Destructive (Data Loss Risk)

  • Renaming entities (treated as drop old + create new)
  • Renaming fields (treated as drop old + create new)
  • Changing field types (may fail or truncate data)
  • Removing fields (drops column and data)
  • Removing entities (drops table and all data)
  • Tightening constraints on existing data

When to Use UI vs Code

Use UI Mode When

  • Exploring schema changes interactively
  • Quick prototyping (data loss acceptable)
  • No version control needed

Use Code Mode When

  • Production schema changes
  • Version control required
  • Team collaboration
  • Reproducible deployments

Renaming an Entity

Warning: Bknd has no native rename. Renaming = DROP old + CREATE new = DATA LOSS.

Safe Approach: Data Migration

  1. Create new entity with desired name
  2. Migrate data from old to new
  3. Update code references
  4. Delete old entity

Code Approach

// Step 1: Add new entity alongside old
const schema = em({
  // OLD - will be removed later
  posts: entity("posts", {
    title: text().required(),
    content: text(),
  }),
  // NEW - desired name
  articles: entity("articles", {
    title: text().required(),
    content: text(),
  }),
});
// Step 2: Migrate data (run once via script or CLI)
const api = app.getApi();
const oldData = await api.data.readMany("posts", { limit: 10000 });

for (const item of oldData.data) {
  await api.data.createOne("articles", {
    title: item.title,
    content: item.content,
  });
}
// Step 3: Remove old entity from schema
const schema = em({
  articles: entity("articles", {
    title: text().required(),
    content: text(),
  }),
});
# Step 4: Sync with force to drop old table
npx bknd sync --force

UI Approach

  1. Open admin panel (http://localhost:1337)
  2. Go to Data section
  3. Create new entity with desired name
  4. Copy field definitions manually
  5. Export data from old entity (if needed)
  6. Import data to new entity
  7. Delete old entity

Renaming a Field

Warning: Bknd treats field renames as drop + create = DATA LOSS on that column.

Safe Approach: Data Migration

// Step 1: Add new field alongside old
const schema = em({
  users: entity("users", {
    name: text(),           // OLD - will be removed
    full_name: text(),      // NEW - desired name
  }),
});
// Step 2: Migrate data
const api = app.getApi();
const users = await api.data.readMany("users", { limit: 10000 });

for (const user of users.data) {
  if (user.name && !user.full_name) {
    await api.data.updateOne("users", user.id, {
      full_name: user.name,
    });
  }
}
// Step 3: Remove old field
const schema = em({
  users: entity("users", {
    full_name: text(),
  }),
});
# Step 4: Sync with force to drop old column
npx bknd sync --force

UI Approach

  1. Add new field with desired name
  2. Write script or manually copy data
  3. Delete old field

Changing Field Type

Type changes are risky. Some conversions work; others fail or truncate.

Compatible Type Changes

FromToNotes
texttext (with different constraints)Usually safe
numbertextSafe (numbers become strings)
booleannumberSafe (0/1 values)
booleantextSafe ("true"/"false")

Incompatible Type Changes

FromToRisk
textnumberFails if non-numeric data
textbooleanFails if not "true"/"false"/0/1
textdateFails if not valid date format
jsontextMay truncate; loses structure

Safe Approach for Type Change

// Step 1: Add new field with new type
const schema = em({
  products: entity("products", {
    price: text(),            // OLD - string prices
    price_cents: number(),    // NEW - integer cents
  }),
});
// Step 2: Transform and migrate data
const api = app.getApi();
const products = await api.data.readMany("products", { limit: 10000 });

for (const product of products.data) {
  if (product.price && !product.price_cents) {
    const cents = Math.round(parseFloat(product.price) * 100);
    await api.data.updateOne("products", product.id, {
      price_cents: cents,
    });
  }
}
// Step 3: Remove old field, rename new if desired
const schema = em({
  products: entity("products", {
    price_cents: number(),
  }),
});

Changing Field Constraints

Making a Field Required

Risk: Fails if existing records have null values.

// Before
entity("users", {
  email: text(),  // Optional
});

// After
entity("users", {
  email: text().required(),  // Now required
});

Safe approach:

  1. Update all null values first
  2. Then add .required()
// Step 1: Fill nulls with default
const api = app.getApi();
const usersWithNull = await api.data.readMany("users", {
  where: { email: { $isnull: true } },
});

for (const user of usersWithNull.data) {
  await api.data.updateOne("users", user.id, {
    email: "unknown@example.com",
  });
}

// Step 2: Now safely add .required()

Making a Field Unique

Risk: Fails if duplicates exist.

// Before
entity("users", {
  username: text(),
});

// After
entity("users", {
  username: text().unique(),
});

Safe approach:

  1. Find and resolve duplicates
  2. Then add .unique()
// Check for duplicates via raw SQL or manual inspection
// Resolve duplicates by updating or deleting
// Then add .unique() constraint

Removing Required/Unique

Generally safe:

// Before
entity("users", {
  email: text().required().unique(),
});

// After - loosening constraints is safe
entity("users", {
  email: text(),  // Now optional, non-unique
});

The Sync Workflow

Preview Changes (Dry Run)

# See what sync would do without applying
npx bknd sync

Output shows:

  • New entities/fields to create
  • Entities/fields to drop
  • Index changes

Apply Non-Destructive Changes

# Applies only additive changes
npx bknd sync

Apply All Changes (Including Drops)

# WARNING: This will drop tables/columns
npx bknd sync --force

Apply Drops Only

# Specifically enables drop operations
npx bknd sync --drop

UI Approach: Field Modifications

Change Field Type

  1. Open entity in Data section
  2. Click on field to edit
  3. Note: Type dropdown may be locked for existing fields
  4. If locked: Create new field with correct type, migrate data, delete old

Change Constraints

  1. Open entity in Data section
  2. Click on field to edit
  3. Toggle Required/Unique as needed
  4. Click Save
  5. Click Sync Database

Rename Field

  1. Create new field with desired name
  2. Manually copy data or write migration script
  3. Delete old field
  4. Sync database

Common Pitfalls

Sync Fails on Type Change

Error: Cannot convert column type from X to Y

Fix: Use migration approach - create new field, copy data, drop old.

Sync Fails on Required Constraint

Error: Column contains null values, cannot add NOT NULL

Fix: Update all null values to non-null first, then re-sync.

Sync Fails on Unique Constraint

Error: Duplicate values exist for column

Fix: Remove duplicates before adding unique constraint.

Data Lost After Rename

Problem: Renamed entity/field and lost all data.

Fix: Unfortunately, data is gone. Restore from backup. Use migration approach next time.

Force Flag Ignored

Problem: --force doesn't seem to apply changes.

Fix: Check sync output for actual errors. May be validation issue, not permission.


Migration Script Template

For complex migrations, create a standalone script:

// scripts/migrate-schema.ts
import { App } from "bknd";

async function migrate() {
  const app = new App({
    connection: { url: process.env.DB_URL! },
  });
  await app.build();

  const api = app.getApi();

  console.log("Starting migration...");

  // Read all records from old structure
  const records = await api.data.readMany("old_entity", { limit: 100000 });
  console.log(`Found ${records.data.length} records`);

  // Transform and insert into new structure
  let migrated = 0;
  for (const record of records.data) {
    await api.data.createOne("new_entity", {
      // Transform fields as needed
      new_field: record.old_field,
    });
    migrated++;
    if (migrated % 100 === 0) {
      console.log(`Migrated ${migrated}/${records.data.length}`);
    }
  }

  console.log("Migration complete!");
  process.exit(0);
}

migrate().catch(console.error);

Run with:

npx bun scripts/migrate-schema.ts
# or
npx ts-node scripts/migrate-schema.ts

Verification

After Schema Modification

# 1. Check sync status
npx bknd sync

# 2. Verify schema in debug output
npx bknd schema --pretty

Via Code

const api = app.getApi();

// Verify field exists by querying
const result = await api.data.readMany("entity_name", { limit: 1 });
console.log(result.data[0]);  // Check field names/values

Via UI

  1. Open entity in Data section
  2. Verify fields appear correctly
  3. Create test record with new schema
  4. Query existing records to verify data

DOs and DON'Ts

DO:

  • Back up database before destructive changes
  • Use migration approach for renames
  • Preview with npx bknd sync before forcing
  • Test on development database first
  • Keep old structure until data migrated

DON'T:

  • Rename entities/fields directly (data loss)
  • Use --force without previewing first
  • Change types without migration plan
  • Add .required() to fields with null data
  • Add .unique() to fields with duplicates

Related Skills

  • bknd-create-entity - Create new entities
  • bknd-add-field - Add fields to entities
  • bknd-delete-entity - Safely remove entities
  • bknd-seed-data - Populate migrated data
  • bknd-crud-update - Update records during migration

平台分布

Codex

34.98%
按下载量换算37

Claude

26.57%
按下载量换算28

Cursor

19.84%
按下载量换算21

Gemini CLI

9.37%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills