Logo van Confluence To Markdown

Confluence To Markdown

Community
iurykrieger
confluence-to-markdown

Internal fetcher module for Confluence pages. Fetches content via Atlassian MCP (preferred), REST API with Basic Auth (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:learn and /bedrock:sync — not intended for direct user invocation.

Add to TypingMind

Overzicht

Uitgeveriurykrieger
Repositoryclaude-bedrock
Skillnaamconfluence-to-markdown
Sterren
109
Forks
9
Meegeleverde bestanden
1
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 1

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door iurykrieger op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Confluence To Markdown in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/iurykrieger/claude-bedrock/tree/main/skills/confluence-to-markdown
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iurykrieger/claude-bedrock.git /tmp/claude-bedrock
mkdir -p .claude/skills
cp -r /tmp/claude-bedrock/skills/confluence-to-markdown .claude/skills/confluence-to-markdown
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Confluence To Markdown in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Confluence To Markdown automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Confluence To Markdown niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Confluence Fetcher

Internal module — invoked by /bedrock:learn Phase 1 and /bedrock:sync Phase 2, not user-invocable.

Fetches a Confluence page and returns its content as Markdown. Three layers in fallback order: MCP (preferred) → REST API → Browser DOM extraction.

Dependency: Browser fallback (Layer 3) requires scripts/extract.js (relative to this skill directory).


Step 1 — Parse URL

Parse the Confluence URL. Accept these formats:

  • https://<domain>.atlassian.net/wiki/spaces/<spaceKey>/pages/<pageId>/<title>
  • https://<domain>.atlassian.net/wiki/spaces/<spaceKey>/pages/<pageId>
  • https://<domain>.atlassian.net/wiki/x/<shortlink>
  • https://<domain>.atlassian.net/wiki/pages/viewpage.action?pageId=<pageId>

Extract:

  • Base URL: https://<domain>.atlassian.net (everything before /wiki/...)
  • Page ID: the numeric ID from the URL path (segment after /pages/) or pageId query parameter
  • Full URL: the original URL as provided (needed for browser fallback)

Step 2 — Layer 1: MCP (Atlassian)

The preferred layer. Uses the plugin:atlassian:atlassian MCP server if installed and authenticated.

2.1 Check MCP availability

Use ToolSearch to check if Atlassian MCP tools are available:

ToolSearch(query: "atlassian confluence page", max_results: 5)

Evaluate the result:

  • MCP tools found and functional (tools other than authenticate and complete_authentication are available) → proceed to 2.2 Fetch via MCP
  • Only authenticate / complete_authentication tools found (MCP installed but not authenticated) → proceed to 2.3 Guide authentication
  • No Atlassian MCP tools found → log and fall through:

MCP not available: No Atlassian MCP server installed. Install the Atlassian MCP plugin for Claude Code to enable direct Confluence access. Falling back to API (Layer 2).

2.2 Fetch via MCP

Use the Atlassian MCP tools to fetch the page content. The specific tool depends on what the MCP exposes after authentication (typically a page read or content retrieval tool).

Call the MCP tool passing the page ID or URL. The MCP returns the page content directly.

  • Success → convert content to Markdown if not already, proceed to Output Contract
  • Error → log the error and fall through to Layer 2:

MCP fetch failed: {error message}. Falling back to API (Layer 2).

2.3 Guide authentication

If the MCP is installed but not authenticated, guide the user:

MCP not authenticated: The Atlassian MCP server is installed but requires authentication. Run mcp__plugin_atlassian_atlassian__authenticate to start the OAuth flow, then complete it in your browser. After authentication, Confluence pages can be fetched directly via MCP.

Ask the user: "Would you like to authenticate the Atlassian MCP now, or skip to API fallback (Layer 2)?"

  • User wants to authenticate → invoke mcp__plugin_atlassian_atlassian__authenticate, wait for the user to complete the OAuth flow, then retry 2.2 Fetch via MCP
  • User declines → log "User declined MCP authentication, falling to Layer 2" → continue to Step 3

Step 3 — Layer 2: API (REST)

Uses the Confluence REST API with Basic Auth (API token + email).

3.1 Check credentials

bash
echo "CONFLUENCE_API_TOKEN: ${CONFLUENCE_API_TOKEN:+set}" && echo "CONFLUENCE_USER_EMAIL: ${CONFLUENCE_USER_EMAIL:+set}"
  • Both set → proceed to 3.2 Compute auth header
  • Either missing → guide and fall through:

API not available: CONFLUENCE_API_TOKEN or CONFLUENCE_USER_EMAIL environment variable is not set. Generate an API token at https://id.atlassian.com/manage-profile/security/api-tokens and export both variables: export CONFLUENCE_API_TOKEN="your-token" and export CONFLUENCE_USER_EMAIL="your-email". Falling back to Browser extraction (Layer 3).

3.2 Compute Basic Auth header

bash
echo -n "${CONFLUENCE_USER_EMAIL}:${CONFLUENCE_API_TOKEN}" | base64

3.3 Fetch the page

Use WebFetch:

WebFetch(
  url: "{baseUrl}/wiki/api/v2/pages/{pageId}?body-format=storage",
  headers: {
    "Authorization": "Basic {base64_value}",
    "Accept": "application/json"
  }
)

If WebFetch cannot send the Authorization header, fall back to curl via Bash:

bash
curl -sL -H "Authorization: Basic {base64_value}" -H "Accept: application/json" \
  "{baseUrl}/wiki/api/v2/pages/{pageId}?body-format=storage"

3.4 Extract content from response

The API returns JSON with:

  • title — page title
  • body.storage.value — XHTML content (Confluence storage format)

3.5 Convert XHTML to Markdown

Convert the storage format XHTML to Markdown using these rules:

XHTML elementMarkdown output
<h1> through <h6># through ######
<p>Paragraph with blank line separation
<strong>, <b>**text**
<em>, <i>*text*
<s>, <del>~~text~~
<a href="...">[text](url)
<ul> / <ol> / <li>Markdown lists (respect nesting)
<table>Markdown table with | separators and header row
<ac:structured-macro ac:name="code">Fenced code block with language from <ac:parameter ac:name="language">
<pre>Fenced code block
<code> (inline)`code`
<blockquote>> text
<hr>---
Confluence macros (<ac:*>) with textExtract text content
Confluence macros with no text (images, drawio, attachments)Skip silently

3.6 Error handling

HTTP statusAction
200 OKProceed to Output Contract
401 UnauthorizedLog and fall through to Layer 3:

API authentication failed: API returned 401. The token may be expired or invalid. Regenerate your token at https://id.atlassian.com/manage-profile/security/api-tokens. Falling back to Browser extraction (Layer 3).

HTTP statusAction
403 ForbiddenAbort (no fallback can bypass permissions):

API access denied: API returned 403. The user does not have access to this page. Verify page permissions in Confluence.

HTTP statusAction
404 Not FoundAbort:

Page not found: API returned 404. The page ID may be incorrect. Verify the URL: {original_url}.


Step 4 — Layer 3: Browser (Claude in Chrome)

Last resort. Opens the page in Chrome and extracts content via DOM scraping.

4.1 Load Chrome tools

Via ToolSearch:

select:mcp__claude-in-chrome__tabs_context_mcp,mcp__claude-in-chrome__tabs_create_mcp
select:mcp__claude-in-chrome__navigate
select:mcp__claude-in-chrome__javascript_tool

If Chrome MCP tools are not available, abort:

Browser not available: Claude in Chrome MCP is not installed or not running. Install the Claude in Chrome extension and ensure it is connected. No further fallback layers available — cannot fetch this Confluence page.

4.2 Get browser context

mcp__claude-in-chrome__tabs_context_mcp(createIfEmpty: true)

4.3 Navigate to the page

mcp__claude-in-chrome__tabs_create_mcp()
mcp__claude-in-chrome__navigate(url: "<full confluence URL>", tabId: <id>)

4.4 Execute extraction script

Read scripts/extract.js from this skill's directory using the Read tool. Then execute it:

mcp__claude-in-chrome__javascript_tool(
  action: "javascript_exec",
  text: <contents of extract.js>,
  tabId: <id>
)

The script returns JSON:

json
{
  "status": "ready",
  "totalLength": 52969,
  "totalChunks": 6,
  "chunkSize": 10000,
  "title": "Page Title",
  "instructions": "Run window.__confluence.chunk(0), window.__confluence.chunk(1), etc."
}

If the script returns an error field: handle accordingly (login page, empty content, wrong page).

4.5 Read chunks

For each chunk from 0 to totalChunks - 1:

mcp__claude-in-chrome__javascript_tool(
  action: "javascript_exec",
  text: "window.__confluence.chunk(N)",
  tabId: <id>
)

Concatenate all chunks into a single Markdown string.

4.6 Validate

Check that the result is not empty and not a login page. If validation fails:

Browser extraction failed: Could not extract content from the page. Ensure you are logged into Confluence in Chrome and the page has loaded. No further fallback layers available — cannot fetch this Confluence page.


Output Contract

Return to the caller (/bedrock:learn or /bedrock:sync):

  • Markdown content: the full page content as Markdown
  • Page title: extracted from MCP response, API response (title field), or browser extraction (title in JSON)
  • Layer used: MCP, API, or Browser

The caller is responsible for saving the content to its target location.


Hard Rules

RuleDetail
Read-onlyNever write back to Confluence.
No OAuth interactive flowsUse only existing MCP auth, API tokens, or browser sessions.
Validate before returningDo not return empty content, HTML error pages, or login pages.
Layer order is sacredAlways try MCP → API → Browser, in that order. Never skip ahead unless a layer is unavailable or user declines.
Guide before falling throughIf a layer exists but is misconfigured, guide the user before moving to the next layer.
Skip rich media silentlyImages, diagrams, drawio, and attachment macros are omitted without error.
Best-effortIf a layer fails, try the next. If all fail, report and abort — do not retry indefinitely.
403 is terminalPermission denied cannot be resolved by falling to another layer — abort immediately.

Troubleshooting

ProblemSolution
MCP not authenticatedRun mcp__plugin_atlassian_atlassian__authenticate to start OAuth flow
MCP tools not foundAtlassian MCP plugin not installed — use API or browser fallback
API returns 401Token expired — regenerate at https://id.atlassian.com/manage-profile/security/api-tokens
API returns 403User lacks page access — check Confluence permissions
API returns 404Wrong page ID — verify URL
Chrome extension disconnectedRefresh extension, call tabs_context_mcp(createIfEmpty: true)
Browser redirects to loginUser not authenticated — log into Confluence in Chrome, retry
extract.js returns emptyPage may not have loaded — wait and retry, or check if page is empty
Shortlink URL (/wiki/x/...) with APINavigate in browser first to resolve full URL with page ID

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Confluence To Markdown?

Internal fetcher module for Confluence pages. Fetches content via Atlassian MCP (preferred), REST API with Basic Auth (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:learn and /bedrock:sync — not intended for direct user invocation.

Waarom Confluence To Markdown gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Confluence To Markdown bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Confluence To Markdown in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/iurykrieger/claude-bedrock/tree/main/skills/confluence-to-markdown. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Confluence To Markdown gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Confluence To Markdown gebruiken?

Zoveel als je wilt. Je kunt Confluence To Markdown gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Confluence To Markdown gratis?

Ja. Deze skill is door iurykrieger op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇