agentleFS
yohei1126yohei1126/agent-skills/confluence-operations/SKILL.md

confluence-operations

Skill2 starsChanged 22 days agoMITView on GitHub

Upload a local markdown file to a Confluence page, or download a Confluence page to a local markdown file. Use when the user wants to publish/sync a markdown file to Confluence, or fetch an existing Confluence page for offline editing.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If --page-id is given, that page is updated directly — no title search is performed.

    line 48
  2. Distinctive:

    If no matching page exists, a new page is created.

    line 50
  3. Very specific:

    If the output path already exists, a numeric suffix is appended (e.g.

    line 96

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prerequisites

Set the following environment variables in agent_skills/.env:

CONFLUENCE_BASE_URL=https://yourorg.atlassian.net
CONFLUENCE_EMAIL=you@example.com
CONFLUENCE_API_TOKEN=your_api_token   # from id.atlassian.com/manage-profile/security/api-tokens
CONFLUENCE_SPACE_KEY=MYSPACE

Upload — scripts/upload.ts

Upload a local markdown file to Confluence as a page (create or update).

Usage

cd agent_skills
npx tsx confluence-operations/scripts/upload.ts <markdown-file> [options]

Arguments

ArgumentRequiredDescription
markdown-fileYesPath to the local .md file to upload
--title "Title"NoPage title. Defaults to the first H1 heading in the file, or the filename if no H1 exists.
--parent-id 12345NoConfluence page ID to nest the new page under
--page-id 99999NoUpdate a specific existing page by ID (bypasses title search; also allows renaming the title)

Behavior

  • The first # heading in the markdown file is extracted as the page title and stripped from the body (Confluence displays the title separately).
  • A Table of Contents macro is automatically prepended to the page body.
  • If --page-id is given, that page is updated directly — no title search is performed.
  • Otherwise, if a page with the same title already exists in the space, it is updated (new version).
  • If no matching page exists, a new page is created.
  • Markdown is converted to HTML (Confluence storage format) before upload.

Examples

# Create or update a page (title taken from first H1)
npx tsx confluence-operations/scripts/upload.ts reports/gpa-framework-guide-ja.md

# Nest under a parent page
npx tsx confluence-operations/scripts/upload.ts reports/overview-ja.md --parent-id 4890951685

# Update a specific page by ID (safe rename: avoids duplicate page on title change)
npx tsx confluence-operations/scripts/upload.ts reports/overview-ja.md --page-id 5940019259

# Override the title
npx tsx confluence-operations/scripts/upload.ts notes.md --title "Agent Eval Notes" --parent-id 98765

Download — scripts/download.ts

Download a Confluence page and save it as a local markdown file.

Usage

cd agent_skills
npx tsx confluence-operations/scripts/download.ts <page-id> [output]

Arguments

ArgumentRequiredDescription
page-idYesConfluence page ID (numeric, visible in the page URL)
outputNoOutput .md path or directory. Derived from the page title if omitted.

Behavior

  • Fetches the page body in Confluence storage format (HTML) via the REST API.
  • Converts HTML to Markdown using Turndown (headings, tables, lists, code blocks preserved).
  • Confluence macros (TOC, panels, etc.) are stripped.
  • Prepends YAML front matter with source, page_id, and fetched fields.
  • The page title is added as the first # H1 heading in the file.
  • If the output path already exists, a numeric suffix is appended (e.g. page-2.md).

Examples

# Derive filename from page title → saves to: my-page-title.md
npx tsx confluence-operations/scripts/download.ts 5940019259

# Save to a specific path
npx tsx confluence-operations/scripts/download.ts 5940019259 outputs/snowflake/my-page.md

# Save into a directory (filename derived from page title)
npx tsx confluence-operations/scripts/download.ts 5940019259 outputs/snowflake/

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.