Rei-skills confluence-automation
Automate Confluence page creation, content search, space management, labels, and hierarchy navigation via Rube MCP (Composio). Always search tools first for current schemas.
git clone https://github.com/rootcastleco/rei-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/rootcastleco/rei-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/confluence-automation" ~/.claude/skills/rootcastleco-rei-skills-confluence-automation && rm -rf "$T"
skills/confluence-automation/SKILL.mdConfluence Automation via Rube MCP
Automate Confluence operations including page creation and updates, content search with CQL, space management, label tagging, and page hierarchy navigation through Composio's Confluence toolkit.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Confluence connection via
with toolkitRUBE_MANAGE_CONNECTIONSconfluence - Always call
first to get current tool schemasRUBE_SEARCH_TOOLS
Setup
Get Rube MCP: Add
https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming
respondsRUBE_SEARCH_TOOLS - Call
with toolkitRUBE_MANAGE_CONNECTIONSconfluence - If connection is not ACTIVE, follow the returned auth link to complete Confluence OAuth
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Create and Update Pages
When to use: User wants to create new documentation or update existing Confluence pages
Tool sequence:
- List spaces to find the target space ID [Prerequisite]CONFLUENCE_GET_SPACES
- Find existing page to avoid duplicates or locate parent [Optional]CONFLUENCE_SEARCH_CONTENT
- Get current page content and version number before updating [Prerequisite for updates]CONFLUENCE_GET_PAGE_BY_ID
- Create a new page in a space [Required for creation]CONFLUENCE_CREATE_PAGE
- Update an existing page with new content and incremented version [Required for updates]CONFLUENCE_UPDATE_PAGE
- Tag the page with labels after creation [Optional]CONFLUENCE_ADD_CONTENT_LABEL
Key parameters:
: Space ID or key (e.g.,spaceId
,"DOCS"
) -- space keys are auto-converted to IDs"12345678"
: Page title (must be unique within a space)title
: Parent page ID for creating child pages; omit to place under space homepageparentId
: HTML/XHTML content in Confluence storage formatbody.storage.value
: Must bebody.storage.representation
for create operations"storage"
: For updates, must be current version + 1version.number
: Optional change descriptionversion.message
Pitfalls:
- Confluence enforces unique page titles per space; creating a page with a duplicate title will fail
requiresUPDATE_PAGE
set to current version + 1; always fetch current version first withversion.numberGET_PAGE_BY_ID- Content must be in Confluence storage format (XHTML), not plain text or Markdown
usesCREATE_PAGE
whilebody.storage.value
usesUPDATE_PAGE
withbody.valuebody.representation
requires a numeric long ID, not a UUID or stringGET_PAGE_BY_ID
2. Search Content
When to use: User wants to find pages, blog posts, or content across Confluence
Tool sequence:
- Keyword search with intelligent relevance ranking [Required]CONFLUENCE_SEARCH_CONTENT
- Advanced search using Confluence Query Language [Alternative]CONFLUENCE_CQL_SEARCH
- Hydrate full content for selected search results [Optional]CONFLUENCE_GET_PAGE_BY_ID
- Browse pages sorted by date when search relevance is weak [Fallback]CONFLUENCE_GET_PAGES
Key parameters for SEARCH_CONTENT:
: Search text matched against page titles with intelligent rankingquery
: Limit search to a specific spacespaceKey
: Max results (default 25, max 250)limit
: Pagination offset (0-based)start
Key parameters for CQL_SEARCH:
: CQL query string (e.g.,cql
)text ~ "API docs" AND space = DOCS AND type = page
: Comma-separated properties (e.g.,expand
,content.space
)content.body.storage
:excerpt
,highlight
, orindexednone
: Max results (max 250; reduced to 25-50 when using body expansions)limit
CQL operators and fields:
- Fields:
,text
,title
,label
,space
,type
,creator
,lastModified
,createdancestor - Operators:
,=
,!=
(contains),~
,!~
,>
,<
,>=
,<=
,INNOT IN - Functions:
,currentUser()
,now("-7d")now("-30d") - Example:
title ~ "meeting" AND lastModified > now("-7d") ORDER BY lastModified DESC
Pitfalls:
fetches up to 300 pages and applies client-side filtering -- not a true full-text searchCONFLUENCE_SEARCH_CONTENT
is the real full-text search; useCONFLUENCE_CQL_SEARCH
for content body searchtext ~ "term"- HTTP 429 rate limits can occur; throttle to ~2 requests/second with backoff
- Using body expansions in CQL_SEARCH may reduce max results to 25-50
- Search indexing is not immediate; recently created pages may not appear
3. Manage Spaces
When to use: User wants to list, create, or inspect Confluence spaces
Tool sequence:
- List all spaces with optional filtering [Required]CONFLUENCE_GET_SPACES
- Get detailed metadata for a specific space [Optional]CONFLUENCE_GET_SPACE_BY_ID
- Create a new space with key and name [Optional]CONFLUENCE_CREATE_SPACE
- Retrieve custom metadata stored as space properties [Optional]CONFLUENCE_GET_SPACE_PROPERTIES
- List pages, blog posts, or attachments in a space [Optional]CONFLUENCE_GET_SPACE_CONTENTS
- List labels on a space [Optional]CONFLUENCE_GET_LABELS_FOR_SPACE
Key parameters:
: Space key -- alphanumeric only, no underscores or hyphens (e.g.,key
,DOCS
)PROJECT1
: Human-readable space namename
:type
orglobalpersonal
:status
(active) orcurrentarchived
: For GET_SPACE_CONTENTS, filters by space keyspaceKey
: Numeric space ID for GET_SPACE_BY_ID (NOT the space key)id
Pitfalls:
- Space keys must be alphanumeric only (no underscores, hyphens, or special characters)
requires numeric space ID, not the space key; useGET_SPACE_BY_ID
to find numeric IDsGET_SPACES- Clickable space URLs may need assembly: join
(relative) with_links.webui_links.base - Default pagination is 25; set
explicitly (max 200 for spaces)limit
4. Navigate Page Hierarchy and Labels
When to use: User wants to explore page trees, child pages, ancestors, or manage labels
Tool sequence:
- Find the target page ID [Prerequisite]CONFLUENCE_SEARCH_CONTENT
- List direct children of a parent page [Required]CONFLUENCE_GET_CHILD_PAGES
- Get the full ancestor chain for a page [Optional]CONFLUENCE_GET_PAGE_ANCESTORS
- List labels on a specific page [Optional]CONFLUENCE_GET_LABELS_FOR_PAGE
- Add labels to a page [Optional]CONFLUENCE_ADD_CONTENT_LABEL
- List labels across all content in a space [Optional]CONFLUENCE_GET_LABELS_FOR_SPACE_CONTENT
- Audit edit history for a page [Optional]CONFLUENCE_GET_PAGE_VERSIONS
Key parameters:
: Page ID for child pages, ancestors, labels, and versionsid
: Opaque pagination cursor for GET_CHILD_PAGES (fromcursor
)_links.next
: Items per page (max 250 for child pages)limit
: Child page sort options:sort
,id
,-id
,created-date
,-created-date
,modified-date
,-modified-date
,child-position-child-position
Pitfalls:
only returns direct children, not nested descendants; recurse for full treeGET_CHILD_PAGES- Pagination for GET_CHILD_PAGES uses cursor-based pagination (not start/limit)
- Verify the correct page ID from search before using as parent; search can return similar titles
requires the page ID, not a version numberGET_PAGE_VERSIONS
Common Patterns
ID Resolution
Always resolve human-readable names to IDs before operations:
- Space key -> Space ID:
withCONFLUENCE_GET_SPACES
filter, orspaceKey
accepts space keys directlyCREATE_PAGE - Page title -> Page ID:
withCONFLUENCE_SEARCH_CONTENT
param, then extract page IDquery - Space ID from URL: Extract numeric ID from Confluence URLs or use GET_SPACES
Pagination
Confluence uses two pagination styles:
- Offset-based (most endpoints):
(0-based offset) +start
(page size). Incrementlimit
bystart
until fewer results thanlimit
are returned.limit - Cursor-based (GET_CHILD_PAGES, GET_PAGES): Use the
fromcursor
in the response. Continue until no_links.next
link is present.next
Content Formatting
- Pages use Confluence storage format (XHTML), not Markdown
- Basic elements:
,<p>
-<h1>
,<h6>
,<strong>
,<em>
,<code>
,<ul>
,<ol><li> - Tables:
/<table><tbody><tr><th>
structure<td> - Macros:
for code blocks, etc.<ac:structured-macro ac:name="code"> - Always wrap content in proper XHTML tags
Known Pitfalls
ID Formats
- Space IDs are numeric (e.g.,
); space keys are short strings (e.g.,557060
)DOCS - Page IDs are numeric long values for GET_PAGE_BY_ID; some tools accept UUID format
requires numeric ID, not the space keyGET_SPACE_BY_ID
takes an integer, not a stringGET_PAGE_BY_ID
Rate Limits
- HTTP 429 can occur on search endpoints; honor Retry-After header
- Throttle to ~2 requests/second with exponential backoff and jitter
- Body expansion in CQL_SEARCH reduces result limits to 25-50
Content Format
- Content must be Confluence storage format (XHTML), not Markdown or plain text
- Invalid XHTML will cause page creation/update to fail
nests body underCREATE_PAGE
;body.storage.value
usesUPDATE_PAGE
+body.valuebody.representation
Version Conflicts
- Updates require exact next version number (current + 1)
- Concurrent edits can cause version conflicts; always fetch current version immediately before updating
- Title changes during update must still be unique within the space
Quick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| List spaces | | , , |
| Get space by ID | | |
| Create space | | , , |
| Space contents | | , , |
| Space properties | | , |
| Search content | | , , |
| CQL search | | , , |
| List pages | | , , |
| Get page by ID | | (integer) |
| Create page | | , , |
| Update page | | , , , |
| Delete page | | |
| Child pages | | , , |
| Page ancestors | | |
| Page labels | | |
| Add label | | content ID, label |
| Page versions | | |
| Space labels | | space ID |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
🏰 Rei Skills — Curated by Rootcastle Engineering & Innovation | Batuhan Ayrıbaş
Engineering Beyond Boundaries | admin@rootcastle.com