agentleFS
ww-w-aiww-w-ai/bkit-codex/.agents/skills/bkend-data/SKILL.md

bkend-data

Skill70 starsChanged 9 months agoApache-2.0View on GitHub

bkend.ai data management guide. Tables, columns, CRUD operations, schema design, indexes, and query filtering with bkend.ai BaaS. Triggers: bkend table, bkend column, bkend CRUD, bkend schema, bkend data, bkend 테이블, bkend 데이터, CRUD, 스키마, bkendテーブル, bkendデータ, bkend表, bkend数据, tabla bkend, données bkend, bkend-Daten, dati bkend Do NOT use for: auth (use $bkend-auth), file storage (use $bkend-storage).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always include created_at and updated_at

    line 154
  2. Very specific:

    Use reference type for relationships

    line 155
  3. Distinctive:

    Add indexes on frequently filtered columns

    line 156
  4. Very specific:

    Use enum for fixed value sets

    line 157
  5. Very specific:

    Use json sparingly (harder to query)

    line 158

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

bkend.ai Data Management

Create tables, define schemas, and perform CRUD operations.

Actions

ActionDescriptionExample
tableCreate a new table$bkend-data table users
schemaDesign table schema$bkend-data schema
queryQuery data examples$bkend-data query

Creating Tables

Tables in bkend.ai are created through the dashboard or MCP:

Via Dashboard

  1. Go to project > Database
  2. Click "New Table"
  3. Define columns with types

Via MCP

Create a table called "posts" with:
- title (string, required)
- body (text, required)
- status (enum: draft/published, default: draft)
- author_id (reference to users)
- created_at (datetime, auto)
- updated_at (datetime, auto)

Column Types

TypeDescriptionExample
stringShort text (max 255)name, email, slug
textLong text (unlimited)body, description
numberInteger or floatage, price, count
booleanTrue/falseis_active, is_published
datetimeDate and timecreated_at, due_date
enumFixed set of valuesstatus, role, type
jsonJSON objectmetadata, settings
referenceForeign key to another tableauthor_id, category_id
fileFile referenceavatar, attachment

CRUD Operations

Create

const post = await bkend.data.create('posts', {
  title: 'My First Post',
  body: 'Hello world!',
  status: 'draft',
  author_id: currentUser.id,
});

Read (Single)

const post = await bkend.data.get('posts', postId);

Read (List with Filters)

const posts = await bkend.data.list('posts', {
  status: 'published',
  sort: '-created_at',
  page: '1',
  limit: '20',
});

Update

const updated = await bkend.data.update('posts', postId, {
  title: 'Updated Title',
  status: 'published',
});

Delete

await bkend.data.delete('posts', postId);

Query Patterns

Filtering

// Exact match
{ status: 'published' }

// Multiple filters (AND)
{ status: 'published', author_id: userId }

Sorting

// Ascending
{ sort: 'created_at' }

// Descending (prefix with -)
{ sort: '-created_at' }

Pagination

// Page-based
{ page: '2', limit: '10' }

Search

// Full-text search
{ search: 'keyword' }

React Hooks

// hooks/usePosts.ts
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';

export function usePosts(filters?: Record<string, string>) {
  return useQuery({
    queryKey: ['posts', filters],
    queryFn: () => bkend.data.list('posts', filters),
  });
}

export function useCreatePost() {
  const qc = useQueryClient();
  return useMutation({
    mutationFn: (data: CreatePostInput) => bkend.data.create('posts', data),
    onSuccess: () => qc.invalidateQueries({ queryKey: ['posts'] }),
  });
}

Schema Best Practices

  1. Always include created_at and updated_at
  2. Use reference type for relationships
  3. Add indexes on frequently filtered columns
  4. Use enum for fixed value sets
  5. Use json sparingly (harder to query)

Reference

See references/bkend-patterns.md for complete API client code and advanced patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.