- Home
- Skills
- Cameronapak
- Bknd Skills
- Bknd Add Field
bknd-add-field_skill
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cameronapak/bknd-skills --skill bknd-add-field- SKILL.md8.1 KB
Overview
This skill guides you through adding a new field to an existing Bknd entity. It covers UI and code approaches, all supported field types (text, number, boolean, date, enum, json, jsonschema, media), common modifiers (.required(), .unique(), .default()), and practical validation and naming rules. The goal is to help you add fields safely and make changes reproducible when needed.
How this skill works
In UI mode you add fields via the Data section of the running Bknd admin and then sync the database. In code mode you edit the entity definition in your schema file, add the field with its options and modifiers, then restart the server so Bknd picks up the new schema. The skill explains field-specific validation options, default values, enum usage, media constraints, and how to avoid common errors like invalid names or adding required on existing null data.
When to use it
- Quick prototyping or when a non-developer needs to add a field via the admin UI
- When you need version-controlled, reproducible schema changes using the code schema file
- Adding validation or constraints (min/max, regex) to new fields
- Introducing enum values, typed JSON, JSON Schema validation, or media attachments
- When converting a prototype field into a production-safe field with defaults and uniqueness
Best practices
- Use UI for fast iteration and code mode for version control and team collaboration
- Name fields in snake_case, lowercase, and be descriptive (e.g., created_at, first_name)
- Start with optional fields; add .required() later after migrating existing data or providing defaults
- Prefer appropriate types (numbers as number, not text) and add validation rules where useful
- Restart the server after code changes to trigger schema sync and verify with a test record
Example use cases
- Add an optional subtitle text field to posts via the schema file for versioned changes
- Add a published boolean with default true using the admin UI for fast testing
- Add a status enum (draft/published/archived) with default and validation in code
- Add a media gallery field with mime type and min/max item constraints for product images
- Add a jsonschema field for runtime-validated webhook payloads
FAQ
Choose a different, unique field name within the entity; field names must be unique.
Can I add .required() to a field with existing nulls?
No—either update existing records first, add a default_value, or leave it optional to avoid errors.