AI Agent Hub
Back to skills
Calliper Compare to Markdown Generator icon

Calliper Compare to Markdown Generator

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_15292d5a/yjkj-calliper-compare2markdown using https://skillhub.cn/install/skillhub.md.

About this skill

Problem

When two versions of a contract, spec, config, or text file differ, manual review often misses subtle clause wording, field values, table cells, and compliance changes. calliper-compare2markdown turns the “submit two local files and get a readable diff” step into one fixed script: it calls the synchronous calliper API through PDRouter, by default POST /openapi/{serviceCode}/compare/markdown, and prints Markdown diff output to stdout. For engineers, the value is a stable intermediate artifact that can be parsed downstream.

How It Works

  • Fixed entry point: use scripts/compare_to_markdown.js directly; do not reimplement the API flow or bypass the script during normal tasks.
  • Auth and environment: prefer PAODINGAI_API_KEY, fall back to CALLIPER_ACCESS_TOKEN; fail if both are missing. Optional variables include PD_ROUTER_BASE_URL, PD_ROUTER_SERVICE_CODE, and PD_ROUTER_COMPARE_ENDPOINT.
  • Request shape: after validating that both local input files exist, the script sends one multipart request with file1, file2, and optional config, plus an Authorization: Bearer header.
  • Output parsing: if the response is Markdown or plain text, output it directly; otherwise try common JSON fields such as data.markdown and markdown, then fall back to the JSON text.
  • File output: with output-markdown-path, the script writes the same content to that file while also printing to stdout. Progress and errors go to stderr, and failures return a non-zero exit code.

Boundaries

Use it for “export diff to Markdown,” generating parseable change summaries, clause extraction, mismatch validation, and rule checks. If the Markdown is only intermediate input, write it to a working file first and extract only needed fragments; return full Markdown only when the user explicitly asks for the original complete diff. If routing, service code, or endpoint differs from defaults, adjust environment variables rather than changing script logic.

Use Cases

  • Compare two contract drafts, extract clause differences, and export Markdown for review.
  • Check spec version changes and generate a structured diff summary for change review.
  • Write config or rule-file differences to a working file, then parse needed fields.
  • Before compliance checks, convert differences from two files into machine-readable Markdown.

Best For

  • Legal operations reviewing contract clauses: quickly export two-version differences to Markdown.
  • Documentation engineers maintaining specs: extract version changes for review workflows.
  • Automation engineers building parsers: obtain stable Markdown diff intermediates.
  • Compliance engineers validating files: convert differences into checkable structured text.