Agent skill
jq
This skill should be used when the user asks to "get the version from package.json", "what dependencies are in this project", "extract field from JSON", "check tsconfig settings", "parse API response", "get scripts from package.json", or when needing specific fields from JSON files without loading the entire file.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/jq
SKILL.md
jq: JSON Query Tool
Extract specific fields from JSON files without reading entire contents into context.
When to Use
Use jq when:
- Need specific field(s) from JSON config
- File is large (>50 lines) and only need subset
- Querying nested structures
- Working with package.json, tsconfig.json, lock files, API responses
Just use Read when:
- File is small (<50 lines)
- Need to understand overall structure
- Making edits (need full context anyway)
Common Files
package.json- dependencies, scripts, versiontsconfig.json- compiler optionspackage-lock.json- locked versions*.jsonAPI responses.eslintrc.json,prettierrc.json- tool configs
Quick Reference
# Get specific field
jq -r '.version' package.json
jq -r '.name' package.json
# Get nested field
jq -r '.dependencies.react' package.json
jq -r '.compilerOptions.target' tsconfig.json
# Get all keys
jq -r '.scripts | keys[]' package.json
jq -r '.dependencies | keys[]' package.json
# Get multiple fields
jq '{name, version}' package.json
# Filter array
jq '.items[] | select(.active == true)' data.json
# Count items
jq '.dependencies | length' package.json
package.json Patterns
# Version
jq -r '.version' package.json
# All scripts
jq '.scripts' package.json
# Specific script
jq -r '.scripts.build' package.json
# All dependencies (names only)
jq -r '.dependencies | keys[]' package.json
# Dependency version
jq -r '.dependencies["lodash"]' package.json
# Dev dependencies
jq -r '.devDependencies | keys[]' package.json
tsconfig.json Patterns
# Target
jq -r '.compilerOptions.target' tsconfig.json
# All compiler options
jq '.compilerOptions' tsconfig.json
# Include paths
jq '.include' tsconfig.json
# Strict mode
jq -r '.compilerOptions.strict' tsconfig.json
API Response Patterns
# Get data array
jq '.data' response.json
# First item
jq '.data[0]' response.json
# Pluck field from all items
jq '.data[].name' response.json
# Filter by condition
jq '.data[] | select(.status == "active")' response.json
# Count results
jq '.data | length' response.json
Core Principle
Extract exactly what's needed in one command. Saves 80-95% context vs reading entire JSON files.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?