notion-market-publish-skill
npx skills add https://github.com/ewingyangs/notion-skills --skill notion-market-publish-skill
Agent 安装分布
Skill 文档
Notion Market Publish Skill
Overview
Automate publishing Notion templates to the official Notion template marketplace. This skill uses AI to generate intelligent metadata (locale detection, slug generation, category selection, descriptions) and scripts to execute concrete operations (API calls, image uploads, submission).
Prerequisites
- Python 3.7+ with
requestslibrary:pip install -r requirements.txt - Notion API key stored at
~/.config/notion/api_key - (Optional) Stripe account for paid templates
Workflow
Step 1: Gather User Input
Ask the user for:
- Template URL (required) – e.g.,
https://opaque-bag-aa9.notion.site/3148eab86c0980cdaf39fc5cdeb3bcfb - Image directory (required) – e.g.,
~/Documents/clipno/clipno-template/ç¹ä½/ - Price in JPY (optional) – For paid templates
- Stripe product ID (optional) – For paid templates
Step 2: Get Template Title
Use the script to fetch the template title from Notion API:
python scripts/notion_api.py get-title <template_url>
This returns JSON: {"title": "ç¥è庫管ç系統"}
Step 3: AI Analysis and Generation
AI performs all intelligent generation (do NOT use scripts for this):
-
Detect Locale – Analyze the title to determine language:
- Korean characters (íêµì´) â
ko-KR - Japanese characters (æ¥æ¬èª) â
ja-JP - Traditional Chinese (ç¹é«ä¸æ) â
zh-TW - Simplified Chinese (ç®ä½ä¸æ) â
zh-CN - Default â
en-US
- Korean characters (íêµì´) â
-
Generate Slug – Create English slug from title:
- Translate key terms to English
- Convert to lowercase with hyphens
- Add 4 random digits
- Example: “ç¥è庫管ç系統” â “knowledge-base-management-system-1234”
-
Select Categories – Read
category.jsonand select top 3 most relevant categories:- Analyze title and purpose
- Match with category names and descriptions
- Return 3
contentful_idvalues
-
Generate Emoji – Choose appropriate emoji based on title:
- ð for knowledge/learning
- ð for notes/content
- ð¨ for creative/design
- ð¼ for business
- ð for projects/data
- etc.
-
Generate Descriptions:
- shortDescription: 1-2 sentences describing the template
- longDescription: Detailed description with features/modules
- Use the detected locale’s language for descriptions
Step 4: Create Stripe Payment Link (If Paid)
If user provided price and Stripe product ID:
- Use
mcp__stripe__list_pricesto check existing prices - Use
mcp__stripe__create_priceto create one-time JPY price - Use
mcp__stripe__create_payment_linkwith:- Price ID from step 2
- Quantity: 1
- Success URL: template URL
Convert JPY to USD (divide by 150, round to integer) for the price field.
Step 5: Get Notion Cookies (Automated)
Run the browser automation script to get cookies:
node scripts/get_cookies.js
This script will:
- Launch Chrome browser (visible, not headless)
- Navigate to
https://www.notion.so/profile/templates - Wait for user to login if needed (5 seconds)
- Extract all cookies and user_id
- Save to
~/.config/notion/cookies.txtand~/.config/notion/user_id.txt
The cookies will be automatically used by subsequent commands.
Note: If you don’t have Node.js/puppeteer, you can manually:
- Open browser â
https://www.notion.so/profile/templates - Open DevTools (F12) â Network tab
- Copy full
Cookieheader and save to~/.config/notion/cookies.txt - Copy
notion_user_idvalue and save to~/.config/notion/user_id.txt
Step 6: Upload Images
Run the script to upload all images (cookies auto-loaded):
python scripts/notion_api.py upload-images <image_dir>
The script finds and uploads:
- Desktop cover:
desktop.*,cover.*,image.*âimage(1920×1200) - Mobile cover:
mobile_image.*âmobileImage(600×1200) - PC screenshots:
pc1.jpg,pc2.jpg, etc. âscreenshots[](2048×1280) - Mobile screenshots:
mobile1.*,mobile2.*, etc. âmobileScreenshots[](750×2668)
Returns JSON with all uploaded URLs.
Step 7: Combine Data and Confirm
Merge all data into final submission payload:
{
"url": "<template_url>",
"name": "<title>",
"locale": "<ai_detected_locale>",
"shortDescription": "<ai_generated_short_desc>",
"longDescription": "<ai_generated_long_desc>",
"categories": ["<ai_selected_cat1>", "<ai_selected_cat2>", "<ai_selected_cat3>"],
"image": { "url": "...", "height": 1200, "width": 1920 },
"mobileImage": { "url": "...", "height": 1200, "width": 600 },
"emoji": "<ai_selected_emoji>",
"purchaseUrl": "<stripe_payment_link>",
"price": <usd_price>,
"slug": "<ai_generated_slug>",
"screenshots": [...],
"mobileScreenshots": [...],
"videos": [],
"verifiedInstantDelivery": true,
"isDefaultLocale": true,
"status": "in_review"
}
CRITICAL: Display complete JSON to user and get confirmation before submitting.
Step 8: Submit to Marketplace
After user confirms, submit using the script (cookies auto-loaded):
python scripts/notion_api.py submit '<data_json>'
Template will be submitted with status in_review.
Division of Responsibilities
AI Handles (Intelligent Generation)
- Locale detection from title
- Slug generation (translation + formatting)
- Category selection (semantic matching)
- Emoji selection (keyword matching)
- Description generation (context-aware)
Scripts Handle (Concrete Operations)
- Fetching title from Notion API
- Uploading images to S3
- Submitting data to marketplace API
Image Naming Conventions
Organize images in directory as:
image.jpgordesktop.jpg– Desktop covermobile_image.jpgormobile_image.PNG– Mobile coverpc1.jpg,pc2.jpg,pc3.jpg,pc4.jpg– PC screenshotsmobile1.PNG,mobile2.PNG, etc. – Mobile screenshots
Supported Locales
en-US: English (US)ko-KR: íêµì´zh-CN: ç®ä½ä¸æzh-TW: ç¹é«ä¸æja-JP: æ¥æ¬èªes-ES: Españolfr-FR: Françaisde-DE: Deutsch- And more…
Error Handling
- If Notion API key missing, instruct user to create it
- If image upload fails, verify cookies are fresh
- If submission fails, check all required fields present
- Always confirm data with user before submission
Resources
scripts/notion_api.py– Unified script for all API operationsrequirements.txt– Python dependenciesreferences/workflow.md– Detailed workflow documentation