agentleFS
VercelKnown publishervercel/chat/packages/adapter-notion/AGENTS.md

chat / adapter-notion

AGENTS.md2.4k starsChanged 59 days agoMITView on GitHub

Guidance for coding agents working inside the Notion adapter package. The top-level repository AGENTS.md covers monorepo-wide build, lint, and release rules — read it first. @chat-adapter/notion connects a Chat SDK bot to Notion comments (page-level and discussion threads) via: - Webhooks (comment.created) with X-Notion-Signature HMAC verification and a one-time verification_token handshake - Comments REST API (create / update / delete / list / retrieve) - Outbound Vercel Connect authentication via an async token resolver; inbound webhooks remain direct and use…

Trending

Quiet since March.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 4 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the vercel/chat repository that our weekly crawl found: only 5 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When both discussionId and blockId are present, encode prefers discussionId.

    line 68
  2. Very specific:

    Default "mention" matches plain-text @userName / @botUserId (Notion connection bots are not @-mentionable in the composer).

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — @chat-adapter/notion

Guidance for coding agents working inside the Notion adapter package. The top-level repository AGENTS.md covers monorepo-wide build, lint, and release rules — read it first.

Overview

@chat-adapter/notion connects a Chat SDK bot to Notion comments (page-level and discussion threads) via:

  • Webhooks (comment.created) with X-Notion-Signature HMAC verification and a one-time verification_token handshake
  • Comments REST API (create / update / delete / list / retrieve)
  • Outbound Vercel Connect authentication via an async token resolver; inbound webhooks remain direct and use native Notion HMAC verification
  • Outbound files via File Uploads API (single_part binary + external_url for public URLs). external_url imports are polled until uploaded before attach (default [0, 5000, 10000] — immediate recheck then 5s/10s; override with externalUrlPollDelaysMs). Never attach while pending. Up to 3 native comment attachments; overflow/failures/timeouts become markdown links. Edits link files in markdown only (PATCH may not attach).
  • Post+Edit streaming with a global ~3 req/s token bucket

Directory layout

packages/adapter-notion/
├── src/
│   ├── index.ts             # NotionAdapter + createNotionAdapter
│   ├── index.test.ts
│   ├── types.ts
│   ├── utils.ts             # thread IDs, HMAC, deep links
│   ├── markdown.ts          # NotionFormatConverter
│   ├── cards.ts             # card → markdown fallback
│   ├── rate-limit.ts        # token bucket
│   └── testing.ts           # @chat-adapter/notion/testing
├── package.json
├── tsconfig.json
├── tsup.config.ts
├── vitest.config.ts
└── README.md

Public surface

  • createNotionAdapter(config?) / NotionAdapter / NotionAdapterConfig
  • token accepts a static string or async resolver and is resolved for every Notion API request
  • Env: NOTION_TOKEN, NOTION_VERIFICATION_TOKEN, optional NOTION_BOT_USERNAME, NOTION_VERSION, NOTION_MENTION_MODE, NOTION_KEYWORDS
  • Pinned API version: DEFAULT_NOTION_VERSION (2026-03-11)
  • Testing: @chat-adapter/notion/testing
  • fetchSubject → message.subject resolves the parent page via GET /v1/pages/{pageId} (page object / properties on raw, not block children)

Thread IDs

notion:{pageId}
notion:{pageId}:{discussionId}
notion:{pageId}:block:{blockId}

UUIDs are normalized to lowercase hyphenated form. Outbound whole-block discussion starts use notion:{pageId}:block:{blockId} (NotionThreadId.blockId). When both discussionId and blockId are present, encode prefers discussionId. Selected-text discussions cannot be started via API.

Non-goals (v0.1)

Reactions, modals, DMs, typing indicators, multi-workspace OAuth, page-content event triggers, selected-text discussion creation.

Mentions

mentionMode: "mention" | "all-comments" | "keyword". Default "mention" matches plain-text @userName / @botUserId (Notion connection bots are not @-mentionable in the composer). NOTION_KEYWORDS is comma-separated when mode is "keyword". A keyword match reports true; no match leaves isMention undefined so the SDK text fallback still applies. Only isMe comments report a definitive false.

Where to look next

  • Docs: apps/docs/content/adapters/official/notion.mdx
  • PRD: notion-adapter-prd.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.