Visualizing differences and sharing skills

387453 86462 Updated: 2026-07-12 23:07:28

Diffs is a skill used to transform edited text into visual, shareable diffs. It takes the "before" and "after" text or unified patch string from the diffs tool and automatically generates human-readable rendered files (PNG/PDF) or interactive online preview links, avoiding the need to manually write tedious edit summaries.

Install
npx skills add https://github.com/openclaw/openclaw --skill diffs
Skill Details readonly

I. Skill Overview

This skill is utilized when specific edits to code, configuration files, or documentation need to be shared with other collaborators. Instead of pasting two separate text blocks in chat or manually writing verbose notes listing modified lines, the diffs utility generates formatted, visually highlighted output that makes all additions, deletions and edits instantly clear to recipients.
It supports three configurable output modes, adaptable to different sharing use cases.

II. Core Functional Capabilities

1. Three Distinct Output Modes

Mode Description Applicable Scenarios
mode=view Generates an interactive web preview link hosted by the Gateway service Sharing diff content for others to view in a web browser
mode=file Exports a fully rendered static file (PNG or PDF format) Saving as an attachment or distributing via messaging platforms
mode=both Produces both the interactive preview link and rendered static file Workflows requiring both delivery formats simultaneously

2. Flexible Input Acceptance

The diffs utility accepts two valid input formats:
  1. Side-by-side raw text pairs: Separate input blocks for the original pre-edit content and updated post-edit content
  2. Unified Patch string: Direct input of standard unified diff formatted text

3. Rendering Customization Controls

  • File format options: PNG (default) and PDF
  • Output quality tuning: Adjust rendering resolution via the fileQuality parameter (standard / hq)
  • Dimension constraints: Scaling factor via fileScale and maximum horizontal width limit via fileMaxWidth

4. Intelligent Pre-Check & Delivery Rules

  1. If the pre-edit and post-edit input text are completely identical, the utility returns a boolean false and skips generating any output artifacts to eliminate unnecessary idle operations.
  2. When sending rendered files to users or Discord channels, do not rely on the raw renderer output from the diffs tool. Instead, invoke the dedicated message utility and pass the generated file path via the path or filePath argument.

5. Network Topology Compatibility Logic

If the deployment environment uses a loopback trusted reverse proxy (e.g. Tailscale Serve), raw viewer page requests may fail due to missing forwarded client IP headers. In such network setups, prioritize mode=file or mode=both, or configure an explicit public-facing viewerBaseUrl proxy address.

III. Primary Use Cases

  1. Code Review Assistance
     
    Quickly generate visual highlighted diffs for single-file modifications during PR discussions, eliminating manual side-by-side code comparison for reviewers.
  2. Collaborative Documentation Change Presentation
     
    Visually showcase exact edits during collaborative work on docs, configuration files, or README markdown content.
  3. Tutorial & Live Demo Support
     
    Use highlighted diff visuals to clearly demonstrate before/after code fixes for audiences in tutorials or live presentations.
  4. Replacement for Manual Written Summaries
     
    Eliminate tedious, hard-to-read text descriptions such as "I edited line X and removed line Y" within chat threads; a single rendered image or preview link fully conveys all changes.

IV. Usage Examples

Basic diffs Utility Invocation

Input: Original pre-edit text + updated post-edit text (or a unified patch string)
 
Output object returns details.viewerUrl (interactive preview link) and/or details.filePath (local path to rendered static file)

File Delivery via Message Utility

Pass the value stored in details.filePath into the path or filePath parameter of the message tool to send the rendered file to target users or channels.

V. Critical Governing Principles

  1. Prioritize the dedicated diffs utility: Always use this tool to visualize edits instead of manually writing text change summaries when sharing modifications.
  2. Skip artifact generation for identical content: The tool returns false and creates no files if pre-edit and post-edit text match exactly.
  3. Deliver static files through the message utility: Never directly forward raw renderer output; always pass the file path reference via the message tool for distribution.
  4. Loopback proxy network caveat: Interactive preview links may break behind loopback reverse proxies; default to file rendering mode in such environments.
  5. Respect plugin default configuration values: Omit display parameters such as mode, theme, and layout unless explicit overrides are required, adhering to the user’s preconfigured diffs plugin defaults.

VI. Summary

Diffs is a visualization and sharing skill for rendering text modification differences. The diffs utility accepts paired before/after text blocks or standard unified patch input, then outputs highlighted change visuals as either PNG/PDF static files or interactive Gateway-hosted web preview links. Built for code review, collaborative documentation editing, and educational demo workflows, it provides a streamlined visual alternative to cumbersome handwritten text summaries of edits.