Publish To Confluence logo

Publish To Confluence

CommunityPopular
huytieu
publish-to-confluence

Publish any markdown file from the vault to Confluence with format conversion and approval gate

Overview

Publisherhuytieu
RepositoryCOG-second-brain
Skill namepublish-to-confluence
Stars
1.2K
Forks
138
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by huytieu on GitHub. Read the source before you install it.

Installation

Install the Publish To Confluence AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huytieu/COG-second-brain.git /tmp/COG-second-brain
mkdir -p .claude/skills
cp -r /tmp/COG-second-brain/skills/publish-to-confluence .claude/skills/publish-to-confluence
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Publish To Confluence in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Publish To Confluence on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Publish To Confluence is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

COG Publish to Confluence Skill

When to Invoke

  • User wants to publish a document to Confluence
  • User says "publish to Confluence", "push to wiki", "send to Confluence", "confluence publish"
  • User has a markdown file they want to share with the team on Confluence
  • After generating a PRD, release notes, or other document that should go to the wiki

Agent Mode Awareness

Check agent_mode in 00-inbox/MY-PROFILE.md frontmatter:

  • If agent_mode: team — no significant benefit for this skill (single sequential operation)
  • If agent_mode: solo — standard execution

Command: /publish-to-confluence

Pre-Flight Check

  1. Read 00-inbox/MY-INTEGRATIONS.md — Confluence MUST be listed under Active Integrations

    • If Confluence is not active: Inform the user and stop.
      Confluence is not in your active integrations.
      
      Would you like to:
      a) Set up Confluence integration (I'll add it to MY-INTEGRATIONS.md)
      b) Export the document in a Confluence-compatible format for manual upload
    • If Confluence is disabled: Skip silently per COG conventions. Suggest alternative publishing (HackMD, Notion) if active.
  2. Get current timestamp: Run date '+%Y-%m-%d %H:%M' using Bash


Execution Strategy

Phase 1: Identify the Source Document

Determine what to publish:

Option A: User specifies a file path

Read the specified file from the vault.

Option B: User describes the document

Search for matching files:
1. Glob for likely matches in 04-projects/, 05-knowledge/, 01-daily/
2. Present candidates and let user choose

Option C: Just-generated document If this skill is invoked right after generating a PRD, release notes, or other document, use that document.

Phase 2: Configure Publishing Target

Ask the user (if not already provided):

Where should this be published in Confluence?

Required:
- Space key: [CUSTOMIZE: YOUR-SPACE-KEY] (or let me search for spaces)
- Parent page: [Page title or ID under which to nest this page]

Optional:
- Page title: [defaults to the document's H1 heading]
- Labels: [Confluence labels to add]
- Publish mode: "create new" or "update existing"

If the user doesn't know the space or parent page:

Use WebFetch to search Confluence:
GET /wiki/rest/api/space?limit=50
- List available spaces for the user to choose

GET /wiki/rest/api/content?spaceKey=[SPACE]&type=page&limit=25
- List pages in the space for parent page selection

Phase 3: Convert Markdown to Confluence Format

Convert the markdown document to Confluence storage format (XHTML):

Conversion rules:

MarkdownConfluence Storage Format
# Heading<h1>Heading</h1>
## Heading<h2>Heading</h2>
**bold**<strong>bold</strong>
*italic*<em>italic</em>
- list item<ul><li>list item</li></ul>
1. list item<ol><li>list item</li></ol>
[text](url)<a href="url">text</a>
`code`<code>code</code>
Code blocks<ac:structured-macro ac:name="code"><ac:plain-text-body><![CDATA[...]]></ac:plain-text-body></ac:structured-macro>
Tables<table><tbody><tr><th>...</th></tr><tr><td>...</td></tr></tbody></table>
> blockquote<blockquote><p>quote</p></blockquote>
---<hr />
- [ ] task<ac:task-list><ac:task><ac:task-status>incomplete</ac:task-status><ac:task-body>task</ac:task-body></ac:task></ac:task-list>
- [x] taskSame with complete status
YAML frontmatterStrip entirely (not displayed in Confluence)

Important conversion notes:

  • Strip YAML frontmatter — it should not appear in the Confluence page
  • Preserve table structure carefully
  • Convert relative vault links to plain text (they won't work in Confluence)
  • Handle nested lists properly
  • Preserve emoji characters as-is

Phase 4: Preview and Approval Gate

CRITICAL: NEVER publish without explicit user approval.

Present a summary to the user:

Ready to publish to Confluence:

Document: [filename]
Title: [page title]
Space: [space key]
Parent Page: [parent page title]
Mode: [create new / update existing]
Labels: [labels]

Content preview (first 500 chars):
[preview text]

Estimated page size: [approximate word count]

Proceed with publishing? (yes/no)

Wait for explicit "yes" before proceeding.

Phase 5: Publish

Create New Page
Use WebFetch to POST to Confluence REST API:

POST [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content

Headers:
  Content-Type: application/json
  Authorization: [from configured credentials]

Body:
{
  "type": "page",
  "title": "[page title]",
  "space": { "key": "[SPACE_KEY]" },
  "ancestors": [{ "id": "[PARENT_PAGE_ID]" }],
  "body": {
    "storage": {
      "value": "[converted XHTML content]",
      "representation": "storage"
    }
  },
  "metadata": {
    "labels": [
      { "prefix": "global", "name": "[label]" }
    ]
  }
}
Update Existing Page
First, get the current page to obtain the version number:
GET [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content/[PAGE_ID]?expand=version

Then update:
PUT [CUSTOMIZE: your-confluence-url]/wiki/rest/api/content/[PAGE_ID]

Body:
{
  "type": "page",
  "title": "[page title]",
  "version": { "number": [current_version + 1] },
  "body": {
    "storage": {
      "value": "[converted XHTML content]",
      "representation": "storage"
    }
  }
}

Phase 6: Confirm and Update Vault

After successful publishing:

  1. Confirm to the user:

    Published successfully!
    
    Page: [Title]
    URL: [Confluence page URL]
    Space: [Space Key]
    Version: [version number]
  2. Update the source vault file (add published metadata to frontmatter):

    yaml
    confluence_url: "[page URL]"
    confluence_page_id: "[page ID]"
    confluence_space: "[space key]"
    published_at: "[timestamp]"
    confluence_version: [version number]
  3. Log the publication for future reference.


Re-Publishing (Update Flow)

If the vault file already has confluence_page_id in its frontmatter:

This document was previously published to Confluence:
  URL: [confluence_url]
  Last published: [published_at]

Would you like to:
a) Update the existing Confluence page (increment version)
b) Create a new page (separate copy)
c) Cancel

Fallback Behavior

ScenarioBehavior
Confluence not activeStop and inform user; suggest alternative platforms
Confluence API failsSave the converted XHTML to a file so user can manually paste it
Authentication failureInform user their Confluence credentials may need refreshing
Page already exists (same title)Ask user: update existing, create with different title, or cancel
Very large documentWarn user about page size; suggest splitting into child pages
Complex markdown (unsupported elements)Convert best-effort, warn about any elements that couldn't be converted

Error Handling

  • API 403 (Forbidden): User may lack write permissions to the target space
  • API 404 (Not Found): Space key or parent page ID may be incorrect
  • API 409 (Conflict): Page was modified by someone else; fetch latest version and retry
  • Conversion failures: Fall back to plain text for elements that can't be converted
  • Rate limits: Retry with backoff
  • Network errors: Save converted content locally so no work is lost

Frequently asked questions

What does the Publish To Confluence AI skill do?

Publish any markdown file from the vault to Confluence with format conversion and approval gate

Why use Publish To Confluence on TypingMind?

Because you install it once and use it with any model. Publish To Confluence is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Publish To Confluence in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huytieu/COG-second-brain/tree/main/skills/publish-to-confluence. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Publish To Confluence?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Publish To Confluence?

As many as you like. As long as a model supports skills, you can use Publish To Confluence with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Publish To Confluence AI skill free?

Yes. It is published on GitHub by huytieu under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇