agentleFS
jaskirat1616jaskirat1616/grok-skills/skills/comms-notion/SKILL.md

comms-notion

Skill22 starsChanged 2 months agoMITView on GitHub

Read a Notion page from its URL or ID and return its title, metadata, and body. Use for Notion links or requests to read, summarize, fetch, or extract a Notion document.

  • Reads credentials

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run from this skill's base directory.

    line 24
  2. Very specific:

    When --images=download, output also includes page.md and images/img_<hash>.<ext> next to each other, so the markdown's relative paths …

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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
SKILL.md

Notion Page

Fetch a Notion page's title and body content as markdown via the Notion API.

Setup

Requires a Notion internal integration token in .env (in CWD or in this skill's directory):

NOTION_TOKEN=ntn_...

The page must be shared with the integration: open the page in Notion → Share → Connections → add the integration. Without sharing, the API returns 404 even though the page exists.

Dependencies install on first run via uv (notion-client, python-dotenv).

Commands

Run from this skill's base directory.

Read a page (JSON output, default)

uv run python cli.py "https://www.notion.so/Magic-Tags-Product-spec-31a4cb32d18780bbafeaf1e0d7660594?source=copy_link"

Read a page (markdown output)

uv run python cli.py "<url-or-id>" --format md

Truncate large pages

uv run python cli.py "<url-or-id>" --max-chars 20000

Accepts: full URL, dashed page ID (31a4cb32-d187-80bb-afea-f1e0d7660594), or bare 32-char hex (31a4cb32d18780bbafeaf1e0d7660594).

Image handling

By default the page's signed S3 image URLs are kept inline (each is several KB of query-string noise — bad for context). Pick a different mode:

# Download images to results/<page>/images/ and rewrite markdown to relative paths.
# Best mode for agent use: agent gets local paths, can `Read` any image on demand.
uv run python cli.py "<url-or-id>" --images download

# Inline images as data: URLs. Self-contained but bloats context massively
# (a 7-image page becomes ~600K tokens). Use only if you need a single artifact.
uv run python cli.py "<url-or-id>" --images base64

# Replace every image with `[image]` placeholder. Smallest output.
uv run python cli.py "<url-or-id>" --images strip

# Custom output directory for --images=download
uv run python cli.py "<url-or-id>" --images download --out-dir /tmp/magic-tags

When --images=download, output also includes page.md and images/img_<hash>.<ext> next to each other, so the markdown's relative paths resolve.

JSON output shape

{
  "url": "https://www.notion.so/...",
  "page_id": "31a4cb32d18780bbafeaf1e0d7660594",
  "title": "Magic Tags — Product spec",
  "created_time": "2026-...",
  "last_edited_time": "2026-...",
  "content": "## Heading\n\nBody as markdown...",
  "content_length": 4823,
  "truncated": false,
  "images_mode": "download",
  "output_dir": "results/31a4cb32d187_2026-04-28_150833",
  "markdown_path": "results/.../page.md",
  "images": [
    {"path": ".../img_aa209471db1f.png", "relative": "images/img_aa209471db1f.png", "size": 223152, "mime": "image/png", "source_url": "..."}
  ]
}

The images array and output paths only appear when --images=download.

Block coverage

Headings (1–3), paragraphs, bulleted/numbered lists, to-dos, toggles, quotes, callouts, code (with language), dividers, bookmarks/embeds, images/video/files/pdfs, tables, equations, child pages, child databases. Nested children render with indentation. Unsupported block types emit <!-- unsupported block: <type> --> so nothing disappears silently.

Troubleshooting

  • 404 / "object_not_found" — the integration isn't added to the page. Share → Connections → add it.
  • "NOTION_TOKEN not set" — drop a .env next to cli.py or in the directory you're running from.

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.