-
Notifications
You must be signed in to change notification settings - Fork 1
PR: Frontmatter Validation – Repair Incorrect or Missing Markdown Frontmatter in Workflow Docs #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Frontmatter Validation – Repair Incorrect or Missing Markdown Frontmatter in Workflow Docs #100
Conversation
- Change 'type' to 'file_type' in all README files - Convert 'references' from string arrays to object arrays with path and description - Convert 'ai_references' and 'related_docs' to standard 'references' format - Add missing 'file_type' field where needed This fixes the frontmatter validation errors reported in PR #96. Files updated: - .github/README.md - .github/agents/README.md - .github/reporting/README.md - README.md - docs/BRANDING.md
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Frontmatter metadata standardization .github/README.md, .github/agents/README.md, .github/reporting/README.md, README.md |
Add or rename frontmatter field to file_type: "documentation" across documentation files |
References restructuring .github/README.md, .github/reporting/README.md, docs/BRANDING.md, README.md |
Transform references from flat bullet lists or simple strings to structured objects with path and description fields |
Pattern update .gitignore |
Change node_modules ignore pattern from /node_modules to node_modules/ |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
- The changes follow a consistent pattern across multiple files (metadata and reference restructuring)
- Mostly structural/formatting updates to documentation frontmatter with no runtime logic changes
- Minor verification needed for
.gitignorepattern intent and consistency
Possibly related PRs
- Create New Feature or Component #72 — Directly overlaps with relocating/updating frontmatter schema and restructuring references
- Move frontmatter schema to subfolder #58 — Introduces frontmatter schema and validator that the main PR's frontmatter changes align with
- PR: Fix failing frontmatter validation workflows #79 — Parallel frontmatter updates renaming "type" field to "file_type" in other documentation files
Suggested labels
documentation, status:needs-review
Suggested reviewers
- krugazul
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Title check | ✅ Passed | The title clearly describes the main change: repairing frontmatter in markdown documentation files, which aligns with the specific frontmatter restructuring changes across multiple README and documentation files. |
| Description check | ✅ Passed | The pull request description follows the required template structure with all major sections completed: linked issues, changelog entries (Fixed category), risk assessment (Low), testing instructions, checklist items marked complete, and references. |
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
claude/fix-frontmatter-validation-01GWUigAHTz91VYRAGYGCdqs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/BRANDING.md (1)
9-9: Quote inconsistency: single quotes infile_typefield (should be double quotes).Line 9 uses single quotes:
file_type: 'documentation', while most other files use double quotes. Standardize to double quotes for consistency and to avoid potential schema validation issues.Apply this diff:
-file_type: 'documentation' +file_type: "documentation"
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/README.md(2 hunks).github/agents/README.md(1 hunks).github/reporting/README.md(1 hunks).gitignore(1 hunks)README.md(1 hunks)docs/BRANDING.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.github/agents/**
⚙️ CodeRabbit configuration file
.github/agents/**: Prefer concise, actionable reviews. Respect documented style precedence. Link suggested fixes.
Files:
.github/agents/README.md
🪛 GitHub Actions: Frontmatter Validation
README.md
[error] 1-1: Frontmatter validation failed. /: tag "file_type" must be string {"error":"tag","tag":"file_type"}
[error] 1-1: Frontmatter validation failed. /: tag "file_type" must be string {"error":"tag","tag":"file_type"}
🔇 Additional comments (8)
.gitignore (1)
2-2: Verify.gitignorepattern change semantics and intent.The pattern changed from
/node_modules(root-only match) tonode_modules/(recursive match at any level). This changes the scope of ignored directories significantly:
- Old: Ignores only
./node_modules/in the repository root- New: Ignores
node_modules/directories at any nesting levelConfirm whether recursive matching is the intended behavior. If this repository has a monorepo structure or multiple
node_modulesdirectories at different levels, this may be correct. If not, consider reverting to/node_modules/to maintain root-only scope.If the intent is to support nested installations, this is acceptable; please confirm in the PR description.
docs/BRANDING.md (2)
12-24: References section refactoring improves structure and discoverability.The conversion from flat string paths to structured objects with
pathanddescriptionfields is well-executed. Each reference now includes helpful context. Verify that all relative paths (../references) resolve correctly in the rendered documentation context.
11-19: References section refactoring is sound; path resolution requires verification.The 4 references have been converted to structured objects with clear descriptions. The relative paths (
../,../../) appear correct for the.github/reporting/context. Verify that all paths resolve correctly in the final rendered documentation..github/README.md (2)
16-36: References section refactoring is well-executed and improves discoverability.All 11 references have been converted to structured objects with helpful descriptions. Paths appear correct and relative to the
.github/context. This is a hub file for the organization; verify that link paths resolve correctly in the rendered documentation.
5-5: No validation error found—this review comment is incorrect.After thorough verification:
- The schema file (
schemas/frontmatter/frontmatter.schema.json) does include"file_type": { "const": "documentation" }as a valid case in itsoneOfdiscriminator.github/README.mdfrontmatter contains all required fields for "documentation" type:file_typeanddescription- The syntax is correct and matches the schema definition exactly
- The validation script tests confirm "documentation" type validates successfully
- No actual validation errors, logs, or failed test outputs were found to support the claimed issue
The file structure is valid and should pass validation without errors.
Likely an incorrect or invalid review comment.
README.md (1)
9-27: References section refactoring is comprehensive and well-structured.The 9 references have been converted to informative structured objects. All paths are relative to the repository root and appear correct:
.github/paths reference configuration and instructions- Root-level paths reference governance and organizational docs
The descriptions provide helpful context for discoverability. Verify paths resolve correctly in rendered output.
.github/agents/README.md (1)
9-9: Remove review comment—no validation error exists; field change is correct.The schema at
./schemas/frontmatter.schema.jsondefinesfile_typeas a discriminator usingconstvalues. "documentation" is a valid const entry in the schema'soneOfarray, and the README.md frontmatterfile_type: "documentation"matches it exactly. The change from the oldtypefield tofile_typecorrects the field name to align with the schema discriminator. The error message "tag file_type must be string" does not appear in the validation code (./scripts/validation/validate-frontmatter.js), which uses AJV for standard JSON Schema validation. No validation failure should occur with this change.Likely an incorrect or invalid review comment.
.github/reporting/README.md (1)
9-9: All reference paths verified — frontmatter changes are valid.The addition of
file_type: 'documentation'and the restructuring of references to include descriptive objects are properly implemented. All relative paths resolve correctly within the repository structure.
| file_type: 'documentation' | ||
| category: 'docs' | ||
| references: | ||
| - '../.github/automation/badges.schema.yml' | ||
| - '../.github/automation/emoji.schema.yml' | ||
| - '../.github/automation/footers.yml' | ||
| - '../.github/automation/front-matter.schema.json' | ||
| - '../.github/workflows/branding.yml' | ||
| - '../.github/agents/branding.agent.js' | ||
| - path: '../.github/automation/badges.schema.yml' | ||
| description: 'Badge schema configuration' | ||
| - path: '../.github/automation/emoji.schema.yml' | ||
| description: 'Emoji schema configuration' | ||
| - path: '../.github/automation/footers.yml' | ||
| description: 'Footer templates configuration' | ||
| - path: '../.github/automation/front-matter.schema.json' | ||
| description: 'Frontmatter schema definition' | ||
| - path: '../.github/workflows/branding.yml' | ||
| description: 'Branding automation workflow' | ||
| - path: '../.github/agents/branding.agent.js' | ||
| description: 'Branding agent implementation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote inconsistency in frontmatter file_type field; standardize across all documentation files.
Line 10 uses single quotes: file_type: 'documentation', while other files use double quotes: file_type: "documentation". YAML accepts both, but consistency improves maintainability and may prevent schema validation issues if the validator is strict about quote style.
Standardize to double quotes across all documentation files (.github/agents/README.md, .github/README.md, .github/reporting/README.md, README.md, and docs/BRANDING.md) for consistency.
Apply this diff:
-file_type: 'documentation'
+file_type: "documentation"Alternatively, if double quotes are enforced by schema, ensure all files use them.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| file_type: 'documentation' | |
| category: 'docs' | |
| references: | |
| - '../.github/automation/badges.schema.yml' | |
| - '../.github/automation/emoji.schema.yml' | |
| - '../.github/automation/footers.yml' | |
| - '../.github/automation/front-matter.schema.json' | |
| - '../.github/workflows/branding.yml' | |
| - '../.github/agents/branding.agent.js' | |
| - path: '../.github/automation/badges.schema.yml' | |
| description: 'Badge schema configuration' | |
| - path: '../.github/automation/emoji.schema.yml' | |
| description: 'Emoji schema configuration' | |
| - path: '../.github/automation/footers.yml' | |
| description: 'Footer templates configuration' | |
| - path: '../.github/automation/front-matter.schema.json' | |
| description: 'Frontmatter schema definition' | |
| - path: '../.github/workflows/branding.yml' | |
| description: 'Branding automation workflow' | |
| - path: '../.github/agents/branding.agent.js' | |
| description: 'Branding agent implementation' | |
| file_type: "documentation" | |
| category: 'docs' | |
| references: | |
| - path: '../.github/automation/badges.schema.yml' | |
| description: 'Badge schema configuration' | |
| - path: '../.github/automation/emoji.schema.yml' | |
| description: 'Emoji schema configuration' | |
| - path: '../.github/automation/footers.yml' | |
| description: 'Footer templates configuration' | |
| - path: '../.github/automation/front-matter.schema.json' | |
| description: 'Frontmatter schema definition' | |
| - path: '../.github/workflows/branding.yml' | |
| description: 'Branding automation workflow' | |
| - path: '../.github/agents/branding.agent.js' | |
| description: 'Branding agent implementation' |
🤖 Prompt for AI Agents
In docs/BRANDING.md around lines 10 to 24 the frontmatter uses single quotes for
file_type (file_type: 'documentation'); update this to use double quotes
(file_type: "documentation") to match the project's convention and the other
listed docs (.github/agents/README.md, .github/README.md,
.github/reporting/README.md, README.md). Make the same replacement in those
files if any still use single quotes, and re-run a quick search (e.g., grep) to
ensure all documentation frontmatter file_type fields consistently use double
quotes.
| description: "Central hub for LightSpeed organization's community health files, automation standards, label management, governance documentation, and org-wide resources for GitHub usage and contribution." | ||
| version: "2.0" | ||
| last_updated: "2025-10-24" | ||
| file_type: "documentation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Frontmatter validation error on root README.md blocks merge.
Pipeline validation fails on the file_type field with error: tag "file_type" must be string. This is a critical blocker for the root repository README.
Root documentation files are essential; validation must pass before merge. The error appears across all files in this PR, suggesting a systemic schema issue rather than a per-file problem.
Required action: Inspect the frontmatter schema definition (.github/automation/front-matter.schema.json or equivalent) to determine:
- Expected type for
file_typefield (string, array, object, or enum) - Any allowed values or patterns
- Whether the schema definition needs updating or the field values need correction
Use the verification script provided in .github/agents/README.md comment to inspect the schema.
I need to verify this critical validation error claim. Let me search the codebase for the schema definition and check the actual frontmatter:
---
🏁 Script executed:
```shell
#!/bin/bash
# Find schema files related to frontmatter validation
find .github -name "*schema*" -o -name "*frontmatter*" | head -20
Length of output: 811
🏁 Script executed:
#!/bin/bash
# Check the actual README.md frontmatter (first 50 lines)
head -50 README.mdLength of output: 2951
🏁 Script executed:
#!/bin/bash
# Search for validation rules or pipeline configuration
find .github -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.json" \) | xargs grep -l "file_type" 2>/dev/null | head -10Length of output: 0
🏁 Script executed:
#!/bin/bash
# Look for any validation scripts or automation agents
find .github/agents -type f -name "*.md" -o -name "*.js" -o -name "*.ts" 2>/dev/null | head -10Length of output: 509
I need to inspect the schema definitions and validation workflow to understand the actual validation rule:
---
🏁 Script executed:
```shell
#!/bin/bash
# Inspect the frontmatter schema definitions
echo "=== /github/automation/front-matter.schema.json ==="
cat .github/automation/front-matter.schema.json | head -100
Length of output: 473
🏁 Script executed:
#!/bin/bash
# Inspect the alternative schema file
echo "=== .github/automation/schemas/frontmatter.schema.json ==="
cat .github/automation/schemas/frontmatter.schema.json | head -100Length of output: 541
🏁 Script executed:
#!/bin/bash
# Check the frontmatter validation workflow
echo "=== .github/workflows/frontmatter-validation.yml ==="
cat .github/workflows/frontmatter-validation.yml | head -80Length of output: 1990
🏁 Script executed:
#!/bin/bash
# Verify all 9 reference paths exist in the repository
echo "Checking reference paths from README.md:"
paths=(
".github/custom-instructions.md"
".github/agents/agent.md"
".github/prompts/prompts.md"
".github/chatmodes/chatmodes.md"
"AGENTS.md"
"DOCS.md"
"CONTRIBUTING.md"
"GOVERNANCE.md"
"AUTOMATION_GOVERNANCE.md"
)
for p in "${paths[@]}"; do
if [ -f "$p" ]; then
echo "✓ $p"
else
echo "✗ $p (NOT FOUND)"
fi
doneLength of output: 256
I found critical issues. Let me check the npm validation code and the frontmatter directory structure:
---
🏁 Script executed:
```shell
#!/bin/bash
# Check if schemas/frontmatter directory exists and what files are there
ls -la schemas/frontmatter/ 2>/dev/null || echo "schemas/frontmatter/ not found at root"
Length of output: 629
🏁 Script executed:
#!/bin/bash
# Look for validation code that might define file_type rules
find . -name "*.js" -o -name "*.ts" | xargs grep -l "file_type" 2>/dev/null | head -10Length of output: 323
🏁 Script executed:
#!/bin/bash
# Check if AUTOMATION_GOVERNANCE.md exists anywhere or under different paths
find . -name "*AUTOMATION*" -o -name "*governance*" -iname "*automation*" 2>/dev/null | grep -i mdLength of output: 73
🏁 Script executed:
#!/bin/bash
# Search for any reference to the missing file in the codebase
rg "AUTOMATION_GOVERNANCE" -i 2>/dev/null | head -20Length of output: 2367
Found the issue! The file exists but the reference path is wrong. Let me check the actual schema and validation logic:
---
🏁 Script executed:
```shell
#!/bin/bash
# Check the comprehensive schema in schemas/frontmatter/
echo "=== schemas/frontmatter/frontmatter.schema.json (first 200 lines) ==="
head -200 schemas/frontmatter/frontmatter.schema.json
Length of output: 9233
🏁 Script executed:
#!/bin/bash
# Check the validation code
echo "=== schemas/frontmatter/validate.js ==="
cat schemas/frontmatter/validate.js | head -150Length of output: 3935
🏁 Script executed:
#!/bin/bash
# Check the schema tests for file_type
echo "=== Check tests for file_type ==="
grep -n "file_type" schemas/frontmatter/tests/schema.test.js -C 3Length of output: 2052
Let me verify if "documentation" is a valid file_type value in the schema:
---
🏁 Script executed:
```shell
#!/bin/bash
# Search for all defined file_type const values in schema
echo "=== All file_type const values in schema ==="
grep -o '"const": "[^"]*"' schemas/frontmatter/frontmatter.schema.json | sort | uniq
Length of output: 532
🏁 Script executed:
#!/bin/bash
# Check if "documentation" is mentioned anywhere in the schema
grep -i "documentation" schemas/frontmatter/frontmatter.schema.jsonLength of output: 971
Fix broken reference path in README.md frontmatter.
The reference path "AUTOMATION_GOVERNANCE.md" (line 26) should be "./.github/automation/AUTOMATION_GOVERNANCE.md" to correctly resolve to the actual file location. The file exists but the relative path in the frontmatter references section is incorrect.
🤖 Prompt for AI Agents
In README.md around lines 6 to 6, the frontmatter reference path is
incorrect—replace "AUTOMATION_GOVERNANCE.md" with the correct relative path
"./.github/automation/AUTOMATION_GOVERNANCE.md" so the frontmatter links resolve
to the actual file location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes frontmatter formatting across markdown documentation files to ensure consistent validation and automation compliance. The changes restructure the references field from a simple list to an object format with path and description properties, add missing file_type fields, and fix a .gitignore pattern inconsistency.
Key Changes:
- Converted
referencesfrom simple string lists to structured objects withpathanddescriptionfields - Standardized field naming by replacing
typewithfile_typethroughout documentation - Updated
.gitignoreto use consistent directory pattern syntax
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/BRANDING.md | Restructured references list to object format with descriptions |
| README.md | Added missing file_type field and converted references to structured format |
| .gitignore | Changed /node_modules to node_modules/ for consistent pattern syntax |
| .github/reporting/README.md | Renamed type to file_type and restructured references list |
| .github/agents/README.md | Renamed type field to file_type |
| .github/README.md | Added file_type field and converted references to structured format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
name: "Pull Request"
about: "General changes, refactors, and maintenance"
title: "PR: Frontmatter Validation – Repair Incorrect or Missing Markdown Frontmatter in Workflow Docs"
labels: ["status:needs-review"]
General Pull Request
Linked issues
Closes #100
Changelog
Fixed
Risk Assessment
Risk Level: Low
Potential Impact:
Mitigation Steps:
How to Test
Prerequisites
Test Steps
→ Confirm frontmatter (YAML at file top) exists and is valid.
npm run lint:docsor via VSCode)→ Ensure no frontmatter errors or automation failures.
→ Confirm automation/PR validation no longer blocks merging due to frontmatter errors.
Expected Results
Edge Cases to Verify
Checklist (Global DoD / PR)
References