MCPcopy
hub / github.com/agentskills/agentskills / validate_cmd

Function validate_cmd

skills-ref/src/skills_ref/cli.py:29–50  ·  view source on GitHub ↗

Validate a skill directory. Checks that the skill has a valid SKILL.md with proper frontmatter, correct naming conventions, and required fields. Exit codes: 0: Valid skill 1: Validation errors found

(skill_path: Path)

Source from the content-addressed store, hash-verified

27@main.command("validate")
28@click.argument("skill_path", type=click.Path(exists=True, path_type=Path))
29def validate_cmd(skill_path: Path):
30 """Validate a skill directory.
31
32 Checks that the skill has a valid SKILL.md with proper frontmatter,
33 correct naming conventions, and required fields.
34
35 Exit codes:
36 0: Valid skill
37 1: Validation errors found
38 """
39 if _is_skill_md_file(skill_path):
40 skill_path = skill_path.parent
41
42 errors = validate(skill_path)
43
44 if errors:
45 click.echo(f"Validation failed for {skill_path}:", err=True)
46 for error in errors:
47 click.echo(f" - {error}", err=True)
48 sys.exit(1)
49 else:
50 click.echo(f"Valid skill: {skill_path}")
51
52
53@main.command("read-properties")

Callers

nothing calls this directly

Calls 2

_is_skill_md_fileFunction · 0.85
validateFunction · 0.85

Tested by

no test coverage detected