SurrealKit schema sync, rollout migrations, seeding, and declarative testing for SurrealDB apps. Part of the surreal-skills collection.
SurrealKit manages SurrealDB application schemas as desired-state .surql
files, with separate paths for disposable development databases and shared or
production rollouts.
Tracked upstream snapshot: v0.6.3 pre-release (7771b93ea563, 2026-05-13).
The v0.6.1 -> v0.6.3 patch line added library-lock fixes, template variables,
comment-stripping cleanup, DROP ... IF EXISTS handling, and DEFINE coverage
for BUCKET, SEQUENCE, and CONFIG.
# Install
cargo binstall surrealkit
# or: cargo install surrealkit
# Scaffold project structure
surrealkit init
# Reconcile local/disposable database to local schema files
surrealkit sync
# Generate and apply a reviewed rollout for shared/prod
surrealkit rollout plan --name add_customer_indexes
surrealkit rollout start 20260410120000__add_customer_indexes
surrealkit rollout complete 20260410120000__add_customer_indexes
| Command | Use |
|---------|-----|
| surrealkit sync | Desired-state reconciliation for local, preview, or disposable DBs |
| surrealkit sync --watch | Local development loop with file watching |
| surrealkit rollout baseline | Establish rollout tracking on an existing shared DB |
| surrealkit rollout plan --name <name> | Create a reviewed manifest from current schema diff |
| surrealkit rollout start <id> | Apply the expansion phase |
| surrealkit rollout complete <id> | Apply the contract/destructive phase after cutover |
| surrealkit rollout rollback <id> | Roll back an in-flight rollout |
| surrealkit rollout lint <id> | Validate a rollout without mutating the DB |
| surrealkit rollout status | Inspect rollout state stored in the DB |
| surrealkit seed | Apply seed data |
| surrealkit test | Run declarative schema, permission, and API tests |
sync when the database should mirror local files immediately.rollout when changes need staging, review, rollback, or controlled cutover.seed for deterministic fixture data.test in CI to validate permissions, schema behavior, and API contracts.SurrealKit reads these variables:
SURREALDB_HOST (fallback: DATABASE_HOST)SURREALDB_NAME (fallback: DATABASE_NAME)SURREALDB_NAMESPACE (fallback: DATABASE_NAMESPACE)SURREALDB_USER (fallback: DATABASE_USER)SURREALDB_PASSWORD (fallback: DATABASE_PASSWORD)SURREALDB_AUTH_LEVEL (fallback: DATABASE_AUTH_LEVEL)Declarative suites in database/tests/suites/*.toml support:
sql_expectpermissions_matrixschema_metadataschema_behaviorapi_requestExample:
surrealkit test --fail-fast --json-out artifacts/surrealkit-tests.json
See the main skill rule for full operating guidance:
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/surrealkit · pinned to the source commit
git clone https://github.com/24601/surreal-skills.git
cd surreal-skills
git checkout 4e66534bc9e56699c471cd7739297c7e184656b0
mkdir -p ".claude/skills/surrealkit"
cp -r "skills/surrealkit" ".claude/skills/surrealkit"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 4e66534bc9e5. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
References credentials, tokens or secret files that a skill should not need.
Evidence: [redacted]· fingerprint 0be64ae89ddd24e2
References parent-directory traversal, which can escape a target directory.
Evidence: ../· fingerprint fa08499e14d0113b