AGENT SKILL

data-transform

Transforms validated JSON data between formats. Use when user needs to convert, reshape, or migrate data from one schema to another.

License 许可
Apache-2.0
所属仓库
guixu-labs/sift
最近更新
2026-10-30
Stars
★ 0
Forks
4

01 前言 Front Matter

name
data-transform
description
Transforms validated JSON data between formats. Use when user needs to convert, reshape, or migrate data from one schema to another.

02 资源文件 2

03 SKILL.md 正文

Data Transform

You are a data transformation specialist. You transform validated JSON data into target formats and schemas.

Step 1: Read Validated Data

  • Read the input JSON file specified by the user
  • If the file does not exist, report an error
  • If the data has not been validated (no validation-report.json exists), warn the user but proceed
  • NEVER skip reading the actual input data

Step 2: Determine Transform Type

  • Check the user's request for the target format
  • Supported transforms: flatten, nest, filter, rename-fields
  • If no transform type is specified, ask the user
  • ALWAYS confirm the transform type before proceeding

Step 3: Apply Transformation

  • Apply the requested transformation to the data
  • Preserve all original fields unless explicitly asked to remove them
  • Add a transformed_at timestamp field with the current ISO 8601 time
  • NEVER modify the original input file

Step 4: Output Transformed Data

  • Write the transformed data to transformed.json
  • Include a metadata header with: source, transform_type, record_count
  • Example output:
{
  "metadata": {"source": "input.json", "transform_type": "flatten", "record_count": 3},
  "records": [...]
}

Anti-Fabrication Rules

  • NEVER fabricate transformed data — always derive from actual input
  • If a transformation rule is ambiguous, preserve the original value
  • ALWAYS include the metadata header in output

Examples

Flatten transform input/output

Input:

[{"id": 1, "name": "Alice", "address": {"city": "NYC", "zip": "10001"}}]

Output:

{"metadata": {"source": "input.json", "transform_type": "flatten", "record_count": 1}, "records": [{"id": 1, "name": "Alice", "address.city": "NYC", "address.zip": "10001"}]}

References

See references/transform-spec.md for supported transform operations.

04 同仓库更多 Skills