Goal
Allow users to paste markdown text directly into the UI and split it into sections. No URL fetching, no OAuth — just clipboard.
Frontend
frontend/src/components/import-dialog.tsx:
Step 1 — Input:
- Large textarea: "Paste your markdown here"
- Dropdown: "Split on" —
## Headings (H2), ### Headings (H3), # Headings (H1), <!-- split --> delimiter
- "Preview Split" button
Step 2 — Preview:
- List of detected sections: title, word count, first 100 chars
- Checkboxes to include/exclude each section
- Editable slug field (auto-generated from title)
- "Import Selected" button
Step 3 — Import:
- Call section creation endpoints to add to existing project (or create new project)
- Progress indicator during import
- Success: navigate to project / refresh section list
Backend
POST /api/projects/{slug}/import-markdown
{"markdown": "## Overview\n\nContent...\n\n## Tech Stack\n\nMore...", "heading_level": 2, "replace_existing": false}
Returns: {"created": ["overview", "tech-stack"], "skipped": [], "errors": []}
POST /api/projects/{slug}/import-markdown/preview
Same body, returns split preview without creating anything:
{"sections": [{"slug": "overview", "title": "Overview", "word_count": 150, "preview": "First 100 chars..."}], "conflicts": ["overview"]}
Reuses existing prd_import_markdown MCP tool logic exposed as REST.
Trigger
- "Import Markdown" button in project list page (creates new project)
- "Import Markdown" button in section sidebar header (adds to current project)
Acceptance Criteria
Goal
Allow users to paste markdown text directly into the UI and split it into sections. No URL fetching, no OAuth — just clipboard.
Frontend
frontend/src/components/import-dialog.tsx:Step 1 — Input:
## Headings (H2),### Headings (H3),# Headings (H1),<!-- split --> delimiterStep 2 — Preview:
Step 3 — Import:
Backend
POST /api/projects/{slug}/import-markdown{"markdown": "## Overview\n\nContent...\n\n## Tech Stack\n\nMore...", "heading_level": 2, "replace_existing": false}Returns:
{"created": ["overview", "tech-stack"], "skipped": [], "errors": []}POST /api/projects/{slug}/import-markdown/previewSame body, returns split preview without creating anything:
{"sections": [{"slug": "overview", "title": "Overview", "word_count": 150, "preview": "First 100 chars..."}], "conflicts": ["overview"]}Reuses existing
prd_import_markdownMCP tool logic exposed as REST.Trigger
Acceptance Criteria