Agent skill
yaml-config
Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.
Install this agent skill to your Project
npx add-skill https://github.com/benchflow-ai/skillsbench/tree/main/tasks-no-skills/adaptive-cruise-control/environment/skills/yaml-config
SKILL.md
YAML Configuration Files
Reading YAML
Always use safe_load to prevent code execution vulnerabilities:
import yaml
with open('config.yaml', 'r') as f:
config = yaml.safe_load(f)
# Access nested values
value = config['section']['key']
Writing YAML
import yaml
data = {
'settings': {
'param1': 1.5,
'param2': 0.1
}
}
with open('output.yaml', 'w') as f:
yaml.dump(data, f, default_flow_style=False, sort_keys=False)
Options
default_flow_style=False: Use block style (readable)sort_keys=False: Preserve insertion orderallow_unicode=True: Support unicode characters
Error Handling
import yaml
try:
with open('config.yaml', 'r') as f:
config = yaml.safe_load(f)
except FileNotFoundError:
config = {} # Use defaults
except yaml.YAMLError as e:
print(f"YAML parse error: {e}")
config = {}
Optional Config Loading
import os
import yaml
def load_config(filepath, defaults=None):
"""Load config file, return defaults if missing."""
if defaults is None:
defaults = {}
if not os.path.exists(filepath):
return defaults
with open(filepath, 'r') as f:
loaded = yaml.safe_load(f) or {}
# Merge loaded values over defaults
result = defaults.copy()
result.update(loaded)
return result
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
csv-processing
Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.
pid-controller
Use this skill when implementing PID control loops for adaptive cruise control, vehicle speed regulation, throttle/brake management, or any feedback control system requiring proportional-integral-derivative control.
simulation-metrics
Use this skill when calculating control system performance metrics such as rise time, overshoot percentage, steady-state error, or settling time for evaluating simulation results.
vehicle-dynamics
Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state machines for cruise control modes.
web-interface-guidelines
Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.
browser-testing
VERIFY your changes work. Measure CLS, detect theme flicker, test visual stability, check performance. Use BEFORE and AFTER making changes to confirm fixes. Includes ready-to-run scripts: measure-cls.ts, detect-flicker.ts
Didn't find tool you were looking for?