Install
$ agentstack add skill-future-cx-ai-architecture-toolkit-publish-to-confluence ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Publish To Confluence
Quick Start
Publish a markdown or HTML file to Confluence using the helper script:
python3 skills/publish-to-confluence/scripts/publish-to-confluence.py path/to/document.md \
--space-key ARCH
When this toolkit is used as a submodule in a private lab repository, run the script from the private lab root:
python3 toolkit/skills/publish-to-confluence/scripts/publish-to-confluence.py outputs/design.md
Inputs
CONFLUENCE_BASE_URL, such ashttps://example.atlassian.net/wiki.CONFLUENCE_EMAILandCONFLUENCE_API_TOKENfor Confluence Cloud basic authentication.CONFLUENCE_SPACE_KEYfor the default Confluence publishing space.- A source
.md,.html, or.htmfile. - Any local image files referenced by markdown image syntax, such as ``.
- A page title in the first line of the source document.
- Optional overview page title. Defaults to
Overview.
Never commit API tokens, credentials, private Confluence URLs, customer names, or real company content to this public toolkit repository.
Credential Storage
The helper loads Confluence settings from .env in the current working directory. When values are missing, it asks the user for them and stores the missing values in that .env file with owner-only file permissions.
When this toolkit is mounted as toolkit/ in a private lab repo, always run the command from the private lab root so credentials are stored in /.env, not in the public toolkit submodule.
The expected .env keys are:
CONFLUENCE_BASE_URL="https://example.atlassian.net/wiki"
CONFLUENCE_EMAIL="name@example.com"
CONFLUENCE_API_TOKEN="..."
CONFLUENCE_SPACE_KEY="ARCH"
Use --env-file only when the private repo keeps local secrets somewhere other than /.env.
Use --space-key when publishing to a different space for one run. If .env does not yet contain CONFLUENCE_SPACE_KEY, the script stores the provided --space-key value there.
Workflow
- Confirm the source file is safe to publish to the target Confluence space.
- Run the helper from the private lab root, or pass
--env-filepointing to the private repo's local.env. - Let the helper prompt for missing Confluence settings during the first interactive run.
- Use the first line of the document as the Confluence page title. A markdown heading like
# L2 - PromotionsbecomesL2 - Promotions. The first line is not included in the published Confluence body. - If the top metadata table contains
Confluence Link, use the page ID from that link as the target page to update. - If no Confluence page ID is found, stop immediately and ask the user which option they want before checking credentials, running a dry run, creating a page, updating a source file, or publishing. Do not choose for the user:
- Ask for an existing
Confluence Link. After the user provides it, update the source markdown first, then publish to that page. - Ask whether to create the page under the Confluence overview page. If the user chooses this, find the overview page, create a new child page, then update the source markdown with the returned
Confluence Link.
- Before a real publish, always check Git for open changes to the source document, linked local images, embedded SVG diagram files, same-basename
.drawiofiles for embedded SVG diagrams, and local Markdown links to.drawioor.svgdiagrams. Only ask about committing when Git reports open changes for those files. If any of those files have changes, explicitly ask the user whether to commit those publish-related files before publishing. If the user chooses yes, ask for a commit message and create the Git commit. If the user chooses no, skip the Git commit and continue publishing. - Use
--dry-runfirst when the target page, parent page, or conversion output is uncertain. - Prefer
--overview-titlewhen the overview page is not namedOverview. - When the markdown references local images or SVG files, make sure those files exist beside the markdown or at the referenced relative path before publishing.
- Publish with the helper script.
- After a successful publish, check Git again for the source document and linked images or diagrams. Only ask about committing when Git reports open changes for those files.
- Record the returned page URL, page ID, and Git Commit in the working notes or handoff summary.
Behavior
The script uses --title when creating a new page. Otherwise, it derives the new page title from the first non-empty line of the source document. When updating an existing page from a Confluence Link, the script preserves the existing Confluence page title and does not rename it. For markdown publishing, the first non-empty line is removed from the Confluence body so the page title does not appear twice.
When a top metadata table includes a Confluence Link row, the script extracts the page ID from URLs such as https://example.atlassian.net/wiki/spaces/ARCH/pages/677838849/L2+-+Promotions and updates that page directly. In that example, the page ID is 677838849.
For markdown publishing, a leading Field / Value metadata table is also removed from the Confluence body. The table can stay in the source file for toolkit tracking without being shown at the top of the published page.
For markdown publishing, links to local .md files are rewritten before conversion. The script resolves each local markdown link relative to the source file, reads the linked file's top Field / Value metadata table, and replaces the markdown file target with that file's Confluence Link. If the linked file does not exist or has no usable top-table Confluence Link, the published body keeps the link text as plain text and does not create a Confluence link.
For markdown publishing, local image references such as ` or ` are uploaded to the target Confluence page as attachments. The published page body is rewritten to use Confluence attachment image macros so the images render from the page attachments. If an attachment with the same filename already exists on the page, the script uploads a new attachment version. Missing local image files stop the publish.
Markdown or HTML same-page anchors are rewritten to Confluence storage format. Links such as [ARCH001](#arch001) become Confluence anchor links, and raw anchors such as ` or ` become Confluence anchor macros instead of visible plain text.
Markdown or HTML tables are rewritten with Confluence full-width table layout attributes so wide stakeholder-facing tables use the available page width after publishing.
Before a real publish, the script checks Git for open changes to the source document, embedded local image or SVG diagram files, same-basename .drawio files for embedded SVG diagrams, and local Markdown links to .drawio or .svg diagrams. If any of those files have open changes, the script asks whether to commit those publish-related files before publishing. Choosing yes prompts for a commit message and commits only those publish-related files. Choosing no skips the commit and continues. After a successful publish, the script checks those files again and asks the same commit question only when Git reports remaining changes for those files. Use --skip-git-check only for automation where this prompt is intentionally bypassed.
If no Confluence page ID is found, the script always prompts the user to choose before credential loading, dry-run output, source updates, page creation, or publishing. The user can provide an existing Confluence link, or choose to create the page as a child of the overview page. The overview page is found by title in the target space and defaults to Overview; override this with --overview-title .
When the script creates a new child page, it writes the returned Confluence link back to the source markdown, regenerates the content, and updates the new page so the Confluence copy contains the link too.
Markdown conversion uses the optional markdown package when installed. Without it, the script falls back to a small built-in converter for headings, paragraphs, pipe tables, lists, links, inline code, fenced code blocks, bold text, and italic text. For highly formatted documents, convert to storage-safe HTML before publishing.
Fenced markdown code blocks are converted to Confluence code macros. A language hint such as ``` `python ``` is carried into the macro language parameter when present.
Use --content-format html to publish HTML directly, or --content-format markdown to force markdown conversion.
Script
See [README.md](README.md) and [scripts/publish-to-confluence.py](scripts/publish-to-confluence.py).
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Future-CX
- Source: Future-CX/AI-Architecture-Toolkit
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.