json-config-loader-6-yaml-configuration-via-yq
Sub-skill of json-config-loader: 6. YAML Configuration (via yq).
Best use case
json-config-loader-6-yaml-configuration-via-yq is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of json-config-loader: 6. YAML Configuration (via yq).
Teams using json-config-loader-6-yaml-configuration-via-yq should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/6-yaml-configuration-via-yq/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How json-config-loader-6-yaml-configuration-via-yq Compares
| Feature / Agent | json-config-loader-6-yaml-configuration-via-yq | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of json-config-loader: 6. YAML Configuration (via yq).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 6. YAML Configuration (via yq)
## 6. YAML Configuration (via yq)
Parse YAML files when yq is available:
```bash
#!/bin/bash
# ABOUTME: YAML configuration parsing with yq
# ABOUTME: Falls back to jq for JSON subset of YAML
# Check for yaml parser
get_yaml_parser() {
if command -v yq &> /dev/null; then
echo "yq"
elif command -v jq &> /dev/null; then
echo "jq" # Can parse YAML's JSON subset
else
echo "none"
fi
}
# Load YAML config
load_yaml_config() {
local file="$1"
local parser
parser=$(get_yaml_parser)
if [[ ! -f "$file" ]]; then
echo "{}"
return 1
fi
case "$parser" in
yq)
yq -o=json "$file" 2>/dev/null || echo "{}"
;;
jq)
# Try to parse as JSON (YAML subset)
jq '.' "$file" 2>/dev/null || echo "{}"
;;
*)
echo "Error: No YAML parser available (install yq or jq)" >&2
echo "{}"
return 1
;;
esac
}
# Get YAML value (returns as JSON for jq processing)
yaml_get() {
local file="$1"
local path="$2"
local default="${3:-}"
local parser
parser=$(get_yaml_parser)
local value
case "$parser" in
yq)
value=$(yq -r "$path // \"$default\"" "$file" 2>/dev/null)
;;
jq)
value=$(jq -r "$path // \"$default\"" "$file" 2>/dev/null)
;;
*)
value="$default"
;;
esac
if [[ -z "$value" || "$value" == "null" ]]; then
echo "$default"
else
echo "$value"
fi
}
# Usage
CONFIG_FILE="config.yaml"
# Load entire config as JSON
CONFIG_JSON=$(load_yaml_config "$CONFIG_FILE")
# Or get specific values
DB_HOST=$(yaml_get "$CONFIG_FILE" '.database.host' 'localhost')
DB_PORT=$(yaml_get "$CONFIG_FILE" '.database.port' '5432')
echo "Database: $DB_HOST:$DB_PORT"
```Related Skills
toml-section-scoping-config-debug
Diagnose TOML config errors caused by misplaced keys in table sections
portable-config-baseline-pattern
Extract machine-agnostic settings into portable template files while keeping machine-specific hooks and plugins separate
portable-baseline-configuration-pattern
Separate portable/universal config from machine-specific settings to enable safe template reuse across environments
portable-baseline-config-pattern
Separate machine-portable baseline config from environment-specific hooks and plugins
codex-skill-loader-broken-symlink-recovery
Diagnose Codex startup failures in workspace-hub caused by a broken `.Codex/skills/skills` symlink and recover without misattributing the failure to issue scope.
orcaflex-yaml-gotchas
Production-proven OrcaFlex YAML traps and solutions covering dormant properties, boolean mismatches, section ordering, Pydantic integration, and section name aliases.
orcaflex-environment-config
Configure OrcaFlex environmental conditions including wave spectra (JONSWAP, Dean Stream), current profiles, wind loading, and seabed properties for offshore analysis.
hermes-config-audit-gotchas
Audit Hermes custom config keys and migrated skill settings safely, with verified command behavior and stale-path checks.
hermes-local-configuration
Class-level Hermes local configuration and setup workflows, including config audit gotchas and Windows installation.
yaml-workflow-executor
Execute configuration-driven analysis workflows from YAML files. Use for running analysis pipelines, data processing tasks, and automation workflows defined in YAML configuration.
mkdocs-8-plugin-configuration
Sub-skill of mkdocs: 8. Plugin Configuration (+4).
json-config-loader-5-environment-variable-configuration
Sub-skill of json-config-loader: 5. Environment Variable Configuration.