confluence-adf-edit

Edit existing Confluence pages via REST v2 and ADF diff-based updates.

3|Updated Jul 1, 2016
One-click install
npx skills add https://github.com/shomatan/dotfiles --skill confluence-adf-edit-shomatan
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: confluence-adf-edit
Source: https://github.com/shomatan/dotfiles/tree/main/dot_claude/skills/confluence-adf-edit
Command: npx skills add https://github.com/shomatan/dotfiles --skill confluence-adf-edit-shomatan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Updating existing Confluence pages through the MCP updateConfluencePage tool replaces the entire page body, which silently overwrites edits made by other people (including editor Autosave) and blows past token limits on pages over 50k characters. This Skill performs partial, diff-based edits through the Confluence REST v2 API using the native Atlas Document Format (ADF), so only the intended sections change. ## Core Features & Use Cases - Diff-based ADF editing: Replace text, drop sections or paragraphs, swap tables, add rows, and insert nodes with count-checked operations that stop when the expected match count is wrong. - OAuth token reuse: Reuses the Atlassian OAuth access token already stored in macOS Keychain by the MCP connection, with an API-token fallback path for environments without MCP. - Safe update protocol: Re-fetches the page version and title immediately before the PUT to avoid clobbering concurrent edits, then verifies changes by diffing storage-format dumps of old and new versions. - Use Case: A teammate asks you to add a row to a status table and fix one figure on a 60k-character Confluence page. You fetch the page as ADF, apply targeted edits with adf_edit.py, PUT only the changed document, and diff versions to confirm nothing else moved. ## Quick Start Update the Confluence page with ID 123456 by replacing the text "actual 12 items" with "actual 18 items" using a diff-based ADF edit instead of a full-body replacement.

Frequently Asked Questions about confluence-adf-edit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update a Confluence page without overwriting other people's edits?โ–ผ

Use the Confluence REST v2 API with Atlas Document Format to apply diff-based edits instead of the MCP updateConfluencePage full-body replacement. Re-fetch the current version number and title immediately before the PUT so concurrent edits and renames are not rolled back.

How to edit Confluence tables programmatically via the REST API?โ–ผ

Fetch the page with body-format=atlas_doc_format, then use helper functions to swap an entire table matched by its header text or add rows cloned from an existing anchor row. Cells support inline code, bold, and link marks.

Can I reuse the MCP Atlassian OAuth token for Confluence REST API calls?โ–ผ

Yes, the OAuth access token stored in macOS Keychain under Claude Code-credentials works directly against api.atlassian.com for Confluence REST v2. Select the entry with the write:page:confluence scope that has not expired, since stale entries coexist in the same store.

Why does the Confluence v1 REST API return 401 with an MCP OAuth token?โ–ผ

The MCP OAuth token uses granular scopes that only cover the v2 API, so requests to /wiki/rest/api/... return 401. Use /wiki/api/v2/... endpoints, or switch to an email plus API token credential pair for v1-only features.

What are the limitations of text replacement in Confluence ADF documents?โ–ผ

Text replacement only matches within a single text node, so strings split by bold or code marks will not match and the operation stops when the expected count fails. Shorten the target string or process longer needles before their substrings to avoid double replacement.