Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Text Diff

text.diff_text

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
File inputNo network

Overview

Computes a structured diff between two text inputs using Myers algorithm. Supports line, word, and character granularity. Returns hunks, operations, unified diff output, and summary statistics. Accepts file input via file_ref — no need to extract file content first.

LLMs cannot reliably compute precise line- or word-level diffs. We use Myers' algorithm to give you exact, structured change information every time.

Reliability

STRICT and deterministic — Myers' algorithm produces optimal shortest-edit diffs. Identical inputs always yield identical hunks, stats, and unifiedDiff. We return at most 500 hunks while stats still count every change, and a line diff that hits the cap adds truncated: true. Input validation (not retryable): a granularity outside line, word, character; neither text nor file_ref on a side; both on a side; either side longer than 1,048,576 characters, or 10,000 at character granularity.

Context footprint

Each side accepts inline text up to ~1M chars or file_ref (up to 2 MB). Diff output exceeding 100 KB is stored as a downloadable file automatically. A successful call costs 2 execution credits.

When to use it

When you need deterministic change detection between two text versions at line, word, or character granularity.

Do not use to apply patches, compare binary files, or resolve three-way merge conflicts.

Powered by java-diff-utils, a battle-tested implementation of Myers' diff algorithm trusted across the JVM ecosystem.

Scope

Note
Computes a structured diff between two texts using Myers' algorithm at line, word, or character granularity, with unified diff output and change statistics.

Non-goals

  • Does not apply patches or merge changes
  • Does not perform three-way merge or conflict resolution
  • Does not compare binary content

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysistext-processing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input1 MBMax file size1.9 MB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file1.9 MiBSkill maximum

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
oldTextstringNoOld inline text. Required unless old_file_ref is provided.
old_file_refstringNoOld tenant-scoped file reference. Omit it when oldText is supplied.
newTextstringNoNew inline text. Required unless new_file_ref is provided.
new_file_refstringNoNew tenant-scoped file reference. Omit it when newText is supplied.
granularitystringNoComparison granularity; omit it for line.
contextLinesintegerNoUnified-diff context lines; omit it for three.
ignoreWhitespacebooleanNoWhether whitespace-only differences are ignored; omit it for false.
outputToFilebooleanNoWhether a large diff is stored as a file; omit it for false.

Output schema

FieldTypeRequiredDescription
hunksarrayYesBounded array of ordered difference hunks with type, positions, source, and target properties. The item shape is defined by the nested schema and the array contains from 0 through 2000000 items.
statsobjectYesPurpose-bound count map for added, removed, changed, and unchanged units. Its purpose-bound receipt properties are bounded to 64 entries — unconstrained RFC 8259 JSON items.
granularitystringYesApplied comparison granularity.
identicalbooleanYesWhether the compared texts are identical under the options.
unifiedDiffstringNoOptional bounded unified-diff rendering.
unifiedDiffTruncatedbooleanNoWhether the unified-diff rendering was cut at 512 KB. Present only when the cap was hit.
truncatedbooleanNoWhether hunks omitted deltas beyond the first 500. Present only when the hunk cap was hit.
file_refstringNoStored unified-diff reference when returned by file.
download_urlstringNoTemporary platform download URL when returned by file.
size_bytesintegerNoReturned diff UTF-8 byte size.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.diff_text","input":{"oldText":"hello world","newText":"hello there world"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("text.diff_text", {"oldText":"line1\nline2\nline3","newText":"line1\nline2 modified\nline3\nline4"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not apply patches or merge changes
  • Does not perform three-way merge or conflict resolution
  • Does not compare binary content
  • Applying or merging diffs programmatically
  • Binary file comparison
  • Three-way merge or conflict resolution

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "text.diff_text",
  "input": {
    "oldText": "line1\nline2\nline3",
    "newText": "line1\nline2 modified\nline3\nline4"
  }
}

Examples

Line-level diff with unified output

Inputjson
{
  "oldText": "line1\nline2\nline3",
  "newText": "line1\nline2 modified\nline3\nline4"
}
Expected outputjson
{
  "stats": {
    "changed": 1,
    "added": 1,
    "removed": 0,
    "unchanged": 2
  },
  "granularity": "line",
  "unifiedDiff": "--- old\n+++ new\n@@ -1,3 +1,4 @@\n line1\n-line2\n+line2 modified\n line3\n+line4",
  "identical": false,
  "hunks": [
    {
      "sourcePosition": 2,
      "sourceLines": [
        "line2"
      ],
      "type": "change",
      "targetLines": [
        "line2 modified"
      ],
      "targetPosition": 2
    },
    {
      "sourcePosition": 4,
      "sourceLines": [],
      "type": "insert",
      "targetLines": [
        "line4"
      ],
      "targetPosition": 4
    }
  ]
}

Word-level insertion

Inputjson
{
  "granularity": "word",
  "newText": "hello there world",
  "oldText": "hello world"
}
Expected outputjson
{
  "identical": false,
  "granularity": "word",
  "stats": {
    "changed": 0,
    "added": 2,
    "removed": 0,
    "unchanged": 3
  },
  "hunks": [
    {
      "source": [],
      "type": "insert",
      "target": [
        "there",
        " "
      ]
    }
  ]
}
  • Compare document or configuration versions
  • Track prompt or template evolution over time
  • Audit generated content for unexpected regressions

Avoid for

  • Applying or merging diffs programmatically
  • Binary file comparison
  • Three-way merge or conflict resolution

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

textanalysistransformation