md-to-confluencelisted
Install: claude install-skill FarzamMohammadi/dev-toolbox
# Markdown → Confluence
Confluence Cloud does **not** store Markdown. Pasting `.md` source into the editor leaves tables as literal `| ... |` text and mermaid blocks as dead code fences. This skill converts the file to Confluence **storage format** (their XHTML dialect) and pushes it over the REST API, so tables, headings, lists, inline code, and diagrams all render — and **not a word of the content changes**.
Two bundled scripts do the work:
- `scripts/convert.py` — Markdown → storage-format XHTML. Pulls out mermaid blocks, adds an auto table-of-contents.
- `scripts/publish.py` — creates or updates the page, then renders each mermaid diagram to a retina PNG and uploads it as an attachment.
## What you need from the user
Ask for these before doing anything. Never hardcode them into the scripts — the scripts read credentials from environment variables so nothing sensitive is written to disk.
1. **The markdown file** — its path.
2. **Confluence site** — the subdomain, e.g. `yourcompany.atlassian.net` (no `https://`, no `/wiki`).
3. **Atlassian email** — the account the API token belongs to.
4. **API token** — the user creates one at https://id.atlassian.com/manage-profile/security/api-tokens ("Create API token", ~30 seconds). Atlassian Cloud authenticates as Basic `email:token`; a plain token alone will 401.
5. **Target**, one of:
- **Update an existing page** — the page ID. It's the number in the page URL: `.../pages/<PAGE_ID>/Some+Title`.
- **Create a new page** —