Community라이팅 & 에디팅github.com

Jamie-BitFlight/data-transformation

dasel v3을 사용하여 JSON, YAML, TOML, XML, CSV, HCL, INI 등 구조화된 데이터를 수정, 변환, 변형합니다. 인플레이스 변경, 형식 변환, 일괄 처리, 배열 조작, 객체 구성 및 병합 패턴을 지원합니다.

data-transformation란 무엇인가요?

이 스킬은 dasel v3 명령줄 도구를 활용하여 다양한 구조화된 데이터 형식을 안전하게 변환하고 수정하는 방법을 제공합니다. 사용자는 YAML, JSON, TOML, XML, CSV 등 여러 형식 간 변환은 물론, 배열 요소의 일괄 업데이트(예: 가격 10% 인상), 객체 병합, 필드 삭제/이름 변경과 같은 고급 데이터 조작을 수행할 수 있습니다. 특히 dasel v3에서 'put'과 'delete' 명령어가 사라진 점을 반영하여 할당 표현식(assignment expressions)을 통한 수정 방식을 강조하며, 데이터 손실을 방지하기 위해 임시 파일로 출력한 후 원본을 덮어쓰는 안전한 인플레이스 수정 패턴을 사용합니다. 또한 필터, 맵, each, spread 연산자 등 다양한 함수를 활용한 조건부 변환 및 다단계 변환 패턴을 지원하여 복잡한 데이터 처리 요구사항을 충족시킵니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/dasel/skills/data-transformation

Installed? Explore more 라이팅 & 에디팅 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Dasel v3를 사용한 데이터 변환

<when_to_use>

다음과 같은 상황에서 이 스킬을 활성화하세요:

  • 설정 파일(YAML, TOML, JSON, XML, HCL, INI)의 값 수정
  • 데이터 형식 간 변환(JSON을 YAML로, TOML을 JSON으로 등)
  • 배열 요소 일괄 업데이트(가격, 버전, 플래그 등)
  • 데이터 구조 추가, 제거 또는 재구성
  • 객체 병합 또는 기존 데이터로 새 구조 구성

</when_to_use>

안전 규칙

절대 동일한 입력 파일로 출력을 리디렉션하지 마십시오. 이렇게 하면 dasel이 파일을 읽기 전에 파일이 잘려 데이터가 손실됩니다:

# 잘못된 방법 — 입력 파일이 손상됨
cat config.yaml | dasel -i yaml --root 'port = 9090' > config.yaml

# 올바른 방법 — 임시 파일에 쓴 후 이름 변경
cat config.yaml | dasel -i yaml --root 'port = 9090' > config_tmp.yaml && mv config_tmp.yaml config.yaml

덮어쓰기 전에 항상 확인하십시오. 먼저 변환 결과를 미리 본 다음 리디렉션하세요:

# 미리 보기
cat config.yaml | dasel -i yaml --root 'server.port = 9090'
# 적용
cat config.yaml | dasel -i yaml --root 'server.port = 9090' > config_tmp.yaml && mv config_tmp.yaml config.yaml

핵심 수정 구문

dasel v3에서는 put 및 delete 서브커맨드가 존재하지 않습니다. 모든 수정은 할당 표현식(assignment expressions)과 함께 --root를 사용하여 전체 문서를 출력합니다.

값 설정

# 하나의 필드가 변경된 전체 문서 출력
cat config.yaml | dasel -i yaml --root 'server.port = 9090'

# 숫자, 불리언, 문자열 할당
echo '{"count": 1}' | dasel -i json --root 'count = 42'
echo '{"enabled": false}' | dasel -i json --root 'enabled = true'
echo '{"name": "old"}' | dasel -i json --root 'name = "new"'

중첩 값 설정

cat config.yaml | dasel -i yaml --root 'database.connection.host = "db.example.com"'
cat config.yaml | dasel -i yaml --root 'database.connection.port = 5432'

인플레이스 수정 (안전한 패턴)

# 단일 필드 업데이트
cat config.yaml | dasel -i yaml --root 'server.port = 9090' > config_tmp.yaml && mv config_tmp.yaml config.yaml

# 여러 필드 — 세미콜론으로 연결
cat config.yaml | dasel -i yaml --root 'server.port = 9090; server.host = "0.0.0.0"' > config_tmp.yaml && mv config_tmp.yaml config.yaml

형식 변환

서로 다른 입출력 형식 플래그와 함께 dasel을 통해 파이프합니다:

# JSON을 YAML로
cat data.json | dasel -i json -o yaml > data.yaml

# YAML을 TOML로
cat config.yaml | dasel -i yaml -o toml > config.toml

# JSON을 XML로
cat data.json | dasel -i json -o xml > data.xml

# TOML을 JSON으로
cat config.toml | dasel -i toml -o json > config.json

# CSV를 JSON으로
cat data.csv | dasel -i csv -o json > data.json

배열 연산

배열에 추가

# 배열 끝에 요소 추가
echo '[1,2,3]' | dasel -i json --root '[$this..., 4]'
# 출력: [1, 2, 3, 4]

# 배열에 객체 추가
cat data.json | dasel -i json --root 'items = [$root.items..., {"name": "new", "value": 42}]'

each를 사용한 일괄 업데이트

# 모든 가격에 1.1 곱하기 (10% 인상)
cat data.json | dasel -i json --root 'items.each(price = price * 1.1)'

# 모든 요소에 플래그 설정
cat data.json | dasel -i json --root 'users.each(active = true)'

# 모든 값 증가
echo '[1,2,3]' | dasel -i json --root 'each($this = $this + 1)'

필터 후 변환

# 활성 사용자만 가져온 후 이름 추출
cat data.json | dasel -i json 'users.filter(active == true).map(name)'

객체 연산

스프레드(spread)를 통한 병합

# 기존 객체에 새 키 추가
cat base.json | dasel -i json --root '{ $root..., "newKey": "value" }'

# 두 객체 병합
cat base.json | dasel -i json --root '{ $root..., "extra": true, "version": 2 }'

재구성을 통한 필드 삭제

v3에는 delete 명령어가 없으므로, 원하는 키만 포함하는 새 객체를 구성하여 필드를 제거합니다:

# "name"과 "email"만 유지하고 나머지는 모두 제거
echo '{"name":"a","email":"b","password":"c"}' | dasel -i json --root '{ name, email }'

재구성을 통한 필드 이름 변경

echo '{"old_name": "value"}' | dasel -i json --root '{ "new_name": old_name }'

다단계 변환

복잡한 연산을 위해 변수 할당과 세미콜론을 사용하세요:

# 중간 결과를 변수에 저장한 후 변환
cat data.json | dasel -i json '$active = users.filter(active == true); $active.map(name)'

# 여러 변수
cat data.json | dasel -i json '$a = items.filter(price > 100); $b = $a.map(name); $b'

조건부 변환

# 조건에 따라 값 설정
cat data.json | dasel -i json --root 'if(count > 5) { status = "many" } else { status = "few" }'

변환 패턴

사용 사례별 상세 변환 패턴(설정 업데이트, 배치 처리, 형식 마이그레이션, 데이터 재구성, 오류 처리)은 변환 패턴을 참조하세요.

참고 자료

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Jamie-BitFlight/agentskill-kaizen-meta-docs

Agentskill kaizen plugin documentation index. Load when needing to read about cross-platform notes, improvement plans, or DuckDB integration.

Jamie-BitFlight/bash-51-features

Bash 5.1 release features and improvements with practical examples. Use when working with Bash 5.1 features, epoch time variables, redirection enhancements, or when user asks about Bash 5.1 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-52-features

Bash 5.2 release features and improvements with practical examples. Use when working with Bash 5.2 features, variable handling enhancements, readline improvements, or when user asks about Bash 5.2 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-53-features

Bash 5.3 release features and improvements with practical examples. Use when working with Bash 5.3 features, new command substitution, GLOBSORT, loadable builtins, or when user asks about Bash 5.3 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-development

This skill should be used when the user asks to "write a bash script", "create a shell script", "implement bash function", "parse arguments in bash", "handle errors in bash", or mentions bash development, shell scripting, script templates, or modern bash patterns.

Jamie-BitFlight/bash-lint

This skill should be used when the user asks to "lint bash script", "run shellcheck", "format shell script", "use shfmt", "fix shellcheck errors", or mentions shell script linting, formatting, code quality, or pre-commit hooks for bash.

Jamie-BitFlight/bash-logging

This skill should be used when the user asks to "add logging to bash script", "colorize output", "implement log levels", "CI/CD sections", "terminal colors in bash", or mentions logging functions, emoji output, collapsible CI sections, or shlocksmith.

Jamie-BitFlight/bash-portability

This skill should be used when the user asks about "POSIX compatibility", "portable shell scripts", "cross-shell compatibility", "bashisms", "shebang selection", or mentions writing scripts that work on different shells (bash, sh, dash, zsh) or different systems.

Jamie-BitFlight/bash-testing

This skill should be used when the user asks to "test bash script", "write shell tests", "use shunit2", "use shellspec", "create test suite for bash", or mentions unit testing, test frameworks, mocking, or test-driven development for shell scripts.

Jamie-BitFlight/brainstorming-skill

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using research-validated prompt patterns.

Jamie-BitFlight/clang-format

Configure clang-format code formatting. Use when: user mentions clang-format or .clang-format, analyzing code style/patterns, creating/modifying formatting config, troubleshooting formatting, brace styles/indentation/spacing/alignment/pointer alignment, or codifying conventions.

Jamie-BitFlight/commitlint

When setting up commit message validation for a project. When project has commitlint.config.js or .commitlintrc files. When configuring CI/CD to enforce commit format. When extracting commit rules for LLM prompt generation. When debugging commit message rejection errors.

Jamie-BitFlight/conventional-commits

When writing a git commit message. When task completes and changes need committing. When project uses semantic-release, commitizen, git-cliff. When choosing between feat/fix/chore/docs types. When indicating breaking changes. When generating changelogs from commit history.

Jamie-BitFlight/dasel-reference

Use when querying, modifying, or converting JSON, YAML, TOML, XML, CSV, HCL, or INI with dasel v3. Complete reference for selectors, functions, conditionals, variables, spread operator, type casting, and format-specific patterns.

Jamie-BitFlight/data-exploration

Use when exploring unknown structured data files with dasel v3 — discover schema, list keys, find nested values, sample arrays, identify data types across JSON, YAML, TOML, XML, CSV, HCL, INI formats

Jamie-BitFlight/delegate

Decompose substantive work into phases, dispatch each phase to a sub-agent, and adjudicate what comes back. Use whenever a request asks for implementation, investigation, a fix, a review, or any change to files — including small ones — and whenever you are about to read source or run a diagnostic yourself instead of handing it off. Also use when a report from a sub-agent needs judging, when a phase needs re-dispatching, or when a user names one instance of a pattern. Does not apply when your own prompt begins "Your ROLE_TYPE is sub-agent." — then follow references/sub-agent-contract.md instead.

Jamie-BitFlight/enterprise-hibernate-hbm

Dasel v3 query patterns for Hibernate .hbm.xml mapping files — entity-table binding, Java property-to-column extraction, one-to-many set/list/bag relationship tracing, many-to-one foreign key discovery, batch scanning across 60+ HBM files. Use when querying Hibernate ORM class mappings, extracting schema metadata from Java persistence layer, or auditing entity-column relationships in enterprise legacy codebases.

Jamie-BitFlight/enterprise-installanywhere

Dasel v3 query patterns for InstallAnywhere .iap_xml installer definitions — use when querying action sequences, discovering variables, resolving platform conditions, navigating panels, or comparing installer variants. Files are 2.5+ MB, 65,000+ lines — too large for context reads, requires structural dasel queries.

Jamie-BitFlight/enterprise-maven-pom

Dasel v3 selector patterns for Maven POM XML files — use when querying dependency versions, filtering by groupId or scope, extracting module hierarchy from parent POMs, or detecting version conflicts across enterprise multi-module Java projects. Load this skill when working with pom.xml files using dasel.

Jamie-BitFlight/enterprise-spring-xml

Dasel v3 selectors for Spring bean factory XML — use when querying any Spring ApplicationContext XML for bean discovery, dependency wiring, JMS destination mapping, property injection extraction, or cross-bean reference tracing. Load this skill before writing dasel selectors against Spring bean XML files (applicationContext.xml, *_beans.xml, spring-*.xml).

관련 스킬