360 Secure SkillHub
360 安全技能中心

Yamlcheck

这是一款面向开发者的YAML工具,核心功能包括校验YAML语法并输出文档信息、将YAML转成格式化JSON、检查缩进/空格等风格问题、列出顶层键及类型预览。典型场景如验证docker-compose文件、转换配置格式、规范Ansible剧本风格等。需依赖Python3,可选安装PyYAML实现完整解析,无PyYAML时仍可通过基础检查工作,输入为YAML文件,输出为命令行结果。

bytesagain1
bytesagain1
热度 67.05
最近更新 2026-05-11 17:31:53
分类:开发依赖:代码执行 / 读写文件应用场景:文件转换 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add yamlcheck
Metadata
name
YAMLCheck
description
Validate YAML syntax using python3, lint configs, and convert YAML to JSON. Use when checking syntax, finding errors, or converting formats.
version
3.0.2
author
BytesAgain
homepage
https://bytesagain.com
source
https://github.com/bytesagain/ai-skills
tags
["yaml","validator","lint","formatter","json","developer"]
categories
["Developer Tools","Utility"]

YAMLCheck

A real YAML validator and toolkit. Check syntax, convert YAML to JSON, lint for style issues, and list top-level keys. Uses PyYAML when available, falls back to basic parsing when not.

Commands

Command Description
yamlcheck validate <file> Validate YAML syntax — reports document count, types, key counts, file size. Falls back to basic tab/colon checks without PyYAML
yamlcheck to-json <file> Convert YAML to formatted JSON output. Handles multi-document YAML files
yamlcheck lint <file> Check for common style issues: tabs, trailing whitespace, Windows line endings, odd indentation, missing spaces after colons, long lines
yamlcheck keys <file> List top-level keys with types and value previews

Requirements

  • python3 (required)
  • PyYAML (optional — enables full parsing; install with pip3 install pyyaml)

Without PyYAML, the tool still works but uses basic regex-based checks instead of full YAML parsing.

Examples

# Validate a docker-compose file
yamlcheck validate docker-compose.yml

# Convert YAML config to JSON
yamlcheck to-json values.yaml

# Check for style issues
yamlcheck lint playbook.yml

# See what keys are defined
yamlcheck keys config.yaml