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.5 $0.00100 $0.01428
Sonnet 5.5 $0.00050 $0.00714
Haiku 4.5 $0.00025 $0.00357

Measured 3mo ago against content hash 94d6c2990f3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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_URL → SURREALDB_URL, SURREAL_NS → SURREALDB_NS, SURREAL_DB → SURREALDB_DB, SURREAL_USER → SURREALDB_USER, SURREAL_PASS → SURREALDB_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. 3mo 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 2d ago), licensed MIT. It adds 249 tokens to every session and 3,570 once invoked, about $0.0010 per session on Opus 5.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

surrealdb-canonical-layer compared with skills from other repositories

surrealdb-canonical-layer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
surrealdb-canonical-layerlossless-group/lossless-agent-skillsSkill42d agoMITA249Claude Code
ddia-systemswondelai/skillsSkill2.8ktodayMITA138Claude Code
acme-arch-reviewbmad-code-org/BMAD-METHODSkill56kyesterdaynoneA39Claude Code, Codex
migration-patternssoftspark/ai-toolkitSkill18013d agoApache-2.0A41Claude Code
airtablediillson/chatcliSkill94yesterdayApache-2.0A57Claude Code
bitrix-performancebxmaximum/bitrix-framework-skillsSkill7513d agoMITA51Claude Code, Codex
bitrix-postgresqlbxmaximum/bitrix-framework-skillsSkill7513d agoMITA51Claude Code, Codex