Back to list
xdb-dev

using-xdb

by xdb-dev

XDB is a new kind of database library based on tuples. Rather than writing database specific schemas, queries, and migrations, XDB allows developers to model their domain once and use it with one or more databases.

2🍴 0📅 Jan 12, 2026

SKILL.md


name: using-xdb description: Use XDB CLI to store and manage structured data. Use when you need to persist data, create schemas for tracking information (issues, scraped data, metrics, logs), or organize data by namespace for different projects/users/contexts. allowed-tools: Bash(xdb:*), Write

Using XDB CLI for Data Management

Run xdb --help for command syntax and flags.

URI Format

xdb://NAMESPACE/SCHEMA/ID#ATTRIBUTE
ComponentRequiredExample
NamespaceYesagent.scraper, user.john, project.myapp
SchemaFor data opsarticles, issues, tasks
IDFor recordsarticle-123, issue-1
AttributeOptional#title, #status, #author.name

Namespace Strategy

PatternUse CaseExample
agent.<name>Agent-specific dataagent.scraper, agent.researcher
user.<id>Per-user datauser.john, user.admin
project.<name>Project dataproject.webapp, project.api
team.<name>Team shared datateam.engineering, team.support
org.<name>Organization dataorg.acme, org.internal

Schema Definition Format

Modes:

ModeBehavior
flexibleAccepts any attributes (default, no schema file needed)
strictOnly allows attributes defined in schema
dynamicAuto-infers and adds new fields from data

Flexible schema:

xdb make-schema xdb://agent.scraper/articles

Strict or dynamic schema with JSON definition:

{
  "name": "Article",
  "mode": "strict",
  "fields": [
    { "name": "title", "type": "STRING" },
    { "name": "tags", "type": "ARRAY", "array_of": "STRING" },
    {
      "name": "metadata",
      "type": "MAP",
      "map_key": "STRING",
      "map_value": "STRING"
    },
    { "name": "author.name", "type": "STRING" },
    { "name": "author.email", "type": "STRING" }
  ]
}

Types: STRING, INTEGER, UNSIGNED, FLOAT, BOOLEAN, TIME, BYTES, ARRAY, MAP

Nested fields: Use dot notation (author.name, stats.views)

Nanoid Helper

Generate unique IDs:

nanoid() { openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | head -c 21; }

Example Use Cases

Use CaseModeNamespaceSchema
Web scrapingflexibleagent.scraperpages
Issue trackingstrictproject.<name>issues
Research notesdynamicagent.researchernotes
API cacheflexibleagent.apicache
Conversation memorydynamicagent.memoryconversations
Bookmarksflexibleuser.<id>bookmarks
Code snippetsstrictteam.<name>snippets
Meeting notesdynamicorg.<name>meetings
Error logsdynamicproject.<name>errors
Feature flagsstrictproject.<name>flags

Workflow Examples

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

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

+20
LICENSE

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

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

+5

Reviews

💬

Reviews coming soon