data-processing by 0xdarkmatter/claude-mods
npx skills add https://github.com/0xdarkmatter/claude-mods --skill data-processing从命令行高效地查询、筛选和转换结构化数据(JSON、YAML、TOML)。
| 工具 | 命令 | 用途 |
|---|---|---|
| jq | jq '.key' file.json | JSON 处理 |
| yq | yq '.key' file.yaml | YAML/TOML 处理 |
# 提取单个字段
jq '.name' package.json
# 提取嵌套字段
jq '.scripts.build' package.json
# 从数组中提取
jq '.dependencies[0]' package.json
# 提取多个字段
jq '{name, version}' package.json
# 深度嵌套导航
jq '.data.users[0].profile.email' response.json
# 按条件筛选
jq '.users[] | select(.active == true)' data.json
# 转换每个元素
jq '.users | map({id, name})' data.json
# 统计元素数量
jq '.users | length' data.json
# 原始字符串输出
jq -r '.name' package.json
# 提取字段
yq '.name' config.yaml
# 提取嵌套字段
yq '.services.web.image' docker-compose.yml
# 列出所有键
yq 'keys' config.yaml
# 列出所有服务名称(Docker Compose)
yq '.services | keys' docker-compose.yml
# 获取容器镜像(K8s)
yq '.spec.template.spec.containers[].image' deployment.yaml
# 更新值(原地)
yq -i '.version = "2.0.0"' config.yaml
# TOML 转 JSON
yq -p toml -o json '.' config.toml
Query, filter, and transform structured data (JSON, YAML, TOML) efficiently from the command line.
| Tool | Command | Use For |
|---|---|---|
| jq | jq '.key' file.json | JSON processing |
| yq | yq '.key' file.yaml | YAML/TOML processing |
# Extract single field
jq '.name' package.json
# Extract nested field
jq '.scripts.build' package.json
# Extract from array
jq '.dependencies[0]' package.json
# Extract multiple fields
jq '{name, version}' package.json
# Navigate deeply nested
jq '.data.users[0].profile.email' response.json
# Filter by condition
jq '.users[] | select(.active == true)' data.json
# Transform each element
jq '.users | map({id, name})' data.json
# Count elements
jq '.users | length' data.json
# Raw string output
jq -r '.name' package.json
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 任务 | jq | yq |
|---|---|---|
| 获取字段 | jq '.key' | yq '.key' |
| 数组元素 | jq '.[0]' | yq '.[0]' |
| 筛选数组 | `jq '.[] | select(.x)'` |
| 转换 | jq 'map(.x)' | yq 'map(.x)' |
| 计数 | jq 'length' | yq 'length' |
| 键 | jq 'keys' | yq 'keys' |
| 美化打印 | jq '.' | yq '.' |
| 紧凑格式 | jq -c | yq -o json -I0 |
| 原始输出 | jq -r | yq -r |
| 原地编辑 | - | yq -i |
如需完整的模式库,请加载:
./references/jq-patterns.md - 数组、筛选、转换、聚合、输出格式化./references/yq-patterns.md - Docker Compose、K8s、GitHub Actions、TOML、YAML 修改./references/config-files.md - package.json、tsconfig、eslint/prettier 模式每周安装次数
18
代码仓库
GitHub 星标数
8
首次出现
2026年1月24日
安全审计
安装于
claude-code16
codex16
opencode16
gemini-cli15
cursor13
antigravity12
# Extract field
yq '.name' config.yaml
# Extract nested
yq '.services.web.image' docker-compose.yml
# List all keys
yq 'keys' config.yaml
# List all service names (Docker Compose)
yq '.services | keys' docker-compose.yml
# Get container images (K8s)
yq '.spec.template.spec.containers[].image' deployment.yaml
# Update value (in-place)
yq -i '.version = "2.0.0"' config.yaml
# TOML to JSON
yq -p toml -o json '.' config.toml
| Task | jq | yq |
|---|---|---|
| Get field | jq '.key' | yq '.key' |
| Array element | jq '.[0]' | yq '.[0]' |
| Filter array | `jq '.[] | select(.x)'` |
| Transform | jq 'map(.x)' | yq 'map(.x)' |
| Count | jq 'length' | yq 'length' |
| Keys | jq 'keys' | yq 'keys' |
| Pretty print | jq '.' | yq '.' |
| Compact | jq -c | yq -o json -I0 |
| Raw output | jq -r | yq -r |
| In-place edit | - | yq -i |
For complete pattern libraries, load:
./references/jq-patterns.md - Arrays, filtering, transformation, aggregation, output formatting./references/yq-patterns.md - Docker Compose, K8s, GitHub Actions, TOML, YAML modification./references/config-files.md - package.json, tsconfig, eslint/prettier patternsWeekly Installs
18
Repository
GitHub Stars
8
First Seen
Jan 24, 2026
Security Audits
Installed on
claude-code16
codex16
opencode16
gemini-cli15
cursor13
antigravity12
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装