Parent
#21
What to build
Add the Notion → markdown import path on top of slice #22. Once this lands, an Ocobo author can draft a tool entry as a Notion page and /new-tool <notion-url> will import it end-to-end. Subsequent type slices (#3–#6) reuse this infrastructure.
Concretely:
- Create
scripts/notion-to-markdown.js — takes a Notion page object (as returned by the Notion MCP) and returns {frontmatter, body, assets[]}. Handles property → frontmatter mapping and image extraction.
- Tests in
scripts/__tests__/notion-to-markdown.test.js against fixture Notion page payloads (happy path + missing properties + image extraction).
- Extend
.claude/skills/new-tool/SKILL.md to multimode: with a Notion URL argument → fetch via MCP, transform via notion-to-markdown, ask for confirmation, write the file. Without an argument → existing interview flow.
- Create
docs/mcp-notion-setup.md — per-user setup guide for configuring an MCP Notion connection authenticated against the Ocobo workspace.
- Create
docs/notion-templates/README.md — overview of the Notion → import flow, links to the per-type docs.
- Create
docs/notion-templates/tool.md — property mapping (Notion property name ↔ Zod field), NotionAI scaffolding prompt for the Tools database, sample template page.
Acceptance criteria
Blocked by
Parent
#21
What to build
Add the Notion → markdown import path on top of slice #22. Once this lands, an Ocobo author can draft a tool entry as a Notion page and
/new-tool <notion-url>will import it end-to-end. Subsequent type slices (#3–#6) reuse this infrastructure.Concretely:
scripts/notion-to-markdown.js— takes a Notion page object (as returned by the Notion MCP) and returns{frontmatter, body, assets[]}. Handles property → frontmatter mapping and image extraction.scripts/__tests__/notion-to-markdown.test.jsagainst fixture Notion page payloads (happy path + missing properties + image extraction)..claude/skills/new-tool/SKILL.mdto multimode: with a Notion URL argument → fetch via MCP, transform vianotion-to-markdown, ask for confirmation, write the file. Without an argument → existing interview flow.docs/mcp-notion-setup.md— per-user setup guide for configuring an MCP Notion connection authenticated against the Ocobo workspace.docs/notion-templates/README.md— overview of the Notion → import flow, links to the per-type docs.docs/notion-templates/tool.md— property mapping (Notion property name ↔ Zod field), NotionAI scaffolding prompt for the Tools database, sample template page.Acceptance criteria
scripts/notion-to-markdown.jsis tested in isolation against fixture Notion payloads./new-tool <notion-url>in Claude Code with an MCP Notion connection imports the page and produces a validtools/<slug>.mdplus any image inassets/tools/./new-toolwithout an argument still triggers the interview (slice [Slice 1] Foundation + new-tool (interview only) + publish-content #22 behaviour preserved).docs/mcp-notion-setup.mdis followable from a fresh machine.docs/notion-templates/tool.mdcontains a NotionAI prompt that, pasted into Notion, scaffolds the Tools database.Blocked by