publish-to-confluence
Skill8 starsChanged 6 months agoMITView on GitHub
Publish markdown or HTML content to Confluence pages through the Confluence REST API. Use when the user asks to publish, create, update, sync, or push architecture content, documents, ADRs, designs, or generated toolkit artifacts to Confluence.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- huytieu/COG-second-braintheir own version, first seen Jul 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- huytieu/COG-second-brain★ 1.3ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-decision-recordSkill
- assess-solutionSkill
- capability-overviewSkill
- check-readabilitySkill
- create-an-agentSkill
- create-a-skillSkill
- create-drawio-diagramSkill
- data-architecture-designSkill
- grill-meSkill
- integration-designSkill
- problem-to-solutionSkill
- solution-architecture-designSkill
- target-architecture-documentSkill
- to-epicsSkill
- ubiquitous-languageSkill
- write-a-principleSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 6 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 17
When this toolkit is used as a submodule in a private lab repository, run the script from the private lab root:
- Distinctive: line 33
Never commit API tokens, credentials, private Confluence URLs, customer names, or real company content to this public toolkit repository.
- Very specific: line 39
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 …
- Very specific: line 50
Use --env-file <path> only when the private repo keeps local secrets somewhere other than <private-lab-root>/.env.
- Very specific: line 52
Use --space-key <key> when publishing to a different space for one run.
- Very specific: line 57
Run the helper from the private lab root, or pass --env-file pointing to the private repo's local .env.
- Very specific: line 59
Use the first line of the document as the Confluence page title.
- Very specific: line 60
If the top metadata table contains Confluence Link, use the page ID from that link as the target page to update.
- Distinctive: line 61
If no Confluence page ID is found, stop immediately and ask the user which option they want before checking credentials, running a dry run, …
- Very specific: line 62
Ask for an existing Confluence Link.
- Very specific: line 63
Ask whether to create the page under the Confluence overview page.
- Very specific: line 65
Use --dry-run first when the target page, parent page, or conversion output is uncertain.
- Very specific: line 66
Prefer --overview-title <title> when the overview page is not named Overview.
- Distinctive: line 67
When the markdown references local images or SVG files, make sure those files exist beside the markdown or at the referenced relative path …
- Distinctive: line 69
After a successful publish, check Git again for the source document and linked images or diagrams.
- Very specific: line 76
When a top metadata table includes a Confluence Link row, the script extracts the page ID from URLs such as …
- Distinctive: line 92
When the script creates a new child page, it writes the returned Confluence link back to the source markdown, regenerates the content, and …
- Very specific: line 98
Use --content-format html to publish HTML directly, or --content-format markdown to force markdown conversion.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 ARCHWhen 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.mdInputs
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 <private-lab-root>/.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 <path> only when the private repo keeps local secrets somewhere other than <private-lab-root>/.env.
Use --space-key <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.
- Ask for an existing
- 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-title <title>when 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 <a id="arch001"></a> or <a name="arch001"></a> 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 <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 and scripts/publish-to-confluence.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

