notion · imoonkey — Claude Code skill: search, read and create Notion pages
This skill gives your agent hands-on access to a Notion workspace: find pages, read their content, query databases and write new entries.
npx skills add imoonkey/openweb --skill notion -a claude-codeWhat notion does
Everything runs through the openweb CLI. getSpaces hands back a spaceId, and that identifier is required by every call after it. Text search goes through searchPages, which returns page id, title and a relevance score. Reading a page means getPage, which walks the block tree; queryDatabase pulls database rows together with their property values.
Writing is covered too. createPage makes a page at the workspace top level, or nests it under parentId if you pass one. updatePage rewrites a title, deletePage trashes the page. All three carry a CAUTION flag: createPage puts a real page in your workspace, so a test run leaves something you have to clean up by hand.
Databases have a catch. The collectionId lives in collection_view_page blocks inside recordMap.block from search results, and system databases such as “Home views” or “My Tasks” may not expose it — only user-created ones do. No collectionId and viewId, no queryDatabase call.
What it helps with
- find a page by text query in a workspace
- read page content and its properties
- pull rows out of a user-created database
- create a page or a nested subpage
- rename a page or move it to trash
Example prompts for the agent
- Search Notion for pages about meetings
- Read page
<pageId>and show me its blocks - Create a Notion page titled “Weekly plan”
How to install notion
1Skills CLI (Vercel)
npx skills add imoonkey/openweb --skill notion -a claude-code2Manually: put the files in place
~/.claude/skills/notion/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/notion/
1Skills CLI (Vercel)
npx skills add imoonkey/openweb --skill notion -a codex2Manually: put the files in place
.agents/skills/notion/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add imoonkey/openweb --skill notion -a cursor2Manually: put the files in place
.cursor/skills/notion/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install imoonkey/openweb notion2Manually: put the files in place
.github/skills/notion/SKILL.md1Skills CLI (Vercel)
npx skills add imoonkey/openweb --skill notion -a gemini-cli2Platform CLI
gemini skills install https://github.com/imoonkey/openweb --path src/sites/notionManually: put the files in place
.devin/skills/notion/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add imoonkey/openweb --skill notion -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about notion
How do I install notion in Claude Code?
Run npx skills add imoonkey/openweb --skill notion -a claude-code. The skill lands at ~/.claude/skills/notion/SKILL.md.
What does the notion skill do?
It exposes Notion operations to the agent: page search, block reading, database queries, plus creating, renaming and deleting pages.
Why does queryDatabase fail on my database?
The collectionId comes from collection_view_page blocks in search results, and system databases like “Home views” or “My Tasks” may not have one. Only user-created databases can be queried.
Source text
SKILL.md · MIT
# Notion
## Overview
Productivity and collaboration workspace. Enterprise archetype.
## Workflows
### Search pages
1. `getSpaces` → pick workspace → `spaceId`
2. `searchPages(query, spaceId)` → results with page `id`, `title`, `score`
### Read a page
1. `searchPages(query, spaceId)` → find page `id` in results
2. `getPage(pageId)` → blocks in `recordMap.block`, properties in root block's `value.properties`
### Query a database
1. `searchPages(query, spaceId)` → find `collection_view_page` blocks in `recordMap.block` → `collection_id`, `view_ids`
2. `queryDatabase(collectionId, viewId)` → rows with property values
**Note:** `collection_id` is found in blocks of type `collection_view_page` within search results' `recordMap.block`. It may not appear in system databases ("Home views", "My Tasks") — only user-created databases.
### Create a page
1. `getSpaces` → `spaceId`
2. `createPage(title, spaceId)` → new `pageId`
- Optionally pass `parentId` to nest under an existing page
### Update a page
1. `searchPages(query, spaceId)` → find page → `pageId`
2. `updatePage(pageId, title, spaceId)` → updated page info
### Delete a page
1. `searchPages(query, spaceId)` → find page → `pageId`
2. `deletePage(pageId, spaceId)` → `deleted: true`
- Moves page to trash — recoverable from Notion UI
- Reverse of `createPage`
## Operations
| Operation | Intent | Key Input | Key Output | Notes |
|-----------|--------|-----------|------------|-------|
| getSpaces | list workspaces | — | userId, spaceId | entry point for spaceId |
| searchPages | full-text search | query, spaceId | results[].id, score, recordMap | paginated via limit |
| getPage | read page content | pageId | recordMap.block (page tree), cursor | paginated via chunkNumber |
| queryDatabase | filter/sort database rows | collectionId, viewId | blockIds, recordMap.block (rows) | needs collectionId from search |
| createPage | create page | title, spaceId, parentId? | pageId | write op — adapter-based |
| deletePage | delete (trash) page | pageId, spaceId | deleted: true | write op — reverse of createPage |
| updatePage | update page title | pageId, title, spaceId | updated: true | write op — adapter-based |
### Write Operations Safety
| Operation | Level | Notes |
|-----------|-------|-------|
| createPage | CAUTION | Creates a real page in workspace — delete manually if testing |
| deletePage | CAUTION | Moves page to trash — recoverable from Notion UI |
| updatePage | CAUTION | Overwrites page title — reversible by updating again |
## Quick Start
```bash
# Get workspace spaceId
openweb notion exec getSpaces '{}'
# Search pages
openweb notion exec searchPages '{"x-notion-space-id":"<spaceId>","type":"BlocksInSpace","query":"meeting","spaceId":"<spaceId>","limit":20,"source":"quick_find","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"includePublicPagesWithoutExplicitAccess":false,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[],"excludeSurrogateCollections":false,"excludedParentCollectionIds":[]},"sort":{"field":"relevance"},"peopleBlocksToInclude":"all"}'
# Read a page's content
openweb notion exec getPage '{"x-notion-space-id":"<spaceId>","page":{"id":"<pageId>"},"limit":100,"cursor":{"stack":[]},"chunkNumber":0,"verticalColumns":false}'
# Query a database (requires collectionId and viewId from search results)
openweb notion exec queryDatabase '{"x-notion-space-id":"<spaceId>","collection":{"id":"<collectionId>"},"collectionView":{"id":"<viewId>"},"loader":{"type":"reducer","reducers":{"collection_group_results":{"type":"results","limit":50}},"searchQuery":"","userTimeZone":"America/Los_Angeles"}}'
# Create a new page at workspace top level
openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"My New Page"}'
# Create a subpage under an existing page
openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"Child Page","parentId":"<parentPageId>"}'
# Update a page's title
openweb notion exec updatePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>","title":"New Title"}'
# Delete (trash) a page
openweb notion exec deletePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>"}'
```
© imoonkey · MIT · imoonkey/openweb
Similar skills
All skills for Notes, tasks and projects →notion by other authors comes first.