From 7f20c08edf67095986be0627c0f8cfe2815d8e62 Mon Sep 17 00:00:00 2001 From: Andrew Yim Date: Sat, 27 Jun 2026 07:39:36 +0900 Subject: [PATCH] docs(notion-writer): design spec for CLI file uploads + markdown engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tier 1: local ![](path) images uploaded via `ntn files create` and embedded as file_upload image blocks (parser stays pure; upload happens in an isolated post-parse walk). Tier 2: opt-in `--engine markdown` writes through Notion's native enhanced-markdown endpoints (POST /pages, PATCH .../markdown) with a dialect translator (callouts/columns/toggles/mentions) so one source doc works in both engines. Default engine stays `blocks` (no regression). Adds ntn_files.py + md_translate.py, version-aware client (2026-03-11 for markdown writes only), new test suites, venv setup, docs → v1.3.0. Co-Authored-By: Claude Opus 4.8 (1M context) --- ...7-notion-writer-cli-enhancements-design.md | 280 ++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 docs/superpowers/specs/2026-06-27-notion-writer-cli-enhancements-design.md diff --git a/docs/superpowers/specs/2026-06-27-notion-writer-cli-enhancements-design.md b/docs/superpowers/specs/2026-06-27-notion-writer-cli-enhancements-design.md new file mode 100644 index 0000000..f0dc6d0 --- /dev/null +++ b/docs/superpowers/specs/2026-06-27-notion-writer-cli-enhancements-design.md @@ -0,0 +1,280 @@ +# Notion Writer (Skill 32) — CLI Enhancements: File Uploads + Markdown Engine + +> **Date**: 2026-06-27 +> **Status**: Approved (brainstorming) +> **Scope**: Two additive features — (Tier 1) local file/image upload via the `ntn` CLI, and (Tier 2) an opt-in "markdown engine" that writes through Notion's native enhanced-markdown endpoints. +> **Predecessor**: 2026-04-27 Extended Block Coverage (callouts/toggles/columns/mentions), CLAUDE.md v1.2.0 +> **Target version**: bump CLAUDE.md footer to v1.3.0 + +--- + +## Goal + +Add two capabilities to `custom-skills/32-notion-writer/code/scripts/notion_writer.py`: + +1. **Tier 1 — Local media uploads.** Today `![alt](path)` is effectively broken (the inline link regex leaves a stray `!` and renders the image as a text link). Make standalone image references work: local files are uploaded via `ntn files create` and embedded as Notion `image` blocks with a `file_upload` reference; remote URLs become `external` image blocks. This fills a genuine capability gap — the parser previously had no image support at all. + +2. **Tier 2 — Markdown engine.** Add `--engine markdown` to write content through Notion's native enhanced-markdown endpoints (`POST /v1/pages` with `markdown`, `PATCH /v1/pages/:id/markdown`) instead of the local block converter. A dialect translator converts the skill's existing authoring syntax (GitHub alerts, Pandoc columns, `@[mentions]`) into Notion-flavored markdown so a single source document works in both engines. + +The default engine stays `blocks` — every existing call and downstream script behaves identically. Both engines share one media-upload path. + +--- + +## Non-goals + +- **Re-platforming onto `ntn`** (Tier 3, rejected). The skill keeps its token-based SDK core; `ntn` is used only as a file-upload subprocess. +- **Reading pages back as markdown** (`GET /v1/pages/:id/markdown`). Not needed for a writer; parked. +- **Workspace-mismatch hard guard.** User chose plain shell-out; preflight surfaces the `ntn` target workspace as an informational note but does not block on mismatch. +- **Generic local attachments** (``, ``, `