Agent skill

notion

Notion workspace — read/write pages, databases, search, create tasks via Notion API

Stars 39
Forks 5

Install this agent skill to your Project

npx add-skill https://github.com/ariffazil/arifOS/tree/main/skills/notion

SKILL.md

Notion Skill — arifOS_bot

Triggers: "notion", "note", "add to notion", "search notion", "create page", "update notion", "notion database", "my notes", "add task to notion", "notion doc", "write to notion"

API: https://api.notion.com/v1 | Auth: NOTION_API_KEY (Integration Token)


⚙️ One-Time Setup (do once, then forget)

Status: NOTION_API_KEY not yet configured.

  1. Go to: https://www.notion.so/my-integrations
  2. Click "New integration" → name it arifOS_bot
  3. Select your workspace → Submit → Copy the Internal Integration Token (secret_...)
  4. Add the token to VPS:
    bash
    # On VPS host:
    echo 'NOTION_API_KEY=secret_YOUR_TOKEN_HERE' >> /root/arifOS/.env
    docker compose up -d --force-recreate openclaw
    
  5. Share pages with the integration: Open any Notion page → Share → invite arifOS_bot

After setup, test:

bash
curl -s https://api.notion.com/v1/users/me \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" | python3 -m json.tool

Search

bash
# Search across your Notion workspace
curl -s -X POST https://api.notion.com/v1/search \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{"query":"YOUR SEARCH TERM","page_size":10}' \
  | python3 -c "
import sys, json
d = json.load(sys.stdin)
for r in d.get('results',[]):
    title = ''
    if r['object'] == 'page':
        props = r.get('properties',{})
        for k,v in props.items():
            if v.get('type') == 'title':
                title = ''.join([t['plain_text'] for t in v['title']])
                break
    elif r['object'] == 'database':
        title = ''.join([t['plain_text'] for t in r.get('title',[])])
    print(f\"{r['object']}: {title} — {r['id']}\")
"

Read a Page

bash
PAGE_ID="YOUR-PAGE-ID-HERE"  # from URL: notion.so/PAGE_ID

# Get page metadata
curl -s https://api.notion.com/v1/pages/${PAGE_ID} \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" | python3 -m json.tool

# Get page content (blocks)
curl -s https://api.notion.com/v1/blocks/${PAGE_ID}/children \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  | python3 -c "
import sys, json
d = json.load(sys.stdin)
for block in d.get('results', []):
    bt = block['type']
    content = block.get(bt, {})
    text = ''.join([t.get('plain_text','') for t in content.get('rich_text',[])])
    if text: print(f'[{bt}] {text}')
"

Create a Page

bash
PARENT_PAGE_ID="YOUR-PARENT-PAGE-ID"

curl -s -X POST https://api.notion.com/v1/pages \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d "{
    \"parent\": {\"page_id\": \"${PARENT_PAGE_ID}\"},
    \"properties\": {
      \"title\": {\"title\": [{\"text\": {\"content\": \"YOUR TITLE HERE\"}}]}
    },
    \"children\": [
      {
        \"object\": \"block\",
        \"type\": \"paragraph\",
        \"paragraph\": {
          \"rich_text\": [{\"type\": \"text\", \"text\": {\"content\": \"Page content here.\"}}]
        }
      }
    ]
  }" | python3 -c "import sys,json; d=json.load(sys.stdin); print('Created:', d.get('id'), d.get('url'))"

Append to Existing Page

bash
PAGE_ID="YOUR-PAGE-ID"
CONTENT="New content to append"

curl -s -X PATCH "https://api.notion.com/v1/blocks/${PAGE_ID}/children" \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d "{
    \"children\": [
      {
        \"object\": \"block\",
        \"type\": \"paragraph\",
        \"paragraph\": {
          \"rich_text\": [{\"type\": \"text\", \"text\": {\"content\": \"${CONTENT}\"}}]
        }
      }
    ]
  }" | python3 -c "import sys,json; d=json.load(sys.stdin); print('Appended:', len(d.get('results',[])),'blocks')"

Database — Query & Add Rows

bash
DB_ID="YOUR-DATABASE-ID"

# Query database rows
curl -s -X POST "https://api.notion.com/v1/databases/${DB_ID}/query" \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{"page_size": 20}' \
  | python3 -c "
import sys, json
d = json.load(sys.stdin)
print(f'Total rows: {len(d[\"results\"])}')
for row in d['results'][:5]:
    props = row['properties']
    for k, v in props.items():
        if v.get('type') == 'title':
            title = ''.join([t['plain_text'] for t in v['title']])
            print(f'  - {title}')
"

# Add a row to database (adjust property names to match your DB schema)
curl -s -X POST https://api.notion.com/v1/pages \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d "{
    \"parent\": {\"database_id\": \"${DB_ID}\"},
    \"properties\": {
      \"Name\": {\"title\": [{\"text\": {\"content\": \"New Task\"}}]},
      \"Status\": {\"select\": {\"name\": \"Todo\"}}
    }
  }" | python3 -c "import sys,json; d=json.load(sys.stdin); print('Row created:', d.get('id'))"

Quick Shortcuts

bash
# List all databases you have access to
curl -s -X POST https://api.notion.com/v1/search \
  -H "Authorization: Bearer ${NOTION_API_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{"filter":{"value":"database","property":"object"}}' \
  | python3 -c "
import sys, json
d = json.load(sys.stdin)
for db in d['results']:
    title = ''.join([t['plain_text'] for t in db.get('title',[])])
    print(f'{title}: {db[\"id\"]}')
"

arifOS_bot → Notion Pipeline

When Arif says "log this to Notion" or "save this decision to Notion":

  1. Search for the target page/database by name
  2. Append content with timestamp and source tag
  3. Log to ~/.openclaw/workspace/logs/audit.jsonl

arifOS_bot — Notion API v2022-06-28

Expand your agent's capabilities with these related and highly-rated skills.

ariffazil/arifOS

mcp-config-separation

39 5
Explore
ariffazil/arifOS

drift-watcher

Periodic knowledge freshness checker: detects when local configs, runbooks, or agent knowledge have drifted from the latest official docs. Reduces the stale-knowledge paradox over time. Use when: (1) periodic health checks or heartbeat runs, (2) before major operations, (3) user asks 'am I up to date', 'check for updates', 'is anything outdated', (4) after a software upgrade to verify configs still match new docs.

39 5
Explore
ariffazil/arifOS

MCP_CONFIG

39 5
Explore
ariffazil/arifOS

config-guardian

Universal governed config co-pilot. Before ANY change to ANY system: (1) check latest docs and running version (docs-first), (2) propose as diff with risk analysis, never apply directly (propose-only), (3) log every change with evidence and rollback (change ledger). Works for OpenClaw, Docker, PostgreSQL, Nginx, arifOS, or any software. Triggers on: 'change config', 'fix settings', 'update', 'propose patch', 'explain config', 'validate config', 'why did we change X'. Enforces propose-only workflow — human applies via git.

39 5
Explore
ariffazil/arifOS

drift-watcher

Periodic knowledge freshness checker: detects when local configs, runbooks, or agent knowledge have drifted from the latest official docs. Reduces the stale-knowledge paradox over time. Use when: (1) periodic health checks or heartbeat runs, (2) before major operations, (3) user asks 'am I up to date', 'check for updates', 'is anything outdated', (4) after a software upgrade to verify configs still match new docs.

39 5
Explore
ariffazil/arifOS

config-guardian

Universal governed config co-pilot. Before ANY change to ANY system: (1) check latest docs and running version (docs-first), (2) propose as diff with risk analysis, never apply directly (propose-only), (3) log every change with evidence and rollback (change ledger). Works for OpenClaw, Docker, PostgreSQL, Nginx, arifOS, or any software. Triggers on: 'change config', 'fix settings', 'update', 'propose patch', 'explain config', 'validate config', 'why did we change X'. Enforces propose-only workflow — human applies via git.

39 5
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results