---
title: "transform"
description: "Convert between formats"
canonical: "https://acs.synapti.ai/capabilities/transform/"
last_updated: "2026-11-16T17:47:25Z"
---

# transform

Convert between formats

Generated from [schemas/capability_ontology.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/capability_ontology.yaml), [skills/transform/SKILL.md](https://github.com/synaptiai/agent-capability-standard/blob/main/skills/transform/SKILL.md) at commit 18c38b74ac21. Ontology version 2.2.0.

Layer: [SYNTHESIZE](https://acs.synapti.ai/layers/synthesize/index.md)

## Safety

| Property | Value |
| --- | --- |
| Risk | Low |
| Changes state | No |
| Needs checkpoint | No |
| Needs approval | No |
| Overridable | No |
| Blocked from autonomy | No |

In a workflow, retrieve, where the workflow has it, must come first (V102).

## Relationships

**Figure: Relationships of transform: 2 relationships with 2 capabilities.** transform has 2 relationships with 2 capabilities: 1 with edges into it and 1 joined to it only by edges that run both ways.

| Capability | Row | Relationships |
| --- | --- | --- |
| [`retrieve`](https://acs.synapti.ai/capabilities/retrieve/index.md) | Edges into transform | `precedes` (into) |
| [`generate`](https://acs.synapti.ai/capabilities/generate/index.md) | Either way | `alternative_to` (both ways) |

- `precedes`: Comes after, when both are present [`retrieve`](https://acs.synapti.ai/capabilities/retrieve/index.md)
- `alternative_to`: Can substitute for [`generate`](https://acs.synapti.ai/capabilities/generate/index.md)

## Contract

**Figure: Contract of transform: 4 inputs (2 required), 6 outputs.** transform takes 4 inputs, 2 required (filled pin) and 2 optional (hollow pin), and returns 6 outputs. The tables below list every field.

### Inputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | any | Yes | Data to transform |
| `source_format` | string | No | Input format |
| `target_format` | string | Yes | Output format |
| `options` | object | No | Transformation options |

### Outputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `output` | object\|array | Yes | Transformed data, a mapping or a list (such as CSV rows as records) |
| `changes` | array | No | Applied transformations |
| `evidence_anchors` | array of Anchor (or deprecated string or object) | Yes | What the output is based on, as evidence anchors (Standard v1.2 §6.5). An empty list grounds nothing, and the output is then marked inferred (§3.1). |
| `confidence` | number | Yes | The producer's probability that the output's claim is correct, self-reported unless the host documents a calibration (Standard v1.2 §4.1.1) From 0 to 1 |
| `inference_method` | string | No | How the output was reached when it is not grounded in evidence; with confidence it marks the output inferred (Standard v1.2 §3.1, §4.1.1). A producer should use model_knowledge, deduction, induction, abduction, analogy, statistical, simulation, assumption or an x- vendor value; a grounding policy (§5.20) requires one of them. |
| `uncertainty` | Uncertainty | No | The uncertainty of the output's principal value; its confidence equals the output's confidence (Standard v1.2 §4.1.1) |

The skill returns 8 fields: 4 are in transform's output contract (3 required) and 4 are the skill's own, outside the contract; it leaves out 2 contract fields (inference_method, uncertainty).

| Field of the skill's output | In the output contract |
| --- | --- |
| `output` | Yes, required |
| `transformation` | No, the skill's own |
| `validation` | No, the skill's own |
| `losses` | No, the skill's own |
| `changes` | Yes, optional |
| `confidence` | Yes, required |
| `evidence_anchors` | Yes, required |
| `assumptions` | No, the skill's own |
| `inference_method` | Yes, but the skill leaves it out |
| `uncertainty` | Yes, but the skill leaves it out |

## Used in workflows

**Figure: transform in workflows.** 6 workflows use transform, in 6 steps in all; its steps are the squares in an ink ring, and the key under the strips names the other squares.

- [`digital_twin_sync_loop`](https://acs.synapti.ai/workflows/digital-twin-sync-loop/index.md): step 3
- [`data_quality_pipeline`](https://acs.synapti.ai/workflows/data-quality-pipeline/index.md): step 5
- [`report_generation`](https://acs.synapti.ai/workflows/report-generation/index.md): step 10
- [`patient_monitoring`](https://acs.synapti.ai/workflows/patient-monitoring/index.md): step 3
- [`production_line_monitoring`](https://acs.synapti.ai/workflows/production-line-monitoring/index.md): step 2
- [`communication_drafting`](https://acs.synapti.ai/workflows/communication-drafting/index.md): step 8

## Claude Code skill

**Figure: What the transform skill's tools can do, against the ontology.** The skill may use 2 tools: 2 only read; the ontology marks transform as read-only, and every tool only reads.

| What they can do | Tools |
| --- | --- |
| Only read | `Read`, `Grep` |
| Run commands, which can change state | none |
| Change files | none |

**Figure: The field names each step of the transform procedure uses.** 7 of the procedure's 7 steps use the name of an input or output field of the transform skill as a word; 3 output fields of 8 are used by no step (confidence, evidence_anchors, assumptions).

| Step | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Parse source data | `input`, `source_format` |  |
| 2. Analyze target schema | `options` |  |
| 3. Build transformation map | `options` | `transformation` |
| 4. Execute transformation |  | `transformation` |
| 5. Track losses |  | `output`, `losses`, `changes` |
| 6. Validate output |  | `output` |
| 7. Ground output |  | `output`, `transformation`, `validation` |

Both examples of the skill write out every one of its 8 output fields.

**Figure: The neighbours the skill lists for transform, checked against the ontology and the catalogs.** The skill lists 6 capabilities as common neighbours of transform; 1 of them has an edge with it in the ontology, and 4 run next to it, in that order, in a catalog workflow (receive most often, 1 time). Under each tile, an edge reads from its source to its target, with transform's symbol in its place: "requires Tn" is a requires edge from the tile's capability to transform, so the tile's capability must run before transform; "Tn precedes" is a precedes edge from transform to the tile's capability.

| Listed as | Capability | Ontology edge | Next to it in a workflow |
| --- | --- | --- | --- |
| commonly follows | [`receive`](https://acs.synapti.ai/capabilities/receive/index.md) | none | 1 times |
| commonly follows | [`retrieve`](https://acs.synapti.ai/capabilities/retrieve/index.md) | `precedes` | 1 times |
| commonly follows | [`observe`](https://acs.synapti.ai/capabilities/observe/index.md) | none | never |
| commonly precedes | [`send`](https://acs.synapti.ai/capabilities/send/index.md) | none | never |
| commonly precedes | [`integrate`](https://acs.synapti.ai/capabilities/integrate/index.md) | none | 1 times |
| commonly precedes | [`verify`](https://acs.synapti.ai/capabilities/verify/index.md) | none | 1 times |

### Intent

Transform data from one format or schema to another while tracking what information is preserved, modified, or lost during conversion. Ensure output conforms to target schema with full provenance.

**Success criteria:**
- Output conforms to target schema
- All fields mapped correctly or explicitly marked as lost
- Transformation is deterministic and reproducible
- Loss/distortion explicitly documented
- Evidence anchors trace source to output

**Compatible schemas:**
- `schemas/output_schema.yaml`

### Inputs

| Parameter | Required | Type | Description |
|-----------|----------|------|-------------|
| `input` | Yes | any | Data to transform |
| `source_format` | No | string | Input format |
| `target_format` | Yes | string | Output format |
| `options` | No | object | Transformation options |

Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).

### Procedure

1) **Parse source data**: Load and validate input
   - Identify source format (JSON, YAML, XML, CSV, etc.)
   - Parse into internal representation
   - Detect encoding and special characters
   - Record source structure for provenance

2) **Analyze target schema**: Understand destination requirements
   - Load target schema specification (`options.schema`, if given)
   - Identify required vs optional fields
   - Note type constraints and validations
   - Map nested structures

3) **Build transformation map**: Match source to target
   - Apply explicit mappings if provided (`options.mapping`)
   - Infer mappings for matching field names
   - Identify fields requiring type conversion
   - Flag unmappable source fields

4) **Execute transformation**: Apply mappings
   - Transform each field according to mapping
   - Apply type conversions (string to number, etc.)
   - Handle nested objects recursively
   - Apply default values for missing required fields

5) **Track losses**: Document what was not preserved
   - List source fields not in output
   - Note precision losses in numeric conversions
   - Record truncations or format changes
   - Document semantic changes

6) **Validate output**: Confirm target schema conformance
   - Check all required fields present
   - Validate types match schema
   - Run any schema-defined constraints
   - Verify structural integrity

7) **Ground output**: Attach provenance
   - Link output fields to source locations
   - Document transformation rules applied
   - Record validation results

### Output Contract

Return a structured object:

```yaml
output: object|array  # Transformed data, a mapping or a list of records
transformation:
  input_type: string  # Format of source data
  output_type: string  # Format of output data
  mapping_applied: string  # Reference to mapping specification
validation:
  input_valid: boolean  # Was source valid?
  output_valid: boolean  # Does output match target schema?
  schema_ref: string  # Target schema reference
  errors: array[string]  # Validation errors if any
losses:
  - field: string  # Source field that was lost
    reason: string  # Why it was not preserved
    severity: info | warning | error  # Impact level
changes:  # Applied transformations
  - source_field: string
    target_field: string
    conversion: string  # What transformation was applied
    reversible: boolean  # Can be converted back?
confidence: number  # probability that the output is a correct transformation of the input (§4.1.1)
evidence_anchors: [{ref: "source:field", kind: record}, {ref: "schema:rule", kind: record}]
assumptions: []  # Explicit assumptions
```

#### Field Definitions

| Field | Type | Description |
|-------|------|-------------|
| `output` | object | The transformed data |
| `transformation` | object | Source and target formats and the mapping applied |
| `validation` | object | Input and output validation results |
| `losses` | array | Fields or data not preserved |
| `changes` | array | Field-level transformations applied (type/format conversions, defaults) |
| `confidence` | number | Probability, 0.0-1.0, that the output is a correct transformation of the input (§4.1.1) |
| `evidence_anchors` | array of evidence anchors (§6.5) | Source references and schema rules |
| `assumptions` | array | Assumptions made during transformation |

### Examples

#### Example 1: JSON to YAML with Schema Validation

**Input:**
```yaml
input:
  user_id: 12345
  user_name: "john_doe"
  email_address: "john@example.com"
  created_timestamp: 1705312800
  metadata:
    source: "api"
    version: "2.1"
source_format: json
target_format: yaml
options:
  schema:
    type: object
    required: [id, name, email, created_at]
    properties:
      id: { type: integer }
      name: { type: string }
      email: { type: string, format: email }
      created_at: { type: string, format: date-time }
      tags: { type: array, items: { type: string } }
  mapping:
    user_id: id
    user_name: name
    email_address: email
    created_timestamp: created_at
```

**Output:**
```yaml
output:
  id: 12345
  name: "john_doe"
  email: "john@example.com"
  created_at: "2024-01-15T10:00:00Z"
  tags: []
transformation:
  input_type: "json"
  output_type: "yaml"
  mapping_applied: "explicit_mapping_v1"
validation:
  input_valid: true
  output_valid: true
  schema_ref: "user_schema_v2"
  errors: []
losses:
  - field: "metadata.source"
    reason: "No mapping to target schema"
    severity: info
  - field: "metadata.version"
    reason: "No mapping to target schema"
    severity: info
changes:
  - source_field: "created_timestamp"
    target_field: "created_at"
    conversion: "unix_epoch to ISO8601 datetime"
    reversible: true
  - source_field: "tags"
    target_field: "tags"
    conversion: "default empty array added"
    reversible: false
confidence: 0.9
evidence_anchors:
  - {ref: "source:user_id -> target:id", kind: record}
  - {ref: "schema:required_fields_present", kind: record}
  - {ref: "conversion:timestamp_to_iso8601", kind: record}
assumptions:
  - "Unix timestamp is in seconds, not milliseconds"
  - "Timezone is UTC"
```

**Evidence pattern:** Field-by-field mapping documented, schema validation confirms conformance.

---

#### Example 2: CSV to Structured Object

**Input:**
```yaml
input: "name,age,city\nAlice,30,NYC\nBob,25,LA"
source_format: csv
target_format: json
options:
  schema:
    type: object
    properties:
      records:
        type: array
        items:
          type: object
          properties:
            full_name: { type: string }
            age_years: { type: integer }
            location: { type: string }
  mapping:
    name: full_name
    age: age_years
    city: location
```

**Output:**
```yaml
output:
  records:
    - full_name: "Alice"
      age_years: 30
      location: "NYC"
    - full_name: "Bob"
      age_years: 25
      location: "LA"
transformation:
  input_type: "csv"
  output_type: "json"
  mapping_applied: "csv_to_object_mapping"
validation:
  input_valid: true
  output_valid: true
  schema_ref: "person_array_schema"
  errors: []
losses: []
changes:
  - source_field: "age"
    target_field: "records[].age_years"
    conversion: "string to integer"
    reversible: true
  - source_field: "(rows)"
    target_field: "records"
    conversion: "CSV rows wrapped as an array under records"
    reversible: true
confidence: 0.95
evidence_anchors:
  - {ref: "source:row_count=2", kind: record}
  - {ref: "schema:all_required_present", kind: record}
assumptions:
  - "CSV uses comma delimiter"
  - "First row is header"
  - "No quoted fields with commas"
```

### Verification

- [ ] Output validates against target schema
- [ ] All required fields are present
- [ ] Type conversions are correct
- [ ] Losses are explicitly documented
- [ ] Transformation is reproducible

**Verification tools:** Read (for schema validation), Grep (for pattern matching)

### Safety Constraints

- `mutation`: false
- `requires_checkpoint`: false
- `requires_approval`: false
- `risk`: low

**Capability-specific rules:**
- Always document data loss explicitly
- Never silently drop fields without recording
- Validate output against schema before returning
- Flag precision loss in numeric conversions
- If transformation is ambiguous, ask for clarification
- Never transform sensitive data without noting it

### Composition Patterns

**Commonly follows:**
- `receive` - Transform incoming messages to canonical form
- `retrieve` - Transform retrieved data to expected format
- `observe` - Understand source before transformation

**Commonly precedes:**
- `send` - Format data before external transmission
- `integrate` - Prepare data for merging
- `verify` - Check transformed output

**Anti-patterns:**
- Never transform without documenting losses
- Never assume field type without verification
- Avoid chained transforms without intermediate validation

**Workflow references:**
- See `reference/composition_patterns.md#digital-twin-sync-loop` for transform in data pipeline
- See `reference/composition_patterns.md#enrichment-pipeline` for transform context
