surrealdb-canonical-layer

surrealdb-canonical-layer is a skill for Claude Code from lossless-group/lossless-agent-skills. It costs 249 tokens per session (3,570 once invoked), scanned A, original, MIT.

A procedure for checking records written to SurrealDB, a database, directly through its database interface.

In plain words
What is it for?
Verifying database writes, relationships, tags, observations, and access-scoped records after an import or update.
Why use it?
It confirms that batches of people, organizations, tags, and relationships were stored correctly without creating a temporary checking script.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PROJECT_DIR variable. Also seen: mentions Claude Code.

Good fit Verifying database writes, relationships, tags, observations, and access-scoped records after an import or update.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add lossless-group/lossless-agent-skills --skill surrealdb-canonical-layer
Clone the repo
git clone --depth 1 https://github.com/lossless-group/lossless-agent-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for surrealdb-canonical-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer/github.svg)](https://agentmods.dev/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer)
Your own site
<a href="https://agentmods.dev/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer"><img src="https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for surrealdb-canonical-layer

Your own site · 80×15
<a href="https://agentmods.dev/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer"><img src="https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/surrealdb-canonical-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 249 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,570 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00249 $0.03570
Opus 5 $0.00125 $0.01785
Sonnet 5 $0.00050 $0.00714
Haiku 4.5 $0.00025 $0.00357

Measured 12d ago against content hash 94d6c2990f3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

surrealdb-canonical-layer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

surrealdb-canonical-layer/SKILL.md · 260 lines

How it starts

The opening of the file, as written. The whole thing — 260 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SurrealDB Canonical-Layer Verification

A SurrealDB-backed canonical layer (persons/organizations/affiliations plus a schemaless observations log, all multi-tenant via client_access) is first live in augment-it, and the pattern — canonical entities + an append-only observation log + client-scoped visibility — is the kind of shape other Lossless projects (dididecks-ai, memopop-ai) are likely to reach for too. This skill is the discipline for querying that layer directly to verify a batch of writes landed correctly, replacing the previous habit of writing a fresh disposable Node script (connect → signin → use → query, deleted after) for every check.

Companion piece: search-lossless-corpus does the same job for the Chroma corpus (MCP for raw access, a skill for the discipline on top). This skill copies that shape for SurrealDB.

Prerequisite — the surrealdb MCP server

Each project that wants this skill needs its own project-scoped .mcp.json entry pointing at surrealmcp, the official SurrealDB MCP server. It's a Rust binary with exactly two distribution paths — build from source (cargo install --path .) or the surrealdb/surrealmcp:latest Docker image. There's no npm/PyPI package, so it can't be invoked the one-line uvx/npx way the chroma MCP server is.

augment-it's wiring (the reference implementation — copy this shape into a new project rather than re-deriving it):

  • augment-it/scripts/mcp-surrealdb.sh — a wrapper script that sources .env relative to its own location ($(dirname "${BASH_SOURCE[0]}")), not $PWD and not the launching shell's exported environment, then execs docker run --rm -i --pull always -e SURREALDB_URL=... surrealdb/surrealmcp:latest start. This matters because Claude Code's ${VAR} expansion in .mcp.json only reads variables already exported in the shell that launched claude — it does not read .env files — and this repo's habit is sourcing .env per-command (set -a; source ./.env; set +a), not exporting at shell startup. The wrapper script sidesteps that dependency entirely.
  • augment-it/.mcp.json:
    {
      "mcpServers": {
        "surrealdb": {
          "command": "${CLAUDE_PROJECT_DIR:-.}/scripts/mcp-surrealdb.sh"
        }
      }
    }
    
    ${CLAUDE_PROJECT_DIR:-.} (not a hardcoded absolute path) keeps this portable across machines — Claude Code sets that variable to the project root when spawning the server.
  • Env vars the wrapper maps from this project's existing SURREAL_* names (.env) to surrealmcp's expected SURREALDB_* names: SURREAL_URLSURREALDB_URL, SURREAL_NSSURREALDB_NS, SURREAL_DBSURREALDB_DB, SURREAL_USERSURREALDB_USER, SURREAL_PASSSURREALDB_PASS.
  • After adding or editing .mcp.json, the tools don't appear in an already-running Claude Code session — reconnect (/mcp) or start a new session. claude mcp list from a shell confirms connectivity independently of whether the current chat session has picked up the new tools yet.

Read the full file on GitHub · 260 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 260 lines · 249 tokens per session scan A 94d6c2990f3f

Subscribe to this mod's changes

surrealdb-canonical-layer is a skill published in the GitHub repository lossless-group/lossless-agent-skills (4 stars, last pushed 19d ago), licensed MIT. It adds 249 tokens to every session and 3,570 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

drizzle-orm

Drizzle ORM best practices. Use when configuring databases, designing schemas, writing queries, or handling migrations with Drizzle ORM, particularly with Cloudflare D1 or SQLite. NOT for database setup without an explicit engine. Require engine specification (Postgres/MySQL/SQLite). Use for ORM-managed migrations.

neverinfamous/memory-journal-mcp · 65 tokens

sqlite

Enforced meta-cognitive rules and production configurations for SQLite development. Use when designing SQLite schemas, PRAGMAs, transactions, migrations, locking, or backups. Also use when debugging SQLite performance or writing queries against an SQLite database. MUST-ASK: Require explicit database engine name before…

neverinfamous/memory-journal-mcp · 101 tokens

postgres

Use when designing, querying, or managing a PostgreSQL database. Enforces enterprise production rules for advanced querying, composite indexing, JSONB data handling, and strict optimization patterns (avoiding N+1). Keywords: PostgreSQL query, JSONB, pg, pgvector, RLS, Postgres migration. MUST-ASK: Require explicit…

neverinfamous/memory-journal-mcp · 107 tokens

mysql

Use when designing, querying, or managing a MySQL or MariaDB database. Enforces enterprise production rules for query safety (strict parameterization), connection pooling, and strict schema configurations (STRICTTRANSTABLES). MUST-ASK: Require explicit database engine name before triggering. Never guess. Do NOT…

neverinfamous/memory-journal-mcp · 87 tokens

redis

Redis best practices. Use when configuring caching strategies, connection pooling, handling TTLs (Time-To-Live), or managing Redis data structures (Hash, Set, List) in Node/TypeScript projects. MUST-ASK: Require explicit database engine name before triggering. Never guess. Do NOT use for generic "set up a database" or…

neverinfamous/memory-journal-mcp · 80 tokens

similarity-search-patterns

Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.

foryourhealth111-pixel/Vibe-Skills · 30 tokens