home / skills / chen19007 / my_skills / skill-metadata-check

skill-metadata-check skill

/skill-metadata-check

This skill helps you validate and report YAML frontmatter integrity in SKILL.md files across a project, ensuring name and description are correct.

npx playbooks add skill chen19007/my_skills --skill skill-metadata-check

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
849 B
---
name: skill-metadata-check
description: 检查 SKILL.md 的 YAML 元数据是否可解析、是否包含 name/description,避免元数据问题影响加载。
---

# Skill 元数据检查

## 作用

批量检查目录内所有 `SKILL.md` 的 YAML 头部:
- 是否存在 frontmatter 分隔符
- YAML 是否可解析
- 是否包含 `name` / `description`
- `name` / `description` 类型是否为字符串

## 使用方式

1. 进入技能根目录后运行脚本。
2. 查看每个 `SKILL.md` 的检查结果。

## 脚本

- `scripts/check_skill_metadata_yaml.py`

## 执行示例

```bash
python {SKILL目录}/scripts/check_skill_metadata_yaml.py
```

## 输出说明

- `yaml_parse: ok` 表示 YAML 可解析
- `required_fields: ok` 表示包含 `name`/`description`
- 发现 `fail` 或 `missing` 时需要修复对应文件的 YAML 头部

Overview

This skill scans skill content files for YAML frontmatter issues to prevent metadata problems from breaking skill loading. It validates the presence and parseability of frontmatter and ensures required fields exist with correct types. Results point to files needing fixes so maintainers can repair metadata quickly.

How this skill works

The tool walks a skill directory and inspects each file that contains YAML frontmatter. It checks for frontmatter delimiters, attempts to parse the YAML, and verifies presence and string type for the required name and description fields. The script prints a concise status per file indicating parse success and field completeness.

When to use it

  • Before publishing or deploying skill bundles
  • As part of a CI pipeline to catch metadata regressions
  • When onboarding new skills to ensure consistent metadata
  • After bulk edits or automated refactors that may affect frontmatter

Best practices

  • Run the checker from the skill root so all files are discovered
  • Fix any file marked as missing or fail before merging changes
  • Keep name and description concise and human-readable strings
  • Integrate the script into pre-commit hooks or CI jobs for early feedback
  • Use consistent frontmatter delimiters and YAML linting to reduce false positives

Example use cases

  • Validate all skill content files in a codebase prior to release
  • Automate metadata checks in continuous integration to prevent load-time errors
  • Audit a collection of skills after a bulk content migration to find broken frontmatter
  • Train new contributors by showing which files need a name and description

FAQ

What exactly does a fail status mean?

A fail indicates the YAML frontmatter could not be parsed or is malformed and needs correction.

Which fields are required by the checker?

The checker requires a name and a description field, and both must be strings.