Metadata File Format Specification

February 8, 2026 ยท View on GitHub

Overview

This document specifies the format for comment metadata files used by Markdown Comment.

Version

2.0

File Extension

  • Format version 2.0 (Extension version v0.1.0 - ): .meta.json (Pretty Printed JSON)
  • Format version 1.0 (Extension version v0.0.1 - v0.0.7): .meta.jsonl (JSON Lines) - LEGACY Format (read-only support for backward compatibility)

File Naming

For a Markdown file example.md, the metadata file is named example.meta.json.

Schema

Root Object

FieldTypeRequiredDescription
versionstringYesFormat version (e.g., "2.0")
tagsstring[]NoAvailable tags for this file
threadsThread[]YesArray of comment threads

Thread Object

FieldTypeRequiredDescription
idstringYesUnique identifier (UUID)
anchorAnchorYesText anchor information
commentsComment[]YesArray of comments in this thread

Anchor Object

FieldTypeRequiredDescription
textstringYesThe anchored text
contextBeforestringYesText before the anchor
contextAfterstringYesText after the anchor
offsetnumberYesCharacter offset from document start
lengthnumberYesLength of anchored text

Comment Object

FieldTypeRequiredDescription
idstringYesUnique identifier (UUID)
contentstringYesComment content
authorstringYesAuthor identifier
createdAtstringYesISO 8601 timestamp
updatedAtstringYesISO 8601 timestamp
statusstringNoStatus: "open", "resolved", "closed" (root comment only)
tagsstring[]NoTags assigned to this comment

Example

{
  "version": "2.0",
  "tags": ["todo", "review", "bug"],
  "threads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "anchor": {
        "text": "This section needs improvement",
        "contextBefore": "## Overview\n\n",
        "contextAfter": "\n\nThe following...",
        "offset": 15,
        "length": 30
      },
      "comments": [
        {
          "id": "c1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6",
          "content": "Please add more examples here",
          "author": "reviewer@example.com",
          "createdAt": "2026-01-26T10:00:00Z",
          "updatedAt": "2026-01-26T10:00:00Z",
          "status": "open",
          "tags": ["documentation"]
        }
      ]
    }
  ]
}

Migration

When reading files:

  1. Try .meta.json first (new format)
  2. Fall back to .meta.jsonl (legacy format)

When saving files:

  • Always write to .meta.json with Pretty Print (2-space indent)
  • Legacy .meta.jsonl files are automatically migrated on next save