Agent skill
notion-to-markdown
Directly convert Notion pages to Obsidian-friendly Markdown using MCP fetch and local processing. Use this skill when you need to migrate specific Notion pages identified by URL or ID into the local Obsidian vault, ensuring LaTeX normalization, image localization, and property-to-frontmatter mapping.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/notion-to-markdown
SKILL.md
Notion to Markdown
This skill provides a high-level workflow for fetching live Notion pages and converting them into clean, localized Markdown files suitable for an Obsidian vault.
Overview
Unlike bulk migration from exports, this skill leverages the Notion MCP (notion-fetch) to retrieve page content directly and then uses the stable_jarvis.notion_to_obsidian toolkit to perform surgical processing.
Execution Workflow
Step 1: Precise Identification
Use notion-search to find the exact page ID or URL.
# Example search
notion-search query="Leveraging Skills from Unlabeled Prior Data"
Step 2: Fetch and Save Content
Retrieve the raw Notion content and save it to a temporary JSON file.
# Fetch content via MCP
notion-fetch id="[PAGE_ID]" > temp_fetch.json
Step 3: Local Processing
Run the migration script to convert the JSON content to localized Markdown.
python skills/notion-to-markdown/scripts/migrate.py temp_fetch.json [OUTPUT_DIR]
Step 4: Verification and Refinement
Inspect the output Markdown. Notion content can sometimes be "jammed" or have deep indentation that script-based normalization might miss. Use the replace tool to:
- Normalize Indentation: Ensure consistent 2 or 4-space indentation for nested blocks.
- Fix Block Spacing: Ensure double newlines exist between headings, details blocks, and paragraphs.
- Verify Equations: Check that all
$$blocks are correctly populated with recovered LaTeX. - Final Polish: Remove any redundant HTML tags or artifacts (e.g., empty
<span>tags).
Key Capabilities
- LaTeX Normalization: Converts Notion's
$ \dots $and$ \dots $to standard$...$and$$...$$syntax. - Image Localization: Automatically detects and downloads Notion S3-hosted images, saving them to a local
assets/folder and updating Markdown links. - Frontmatter Mapping: Extracts Notion properties (Status, Tags, Journal Name, etc.) and maps them to YAML frontmatter.
- Style Conversion: Transforms Notion-specific spans (e.g., color backgrounds) to Obsidian highlights (
==text==).
Dependencies
- Conda Environment: Must use the
jarvisenvironment (conda activate jarvis). notion-fetchMCP Tool: Required to retrieve page data.stable_jarvispackage: Must be installed in editable mode (pip install -e .) within thejarvisenvironment.httpx: Used for reliable image downloads.
Troubleshooting
- Expired Image URLs: Notion S3 URLs are temporary. Ensure the
migrate.pyscript is run immediately afternotion-fetch. - Missing Content: If the fetch result is truncated, ensure you are capturing the full output of the
notion-fetchtool.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?