Skip to content

feat(scripts): Update skill validator to support Python skill structure #892

@WilliamBerryiii

Description

@WilliamBerryiii

Summary

The skill validator (Validate-SkillStructure.ps1) does not recognize Python skill conventions. It treats Python package directories as unrecognized subdirectories (triggering warnings) and flags .py files in scripts/ without companion .ps1 or .sh files as errors. These are structural blockers that must be resolved before a Python skill can pass validation.

Context

Validate-SkillStructure.ps1 (500+ lines) enforces a recognized directory list:

$RecognizedSubdirectories = @('scripts', 'references', 'assets', 'examples', 'tests')

Python skills add directories not on this list (e.g., powerpoint_skill/ as a Python package directory). The validator also expects script files to include at least one .ps1 or .sh file, which conflicts with pure-Python skills that only have .py files in scripts/.

This is a structural blocker for the Python build system series. Without these changes, the skill validator fails on any Python-containing skill, breaking npm run validate:skills and CI validation.

Changes Required

File Change
scripts/collections/Validate-SkillStructure.ps1 Detect pyproject.toml and switch to language-aware validation mode
scripts/collections/Validate-SkillStructure.ps1 Accept Python package directories when a pyproject.toml is present
scripts/collections/Validate-SkillStructure.ps1 Accept .py-only scripts/ directories for Python skills

The validator should detect the presence of pyproject.toml in a skill root directory and apply Python-aware rules:

  • Python package directories (containing __init__.py) are valid subdirectories
  • .py files in scripts/ do not require companion .ps1/.sh files
  • Standard Python project files (pyproject.toml, uv.lock, .python-version) are recognized
  • Existing validation for non-Python skills remains unchanged

Acceptance Criteria

  • Skills with pyproject.toml pass validation without false warnings about unrecognized directories
  • Python package directories (with __init__.py) are accepted as valid subdirectories
  • .py files in scripts/ are valid without requiring .ps1/.sh companion files for Python skills
  • pyproject.toml, uv.lock, and .python-version are recognized as valid skill root files
  • Non-Python skills continue to be validated with existing rules (no regressions)
  • npm run validate:skills passes with the PowerPoint skill from PR feat(skills): add PowerPoint automation skill with YAML-driven deck generation #868

Dependencies

Related

Metadata

Metadata

Labels

infrastructureRepository infrastructure and toolingskillsCopilot skill packages (SKILL.md)

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions