format-docs
Format and restructure markdown documents so they publish cleanly to Confluence via `orbit confluence publish`. Use this skill whenever the user wants to prepare docs for Confluence, fix markdown formatting for wiki publishing, add frontmatter to docs, restructure a docs directory, or ensure markdown files follow Confluence-friendly conventions. Also trigger when the user says things like 'format these docs', 'prepare docs for Confluence', 'fix the frontmatter', 'restructure the docs folder', 'make these docs publishable', 'clean up the markdown', or any task involving making markdown Confluence-ready — even if they just say 'format this' or 'prep for wiki' without mentioning Confluence explicitly. If the user has a docs/ directory and mentions publishing or syncing, this skill applies.
NPX Install
npx skill4agent add jorgemuza/orbit format-docsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Format Docs
orbit confluence publishWhen to Use
- Before running for the first time on a docs directory
orbit confluence publish - When adding new markdown files to an existing published docs tree
- When docs render poorly in Confluence and need structural fixes
- When migrating docs from another system (GitHub wiki, Notion export, etc.)
Process
1. Assess the Scope
- Single file: Read it and apply the file-level checks below.
- Directory: List the full tree, then work through both directory-level and file-level checks.
2. Directory-Level Checks
INDEX.md.mddocs/
INDEX.md ← Required: parent page for docs/
overview.md
api/
INDEX.md ← Required: parent page for api/
endpoints.mdINDEX.md- Frontmatter (title from directory name, today's date)
- A brief intro line
- A properties report directive (see below)
- Child page tables wrapped in confluence ignore blocks
---
title: "Section Title"
# ... full frontmatter ...
confluence_labels:
- my-label
---
# Section Title
> Brief intro summarizing the section.
---
<!-- confluence:properties-report cql="ancestor = currentContent() AND label = 'my-label'" firstcolumn="Title" headings="Owner,Status,Version,Reviewed on" -->
<!-- confluence:ignore-start -->
## Subsection Name
| Document | Version | Summary |
|----------|---------|---------|
| [Child Page](./child-page.md) | v1.0 | Brief description |
<!-- confluence:ignore-end -->- Properties report directive — Add a directive after the intro content. This generates a dynamic table on Confluence that pulls metadata from all child pages sharing the same label. Use
<!-- confluence:properties-report -->to scope to child pages, and match the label fromancestor = currentContent().confluence_labels - Confluence ignore blocks — Wrap all child page listing content (section headings, tables, links) between and
<!-- confluence:ignore-start -->. This content is only visible in markdown viewers (GitHub, local); on Confluence, the properties report replaces it.<!-- confluence:ignore-end --> - Label alignment — The value in the CQL query must match one of the
labeldefined in the child pages' frontmatter. Use the same label across all siblings so the report captures them all.confluence_labels - Report headings — Include at minimum: . These must match field names in the children's
Owner,Status,Version,Reviewed on.confluence_properties
- Use lowercase with hyphens: not
api-reference.mdAPI Reference.md - No spaces, underscores, or special characters in filenames
- No version numbers in filenames — track versions in frontmatter instead
3. File-Level Checks
Frontmatter
---
title: API Reference
subtitle: "Reference — Project Docs v1.0"
date: "2026-03-09"
author: "Engineering Team"
confluence_ignore: false
confluence_labels:
- api
- reference
confluence_properties:
- id: status
fields:
Owner: "Engineering Team"
Classification: Internal
Status: "{status:Green|Published}"
Version: v1.0
Reviewed on: 2026-03-05
---- Derive from the first
titleif present, otherwise from the filename# heading - Set to today's date
date - Derive from inline metadata if present, otherwise from existing sibling files or ask the user
author - Derive from document context (e.g.,
subtitle,"ADR — Project v1.0")"Guide — Team Docs" - Suggest based on the directory name and content
confluence_labels - Always include with at minimum:
confluence_properties,Owner,Classification,Status, andVersionReviewed on - Populate property values from inline metadata found in the document body when available
- Set by default. Only set to
confluence_ignore: falsewhen the user explicitly wants to exclude a file from Confluence publishing (previously published pages will be deleted on next sync)true - Never overwrite existing or
confluence_page_idconfluence_url
Remove Redundant Inline Metadata
confluence_properties**Document Version**: 1.0
**Status**: Draft (Proposal)
**Classification**: Internal
**Last Updated**: March 7, 2026
**Author**: Engineering Team
**Owner**: Platform Team- Key-value lines: or
Version: 1.0Status: Draft - Small two-column tables with metadata-like headers (e.g., )
| Field | Value | - Blockquote metadata:
> **Version**: 1.0
- Only remove metadata lines/blocks where the information is already captured in frontmatter fields or fields
confluence_properties - If an inline metadata block contains values not yet in frontmatter, absorb them into frontmatter first, then remove the block
- Preserve any surrounding content — only strip the metadata lines themselves
- If the metadata block is followed by a blank line or horizontal rule, remove the separator too to avoid orphaned whitespace
Heading Hierarchy
# heading##- Multiple headings — Keep only the first one (it becomes the title). Convert subsequent
#to#.## - Heading gaps — Don't jump from to
##. Fill in the hierarchy.#### - No heading — If the file has no
#heading but has a#in frontmatter, that's fine. If it has neither, add atitleheading derived from the filename.#
Document Structure
# Title
> One-line summary of what this document covers.
<!-- confluence:toc-start -->
## Table of Contents
1. [Section One](#section-one)
2. [Section Two](#section-two)
<!-- confluence:toc-end -->
---
## Section One
Content...
---
## Section Two
Content...- Add a TOC if the document has 3+ sections (headings). Wrap the TOC section (heading + list) with
##/<!-- confluence:toc-start -->directives so it gets replaced with the Confluence TOC macro on publish. The markdown TOC remains visible in GitHub/local renderers.<!-- confluence:toc-end --> - Add horizontal rules () between major sections for visual separation.
--- - Add a summary blockquote after the title if the document jumps straight into content without context.
Cross-References
## Cross-References
| Document | Relevance |
|----------|-----------|
| [Related Doc](./related-doc.md) | Brief note on why it's relevant |Revision History
## Revision History
| Version | Date | Changes |
|---------|------|---------|
| 1.0 | 2026-03-09 | Initial document |4. Content Formatting
| Issue | Fix |
|---|---|
Inline metadata blocks ( | Absorb into frontmatter/ |
| Raw HTML tags | Replace with markdown equivalents |
| Use blank lines instead |
| Deeply nested lists (3+ levels) | Flatten to 2 levels max |
| Tables with multi-line cells | Split into simpler tables |
| Inline images with relative paths | Verify paths are correct relative to the file |
GitHub-flavored alerts ( | Keep as-is — the converter handles these |
MkDocs admonitions ( | Keep as-is — the converter handles these |
5. Confluence-Specific Enhancements
- Status badges — Use syntax in property fields (e.g.,
{status:Color|Text}){status:Green|Published} - Confluence ignore blocks — Wrap sections that should only appear in markdown (not Confluence) with and
<!-- confluence:ignore-start -->. In INDEX.md files, all child page tables must be wrapped (see Directory-Level Checks above).<!-- confluence:ignore-end --> - Properties report — Every INDEX.md must include a properties report directive. See the INDEX.md structure in Directory-Level Checks for the exact pattern.
6. Dry Run
orbit confluence publish <directory> --space <SPACE> --parent <PAGE_ID> --dry-run -p <profile>Rules
- Never delete content — only restructure and add metadata.
- Never overwrite or
confluence_page_id— these are managed byconfluence_url.orbit confluence publish - Preserve existing frontmatter fields — add missing ones, don't remove existing ones.
- When in doubt about a title, derive it from the first, then from the filename.
# heading - Keep changes minimal — don't rewrite prose, don't reorganize sections unless the heading hierarchy is broken.
- Show the user a summary of changes before applying them to a large directory.