Skip to main content

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

MicroSkills Reference

Normalize Whitespace

text.normalize_whitespace

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
File inputNo network

Overview

Normalizes whitespace deterministically: converts CRLF/CR to LF, strips trailing spaces, collapses repeated spaces/tabs, and applies a preservation policy (compact, preserve_lines, preserve_paragraphs, markdown_safe). Fenced code blocks are preserved by default and Markdown hard line breaks are kept in markdown_safe mode. Accepts file input via file_ref — no need to extract file content first.

Whitespace noise breaks comparison and dedup — we clean it deterministically so your pipelines get consistent text.

Reliability

STRICT and deterministic — identical text and options always yield identical output. Fenced code blocks are preserved verbatim when preserveCodeBlocks is true (default). Input validation (not retryable): unsupported mode; text and file_ref both missing.

Context footprint

Returns the normalized text and a small change summary. A successful call costs 1 execution credit.

When to use it

When you compare, hash, or deduplicate text and want predictable whitespace.

Do not use on whitespace-significant formats (some code, fixed-width tables) where every space carries meaning.

Scope

Note
We normalize whitespace in your text — line endings, repeated spaces, trailing spaces — while preserving the line and paragraph structure you choose.

Non-goals

  • Does not change words
  • Does not translate
  • Does not fix spelling

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

normalizationtext-processing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size2 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 file2 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
textstringNoBounded inline text source. Required unless file_ref is provided.
file_refstringNoTenant-scoped opaque text-file reference. Omit it to use the required inline text; never send both.
modestringNoPreservation mode; omit it for preserve_paragraphs.
trimbooleanNoWhether outer whitespace is trimmed; omit it for true.
normalizeNewlinesbooleanNoWhether CRLF and CR become LF; omit it for true.
collapseSpacesbooleanNoWhether repeated spaces and tabs collapse; omit it for true.
preserveCodeBlocksbooleanNoWhether fenced code blocks are preserved; omit it for true.

Output schema

FieldTypeRequiredDescription
okbooleanYesAlways true for a successful normalization.
textstringYesNormalized bounded text.
changesobjectYesClosed change-summary object with originalLength, normalizedLength, and newlineCountChanged properties.

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.normalize_whitespace","input":{"text":"a   b"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("text.normalize_whitespace", {"text":"a   b\r\n\r\n\r\nc"});

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 change words
  • Does not translate
  • Does not fix spelling
  • Whitespace-significant formats where every space matters

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "text.normalize_whitespace",
  "input": {
    "text": "a   b\r\n\r\n\r\nc"
  }
}

Examples

Collapse spaces and normalize newlines

Inputjson
{
  "text": "a   b\r\n\r\n\r\nc"
}
Expected outputjson
{
  "text": "a b\n\nc",
  "changes": {
    "originalLength": 12,
    "newlineCountChanged": true,
    "normalizedLength": 6
  },
  "ok": true
}

Markdown-safe mode preserves hard line breaks

Inputjson
{
  "mode": "markdown_safe",
  "text": "line one  \nline two"
}
Expected outputjson
{
  "text": "line one  \nline two",
  "changes": {
    "originalLength": 19,
    "newlineCountChanged": false,
    "normalizedLength": 19
  },
  "ok": true
}
Tip
The two trailing spaces before the newline survive because they are a Markdown hard break; any other mode would strip them
  • Clean text before hashing/dedup
  • Normalize prompts
  • Tidy scraped text

Avoid for

  • Whitespace-significant formats where every space matters

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

textcleanupnormalization