{"slug":"publish-to-confluence-3","title":"publish-to-confluence","summary":"Publish any markdown file from the vault to Confluence with format conversion and approval gate","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-28T15:11:44.184473Z","repo":{"url":"https://github.com/huytieu/COG-second-brain","stars":1236,"forks":147,"license":"MIT","updatedAt":"2026-09-28T08:52:07Z"},"bodyHtml":"<hr>\n<h2>name: publish-to-confluence\ndescription: Publish any markdown file from the vault to Confluence with format conversion and approval gate\nroles: [product-manager, engineering-lead, founder]\nintegrations: [confluence]</h2>\n<h1>COG Publish to Confluence Skill</h1>\n<h2>When to Invoke</h2>\n<ul>\n<li>User wants to publish a document to Confluence</li>\n<li>User says \"publish to Confluence\", \"push to wiki\", \"send to Confluence\", \"confluence publish\"</li>\n<li>User has a markdown file they want to share with the team on Confluence</li>\n<li>After generating a PRD, release notes, or other document that should go to the wiki</li>\n</ul>\n<h2>Agent Mode Awareness</h2>\n<p><strong>Check <code>agent_mode</code> in <code>00-inbox/MY-PROFILE.md</code> frontmatter:</strong></p>\n<ul>\n<li>If <code>agent_mode: team</code> — no significant benefit for this skill (single sequential operation)</li>\n<li>If <code>agent_mode: solo</code> — standard execution</li>\n</ul>\n<h2>Command: <code>/publish-to-confluence</code></h2>\n<h2>Pre-Flight Check</h2>\n<ol>\n<li><p><strong>Read <code>00-inbox/MY-INTEGRATIONS.md</code></strong> — Confluence MUST be listed under Active Integrations</p>\n<ul>\n<li>If Confluence is <strong>not active</strong>: Inform the user and stop.\n<pre><code>Confluence is not in your active integrations.\n\nWould you like to:\na) Set up Confluence integration (I'll add it to MY-INTEGRATIONS.md)\nb) Export the document in a Confluence-compatible format for manual upload\n</code></pre>\n</li>\n<li>If Confluence is <strong>disabled</strong>: Skip silently per COG conventions. Suggest alternative publishing (HackMD, Notion) if active.</li>\n</ul>\n</li>\n<li><p><strong>Get current timestamp:</strong> Run <code>date '+%Y-%m-%d %H:%M'</code> using Bash</p>\n</li>\n</ol>\n<hr>\n<h2>Execution Strategy</h2>\n<h3>Phase 1: Identify the Source Document</h3>\n<p>Determine what to publish:</p>\n<p><strong>Option A: User specifies a file path</strong></p>\n<pre><code>Read the specified file from the vault.\n</code></pre>\n<p><strong>Option B: User describes the document</strong></p>\n<pre><code>Search for matching files:\n1. Glob for likely matches in 04-projects/, 05-knowledge/, 01-daily/\n2. Present candidates and let user choose\n</code></pre>\n<p><strong>Option C: Just-generated document</strong>\nIf this skill is invoked right after generating a PRD, release notes, or other document, use that document.</p>\n<h3>Phase 2: Configure Publishing Target</h3>\n<p>Ask the user (if not already provided):</p>\n<pre><code>Where should this be published in Confluence?\n\nRequired:\n- Space key: [CUSTOMIZE: YOUR-SPACE-KEY] (or let me search for spaces)\n- Parent page: [Page title or ID under which to nest this page]\n\nOptional:\n- Page title: [defaults to the document's H1 heading]\n- Labels: [Confluence labels to add]\n- Publish mode: \"create new\" or \"update existing\"\n</code></pre>\n<p><strong>If the user doesn't know the space or parent page:</strong></p>\n<pre><code>Use WebFetch to search Confluence:\nGET /wiki/rest/api/space?limit=50\n- List available spaces for the user to choose\n\nGET /wiki/rest/api/content?spaceKey=[SPACE]&amp;type=page&amp;limit=25\n- List pages in the space for parent page selection\n</code></pre>\n<h3>Phase 3: Convert Markdown to Confluence Format</h3>\n<p>Convert the markdown document to Confluence storage format (XHTML):</p>\n<p><strong>Conversion rules:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Markdown</th>\n<th>Confluence Storage Format</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code># Heading</code></td>\n<td><code>&lt;h1&gt;Heading&lt;/h1&gt;</code></td>\n</tr>\n<tr>\n<td><code>## Heading</code></td>\n<td><code>&lt;h2&gt;Heading&lt;/h2&gt;</code></td>\n</tr>\n<tr>\n<td><code>**bold**</code></td>\n<td><code>&lt;strong&gt;bold&lt;/strong&gt;</code></td>\n</tr>\n<tr>\n<td><code>*italic*</code></td>\n<td><code>&lt;em&gt;italic&lt;/em&gt;</code></td>\n</tr>\n<tr>\n<td><code>- list item</code></td>\n<td><code>&lt;ul&gt;&lt;li&gt;list item&lt;/li&gt;&lt;/ul&gt;</code></td>\n</tr>\n<tr>\n<td><code>1. list item</code></td>\n<td><code>&lt;ol&gt;&lt;li&gt;list item&lt;/li&gt;&lt;/ol&gt;</code></td>\n</tr>\n<tr>\n<td><code>[text](url)</code></td>\n<td><code>&lt;a href=\"url\"&gt;text&lt;/a&gt;</code></td>\n</tr>\n<tr>\n<td><code>`code`</code></td>\n<td><code>&lt;code&gt;code&lt;/code&gt;</code></td>\n</tr>\n<tr>\n<td>Code blocks</td>\n<td><code>&lt;ac:structured-macro ac:name=\"code\"&gt;&lt;ac:plain-text-body&gt;&lt;![CDATA[...]]&gt;&lt;/ac:plain-text-body&gt;&lt;/ac:structured-macro&gt;</code></td>\n</tr>\n<tr>\n<td>Tables</td>\n<td><code>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;...&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</code></td>\n</tr>\n<tr>\n<td><code>&gt; blockquote</code></td>\n<td><code>&lt;blockquote&gt;&lt;p&gt;quote&lt;/p&gt;&lt;/blockquote&gt;</code></td>\n</tr>\n<tr>\n<td><code>---</code></td>\n<td><code>&lt;hr /&gt;</code></td>\n</tr>\n<tr>\n<td><code>- [ ] task</code></td>\n<td><code>&lt;ac:task-list&gt;&lt;ac:task&gt;&lt;ac:task-status&gt;incomplete&lt;/ac:task-status&gt;&lt;ac:task-body&gt;task&lt;/ac:task-body&gt;&lt;/ac:task&gt;&lt;/ac:task-list&gt;</code></td>\n</tr>\n<tr>\n<td><code>- [x] task</code></td>\n<td>Same with <code>complete</code> status</td>\n</tr>\n<tr>\n<td>YAML frontmatter</td>\n<td>Strip entirely (not displayed in Confluence)</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Important conversion notes:</strong></p>\n<ul>\n<li>Strip YAML frontmatter — it should not appear in the Confluence page</li>\n<li>Preserve table structure carefully</li>\n<li>Convert relative vault links to plain text (they won't work in Confluence)</li>\n<li>Handle nested lists properly</li>\n<li>Preserve emoji characters as-is</li>\n</ul>\n<h3>Phase 4: Preview and Approval Gate</h3>\n<p><strong>CRITICAL: NEVER publish without explicit user approval.</strong></p>\n<p>Present a summary to the user:</p>\n<pre><code>Ready to publish to Confluence:\n\nDocument: [filename]\nTitle: [page title]\nSpace: [space key]\nParent Page: [parent page title]\nMode: [create new / update existing]\nLabels: [labels]\n\nContent preview (first 500 chars):\n[preview text]\n\nEstimated page size: [approximate word count]\n\nProceed with publishing? (yes/no)\n</code></pre>\n<p><strong>Wait for explicit \"yes\" before proceeding.</strong></p>\n<h3>Phase 5: Publish</h3>\n<h4>Create New Page</h4>\n<pre><code>Use WebFetch to POST to Confluence REST API:\n\nPOST [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content\n\nHeaders:\n  Content-Type: application/json\n  Authorization: [from configured credentials]\n\nBody:\n{\n  \"type\": \"page\",\n  \"title\": \"[page title]\",\n  \"space\": { \"key\": \"[SPACE_KEY]\" },\n  \"ancestors\": [{ \"id\": \"[PARENT_PAGE_ID]\" }],\n  \"body\": {\n    \"storage\": {\n      \"value\": \"[converted XHTML content]\",\n      \"representation\": \"storage\"\n    }\n  },\n  \"metadata\": {\n    \"labels\": [\n      { \"prefix\": \"global\", \"name\": \"[label]\" }\n    ]\n  }\n}\n</code></pre>\n<h4>Update Existing Page</h4>\n<pre><code>First, get the current page to obtain the version number:\nGET [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content/[PAGE_ID]?expand=version\n\nThen update:\nPUT [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content/[PAGE_ID]\n\nBody:\n{\n  \"type\": \"page\",\n  \"title\": \"[page title]\",\n  \"version\": { \"number\": [current_version + 1] },\n  \"body\": {\n    \"storage\": {\n      \"value\": \"[converted XHTML content]\",\n      \"representation\": \"storage\"\n    }\n  }\n}\n</code></pre>\n<h3>Phase 6: Confirm and Update Vault</h3>\n<p>After successful publishing:</p>\n<ol>\n<li><p><strong>Confirm to the user:</strong></p>\n<pre><code>Published successfully!\n\nPage: [Title]\nURL: [Confluence page URL]\nSpace: [Space Key]\nVersion: [version number]\n</code></pre>\n</li>\n<li><p><strong>Update the source vault file</strong> (add published metadata to frontmatter):</p>\n<pre><code>confluence_url: \"[page URL]\"\nconfluence_page_id: \"[page ID]\"\nconfluence_space: \"[space key]\"\npublished_at: \"[timestamp]\"\nconfluence_version: [version number]\n</code></pre>\n</li>\n<li><p><strong>Log the publication</strong> for future reference.</p>\n</li>\n</ol>\n<hr>\n<h2>Re-Publishing (Update Flow)</h2>\n<p>If the vault file already has <code>confluence_page_id</code> in its frontmatter:</p>\n<pre><code>This document was previously published to Confluence:\n  URL: [confluence_url]\n  Last published: [published_at]\n\nWould you like to:\na) Update the existing Confluence page (increment version)\nb) Create a new page (separate copy)\nc) Cancel\n</code></pre>\n<hr>\n<h2>Fallback Behavior</h2>\n<table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Behavior</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Confluence not active</td>\n<td>Stop and inform user; suggest alternative platforms</td>\n</tr>\n<tr>\n<td>Confluence API fails</td>\n<td>Save the converted XHTML to a file so user can manually paste it</td>\n</tr>\n<tr>\n<td>Authentication failure</td>\n<td>Inform user their Confluence credentials may need refreshing</td>\n</tr>\n<tr>\n<td>Page already exists (same title)</td>\n<td>Ask user: update existing, create with different title, or cancel</td>\n</tr>\n<tr>\n<td>Very large document</td>\n<td>Warn user about page size; suggest splitting into child pages</td>\n</tr>\n<tr>\n<td>Complex markdown (unsupported elements)</td>\n<td>Convert best-effort, warn about any elements that couldn't be converted</td>\n</tr>\n</tbody>\n</table>\n<h2>Error Handling</h2>\n<ul>\n<li><strong>API 403 (Forbidden)</strong>: User may lack write permissions to the target space</li>\n<li><strong>API 404 (Not Found)</strong>: Space key or parent page ID may be incorrect</li>\n<li><strong>API 409 (Conflict)</strong>: Page was modified by someone else; fetch latest version and retry</li>\n<li><strong>Conversion failures</strong>: Fall back to plain text for elements that can't be converted</li>\n<li><strong>Rate limits</strong>: Retry with backoff</li>\n<li><strong>Network errors</strong>: Save converted content locally so no work is lost</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":7761,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-28T15:13:58.427715Z","sha256":"80732E9EA2A704B77F1BA33CDD48C227B76DF1802CBD3401944A802C6E924E28","sizeBytes":3494},"review":null,"source":{"repositoryUrl":"https://github.com/huytieu/COG-second-brain","path":".claude/skills/publish-to-confluence","license":"MIT","commit":"4cdb6015dc6eb66f74bac513856ff6446ecb5d1b","subtreeSha":"C1D1E9445F483337A37FA20D67ED824FFA339E2B4C1181CB5CE061A11732D749","lastSyncedAt":"2026-09-28T15:11:28.148164Z"},"reviewedAt":"2026-09-28T15:17:47.017549Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/huytieu/COG-second-brain/tree/main/.claude/skills/publish-to-confluence"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install huytieu-cog-second-brain@llmmart"},{"target":"git","command":"git clone https://github.com/huytieu/COG-second-brain.git"}]}