Surrealkit logo

Surrealkit

Organization
surrealdb
surrealkit

Use SurrealKit, SurrealDB's schema-management and migration CLI, to scaffold projects from templates, sync schema in development, plan and execute production rollouts (with rollback), statically check SurrealQL without a database, generate JSON/TypeScript types, and write declarative TOML test suites for schemas, permissions, and API endpoints. Use this skill whenever users set up, migrate, type, check, or test a SurrealDB schema with SurrealKit.

Overview

Publishersurrealdb
Repositoryagent-skills
Skill namesurrealkit
Stars
28
Forks
3
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by surrealdb on GitHub. Read the source before you install it.

Installation

Install the Surrealkit AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/surrealdb/agent-skills/tree/main/skills/surrealkit
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/surrealdb/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/surrealkit .claude/skills/surrealkit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Surrealkit in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Surrealkit on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Surrealkit is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SurrealKit

A skill for driving SurrealKit, SurrealDB's schema-management and migration CLI. Written against SurrealKit 1.0 (currently 1.0.0-beta.3).

SurrealKit keeps a SurrealDB database in sync with .surql schema files. It provides two complementary workflows — a fast declarative sync for development and controlled, phased rollouts for shared and production databases — plus seeding, static analysis, type generation, and a declarative testing framework.

When to use this skill

Reference these guidelines when:

  • Scaffolding a new SurrealDB project (surrealkit init) or authoring templates
  • Applying schema changes in development (surrealkit sync)
  • Planning, executing, or rolling back production migrations (surrealkit rollout)
  • Adopting SurrealKit on a database that already exists (surrealkit rollout baseline)
  • Splitting a schema into independently tracked modules, or applying it to several databases
  • Statically checking SurrealQL against the schema without a database (surrealkit check)
  • Generating JSON or TypeScript types from a live schema (surrealkit typegen)
  • Writing or running declarative tests for schemas, permissions, or API endpoints (surrealkit test)

This skill covers the SurrealKit tool itself. To write the actual schema, seed, and query statements that go in .surql files, use the surrealql skill.

Installation

MethodCommand
cargo binstall (recommended)cargo binstall surrealkit
Cargo (from source)cargo install surrealkit
Dockerdocker pull ghcr.io/surrealdb/surrealkit:latest
Prebuilt tarballGitHub Releases

Building from source needs a C compiler and cmake. Static analysis is on by default and adds tree-sitter (~7.5 MiB, ~100s of build time); drop it with cargo install surrealkit --no-default-features --features kv-mem,cli — that binary has no check, generate, or watch. Prebuilt binaries and cargo binstall always include analysis.

The Docker image is distroless (~25 MB, uid 65532) and exits on completion, which suits "apply schema then run tests" pipelines in Docker Compose alongside SurrealDB.

Command map

CommandPurposeReference
surrealkit initScaffold a project from a template, selecting optional featuresinit-templates.md
surrealkit syncDeclaratively reconcile the database to your schema files (dev)sync-rollouts.md
surrealkit rollout <sub>Plan, stage, complete, roll back, and repair migrations (shared/prod)sync-rollouts.md
surrealkit seed [--force]Run seeding files in database/seed/ (idempotent, hash-tracked)sync-rollouts.md
surrealkit checkStatically analyse the project's SurrealQL — no database contactedstatic-analysis.md
surrealkit generate / watchEmit / continuously refresh a typed client for embedded queriesstatic-analysis.md
surrealkit typegenIntrospect a live DB and emit JSON / TypeScript typestypegen.md
surrealkit testRun declarative TOML test suitestesting.md
surrealkit apply <path>Apply a single .surql file directly—
surrealkit setupRun database/setup.surql (SurrealKit's own metadata tables)—
surrealkit statusShow sync/rollout state—

Run surrealkit <command> --help to confirm available flags for an installed version.

Connection & config

Global flags work on every command and resolve in this order (highest wins): [target.<name>] in surrealkit.toml > CLI flags > system env vars > .env file > defaults.

bash
surrealkit --host http://localhost:8000 --ns my_ns --db my_db \
  --user root --pass root --auth-level root sync
FlagEnv varDefault
--hostSURREALDB_HOSThttp://localhost:8000
--nsSURREALDB_NAMESPACEdb
--dbSURREALDB_NAMEtest
--userSURREALDB_USERroot
--passSURREALDB_PASSWORDroot
--auth-levelSURREALDB_AUTH_LEVELroot (root / namespace|ns / database|db / none)
--folderSURREALDB_FOLDER./database
--connect-timeout-secsSURREALDB_CONNECT_TIMEOUT_SECS30 (0 waits indefinitely)
--query-timeout-secsSURREALDB_QUERY_TIMEOUT_SECSunset (a rollout step's SQL waits indefinitely)

The DATABASE_* aliases were removed in 1.0. Setting one without its SURREALDB_* replacement is a hard error, not a silent fallback. Update .env files and CI when upgrading.

Selection flags are also global: -s/--schema <name>, -t/--target <name>, --all, --keep-going, --no-deps — see modules-targets.md.

The project root holds surrealkit.toml with [variables], [typegen], [analyze], [schema.*], and [target.*] sections.

Embedded databases

Point --host at an embedded endpoint to manage an in-process datastore; authentication is skipped automatically.

bash
surrealkit --host surrealkv://./data --ns my_ns --db my_db sync

Schemes: surrealkv://, rocksdb://, speedb://, mem://, file://, tikv://. --auth-level none forces the no-signin path on any endpoint. The prebuilt CLI bundles only the in-memory engine — for on-disk engines build with --features kv-surrealkv (or kv-rocksdb, or embedded). Embedded engines take an exclusive lock, so stop the application before running the CLI against one; to manage schema from inside an application at startup, use the library instead.

Template variables

Use ${VAR_NAME} tokens in any .surql file (schema, seed, or rollout SQL). Names are case-insensitive. Values resolve in order (highest wins):

  1. --var KEY=VALUE CLI flag (repeatable)
  2. SURREALKIT_VAR_<KEY> environment variable
  3. [variables] section in surrealkit.toml
toml
# surrealkit.toml
[variables]
schema_prefix = "myapp"
talent_username = "talent_rw"
bash
surrealkit sync --var schema_prefix=acme --var talent_username=talent_rw
  • An undefined variable is a hard error — SurrealKit never silently skips it or leaves the token in the SQL.
  • Escape a literal ${...} by doubling the dollar sign: $${literal}.
  • Substitution is textual, so ${VAR} inside a SurrealQL string literal is also replaced.
  • Substitution runs on sync, seed, apply, and rollout start/complete/rollback. It does not run on rollout plan/baseline/status/lint (no user SQL executes there).

Project layout

surrealkit init creates a database/ directory (override the root with --folder / SURREALDB_FOLDER):

database/
├── schema/                     # Schema definitions (.surql) — the default module, the source of truth
├── modules/<name>/schema/      # Additional schema modules, when declared in surrealkit.toml
├── rollouts/                   # Generated rollout manifests (.toml)
├── snapshots/                  # Drift tracking — what `rollout plan` diffs against
│   ├── schema_snapshot.json
│   └── catalog_snapshot.json
├── seed/                       # Seeding files (.surql)
├── tests/
│   ├── suites/                 # Test suites (.toml)
│   ├── fixtures/               # Test fixture data (.surql)
│   └── config.toml             # Global test config
└── setup.surql                 # One-time setup script (SurrealKit's own metadata tables)
surrealkit.toml                 # Project config

SurrealKit tracks its own state in three metadata tables on your database: __entity (file hashes and per-definition records), __rollout (rollout run state), and __seed (seed-file hashes).

Rules & conventions

  • Sync vs rollout: use sync for local, preview, and other disposable databases where it is safe to match files immediately; use rollout for shared/production databases that need review, staged execution, rollback, or operator-controlled cutover.
  • Schema files are the source of truth. sync creates, updates, and prunes SurrealKit-managed objects to match the schema directory.
  • Schema files should contain DEFINE/REMOVE statements. Allow other statements (INSERT, UPDATE, CREATE) only with --allow-all-statements, which disables catalog entity tracking.
  • rollout plan diffs against database/snapshots/, not the live database, and sync never writes snapshots. Adopting rollouts after a period of sync-only work needs a rollout baseline first, or the first plan proposes every file you have.
  • Commit the generated manifest and the refreshed snapshots together; reverting a plan means reverting both.
  • Store SurrealQL in files with the .surql extension. Validate and format generated SurrealQL with the tools described in the surrealql skill (surreal validate, npx @surrealdb/surql-fmt), and gate it in CI with surrealkit check.
  • SurrealKit is young and evolving; confirm command surfaces against surrealkit --help and the README.

Using SurrealKit as a Rust library

The surrealkit crate runs sync, seed, and rollouts from inside an application — useful for applying schema at startup, or for embedded engines the CLI cannot hold a lock on.

toml
[dependencies]
surrealkit = { version = "1.0.0-beta.3", default-features = false, features = ["kv-mem"] }
  • default = ["kv-mem", "cli"]; library consumers drop cli to shed clap, inquire, rustls, and tempfile.
  • embed_schema! and embed_seed! compile the schema and seed files into the binary, so no filesystem is needed at runtime.
  • Sync is a builder for runtime control; Rollout no longer writes to disk as of 1.0.
  • Progress is emitted through the log facade; without a logger the library is silent.

Full API reference: crates/surrealkit/README.md. Upgrade notes: MIGRATING.md.

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Surrealkit AI skill do?

Use SurrealKit, SurrealDB's schema-management and migration CLI, to scaffold projects from templates, sync schema in development, plan and execute production rollouts (with rollback), statically check SurrealQL without a database, generate JSON/TypeScript types, and write declarative TOML test suites for schemas, permissions, and API endpoints. Use this skill whenever users set up, migrate, type, check, or test a SurrealDB schema with SurrealKit.

Why use Surrealkit on TypingMind?

Because you install it once and use it with any model. Surrealkit is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Surrealkit in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/surrealdb/agent-skills/tree/main/skills/surrealkit. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Surrealkit?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Surrealkit?

As many as you like. As long as a model supports skills, you can use Surrealkit with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Surrealkit AI skill free?

Yes. It is published on GitHub by surrealdb under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇