OR Key
drop another .md file to compare - side-by-side diff against notion

notion

Connects your assistant to your Notion workspace.
description: "Triggers on prompt mention of 'notion'."
personal 2 files

What it does for you

Connects your assistant to your Notion workspace.

What it produces

A recent result, so you can see the kind of work it returns.

loading…

How to get it

These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.

Work with me
For developers how this skill is built, graded, and how it runs

at a glance- the short version

actorExported functions in state/lib/notion.ts.
auditorNone wired yet - eval is manual (Robert review).
eval modeshape
categoryIntegrations
stages2
dependssettings

what's inside - the parts that make up a skill 3/4 present

A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.

The skill
state/skills/notion/SKILL.md present
the skill itself, in plain text
The main file. It says what the skill is and lays out the steps in plain English.
Code
state/lib/notion.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/notion/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/notion/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

how it's graded - what counts as a good run 5 criteria · 4 deterministic · 1 judge

Each row is one thing a good run has to get right. deterministic means a quick check decides, pass or fail. judge means the AI reads the result and rates it. Grading each piece on its own (instead of one overall score) shows exactly where a run fell short, so the fix is obvious.

name
kind
check
notion_result_nonzero
deterministic
Called function returns a non-empty result. search() returns {results: [...]}, array.length > 0. getPage/queryDatabase return object with id + properties. createPage returns {id, ...}.
api_success_code
deterministic
HTTP response code is 200/201 (success). No 401/403 (auth), 429 (rate limit), or 5xx errors in the execution log.
no_fallback_path
deterministic
Eval verb is NOT 'fallback'|'auth-failed'|'rate-limited'. Primary Notion API path was used (not local cache or degraded mode).
if_fallback_then_capped
deterministic
If auth/rate-limit causes fallback path, score is capped at 0.5 max regardless of fallback success.
data_structure_valid
judge
Result schema matches Notion API docs. search results include object with title and block-type fields. Pages include properties object.

how it runs - the shared frame every skill uses 4/5 present

Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.

makes the work The worker
present
Exported functions in state/lib/notion.ts. the worker
Does the actual work. Whatever it produces is what gets checked next.
checks the work The reviewer
present
None wired yet - eval is manual (Robert review). the checker
A separate checker grades the work, so the part that made it can't approve its own work.
frame
learns Self-correction
not present

This skill doesn't fix its own gaps yet.

tidies up Background fixes
present
queued for rewrite runs in the background
Bigger fixes that can't be made on the spot get queued and rewritten in the background later.
remembers Run history
present
state/log/pending-eval.ndjson pending runs
Every run is written down here, then reviewed by hand each week.
Critical rules the things this skill must not get wrong
No must-not-break rules called out for this skill. Anything important lives in the writeup below.

what it has learned - fixes written back in over time sample

When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.

  1. Loading feedback rows…

how the work flows- who makes it, who checks it

inputs settings
actor Exported functions in state/lib/notion.ts.
1 generator
invoke
actor = Exported functions in state/lib/notion.ts.
import from `state/lib/notion.ts`  -  `search()`, `getPage()`, `createPage()`, `getBlockChildren()`, `appendBlocks()`, `queryDatabase()
auditor None wired yet - eval is manual (Robert review).
2 data
eval log
`state/log/pending-eval.ndjson` (manual review until shape gate added)

SKILL.md- the skill, written out in plain English

notion

Notion REST capability: search, read pages, create pages, read and append blocks, and query databases.

Ported from kernel snappy-notion in Phase 0.5. See state/lib/notion.ts for the full API surface.

Steps

  • search() - see state/lib/notion.ts
  • getPage() - see state/lib/notion.ts
  • createPage() - see state/lib/notion.ts
  • getBlockChildren() - see state/lib/notion.ts
  • appendBlocks() - see state/lib/notion.ts
  • queryDatabase() - see state/lib/notion.ts

Eval

Actor: the exported functions in state/lib/notion.ts. Auditor: none wired yet - eval is manual (Robert review). File a state/log/pending-eval.ndjson row on each run.

Score convention:

OutcomeScore
Pass on first try1.0
Failed first, auto-fix applied, re-check passed0.5
Still failing or unrecoverable0.0

Gotchas

via the Phase 0.5 driver. Only these rewrites were applied: already in state/lib/)

  1. realpathSync(process.argv[1]) CLI guard wrapped in try/catch
  • See the kernel SKILL.md for the original long-form guidance if you need it

(read-only reference at the kernel path above).

Eval policy

This skill is prose. Wire a deterministic auditor and set eval: auto to score it automatically.

Rubric

criteria:
  - name: notion_result_nonzero
    kind: deterministic
    check: "Called function returns a non-empty result. search() returns {results: [...]}, array.length > 0. getPage/queryDatabase return object with id + properties. createPage returns {id, ...}."
  - name: api_success_code
    kind: deterministic
    check: "HTTP response code is 200/201 (success). No 401/403 (auth), 429 (rate limit), or 5xx errors in the execution log."
  - name: no_fallback_path
    kind: deterministic
    check: "Eval verb is NOT 'fallback'|'auth-failed'|'rate-limited'. Primary Notion API path was used (not local cache or degraded mode)."
  - name: if_fallback_then_capped
    kind: deterministic
    check: "If auth/rate-limit causes fallback path, score is capped at 0.5 max regardless of fallback success."
  - name: data_structure_valid
    kind: judge
    check: "Result schema matches Notion API docs. search results include object with title and block-type fields. Pages include properties object."

AGENTS.md- what the AI loads when this skill comes up

notion - loader

Per-turn rules for the notion skill. Full reference: state/skills/notion/SKILL.md. Do not skip these.

Compound Response Pattern (MANDATORY)

When notion/notes intent fires, you MUST compose a structured surface - NOT flat prose.

Steps:

  1. Fetch recent pages via state/lib/notion.ts:
   npx tsx state/lib/notion.ts search "" --limit 10

Or import: search("") from state/lib/notion.ts (re-exports from state/lib/docs.ts).

  1. Compose via compose_inline:
root = Card([
  CardHeader("Notion - Recent"),
  Stack([
    Callout("Recently Edited", [...top 5 page titles as ListBlock items, or "No recent pages found"...]),
    Callout("Databases", [...key databases found: projects, tasks, notes, etc...]),
    Card([
      TextInput("New Page Title", @Set($pageTitle, @Input)),
      Button("Create Note", Mutation("invoke_skill_verb", {slug: "notion", verb: "create-page", apply: true, args: {title: $pageTitle}}))
    ])
  ]),
  FollowUpBlock([
    SnappyFollowUpItem("create a new note about today's work", "New note"),
    SnappyFollowUpItem("search notion for [topic from context]", "Search Notion"),
    SnappyFollowUpItem("summarize my project notes", "Summarize projects"),
  ])
])
$pageTitle = ""
  1. Always include FollowUpBlock even if pages are empty.

Critical Rules

_(no failures recorded yet - this skill is a Phase 0.5 mechanical port from snappy-notion with no hard-won rules. Marked LEGACY in the .md frontmatter - confirm the workflow actually needs Notion before reaching for this; most current substrate uses local files + Xano. Read state/skills/notion/SKILL.md and state/lib/notion.ts before invoking.)_

Commands

| ui model | live composition via compose_inline, persisted as artifact lang_body, reopened with OpenArtifact | |invoke: import from state/lib/notion.ts - search(), getPage(), createPage(), getBlockChildren(), appendBlocks(), queryDatabase() |eval log: state/log/pending-eval.ndjson (manual review until shape gate added)

Known Pitfalls

  • Marked LEGACY - most workflows have moved off Notion. Verify the user actually wants Notion-targeted output before invoking
  • Skill frontmatter says eval: shape but no auditor wired - log to pending-eval.ndjson

Self-Test

An agent reading this should correctly:

  1. [ ] Question whether Notion is really the target before invoking (it's marked legacy)?
  2. [ ] Use env("NOTION_TOKEN") (or whatever the lib expects) rather than bash credential fallback?
  3. [ ] Log to pending-eval.ndjson because no shape auditor exists yet?

Found a gap? Edit this file. <!-- footer-injection-point -->

api.ts- the code it can call

#!/usr/bin/env npx tsx
/**
 * snappy-notion/api.ts -- Legacy Notion skill. Re-exports from snappy-docs (canonical).
 *
 * Usage:
 *   npx tsx api.ts search <query>
 *   npx tsx api.ts page <id>
 *
 * Or import as module:
 *   import { search, getPage, createPage } from "./notion.ts";
 */

export { search, getPage, createPage, getBlockChildren, appendBlocks, queryDatabase } from "./docs.ts";

// Re-import for CLI usage
import { search, getPage } from "./docs.ts";

// --- CLI ---

if (import.meta.url === `file://${process.argv[1]}`) {
  (async () => {
    const [, , cmd, ...args] = process.argv;

    switch (cmd) {
      case "search": {
        const query = args.join(" ");
        if (!query) { console.error("Usage: api.ts search <query>"); process.exit(1); }
        const data = await search(query);
        for (const r of data.results) {
          const title = r.properties?.title?.title?.[0]?.plain_text
            || r.properties?.Name?.title?.[0]?.plain_text
            || "(untitled)";
          console.log(`${r.id}\t${r.object}\t${title}`);
        }
        break;
      }
      case "page": {
        const [pageId] = args;
        if (!pageId) { console.error("Usage: api.ts page <page_id>"); process.exit(1); }
        const data = await getPage(pageId);
        console.log(JSON.stringify(data, null, 2));
        break;
      }
      default:
        console.log("Usage: npx tsx api.ts [search|page] ...");
    }
  })();
}

scripts- helper scripts it can run

prose-only skill - 1 inline code block live in SKILL.md above (no state/bin/ sidecar yet).

how we check it- the checks, plus the last 10 runs

rubric shape schema-shape check (no inline rubric)
recent no runs actor/auditor: unverifiable
deps settings

no recent runs logged - the eval contract is declared but nothing has been graded yet