Skip to content

[Slice 2] Notion integration foundation + retro-fit new-tool multimode #23

@wab

Description

@wab

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

  • scripts/notion-to-markdown.js is tested in isolation against fixture Notion payloads.
  • Invoking /new-tool <notion-url> in Claude Code with an MCP Notion connection imports the page and produces a valid tools/<slug>.md plus any image in assets/tools/.
  • Invoking /new-tool without an argument still triggers the interview (slice [Slice 1] Foundation + new-tool (interview only) + publish-content #22 behaviour preserved).
  • docs/mcp-notion-setup.md is followable from a fresh machine.
  • docs/notion-templates/tool.md contains a NotionAI prompt that, pasted into Notion, scaffolds the Tools database.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestready-for-agentScoped, dependencies clear, acceptance criteria explicit — grabbable by an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions