Prompt file imported from NexusSema/omg-marketplace (
.github/prompts/sm-sync-docs.prompt.md). Copyright stays with the author.
Sync Docs
You are starting the Sync Docs workflow — bidirectional sync between local Markdown files and Confluence pages.
Load the confluence-sync skill for conversion reference, frontmatter conventions, and workflow instructions.
Setup
-
Verify credentials — Check that the required environment variables are available:
ATLASSIAN_EMAIL— Atlassian account emailATLASSIAN_API_TOKEN— API token from id.atlassian.comATLASSIAN_INSTANCE— Atlassian instance hostname (optional, defaults toyourcompany.atlassian.net)
If not set, tell the user to configure them (see README).
-
Present menu:
"What would you like to do?
[P] Push — Push a local
.mdfile to Confluence (create or update) [U] Pull — Pull a Confluence page and save as.mdwith frontmatter [B] Batch push — Push all.mdfiles in a directory to Confluence [S] Status — List Confluence spaces and pages to find IDs for frontmatter" -
Route based on choice — Follow the corresponding workflow below.
Workflow Details
Push ([P])
- Ask the user for the markdown file path
- Read the file and check for YAML frontmatter
- If frontmatter is missing or incomplete:
- Ask for
confluence_title - Ask for
confluence_space_id(offer to list spaces if they don't know it) - Optionally ask for
confluence_parent_id - Write the frontmatter into the file
- Ask for
- Run the push script:
plugins/scrum-master/scripts/push-md-to-confluence.sh <file.md> "description" - Confirm: page title, version, and URL
- If new page was created, confirm that
confluence_page_idwas written back to frontmatter - Offer to link back to Jira: "Would you like to attach this Confluence page to a Jira issue? If so, provide the issue key (e.g., PROJ-123)."
- If yes, use the
jiraskill's workflow 18 (Add Remote Link) to attach the Confluence URL to the Jira issue - Confirm: "Link added to PROJ-123: {confluence_title}"
- If yes, use the
Pull ([U])
- Ask the user for a Confluence page ID or URL
- If URL, extract the page ID from the URL path
- Ask for output file path (or use default based on page title)
- Run the pull script:
plugins/scrum-master/scripts/pull-confluence-to-md.sh <page_id> [output.md] - Confirm: page title, version, and saved file path
- Offer to open/display the file
Batch Push ([B])
- Ask the user for the directory path
- List all
.mdfiles in the directory - Check each file for valid frontmatter — report any missing fields
- Confirm the batch operation with the user (show file count)
- Push each file:
for f in <directory>/*.md; do plugins/scrum-master/scripts/push-md-to-confluence.sh "$f" "Batch sync" done - Report results: successes, failures, and URLs
Status ([S])
- List Confluence spaces (to help find
confluence_space_id):curl -s -u "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \ "https://$ATLASSIAN_INSTANCE/wiki/api/v2/spaces" \ | python3 -c " import json, sys d = json.load(sys.stdin) for s in d.get('results', []): print(f\"{s['id']}\t{s['key']}\t{s['name']}\") " - Optionally list pages in a space to find page IDs
Cross-workflow: Push + Link to Jira
A common pattern is: push a doc to Confluence, then attach the URL to a Jira issue. After a successful push, this command offers to do the link-back automatically using the jira skill's Remote Link API. The user just provides the Jira issue key.
This also works from /sm:jira → [A] Attach link, where the user can manually attach any URL to an issue.
Important
- Always use the
confluence-syncskill's auth pattern to read credentials - Every synced
.mdfile must have YAML frontmatter with at leastconfluence_title - New pages require
confluence_space_idin frontmatter - After first push,
confluence_page_idis written back into the frontmatter automatically - The converter uses Python3 stdlib only — no pip dependencies
- Unknown Confluence macros are preserved as HTML comments during pull
- After pushing, offer to link the Confluence page to a Jira issue