← 返回
未分类 Key

calliper-compare2markdown

Compare two local documents and convert differences into LLM-ready Markdown in one synchronous call. Supports PDF, Word, PPT, and image documents accepted by Calliper, and returns a structured markdown diff table suitable for change review, clause comparison, downstream extraction, and rule-based validation.
Compare two local documents and convert differences into LLM-ready Markdown in one synchronous call. Supports PDF, Word, PPT, and image documents accepted by Calliper, and returns a structured markdown diff table suitable for change review, clause comparison, downstream extraction, and rule-based validation.
yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 18
下载
💾 0
安装
1
版本
#latest

概述

Calliper-Compare2Markdown

Run a JavaScript workflow that submits two local files to the calliper synchronous API through PDRouter (POST /openapi/{serviceCode}/compare/markdown by default) and returns Markdown diff output in one step. This is suitable for document comparison, change extraction, compliance checks, and feeding structured diff content into follow-up scripts.

Installation

npx skills add PaodingAI/skills

Usage

node skills/calliper-compare2markdown/scripts/compare_to_markdown.js <left-file-path> <right-file-path> [output-markdown-path]

Execution Constraints

  • You must invoke scripts/compare_to_markdown.js directly. Do not reimplement the API flow yourself.
  • The behavior contract below explains what the script does, what it outputs, and when to use it. It is not a manual checklist for the model to imitate step by step.
  • For any task that depends on cross-document differences, you must run this script first and continue from the generated Markdown result.
  • Only inspect or modify the script implementation when the script itself is unavailable, failing, or needs a fix. Do not bypass it during normal use.

When to Use

  • Use this skill when the user wants to compare two documents and get structured differences in Markdown.
  • Use this skill when the user says things like "diff to markdown", "compare and output markdown", "导出差异 markdown", or asks for a machine-readable diff summary.
  • When downstream work depends on differences, such as clause extraction, mismatch validation, or rule checks, use this skill first.
  • When the diff content is only intermediate input, prefer writing to a working file and extract only required segments instead of returning full raw Markdown.
  • When the user explicitly asks for the original markdown diff output, return the full Markdown directly.

Environment Variables

  • PAODINGAI_API_KEY: Preferred bearer token used by the script.
  • CALLIPER_ACCESS_TOKEN: Optional fallback bearer token when PAODINGAI_API_KEY is absent.
  • PD_ROUTER_BASE_URL: Optional. Defaults to https://platform.paodingai.com/.
  • PD_ROUTER_SERVICE_CODE: Optional. Defaults to calliper.
  • PD_ROUTER_COMPARE_ENDPOINT: Optional. Defaults to /compare/markdown. Use only when routing endpoint differs.
  • CALLIPER_COMPARE_CONFIG: Optional. JSON string forwarded as config form field. Default is {}.

Script Behavior

  1. Read bearer token from PAODINGAI_API_KEY; fallback to CALLIPER_ACCESS_TOKEN; fail if both are missing.
  2. Validate both local input files exist.
  3. Send one multipart request with file1, file2, and optional config to POST /openapi/{serviceCode}{compareEndpoint} using Authorization: Bearer .
  4. Parse final response and output:
    • Markdown text directly when response is markdown/plain text.
    • Otherwise, resolve markdown from common JSON fields (data.markdown, markdown) or fallback to JSON text.
  5. If output-markdown-path is provided, also write the same output text to that file while still printing to stdout.
  6. Write progress and errors to stderr and return non-zero exit code on failure.
  7. For field/table extraction tasks, parse and return only required fragments unless user explicitly asks for the full markdown diff.

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 12:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 384 📥 146,745
design-media

agnes-image-gen

user_15292d5a
使用 Agnes AI 的图片生成模型生成图片,支持文生图(agnes-image-2.1-flash)和图生图(agnes-image-2.0-flash)。支持自定义 API Key,用户可使用自己的 Agnes Key。优化重点:降低
★ 1 📥 189
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 931 📥 187,223