一键导入
yq
yq is a YAML processor. Use this skill when reading, modifying, or querying YAML files from the command line.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
yq is a YAML processor. Use this skill when reading, modifying, or querying YAML files from the command line.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Interactive playtest — full-stack (UI + Playwright + UX Designer) or headless (API-only + Python driver). Coordinates cross-workspace bug reporting via ping-pong file with FIXER.
LLM cost and cache forensics — reconcile server-log narrator costs against the Anthropic Admin API, attribute per-model spend, detect dead caching and invisible callers. Use when analyzing API costs, auditing cache efficiency, or when the Console bill doesn't match expectations.
Create epic or story context documents. Reads sprint YAML for epic/story data, reads context-schema.yaml for required sections, populates templates, and writes output to sprint/context/. Epic context is a single-agent operation (no tandem). Story context uses PM + tandem partner for domain-specific observations.
Jira CLI commands for sprint management. Use when viewing, assigning, or updating Jira issues from the command line.
Sprint status, backlog, and story management for Pennyfarthing. Use when checking current sprint status, finding available stories, reviewing backlog, or understanding story context and history. IMPORTANT: Always use `pf sprint` CLI commands - never manually edit sprint YAML.
List available workflows, show current workflow details, and switch workflows mid-session. Use when checking available workflow types (TDD, trivial, agent-docs), viewing current workflow phase, switching to a different workflow pattern, or managing BikeLane stepped workflows.
| name | yq |
| description | yq is a YAML processor. Use this skill when reading, modifying, or querying YAML files from the command line. |
yq is a lightweight and portable command-line YAML processor. It's like jq but for YAML. This skill covers the mikefarah/yq version (v4+).
# macOS
brew install yq
# Check version (should be v4+)
yq --version
# Read a top-level key
yq '.theme' config.yaml
# Output: discworld
# Read nested value
yq '.agents.sm.character' personas.yaml
# Output: Captain Carrot Ironfoundersson
# Read with default if missing
yq '.missing // "default"' config.yaml
# Output: default
# Get all properties of a key
yq '.agents.sm' personas.yaml
# Output: the entire sm object as YAML
# Output as JSON
yq -o json '.agents.sm' personas.yaml
# Returns "true" or "false"
yq '.agents.sm | has("helper")' personas.yaml
# Returns null if doesn't exist
yq '.agents.missing' personas.yaml
# Output: null
# Edit file in place
yq -i '.theme = "startrek"' config.yaml
# Add a new key
yq -i '.newkey = "value"' config.yaml
# Delete a key
yq -i 'del(.unwanted)' config.yaml
# Modify and output to stdout (file unchanged)
yq '.count = 42' config.yaml
# Pipe to new file
yq '.theme = "newtheme"' config.yaml > new-config.yaml
# List all items
yq '.stories[]' sprint.yaml
# Get specific field from each item
yq '.stories[].title' sprint.yaml
# Filter items
yq '.stories[] | select(.status == "in-progress")' sprint.yaml
# Get all agent names
yq '.agents | keys' personas.yaml
# Output:
# - sm
# - tea
# - dev
# - reviewer
# Iterate with key-value
yq '.agents | to_entries | .[] | .key + ": " + .value.character' personas.yaml
# Merge two YAML files (second overwrites first)
yq '. *= load("overrides.yaml")' base.yaml
# Merge specific key
yq '.agents.sm *= load("sm-overrides.yaml")' personas.yaml
# Export as shell variables
eval $(yq -o shell '.database' config.yaml)
# Creates: $host, $port, $name
# Specific format
yq '.theme' config.yaml | xargs -I{} echo "THEME={}"
# Select specific document (0-indexed)
yq 'select(document_index == 0)' multi.yaml
# Process all documents
yq '... | select(has("kind"))' k8s-manifests.yaml
# Uppercase
yq '.name | upcase' config.yaml
# String contains
yq '.agents | to_entries | .[] | select(.value.style | contains("honest"))' personas.yaml
# String interpolation
yq '"Theme is: " + .theme' config.yaml
# If-then-else
yq 'if .count > 10 then "many" else "few" end' config.yaml
# Select with condition
yq '.stories[] | select(.points >= 5)' sprint.yaml
# Null coalescing
yq '.optional // "default"' config.yaml
# YAML (default)
yq '.data' file.yaml
# JSON
yq -o json '.data' file.yaml
# Properties format
yq -o props '.data' file.yaml
# CSV (for arrays)
yq -o csv '.items' file.yaml
# Get current theme
yq '.theme' .claude/persona-config.yaml
# Get agent persona
THEME=$(yq '.theme' .claude/persona-config.yaml)
yq ".agents.sm" personas/themes/${THEME}.yaml
# Get current sprint stories
yq '.stories[] | select(.status == "todo")' sprint/current-sprint.yaml
# Count stories by status
yq '[.stories[].status] | group_by(.) | map({(.[0]): length}) | add' sprint/current-sprint.yaml
# Update status in YAML frontmatter (if using YAML)
yq -i '.status = "in-progress"' .session/current_work.yaml
| Action | Command |
|---|---|
| Read value | yq '.key' file.yaml |
| Read nested | yq '.parent.child' file.yaml |
| Set value | yq -i '.key = "value"' file.yaml |
| Delete key | yq -i 'del(.key)' file.yaml |
| Array length | `yq '.array |
| Filter array | yq '.array[] | select(.field == "value")' file.yaml |
| Output JSON | yq -o json '.' file.yaml |
| Merge files | yq '. *= load("other.yaml")' base.yaml |
| Default value | yq '.key // "default"' file.yaml |
The key doesn't exist. Use // "default" for fallback:
yq '.missing // "not found"' file.yaml
yq preserves YAML formatting. Use -r (raw) for unquoted strings:
yq -r '.theme' config.yaml
YAML booleans (true/false) are parsed as booleans. Compare accordingly:
# CORRECT
yq '.enabled == true' config.yaml
# WRONG (comparing to string)
yq '.enabled == "true"' config.yaml