Skip to main content

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

MicroSkills Reference

Normalize Line Endings

file.normalize_line_endings

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
File inputFile outputNo networkTemp storage

Overview

You send inline UTF-8 text or a UTF-8 file_ref. We rewrite CR, LF, and CRLF to one target sequence, report how many of each we saw, and drop a UTF-8 BOM from logical text while telling you it was there. Output stays inline up to 1 MiB and becomes a managed file above that. This is not encoding detection, whitespace formatting, or a binary rewrite.

Silent newline conversion hides whether a file used CR, LF, or CRLF and breaks later diffs.

Reliability

A second call with the same target is a no-op on the logical text. ENCODING_INVALID — trigger: file_ref is not valid UTF-8; retryable: no; next: run file.detect_text_encoding. ITEM_LIMIT_EXCEEDED — trigger: the UTF-8 file exceeds 5 MiB; retryable: no; next: split the file.

Context footprint

Inline text plus counts, or a managed file above 1 MiB. A successful call costs 1 execution credit.

When to use it

When decoded UTF-8 text must have one declared newline before a later compare or commit.

When the bytes are not UTF-8, or you need encoding detection rather than newline rewrite.

Scope

Note
Rewrites UTF-8 text line endings to LF, CRLF, or CR and reports source sequence counts.

Non-goals

  • Does not detect or convert character encodings
  • Does not reformat whitespace or wrap lines
  • Does not rewrite binary files

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

encodingnormalization

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size5 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 file5 MiBSkill and platform maximum
Maximum total input size5 MiBSkill maximum
Maximum number of input files1Skill maximum
Maximum generated artifact size5 MiBSkill maximum
Maximum number of generated files1Skill maximum

How we handle your data

Protected temp storage
What this means

This skill may temporarily store files or intermediate data only to complete execution. Temporary data is protected and automatically deleted.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Temporary execution only storage
  • 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
textstringNoInline UTF-8 text to rewrite; omit it when file_ref is set and never send both.
file_refstringNoTenant-scoped UTF-8 text file up to 5 MiB; omit it when inline text is set and never send both.
targetstringNoTarget newline: LF, CRLF, or CR. Omit this field to apply LF.
preserveFinalNewlinebooleanNoWhen true, keep a final terminator if the source had one. Omit it for true.

Output schema

FieldTypeRequiredDescription
textstringNoNormalized logical text without a UTF-8 BOM when utf8ByteSize is at most 1 MiB.
fileRefstringNoManaged UTF-8 file when the normalized payload exceeds 1 MiB; omitted for inline results.
targetstringYesApplied target sequence, one of LF, CRLF, or CR.
preserveFinalNewlinebooleanYesWhether a final terminator was kept when the source had one.
inputHadBombooleanYesTrue when a UTF-8 BOM was present and omitted from logical text.
crlfCountintegerYesHow many CRLF sequences were present in the source.
crCountintegerYesHow many lone CR sequences were present in the source.
lfCountintegerYesHow many lone LF sequences were present in the source.
utf8ByteSizeintegerYesUTF-8 byte size of the logical output without a BOM.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"file.normalize_line_endings","input":{"text":"a\r\nb\n"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("file.normalize_line_endings", {"text":"a\r\nb\rc\n"});

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.
ENCODING_INVALID400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not detect or convert character encodings
  • Does not reformat whitespace or wrap lines
  • Does not rewrite binary files
  • Guessing a legacy code page
  • Pretty-printing source

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "file.normalize_line_endings",
  "input": {
    "text": "a\r\nb\rc\n"
  }
}

Examples

Mixed endings become LF

Inputjson
{
  "text": "a\r\nb\rc\n"
}
Expected outputjson
{
  "preserveFinalNewline": true,
  "utf8ByteSize": 6,
  "text": "a\nb\nc\n",
  "inputHadBom": false,
  "crCount": 1,
  "target": "LF",
  "lfCount": 1,
  "crlfCount": 1
}
Tip
CRLF, lone CR, and LF all become LF and a final newline is kept

UTF-8 BOM is reported and stripped

Inputjson
{
  "text": "x\n"
}
Expected outputjson
{
  "preserveFinalNewline": true,
  "utf8ByteSize": 2,
  "text": "x\n",
  "inputHadBom": true,
  "crCount": 0,
  "target": "LF",
  "lfCount": 1,
  "crlfCount": 0
}
Tip
The BOM is omitted from logical text and inputHadBom is true
  • Normalize mixed CR/LF extracts before a later UTF-8 diff
  • Force CRLF on a checkout that arrived with lone CR

Avoid for

  • Guessing a legacy code page
  • Pretty-printing source

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

line-endingsencodingfile