Validate with read-only queries before in-place edits.
Use explicit paths for targeted updates.
Confirm tool variant expectations (Go yq syntax).
Common Pitfalls
Multiple yq implementations use different syntax.
-i modifies files directly and should be reviewed with git diff.
Broad expressions can unintentionally reshape unrelated sections.
Output Interpretation
YAML output by default.
-o json outputs JSON for downstream tooling.
-P pretty-prints YAML from any supported input.
Why It Matters For Agents
yq gives precise config manipulation without brittle regex edits.
It complements jq for non-JSON configuration ecosystems.
Repo Conventions
Use yq for focused config changes, not full-file rewrites.
Keep workflow edits minimal and reviewable.
Trigger Examples
Should trigger: "Change a YAML workflow key without touching other lines."
Should trigger: "Read the matrix entries from this CI config."
Should not trigger: "Search all source files for a plain text token."
1---2name: tool-yq-23description: tool-yq4---5# tool-yq67## When To Use89- Query and update YAML config files safely.10- Convert between YAML and JSON formats in pipelines.11- Merge and reshape config fragments without manual text editing.1213## Trusted Commands1415```bash16yq '.spec.replicas' file.yaml17yq -o json file.yaml18yq -P file.json19yq -i '.version = "2.0"' file.yaml20yq eval-all 'select(fi == 0) * select(fi == 1)' a.yaml b.yaml21```2223## Safe Defaults2425- Validate with read-only queries before in-place edits.26- Use explicit paths for targeted updates.27- Confirm tool variant expectations (Go yq syntax).2829## Common Pitfalls3031- Multiple yq implementations use different syntax.32- `-i` modifies files directly and should be reviewed with git diff.33- Broad expressions can unintentionally reshape unrelated sections.3435## Output Interpretation3637- YAML output by default.38- `-o json` outputs JSON for downstream tooling.39- `-P` pretty-prints YAML from any supported input.4041## Why It Matters For Agents4243- yq gives precise config manipulation without brittle regex edits.44- It complements jq for non-JSON configuration ecosystems.4546## Repo Conventions4748- Use yq for focused config changes, not full-file rewrites.49- Keep workflow edits minimal and reviewable.5051## Trigger Examples5253- Should trigger: "Change a YAML workflow key without touching other lines."54- Should trigger: "Read the matrix entries from this CI config."55- Should not trigger: "Search all source files for a plain text token."
Run npx skillmds@latest add niksavis/tool-yq-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
tool-yq It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
niksavis (@niksavis) published this skill. Their other Agent Skills are listed on their SkillMD profile.