Format YAML
code.format_yaml
Overview
When you send YAML text or a file reference, we parse it in safe mode and re-emit consistent indentation, block style, and line width. Comments are not preserved — we return a warning when you asked to keep them. We never instantiate custom tags or execute YAML constructors — do not use this when inline comments must survive reformatting. Accepts file input via file_ref — no need to extract file content first.
YAML indentation errors break deploys. We parse safely and re-emit a consistent layout every time.
Reliability
Deterministic for identical input and options. Parse failures surface as validation errors (PARSE_ERROR) — fix the YAML before retrying.
Context footprint
Returns formatted YAML, changed and parseable flags, and warnings. A successful call costs 1 execution credit.
When to use it
When input parses as YAML and you need normalized formatting.
When comments must be preserved in the output.
Powered by SnakeYAML in safe mode (SafeConstructor), which never instantiates arbitrary Java types from YAML tags.
Scope
Non-goals
- Does not execute YAML tags
- Does not preserve comments
- Does not mutate semantics
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
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.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 2 MiB | Skill maximum |
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| yaml | string | No | Inline YAML document text; omit it when file_ref is the source. |
| file_ref | string | No | Tenant-scoped managed YAML file reference; omit it when yaml is the source. |
| indent | integer | No | Output spaces per nesting level; omit it for 2. |
| lineWidth | integer | No | Output line width; omit it for 120. |
| sortKeys | boolean | No | Whether mapping keys are sorted; omit it for false. |
| preserveComments | boolean | No | Whether dropped comments produce a warning; omit it for true. |
| explicitStart | boolean | No | Whether document-start markers are emitted; omit it for false. |
| explicitEnd | boolean | No | Whether document-end markers are emitted; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| formatted | string | Yes | Safely parsed and re-emitted YAML text. |
| changed | boolean | Yes | Whether the formatted text differs from the input. |
| parseable | boolean | Yes | Successful safe-parse marker, always true. |
| warnings | array | Yes | From 0 through 1 comment-preservation warning string naming that comments were dropped. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"code.format_yaml","input":{"yaml":"a: 1"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("code.format_yaml", {"yaml":"a: 1\nb:\n - c\n"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not execute YAML tags
- Does not preserve comments
- Does not mutate semantics
- YAML that must retain inline comments verbatim
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "code.format_yaml",
"input": {
"yaml": "a: 1\nb:\n - c\n"
}
}Examples
Reindent a nested mapping
{
"yaml": "a: 1\nb:\n - c\n"
}{
"changed": true,
"parseable": true,
"formatted": "a: 1\nb:\n- c\n",
"warnings": []
}Inline comments trigger a preservation warning
{
"yaml": "a: 1 # note\n",
"preserveComments": true
}{
"changed": true,
"parseable": true,
"formatted": "a: 1\n",
"warnings": [
"COMMENTS_NOT_PRESERVED: comments are dropped during YAML reformatting."
]
}Recommended use cases
- Normalize config or manifest YAML before commit
- Clean up agent-generated YAML indentation
- Produce consistent block style across documents
Avoid for
- YAML that must retain inline comments verbatim
Related skills
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.