Skills surrealkit
SurrealKit schema sync, rollout migrations, seeding, and declarative testing for SurrealDB apps. Part of the surreal-skills collection.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/24601/surrealdb/skills/surrealkit" ~/.claude/skills/clawdbot-skills-surrealkit && rm -rf "$T"
manifest:
skills/24601/surrealdb/skills/surrealkit/SKILL.mdsource content
SurrealKit -- Schema Management for SurrealDB Apps
SurrealKit manages SurrealDB application schemas as desired-state
.surql
files, with separate paths for disposable development databases and shared or
production rollouts.
Quick Start
# Install 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
Core Commands
| Command | Use |
|---|---|
| Desired-state reconciliation for local, preview, or disposable DBs |
| Local development loop with file watching |
| Establish rollout tracking on an existing shared DB |
| Create a reviewed manifest from current schema diff |
| Apply the expansion phase |
| Apply the contract/destructive phase after cutover |
| Roll back an in-flight rollout |
| Validate a rollout without mutating the DB |
| Inspect rollout state stored in the DB |
| Apply seed data |
| Run declarative schema, permission, and API tests |
When to Use It
- Use
when the database should mirror local files immediately.sync - Use
when changes need staging, review, rollback, or controlled cutover.rollout - Use
for deterministic fixture data.seed - Use
in CI to validate permissions, schema behavior, and API contracts.test
Environment
SurrealKit reads these variables:
orDATABASE_HOSTPUBLIC_DATABASE_HOST
orDATABASE_NAMEPUBLIC_DATABASE_NAME
orDATABASE_NAMESPACEPUBLIC_DATABASE_NAMESPACEDATABASE_USERDATABASE_PASSWORD
Testing
Declarative suites in
database/tests/suites/*.toml support:
sql_expectpermissions_matrixschema_metadataschema_behaviorapi_request
Example:
surrealkit test --fail-fast --json-out artifacts/surrealkit-tests.json
Full Documentation
See the main skill rule for full operating guidance:
- rules/surrealkit.md -- sync vs rollout strategy, env vars, seeds, declarative tests, and CI patterns
- surrealdb/surrealkit -- upstream repository