New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Structured data tools (jq, yq, dasel, qsv) that replace grep, sed, and awk on JSON, YAML, TOML, XML, and CSV.

GitHub stars
92
View on GitHub

What it does

  • Adds a data-tools skill that teaches the agent which parser to use for each structured format
  • Covers jq, yq, dasel, qsv, and mlr for querying, filtering, converting, and editing structured files
  • Enforces a PreToolUse hook that denies grep, sed, or awk on structured files and explains the correct tool
  • Designed for projects that edit API responses, CI configs, and data pipelines in JSON, YAML, or CSV

Structured data manipulation with jq, yq, dasel, and qsv. Teaches agents to use proper tools instead of grep/sed/awk on JSON, YAML, TOML, XML, and CSV files. Includes cookbook patterns for API responses, CI configs, and data pipelines.

Add marketplace

/plugin marketplace add netresearch/claude-code-marketplace

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install data-tools@netresearch-claude-code-marketplace

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Data Tools Skill

Critical Rule

NEVER use grep, sed, awk, or inline interpreters (python3 -c, node -e) on JSON, JSONL, YAML, TOML, XML, or CSV. Refuse and use the correct tool — text tools break on structure; inline scripts are verbose and fragile.


Key Patterns

For the general legacy-tool → modern-tool comparison (grep→rg, find→fd, cat→bat, ...), see the cli-tools skill's table.

Convert: dasel -w FORMAT or yq -o FORMAT.

jq -- JSON (no in-place)

jq -r '.version' package.json
jq '.users[] | select(.role == "admin") | .name' users.json
jq -s '.[0] * .[1]' base.json override.json

Or gh --jq when the source is the GitHub CLI (see below) — no separate jq process needed.

yq -- YAML

yq '.services.web.image' docker-compose.yml
yq '.jobs[].name' .gitlab-ci.yml
yq -o json config.yml

dasel -- TOML (only native tool) / XML (or xmlstarlet for XPath) / Universal auto-detect

dasel -f Cargo.toml '.package.version'
dasel -f pyproject.toml '.project.dependencies'
dasel -f input.json -w yaml

qsv -- CSV / TSV

qsv headers data.csv && qsv stats data.csv --everything | qsv table
qsv search -s status "active" users.csv | qsv select name,email
qsv join user_id orders.csv id users.csv

qsv index, stats and frequency write files next to the input (x.csv.idx, x.stats.csv*). In a repository or a package directory, run them on a copy (details).

mlr -- JSONL / multi-format / DSL (in-place -I)

mlr --c2j cat data.csv
mlr --jsonl filter '$level == "error"' logs.jsonl
mlr -I --csv put '$total = $qty * $price' orders.csv

GitHub CLI -- always --jq

gh api repos/owner/repo/releases/latest --jq '.tag_name'
gh pr list --json number,title --jq '.[] | [.number, .title] | @tsv'

Editing an existing file

A serializer writes the whole document back in its own formatting: indentation, blank lines, key order, quoting. jq … > file.json, yq -i, dasel put -f and a script's json.dump() or yaml.dump() all do that, so a one-value change to a hand-maintained file becomes a full-file diff.

  1. Find the value with the parser: yq '.services.app.image' docker-compose.yml.
  2. Change that line with an exact-match edit (editor or edit tool), not by re-emitting the file.
  3. Parse the file again (jq empty f.json, yq '.' f.yml > /dev/null) and check the diff is the size you meant: git diff --numstat -- <file>.

The plugin's hook denies the shell forms yq -i, jq/yq/dasel … > file.json|yaml|toml and sponge into such a file (details); it does not see dasel put -f or a script's json.dump(). A file with no hand-maintained formatting (a generated lock or cache) may be re-emitted whole: put DATA_TOOLS_REWRITE_OK=1 in that command.


Anti-Patterns

# BAD → GOOD: jq -r '.version' package.json
grep '"version"' package.json | sed 's/.*"\(.*\)".*/\1/'
# BAD → GOOD: locate with yq '.services.app.image', then edit that one line
sed -i 's/image: node:.*/image: node:20/' docker-compose.yml
# BAD → GOOD: qsv select 2 data.csv
awk -F',' '{print $2}' data.csv
# BAD → GOOD: jq -r '.version' plugin.json
python3 -c 'import json;print(json.load(open("plugin.json"))["version"])'

References

CookbookContent
jq CookbookFiltering, transforms, GitHub CLI, large inputs ("Argument list too long", Windows)
yq CookbookActions, Compose, K8s
dasel CookbookTOML/XML, conversion
CSV Processingqsv workflows, joins
mlr CookbookJSONL, DSL, stats, joins
Enforcement HookPreToolUse gate shipped with this plugin: denies field extraction and serializer write-back, warns once otherwise

Docs: jq, yq, dasel, qsv, mlr.

Readme

data-tools-skill

AI agent skill for structured data manipulation. Teaches agents when and how to use dedicated tools instead of fragile text processing (grep/sed/awk) on structured formats.

Tools Covered

ToolFormatUse Case
jqJSONQuery, filter, transform JSON data
yqYAMLEdit CI configs, docker-compose, K8s manifests
daselJSON/YAML/TOML/XMLUniversal selector, format conversion
qsvCSV/TSVFast data exploration, filtering, analysis
mlrCSV/TSV/JSON/JSONL/PPRINT/XTAB/NIDXName-indexed records, DSL stats/joins, in-place edits

Core Principle

Never use grep, sed, or awk on JSON, YAML, TOML, XML, or CSV data. These tools treat structured data as flat text and break on multi-line values, nested structures, quoted strings, and encoding differences.

Installation

Marketplace (Recommended)

Add the Netresearch marketplace once, then browse and install skills:

# Claude Code
/plugin marketplace add netresearch/claude-code-marketplace
/plugin install data-tools@netresearch-claude-code-marketplace

Without a marketplace

Since Claude Code 2.1.157 a plugin directory under your personal skills directory loads on its own, including the hooks this repo ships:

mkdir -p ~/.claude/skills
git clone https://github.com/netresearch/data-tools-skill.git \
  ~/.claude/skills/data-tools

It loads as data-tools@skills-dir on the next session. Update with git -C ~/.claude/skills/data-tools pull and start a new session; remove it by deleting the directory. This route has no claude plugin update.

npx (skills.sh)

Install with any Agent Skills-compatible agent:

npx skills add https://github.com/netresearch/data-tools-skill --skill data-tools

Limitation: npx skills installs SKILL.md-based skills only. This repo also ships hooks, which it does not install — use the marketplace or the skills directory for those.

Download Release

Download the latest release and extract to your agent's skills directory.

Git Clone

git clone https://github.com/netresearch/data-tools-skill.git

Composer (PHP Projects)

composer require netresearch/data-tools-skill

Requires netresearch/composer-agent-skill-plugin.

npm (Node Projects)

npm install --save-dev \
  @netresearch/agent-skill-coordinator \
  github:netresearch/data-tools-skill

Requires @netresearch/agent-skill-coordinator, which discovers the skill in node_modules and registers it in AGENTS.md via a postinstall hook. For pnpm, also allowlist the coordinator's postinstall:

{
  "pnpm": {
    "onlyBuiltDependencies": ["@netresearch/agent-skill-coordinator"]
  }
}

Structure

skills/data-tools/
  SKILL.md                       # Main skill file (tool selection, patterns, anti-patterns)
  references/
    jq-cookbook.md                # Comprehensive jq patterns
    yq-cookbook.md                # YAML manipulation patterns
    dasel-cookbook.md             # TOML/XML/universal selector patterns
    csv-processing.md            # qsv workflows and recipes
    mlr-cookbook.md               # Miller for JSONL, DSL, stats, joins
    enforcement-hook.md           # What the PreToolUse gate denies and lets through
hooks/hooks.json                  # Registers the PreToolUse gate for the Bash tool
scripts/
  pre_bash_structured_warn.py     # The gate (Python, standard library only)
  test_pre_bash_structured_warn.py  # Its behavioural tests

The components and the hook's data flow are described in docs/ARCHITECTURE.md.

Contributing

Contributions follow the Netresearch contributing guide. pre-commit run --all-files runs the Skill Validation linters locally, stricter than CI: markdownlint checks every Markdown file (CI: the root files), and ShellCheck runs at its default style severity on every file pre-commit identifies as shell, .envrc and Build/hooks/pre-push included (CI: error, on *.sh files only). pre-commit install --install-hooks installs them as a commit hook, but pre-commit refuses while core.hooksPath is set, which .envrc does (it points git at Build/hooks); direnv users run the linters by hand instead.

Tests

The behavioural tests of the PreToolUse hook need Python 3.11 or later, which uv run --python 3.11 provides:

uv run --python 3.11 python scripts/test_pre_bash_structured_warn.py
  • The script runs scripts/pre_bash_structured_warn.py as a subprocess with a hook payload per case and compares the result. It covers the deny cases (serializer rewrites, also with a | or ; inside the quoted filter and with the input arriving through <, a pipe, a variable or an extensionless file, field extraction from files and from gh/glab API responses, either one inside a command substitution in an echo argument or a commit message), the commands that must pass (a new document that reads no structured file — built with jq -n/yq -n or piped from an API —, count and presence greps, cosmetic grep -n | sed, prose in PR bodies, commit messages and quoted heredocs, output already parsed by --jq, a non-structured file fetched through a raw-content endpoint, a CI job log, a structured name that is only the argument of a script run, grep's pattern, or an --exclude of a whole structured type), the one-time warnings and their once-per-session deduplication, that a deny is never deduplicated, that a session id cannot steer the state file out of the temp directory, and that the hook answers within its timeout on long backslash runs and on 100 KB commands of repeated words.
  • Each case prints one line: OK or FEHL, the case name, the expected (erwartet) and the actual (erhalten) result. The last line is ---- Fehlschlaege: N, the number of failing cases; the script exits 1 when N is not 0.
  • When it finishes, the script deletes every data-tools-hook-seen-* file in the system temp directory, so warnings already shown in a running session appear once more.

In CI, the Skill Tests workflow (.github/workflows/tests.yml) runs the script on every pull request and on pushes to main.

A pull request that changes what the hook denies, warns about or lets through adds a case to scripts/test_pre_bash_structured_warn.py that fails without the change.

Governance and policies

This repository follows the Netresearch organisation policies:

  • Governance: ownership, roles, how decisions are made and disputes resolved, and continuity.
  • Roadmap: planned and explicitly excluded work for the coming year.
  • Handling of dependency and code analysis findings: thresholds, deadlines and the exception process for dependency (SCA) and static analysis (SAST) findings.
  • Secret management: how CI and release credentials are stored, accessed and rotated.
  • Access roster: who holds administrative access to this repository and the organisation.

The security assurance case for this skill (threat model, trust boundaries, countermeasures and limits) is in docs/SECURITY-ASSURANCE.md.

Checks that run on pull requests in this repository:

  • Every pull request: Skill Validation (lint.yml: skill structure, manifest sync, markdownlint, yamllint, actionlint, JSON syntax, version parity, ShellCheck, ruff), Eval Validation (eval-validate.yml) and Skill Tests (tests.yml).
  • Pull requests to main: security.yml with Betterleaks (secret scanning), zizmor (workflow static analysis), dependency review (fails on vulnerabilities of severity high or above), Composer Audit and Opengrep SAST (failure threshold: organisation SAST rule); Harness Verification (harness-verify.yml) and Template Drift (check-template-drift.yml).

License

This project uses split licensing:

  • Code (scripts, workflows, configs): MIT
  • Content (skill definitions, documentation, references): CC-BY-SA-4.0

See the individual license files for full terms.

Details

Marketplace
netresearch/claude-code-marketplace
Source
netresearch/data-tools-skill
Category
Development
Listed since
Apr 7, 2026

More from netresearch/claude-code-marketplace

All 41

Similar to data-tools

More CLI & Terminal