Canonical Schema logo

Canonical Schema

OrganizationPopular
NxcoreAI
canonical-schema

canonical schema 字段语义与各 provider 原始格式要点(gmail/outlook/google-calendar)。产出格式映射时使用。

Overview

PublisherNxcoreAI
RepositoryEverRoom
Skill namecanonical-schema
Stars
1.5K
Forks
220
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Canonical Schema 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.
  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/NxcoreAI/EverRoom.git /tmp/EverRoom
mkdir -p .claude/skills
cp -r /tmp/EverRoom/agents/connector-mapper/skills/canonical-schema .claude/skills/canonical-schema
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Canonical Schema 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 Canonical Schema 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 Canonical Schema 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.

canonical schema 字段语义

邮件(recordKind = "mail")

  • providerMessageId(必填):provider 内全局唯一消息 id(Gmail id;Outlook id)。
  • providerThreadId:会话 id(Gmail threadId;Outlook conversationId)。
  • subject / snippet:主题;正文摘要(Gmail snippet;Outlook bodyPreview)。
  • textBody / htmlBody:正文明文与 HTML;两者都有时都输出。
  • receivedAt / sentAt:ISO-8601。
  • isRead / isStarred / isDraft:布尔。
  • addresses{role, address, displayName?} 数组;role 枚举 from/sender/to/cc/bcc/reply-to。
  • memberships:Gmail labelIds 原样(不含语义推导)。
  • attachments{providerId?, filename?, mimeType?, size?, inline?}

日程(recordKind = "calendar")

  • providerEventId(必填)、title(必填,缺失时输出 "(无标题)")、 startsAt / endsAt(必填,ISO-8601)。
  • allDay:全天事件(Google start.date 无 dateTime 时为 true)。
  • timeZone / location / description / status / providerRevision(etag)。
  • organizer / attendees{role, address, displayName?};日程专用 role: organizer 用 "organizer"、参与人用 "attendee"
  • 墓碑:Google status === "cancelled" → isTombstone。

provider 原始格式要点

gmail(映射输入 = Gmail REST 资源形状)

  • payload.headers{name, value} 数组,name 大小写不敏感 → 地址字段。
  • 正文:payload MIME 树递归,mimeType="text/plain" / "text/html"body.data 是 base64url;附件节点有 body.attachmentId
  • labelIds 数组:UNREAD(无 → isRead=true)、STARREDDRAFT
  • internalDate:毫秒字符串 → $fromMillis($number(internalDate))historyId → providerRevision。

outlook(映射输入 = Microsoft Graph 消息对象)

  • @removed 存在 → 墓碑(tombstoneId = $string(id))。
  • 地址:from/sender(单对象)、toRecipients/ccRecipients/bccRecipients/replyTo (数组),均为 {emailAddress: {name, address}} → role 依次映射 sender/to/cc/bcc/reply-to。
  • flag.flagStatus === "flagged" → isStarred;isRead/isDraft 直取。
  • body.contentType "text"|"html" → textBody|htmlBody(content); receivedDateTime/sentDateTime 已是 ISO;changeKey → providerRevision。

google-calendar(映射输入 = Google Calendar API v3 event)

  • start/enddateTime(含时区)或 date(全天 → 追加 T00:00:00Z,allDay=true)。
  • status === "cancelled" → 墓碑;etag → providerRevision;recurrence → recurrence.rules。
  • organizer/attendees{email, displayName, ...}

JSONata 表达式注意事项(实测)

  • 单匹配退化:过滤或对象构造(x[cond].{...})在只有 1 个匹配时结果是 单对象而非数组。canonical 的数组字段(addresses / attendees / memberships / attachments)必须用数组构造包裹保证类型:[x[cond].{'role': ..., 'address': ...}]。 包裹后无匹配产出 [](合法)。
  • 特殊字符字段名用反引号$exists(`@removed`)`@odata.deltaLink`
  • 数组直接当条件会逐项映射:存在性/判空一律 $count(x) > 0$count($filter(labelIds, function($v){$v='UNREAD'})) = 0
  • $append 只接受 2 个参数:多段拼接需嵌套并数组包裹: [$append($append(a, b), c)]
  • $flatten 不可用(T1006 "Attempted to invoke a non-function")。展平一层 数组的数组用 $reduce($blocks, $append, [])$append 会拼接第二参数的元素)。
  • 对象构造器不对函数调用结果扇出{'address': $split(value, ',')} 得到的 address 是数组而非多条目。逐条目产出必须显式 $map(..., function($p){ {...} })
  • 多地址头To: a@x.com, "Li, Si" <b@y.com>):禁止按逗号 $split(引号显示名 含逗号会切碎),也禁止 $match(...) 不取 .match(address 会变成数组)。用 $match($h.value, /[\w.+-]+@[\w.-]+/).match 逐匹配提取,配 $map 构造条目、 $reduce($blocks, $append, []) 展平。
  • 总表达式纪律:每个 record 表达式对所有真实记录都不能抛错——可选路径先 $exists(...) 守卫($exists(x) ? f(x) : undefined),否则一条形状不同的 真实邮件就会让整轮 run 以 format_mapping_pending 失败。
  • 递归下降收集 MIME 节点用 **[mimeType='text/plain'][0].body.data($**) 语法不合法)。
  • 无匹配的字段表达式返回 undefined,服务端自动略过该字段;不要用占位值 (title 必填除外,canonical 规定缺失时输出 "(无标题)")。

Frequently asked questions

What does the Canonical Schema AI skill do?

canonical schema 字段语义与各 provider 原始格式要点(gmail/outlook/google-calendar)。产出格式映射时使用。

Why use Canonical Schema on TypingMind?

Because you install it once and use it with any model. Canonical Schema 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 Canonical Schema in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NxcoreAI/EverRoom/tree/main/agents/connector-mapper/skills/canonical-schema. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Canonical Schema?

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 Canonical Schema?

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

Is the Canonical Schema AI skill free?

It is published on GitHub by NxcoreAI. Check the repository for licensing terms. 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 👇