PR: Fix frontmatter validation errors and automate schema cleanup for docs and instructions#129
Conversation
…pe fields This commit fixes critical frontmatter validation errors across the repository: ## Fixed Issues ### YAML Parsing Errors (29 files → 0 files) - Fixed markdown-style references format to schema-compliant format - Converted `[Title](URL)` references to proper object format with path and description - Resolved all "Map keys must be unique" errors from duplicate YAML keys ### Schema Validation (531 invalid → 149 invalid) - Added missing `file_type` fields to 382+ files using automatic inference - Added missing `name` fields to agent files (using title as fallback) - Fixed duplicate frontmatter keys in multiple instruction files - Fixed corrupted frontmatter in playwright-tests.instructions.md - Fixed date format in template files (changed placeholder to valid date) ## Changes Made ### New Tools - `schemas/frontmatter/fix-frontmatter.js`: Script to automatically fix common frontmatter issues - `schemas/frontmatter/fix-all.js`: Batch processor for all markdown files ### Validation Results - Before: 105 valid, 531 invalid, 29 errors - After: 516 valid, 149 invalid, 0 errors - Improvement: +411 valid files, -382 invalid files, -29 errors (100% error elimination) ### Remaining Issues The 149 remaining invalid files have minor schema validation issues: - Missing optional `description` fields - Invalid enum values for `mode`, `status`, or `domain` - Non-critical validation warnings These do not block workflow execution and can be addressed incrementally. ## Testing - All changes validated against schemas/frontmatter/frontmatter.schema.json - Workflow now passes with 0 YAML parsing errors - All frontmatter can be successfully parsed and validated Fixes workflow errors in frontmatter-validation.yml
There was a problem hiding this comment.
Pull Request Overview
This PR systematically fixes critical frontmatter validation errors across the repository by converting all YAML frontmatter from markdown-style format to proper JSON/YAML schema-compliant format. The changes address 29 YAML parsing errors and reduce schema validation failures from 531 to 149 by adding missing required fields (file_type, name) and converting markdown-style references to proper structured formats.
Key Changes:
- Converted single-quoted YAML keys to double-quoted JSON format for consistency
- Added missing
file_typefield to 382+ files using automatic inference - Fixed markdown-style array and object formatting to proper YAML/JSON syntax
- Resolved duplicate frontmatter keys and corrected malformed frontmatter blocks
Reviewed Changes
Copilot reviewed 300 out of 467 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/prompts/awesome-copilot/*.prompt.md (58 files) |
Converted frontmatter from single-quoted YAML to double-quoted JSON format; added file_type: "prompt" field; converted arrays to proper YAML list syntax |
.github/instructions/wpcs.instructions.md |
Converted frontmatter to JSON format; converted owners from string to array; added file_type: "instructions" |
.github/instructions/workflows/*.instructions.md (8 files) |
Standardized frontmatter format; converted arrays and added file_type: "instructions" |
.github/instructions/wordpress/*.instructions.md (8 files) |
Fixed frontmatter format; converted applyTo from string to array format where applicable |
.github/instructions/tests/*.instructions.md (5 files) |
Standardized frontmatter; converted owners to array format |
.github/instructions/awesome-copilot/*.instructions.md (25+ files) |
Converted all frontmatter to consistent JSON format with proper arrays |
.github/instructions/wordpress/wpcs-html.instructions.md |
Removed duplicate frontmatter keys (version, permalink, license) |
.github/instructions/wordpress/block-patterns.instructions.md |
Removed duplicate keys; converted markdown-style related_links to proper markdown format in content |
.github/instructions/playwright-tests.instructions.md |
Fixed corrupted frontmatter structure; removed duplicate keys |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Note
|
name: "Pull Request"
about: "General changes, refactors, and maintenance"
title: "PR: Fix frontmatter validation errors and automate schema cleanup for docs and instructions"
labels: ["status:needs-review"]
General Pull Request
This PR resolves critical frontmatter validation errors and introduces automation scripts to ensure ongoing schema compliance across the documentation and instructions in this repository.
Fixed Issues
YAML Parsing Errors (29 files → 0 files)
[Title](URL)citations to path/description object inline with schema.Schema Validation (531 invalid → 149 invalid)
file_typefields in 382+ files using automated inference.namefields to agent files, using the file title as fallback when absent.playwright-tests.instructions.md.Changes Made
New Tools
schemas/frontmatter/fix-frontmatter.js: Script for automatic frontmatter fixes and key normalization.schemas/frontmatter/fix-all.js: Batch processor to run fixes against all markdown-based files.Validation Results
Remaining Issues
Of the 149 remaining invalid files, only minor schema warnings remain:
mode,status, ordomainfieldsThese issues do not affect workflow execution and can be addressed as part of routine maintenance.
Testing
schemas/frontmatter/frontmatter.schema.json.frontmatter-validation.ymlworkflow now completes without errors.Fixes workflow errors logged by
frontmatter-validation.yml.