-
Notifications
You must be signed in to change notification settings - Fork 1
Move frontmatter schema to subfolder #58
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
Move frontmatter schema to subfolder #58
Conversation
- Create new schemas/frontmatter/ folder for better organization - Add comprehensive validation script (validate.js) using AJV - Add validation tests and example frontmatter files - Add GitHub Actions workflow for CI/CD validation - Add detailed README and migration plan documentation This prepares for moving frontmatter.schema.json to its own subfolder. The schema file itself will be moved in a subsequent commit after review. Includes: - Validation CLI tool with schema and frontmatter validation - Example files for agents, instructions, and prompts - Automated testing framework - CI/CD integration for pull request validation - Comprehensive migration plan documenting all 45+ affected files
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Workflow Configuration .github/workflows/.gitignore, .github/workflows/frontmatter-validation.yml |
Adds workflow directory ignore file to exclude validation logs and a three-job GitHub Actions workflow that validates schema structure, all frontmatter files, and changed files in PRs, with artifact uploads and PR comments on failure. |
Validation Core schemas/frontmatter/package.json, schemas/frontmatter/validate.js |
Introduces npm package manifest for @lightspeedwp/frontmatter-validator with dependencies (AJV, yaml, glob) and a Node.js validation script that loads the schema, extracts YAML frontmatter from Markdown files, and validates against JSON Schema Draft-07 with colored output and utility exports. |
Documentation schemas/frontmatter/MIGRATION.md, schemas/frontmatter/README.md |
Adds comprehensive documentation covering schema overview, project structure, validation instructions, VSCode integration, pre-commit hooks, and a detailed migration plan with rollback procedures and automated scripts for the schema path relocation. |
Examples schemas/frontmatter/examples/agent.example.md, schemas/frontmatter/examples/instruction.example.md, schemas/frontmatter/examples/prompt.example.md |
Adds three example Markdown files demonstrating frontmatter usage for security agents, REST API security instructions, and block pattern generation prompts, each with schema references and metadata. |
Tests schemas/frontmatter/tests/schema.test.js |
Introduces test suite validating schema loading, frontmatter extraction, file validation, schema structure integrity, common field definitions, and error handling with temporary file cleanup. |
Sequence Diagram(s)
sequenceDiagram
participant GHA as GitHub Actions
participant VS as validate-schema Job
participant VF as validate-frontmatter Job
participant VCF as frontmatter-changed-files Job
participant Val as validate.js
GHA->>VS: Trigger on push/PR
VS->>Val: Load schema & run schema tests
alt Schema Valid
VS-->>GHA: ✓ Pass
GHA->>VF: Trigger (depends on VS)
VF->>Val: Validate all frontmatter files
alt All Valid
VF-->>GHA: ✓ Pass
else Validation Fails
VF->>GHA: Upload validation-errors.log artifact
VF->>GHA: Post PR comment with errors
VF-->>GHA: ✗ Fail
end
else Schema Invalid
VS-->>GHA: ✗ Fail
end
GHA->>VCF: Parallel: detect changed .md files
alt Files Changed
VCF->>Val: Validate only changed files
alt Changes Valid
VCF-->>GHA: ✓ Pass
else Validation Fails
VCF->>GHA: Comment PR with change validation errors
VCF-->>GHA: ✗ Fail
end
else No .md Changes
VCF-->>GHA: ✓ Pass
end
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
- validate.js: Logic density around AJV schema loading, YAML extraction with error handling, glob pattern matching, and colored output formatting warrant careful review of error cases and edge conditions.
- frontmatter-validation.yml: Multi-job workflow with artifact uploads, PR comments, and file change detection requires verification of job dependencies, caching setup, and error handling paths.
- Documentation files: Large volume of content (migration guide with scripts, comprehensive README) benefits from verification of accuracy against implementation but is primarily textual review.
- Example files: Lower complexity but should verify schema adherence to documented types.
Possibly related PRs
- PR: Fix glob import error and refactor module import patterns #56: Modifies glob API import/usage patterns that overlap with this PR's glob-based Markdown file discovery in validate.js.
- Set up weekly frontmatter metrics workflow #54: Adds frontmatter validation tooling with AJV-based schema validation, sharing validation logic and schema file interactions.
Suggested reviewers
- krugazul
Pre-merge checks and finishing touches
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The description lacks critical required sections: no linked issues specified, changelog entries are empty placeholders, risk assessment is incomplete, and testing instructions are empty. | Complete the changelog sections (Added/Changed/Fixed/Removed) with user-facing notes, specify linked issues if applicable, fill in risk assessment details, and provide concrete testing instructions with prerequisites and expected results. | |
| Docstring Coverage | Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title 'Move frontmatter schema to subfolder' directly and specifically describes the main organizational change in the pull request. |
✨ 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/move-frontmatter-schema-folder-011CV3i3p2ybWHtcbzRPXmat
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.
|
Please check the workflow logs for details and ensure all frontmatter follows the schema at See Frontmatter Documentation for guidance. |
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 prepares for reorganizing the frontmatter schema by creating a dedicated schemas/frontmatter/ subfolder with comprehensive validation infrastructure, documentation, and CI/CD integration. The actual schema file move will occur in a subsequent commit after review.
Key Changes:
- Introduces validation CLI tool with schema and frontmatter validation capabilities
- Adds automated testing framework and CI/CD workflow for validation
- Provides example frontmatter files and detailed migration documentation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/frontmatter/validate.js | Validation CLI tool using AJV to validate schema structure and frontmatter content |
| schemas/frontmatter/tests/schema.test.js | Comprehensive test suite for schema validation functionality |
| schemas/frontmatter/package.json | Dependencies and scripts for validation tooling |
| schemas/frontmatter/examples/*.md | Example frontmatter files for agent, instruction, and prompt file types |
| schemas/frontmatter/README.md | Documentation for schema structure, usage, and validation workflows |
| schemas/frontmatter/MIGRATION.md | Detailed migration plan documenting all 45+ affected files |
| .github/workflows/frontmatter-validation.yml | GitHub Actions workflow for automated validation on push/PR |
| .github/workflows/.gitignore | Ignore patterns for workflow artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| |-------|------|-------------| | ||
| | `title` | string | Human-readable title | | ||
| | `description` | string | Brief description of purpose (required for most types) | | ||
| | `version` | string | Version string (e.g., v1.1) | |
Copilot
AI
Nov 12, 2025
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.
[nitpick] Corrected version example format from 'v1.1' to 'v1.0.0' to match the semantic versioning format used throughout the examples.
| | `version` | string | Version string (e.g., v1.1) | | |
| | `version` | string | Version string (e.g., v1.0.0) | |
| find . -name "*.js" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | ||
|
|
||
| # Update markdown files | ||
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | ||
|
|
||
| # Update YAML files | ||
| find . -name "*.yml" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | ||
| find . -name "*.yaml" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | ||
|
|
||
| # Fix broken links (schema/ -> schemas/frontmatter/) | ||
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i "s|schema/frontmatter\.schema\.json|schemas/frontmatter/frontmatter.schema.json|g" {} + | ||
|
|
Copilot
AI
Nov 12, 2025
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.
The sed -i command syntax differs between GNU sed (Linux) and BSD sed (macOS). The script will fail on macOS without the backup extension. Consider adding a note about platform compatibility or using sed -i.bak with subsequent cleanup for cross-platform support.
| find . -name "*.js" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Update markdown files | |
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Update YAML files | |
| find . -name "*.yml" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| find . -name "*.yaml" -type f -not -path "*/node_modules/*" -exec sed -i "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Fix broken links (schema/ -> schemas/frontmatter/) | |
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i "s|schema/frontmatter\.schema\.json|schemas/frontmatter/frontmatter.schema.json|g" {} + | |
| find . -name "*.js" -type f -not -path "*/node_modules/*" -exec sed -i.bak "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Update markdown files | |
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i.bak "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Update YAML files | |
| find . -name "*.yml" -type f -not -path "*/node_modules/*" -exec sed -i.bak "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| find . -name "*.yaml" -type f -not -path "*/node_modules/*" -exec sed -i.bak "s|$OLD_PATH|$NEW_PATH|g" {} + | |
| # Fix broken links (schema/ -> schemas/frontmatter/) | |
| find . -name "*.md" -type f -not -path "*/node_modules/*" -exec sed -i.bak "s|schema/frontmatter\.schema\.json|schemas/frontmatter/frontmatter.schema.json|g" {} + | |
| # Remove backup files created by sed | |
| find . -name "*.bak" -type f -delete |
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: 9
♻️ Duplicate comments (2)
schemas/frontmatter/examples/prompt.example.md (1)
2-2: Same schema path issue as instruction.example.md.The schema reference uses
"../frontmatter.schema.json". Verify this path is correct after the schema migration mentioned in the README.schemas/frontmatter/examples/agent.example.md (1)
2-2: Same schema path issue.Consistent with other example files, verify the schema path after migration.
🧹 Nitpick comments (3)
schemas/frontmatter/tests/schema.test.js (1)
23-36: Consider using Jest instead of custom test utilities.The package.json includes
jest: "^29.7.0"as a devDependency, but this test file implements a custom test runner withassertanddescribefunctions. Consider using Jest's built-in testing utilities for consistency and better IDE integration.-function assert(condition, message) { - if (condition) { - console.log(`${colors.green}✓${colors.reset} ${message}`); - testsPassed++; - } else { - console.log(`${colors.red}✗${colors.reset} ${message}`); - testsFailed++; - } -} - -function describe(description, tests) { - console.log(`\n${colors.blue}${description}${colors.reset}`); - tests(); -} +// Use Jest's built-in describe, test, and expectAlternatively, if the custom test runner is preferred, remove the unused Jest devDependency from package.json.
schemas/frontmatter/package.json (1)
1-32: LGTM! Well-structured package manifest.The package.json follows best practices:
- Clear metadata with appropriate keywords
- Proper dependency separation
- Sensible engine requirement (Node.js >=16)
- Clean script definitions
Note: The
jestdevDependency is declared but the test file (schemas/frontmatter/tests/schema.test.js) uses a custom test runner. Consider either adopting Jest in the tests or removing the unused dependency.schemas/frontmatter/MIGRATION.md (1)
25-28: Switch to UK English spellingsThe guidelines require UK English in documentation. For example, “organization” should be “organisation” (and similar occurrences elsewhere). Please update the wording accordingly. As per coding guidelines.
-**Why?** -- Better organization for related files (docs, examples, tests) +**Why?** +- Better organisation for related files (docs, examples, tests)
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
.github/workflows/.gitignore(1 hunks).github/workflows/frontmatter-validation.yml(1 hunks)schemas/frontmatter/MIGRATION.md(1 hunks)schemas/frontmatter/README.md(1 hunks)schemas/frontmatter/examples/agent.example.md(1 hunks)schemas/frontmatter/examples/instruction.example.md(1 hunks)schemas/frontmatter/examples/prompt.example.md(1 hunks)schemas/frontmatter/package.json(1 hunks)schemas/frontmatter/tests/schema.test.js(1 hunks)schemas/frontmatter/validate.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (27)
**/*.{md,mdx,markdown}
📄 CodeRabbit inference engine (.github/instructions/copilot-frontmatter.instructions.md)
**/*.{md,mdx,markdown}: Every Markdown (and template) file must start with YAML frontmatter containing: version (semantic, starting at "v0.1.0"), last_updated (UTC ISO date "YYYY-MM-DD"), owners (array of strings), file_type (string), category (string), and description (one-sentence string).
Frontmatter must be located at the very top of the file, delimited by '---' markers.
Inspect the YAML frontmatter at the top of the file before making changes.
Add or normalize the required frontmatter fields, setting sensible defaults where appropriate.
Preserve any existing frontmatter fields and their values.
Do not alter the body/content of the file when updating frontmatter.
If a field exists, do not overwrite its value unless it is outdated or incorrect.
Files:
schemas/frontmatter/examples/instruction.example.mdschemas/frontmatter/README.mdschemas/frontmatter/examples/agent.example.mdschemas/frontmatter/examples/prompt.example.mdschemas/frontmatter/MIGRATION.md
**/*.{js,ts,php,css,scss,sass,html,json,md,yml,yaml,py,sh}
📄 CodeRabbit inference engine (.github/instructions/linting.instructions.md)
Apply linting checks to all supported source and config files (JavaScript, TypeScript, PHP, CSS/SCSS/Sass, HTML, JSON, Markdown, YAML, Python, Shell).
Files:
schemas/frontmatter/examples/instruction.example.mdschemas/frontmatter/README.mdschemas/frontmatter/examples/agent.example.mdschemas/frontmatter/examples/prompt.example.mdschemas/frontmatter/validate.jsschemas/frontmatter/MIGRATION.mdschemas/frontmatter/tests/schema.test.jsschemas/frontmatter/package.json
**/*.{md,yml,yaml,json,toml}
📄 CodeRabbit inference engine (.github/instructions/naming-conventions.instructions.md)
Documentation and configuration filenames must use lowercase with hyphens (-) for spaces, except designated top-level summary/reference files
Files:
schemas/frontmatter/examples/instruction.example.mdschemas/frontmatter/README.mdschemas/frontmatter/examples/agent.example.mdschemas/frontmatter/examples/prompt.example.mdschemas/frontmatter/MIGRATION.mdschemas/frontmatter/package.json
**/*.md
📄 CodeRabbit inference engine (.github/instructions/naming-conventions.instructions.md)
Always include a canonical file_type field in YAML frontmatter of Markdown files
**/*.md: Include YAML frontmatter in all documentation Markdown files
Use UK English in documentation
Files:
schemas/frontmatter/examples/instruction.example.mdschemas/frontmatter/README.mdschemas/frontmatter/examples/agent.example.mdschemas/frontmatter/examples/prompt.example.mdschemas/frontmatter/MIGRATION.md
**/*.{html,php,md}
📄 CodeRabbit inference engine (GEMINI.md)
Use semantic, accessible markup in user-facing content
Files:
schemas/frontmatter/examples/instruction.example.mdschemas/frontmatter/README.mdschemas/frontmatter/examples/agent.example.mdschemas/frontmatter/examples/prompt.example.mdschemas/frontmatter/MIGRATION.md
{**/README*.md,docs/**/*.md}
📄 CodeRabbit inference engine (.github/instructions/footer-header-style.instructions.md)
{**/README*.md,docs/**/*.md}: All README and documentation files must end with exactly one fun footer
Footer text must be chosen from the approved variants list (or a repo-configured override)
Insert a badges block immediately below the main# Header, wrapped between<!-- BADGES-START -->and<!-- BADGES-END -->
Recommended badges to include: License, Build Status, Coverage, Contributors, Workflows
Badges may be single-line or stacked; both layouts are acceptable within the badge block
Ensure one and only one footer exists at the end of each documentation file
Files:
schemas/frontmatter/README.md
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/blocks.instructions.md)
Use @wordpress/i18n (e.g., import { __, _x, _n, sprintf } from '@wordpress/i18n') for all translatable strings in JavaScript/TypeScript
**/*.{js,jsx,ts,tsx}: Prefer ES modules over CommonJS in JavaScript/TypeScript code
Keep DOM interactions block‑editor–first and avoid jQuery
Use ES6+ features (arrow functions, destructuring, template literals)
Prefer const and let over var
Use async/await for asynchronous operations
Implement proper error handling with try/catch around async code
Use @wordpress/block-editor components when possible
Implement proper block registration and attributes
Use WordPress data stores for state management
Write descriptive function and variable names
Use JSDoc for function documentation
Minimize bundle size with tree shaking (prefer side‑effect‑free ES modules)
Use dynamic imports for code splitting
Use wp.hooks for the WordPress action/filter system
Integrate with the WordPress REST API when needed
Follow WordPress JavaScript coding standards
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/wordpress.instructions.md)
**/*.{php,js,jsx,ts,tsx}: Use proper text domain 'ai-block-theme-template' for internationalization
Wrap all user-facing strings in translation functions
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{php,html,htm,js}
📄 CodeRabbit inference engine (.github/instructions/wpcs.instructions.md)
Apply LightSpeed WordPress Accessibility rules for markup, ARIA, keyboard interactions, and color contrast
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.js
📄 CodeRabbit inference engine (.github/instructions/wpcs.instructions.md)
**/*.js: Adhere to LightSpeed WordPress JavaScript style, naming, formatting, and best practices
Use JSDoc for inline documentation and comments in JavaScript
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{php,js,jsx,css,scss}
📄 CodeRabbit inference engine (CLAUDE.md)
Follow WordPress coding standards across PHP, JS/JSX, and CSS/SCSS code
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{php,js,css}
📄 CodeRabbit inference engine (GEMINI.md)
Adhere to WordPress coding standards for PHP, JavaScript, and CSS
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{html,php,js,css}
📄 CodeRabbit inference engine (GEMINI.md)
Optimise for performance and accessibility for all user-facing code
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
**/*.{js,ts}
⚙️ CodeRabbit configuration file
**/*.{js,ts}: Review JavaScript/TypeScript for WordPress block theme:
- Ensure code is linted and follows project style guides.
- Validate use of ES modules or CommonJS as appropriate.
- Check for dead code, unused variables, and clear function naming.
- Ensure minimal JavaScript usage, following block theme best practices.
- Verify scripts enhance, not replace, native WordPress functionality.
- Check for proper script enqueueing in functions.php or block.json.
- Validate accessibility and performance optimizations.
- Ensure compatibility with WordPress script loading patterns.
- Confirm event handling, DOM manipulation, and editor/frontend compatibility.
- Check for code comments, modularity, and maintainability.
- Ensure tests are isolated and do not depend on external state.
- Check for descriptive test names and clear test structure.
Files:
schemas/frontmatter/validate.jsschemas/frontmatter/tests/schema.test.js
.github/workflows/**/*.yml
📄 CodeRabbit inference engine (.github/instructions/design-agents.instructions.md)
Integrate agents into GitHub Actions by triggering them in appropriate jobs (e.g., code review agents on pull requests)
CI must run lint, unit, and E2E tests on pull requests
Automate linting, accessibility checks, and test coverage before merge
Files:
.github/workflows/frontmatter-validation.yml
.github/workflows/**/*.{yml,yaml}
📄 CodeRabbit inference engine (.github/instructions/playwright-tests.instructions.md)
.github/workflows/**/*.{yml,yaml}: Ensure CI workflow installs dependencies and runs Playwright tests on pull requests and merges
Integrate Playwright into the CI/CD pipeline (e.g., GitHub Actions)
Files:
.github/workflows/frontmatter-validation.yml
{.github/workflows/**/*.yml,**/playwright.config.@(js|ts)}
📄 CodeRabbit inference engine (.github/instructions/testing.instructions.md)
CI should upload artifacts (videos, traces) for failing E2E runs
Files:
.github/workflows/frontmatter-validation.yml
.github/workflows/**/*.@(yml|yaml)
📄 CodeRabbit inference engine (.github/instructions/workflows.instructions.md)
.github/workflows/**/*.@(yml|yaml): Declare explicit permissions in each workflow using the permissions key; default to contents: read and only elevate when necessary
Use the concurrency key to prevent overlapping runs (e.g., concurrency: { group: '', cancel-in-progress: true })
Provide a manual trigger via workflow_dispatch and use clear, descriptive names for jobs and steps
Validate workflow syntax with actionlint locally or in CI
Include a smoke-test job that performs a minimal build or test to verify end-to-end workflow functionality
Files:
.github/workflows/frontmatter-validation.yml
{.github/workflows/**/*.@(yml|yaml),.github/actions/**/action.@(yml|yaml)}
📄 CodeRabbit inference engine (.github/instructions/workflows.instructions.md)
{.github/workflows/**/*.@(yml|yaml),.github/actions/**/action.@(yml|yaml)}: Do not pass secrets to third-party actions; use GitHub encrypted secrets and limit their scope
Cache dependencies deterministically with actions/cache using a key derived from lockfiles (e.g., package-lock.json, composer.lock)
Pin all actions to a full-length commit SHA instead of a mutable tag
Files:
.github/workflows/frontmatter-validation.yml
.github/workflows/*.{yml,yaml}
📄 CodeRabbit inference engine (GEMINI.md)
Automate linting, accessibility checks, and tests in CI before merge
Files:
.github/workflows/frontmatter-validation.yml
**/.github/workflows/*.yml
⚙️ CodeRabbit configuration file
**/.github/workflows/*.yml: Review .github workflows for CI/CD:
- Check for use of reusable workflow templates and matrix strategies.
- Validate secrets and environment variables are handled securely.
- Ensure jobs have clear names and steps are well-commented.
- Ensure workflows enforce linting, testing, and release policies.
- Validate required status checks for merges.
- Check for proper branch and path filters.
- Confirm workflows are documented, maintainable, and DRY.
- Check for agent capabilities, tool integration, and test coverage.
- Ensure agent files reference org-wide standards and indexes.
- Ensure workflows run markdownlint, test jobs, and security checks as required.
Files:
.github/workflows/frontmatter-validation.yml
**/*.{test,spec}.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/js.instructions.md)
Write unit tests for utility functions
Files:
schemas/frontmatter/tests/schema.test.js
**/*.test.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Update/add Jest unit tests as needed for changed logic
Files:
schemas/frontmatter/tests/schema.test.js
**/tests/*.*
⚙️ CodeRabbit configuration file
**/tests/*.*: Review all test files:
- Ensure valid syntax, logical structure, and clear instructions for users.
- All test files must:
- Start with a valid shebang (if applicable).
- Contain a detailed header (purpose, author, date, related files).
- Use clear, descriptive test names and logical structure.
- Include both positive and negative test cases.
- Reference the agent or feature under test.
- Be discoverable from the main agent/test index.
- Be linted and pass all style checks.
- Ensure all tests have comprehensive inline documentation.
Files:
schemas/frontmatter/tests/schema.test.js
**/*.{json,jsonc}
📄 CodeRabbit inference engine (.github/instructions/json-schema.instructions.md)
Format JSON files with Prettier or VS Code’s formatter for human readability
Files:
schemas/frontmatter/package.json
**/*.json
📄 CodeRabbit inference engine (.github/instructions/json.instructions.md)
**/*.json: Use 2-space indentation in JSON files
Do not use trailing commas in JSON
Files:
schemas/frontmatter/package.json
**/package.json
⚙️ CodeRabbit configuration file
**/package.json: Review package.json for WordPress block theme project:
- Ensure dependencies are focused on WordPress theme/plugin development.
- Check for security vulnerabilities and outdated packages.
- Ensure scripts are documented and have clear, descriptive names.
- Check for presence of postinstall, prepublish, and prepare scripts if needed.
- Validate repository, bugs, and homepage fields for open source projects.
- Validate semantic versioning and proper version pinning.
- Confirm devDependencies vs dependencies separation.
- Check for unnecessary or duplicate dependencies.
- Ensure scripts follow org standards (lint, test, build, format, env, etc.).
- Confirm presence of npm scripts for linting, formatting, testing, and CI.
- Validate package metadata (name, version, description, author, license).
Files:
schemas/frontmatter/package.json
🧬 Code graph analysis (2)
schemas/frontmatter/validate.js (1)
schemas/frontmatter/tests/schema.test.js (10)
fs(9-9)require(8-8)path(10-10)colors(13-18)validateSchemaFile(97-97)validateSchemaFile(165-165)validateSchemaFile(181-181)validateSchemaFile(194-194)result(40-40)result(114-114)
schemas/frontmatter/tests/schema.test.js (1)
schemas/frontmatter/validate.js (4)
fs(15-15)path(16-16)colors(36-43)schema(53-53)
🪛 LanguageTool
schemas/frontmatter/README.md
[uncategorized] ~19-~19: The official name of this software platform is spelled with a capital “H”.
Context: ...atter schema used across all LightSpeed .github configuration files, along with valida...
(GITHUB)
[uncategorized] ~25-~25: The official name of this software platform is spelled with a capital “H”.
Context: ...rontmatter in: - Agent specifications (.github/agents/*.agent.md) - Instructions (`.g...
(GITHUB)
[uncategorized] ~26-~26: The official name of this software platform is spelled with a capital “H”.
Context: ...hub/agents/.agent.md) - Instructions (.github/instructions/.instructions.md`) - Prom...
(GITHUB)
[uncategorized] ~27-~27: The official name of this software platform is spelled with a capital “H”.
Context: ...ructions/.instructions.md) - Prompts (.github/prompts/.prompt.md) - Chatmodes (.gi...
(GITHUB)
[uncategorized] ~28-~28: The official name of this software platform is spelled with a capital “H”.
Context: ...thub/prompts/.prompt.md) - Chatmodes (.github/chatmodes/.chatmode.md`) - Documentati...
(GITHUB)
[uncategorized] ~106-~106: The official name of this software platform is spelled with a capital “H”.
Context: ...: - agent: Agent specifications (.github/agents/*.agent.md) - **instructions*...
(GITHUB)
[uncategorized] ~107-~107: The official name of this software platform is spelled with a capital “H”.
Context: ...instructions: Instructions files (.github/instructions/*.instructions.md) - **`p...
(GITHUB)
[uncategorized] ~108-~108: The official name of this software platform is spelled with a capital “H”.
Context: ... - prompt: Prompt specifications (.github/prompts/*.prompt.md) - chatmode:...
(GITHUB)
[uncategorized] ~109-~109: The official name of this software platform is spelled with a capital “H”.
Context: ...*chatmode**: Chatmode configurations (.github/chatmodes/*.chatmode.md) - **`document...
(GITHUB)
[uncategorized] ~169-~169: The official name of this software platform is spelled with a capital “H”.
Context: ... is integrated into GitHub Actions. See .github/workflows/frontmatter-validation.yml. ...
(GITHUB)
schemas/frontmatter/MIGRATION.md
[uncategorized] ~49-~49: The official name of this software platform is spelled with a capital “H”.
Context: ...ation/README.md- Instruction files in.github/instructions/` (7 files) - Chatmode fil...
(GITHUB)
[uncategorized] ~144-~144: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ... Update Documentation Links Update all markdown links: Pattern to find: ```bash gr...
(MARKDOWN_NNP)
[uncategorized] ~182-~182: The official name of this software platform is spelled with a capital “H”.
Context: ... Phase 7: Update Workflow Files Update .github/workflows/frontmatter-metrics.yml and ...
(GITHUB)
🔇 Additional comments (10)
.github/workflows/.gitignore (1)
1-3: LGTM! Appropriate workflow artifact management.The .gitignore correctly excludes validation logs generated by the frontmatter-validation workflow, preventing them from being committed while still allowing them to be uploaded as CI artifacts.
schemas/frontmatter/tests/schema.test.js (3)
1-11: LGTM! Proper test file structure with clear header.The shebang, header documentation, and imports follow best practices for Node.js test files.
72-93: LGTM! Comprehensive frontmatter extraction tests with proper cleanup.The tests cover valid frontmatter, missing frontmatter, and invalid YAML scenarios, with appropriate temporary file cleanup.
96-162: Excellent validation test coverage.The file validation tests appropriately cover:
- Valid agent frontmatter with all required fields
- Missing required fields
- Invalid file_type values
- Valid instruction frontmatter with specific fields
.github/workflows/frontmatter-validation.yml (2)
22-48: LGTM! Well-structured validation jobs with proper dependency management.The workflow appropriately:
- Validates schema before validating files (job dependency on line 52)
- Uses consistent Node.js 20 setup with npm caching
- Uploads validation errors as artifacts on failure for debugging
Also applies to: 49-80
110-118: The review comment is incorrect; the path resolution works as intended.The workflow correctly invokes
node validate.js "../../$file"fromworking-directory: schemas/frontmatter. The validate.js script extracts this argument and resolves it to an absolute path viapath.resolve(specificFile)on line 208, which correctly navigates from the workflow's CWD to the repository root. TheextractFrontmatter()function then reads the file usingfs.readFileSync(filePath, 'utf8')with this absolute path, which works correctly.Likely an incorrect or invalid review comment.
schemas/frontmatter/README.md (2)
1-16: LGTM! Proper frontmatter structure.The README includes comprehensive frontmatter with all required fields (version, last_updated, file_type, description) plus additional metadata (title, tags, references).
21-238: Excellent comprehensive documentation.The README provides thorough coverage of:
- Schema structure and common fields with clear tables
- Installation and usage instructions
- Validation workflows (manual, CI/CD, pre-commit)
- Examples and testing guidance
- Migration notes and update procedures
- Resource links and support channels
The documentation is well-organized and will serve as an effective guide for users.
schemas/frontmatter/examples/agent.example.md (1)
15-21: I need to examine the actual file to fully verify the references. Let me check the agent.example.md file directly:Based on the verification results:
docs/SECURITY.md does not exist—but the two referenced instruction files are present.
GitHub allows SECURITY.md files in the repository's root, docs, or .github folder. The example file is referencing
docs/SECURITY.mdat line 16, which is a valid and standard location. However, since this is an example file demonstrating frontmatter structure, referencing a documentation file that may not yet exist is acceptable as part of showing the expected documentation structure. The other two referenced files (the instructions files in.github/instructions/) do exist.Create docs/SECURITY.md or update the example reference if the file is not planned.
Verify whether
docs/SECURITY.mdshould be created as part of the documentation structure. If it's not planned, update the example to reference../../../SECURITY.mdat the repository root instead, or remove this reference if security guidelines are only in the instruction files.schemas/frontmatter/examples/instruction.example.md (1)
2-2: The reference is correct—no changes needed.The
$schema: "../frontmatter.schema.json"reference is accurate. The schema file is located atschemas/frontmatter.schema.json(verified), and the relative path correctly resolves fromschemas/frontmatter/examples/instruction.example.mdto that location.The README describes a planned migration to move the schema to
schemas/frontmatter/frontmatter.schema.json, but this migration has not yet been executed—the schema remains at its current location. Once the migration is completed as a separate initiative, the reference in this file should be updated accordingly, but that update is not required now.Likely an incorrect or invalid review comment.
| --- | ||
| name: Frontmatter Validation | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| - 'claude/**' | ||
| paths: | ||
| - '**.md' | ||
| - 'schemas/frontmatter/**' | ||
| - '.github/workflows/frontmatter-validation.yml' | ||
| pull_request: | ||
| paths: | ||
| - '**.md' | ||
| - 'schemas/frontmatter/**' | ||
| - '.github/workflows/frontmatter-validation.yml' | ||
| workflow_dispatch: | ||
|
|
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.
Add explicit permissions and concurrency controls.
The workflow is missing two critical GitHub Actions best practices:
- Explicit permissions: Add a top-level
permissionskey to follow the principle of least privilege - Concurrency controls: Add a
concurrencykey to prevent overlapping runs and save CI resources
As per coding guidelines, apply this diff:
---
name: Frontmatter Validation
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
on:
push:📝 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.
| --- | |
| name: Frontmatter Validation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - 'claude/**' | |
| paths: | |
| - '**.md' | |
| - 'schemas/frontmatter/**' | |
| - '.github/workflows/frontmatter-validation.yml' | |
| pull_request: | |
| paths: | |
| - '**.md' | |
| - 'schemas/frontmatter/**' | |
| - '.github/workflows/frontmatter-validation.yml' | |
| workflow_dispatch: | |
| --- | |
| name: Frontmatter Validation | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - 'claude/**' | |
| paths: | |
| - '**.md' | |
| - 'schemas/frontmatter/**' | |
| - '.github/workflows/frontmatter-validation.yml' | |
| pull_request: | |
| paths: | |
| - '**.md' | |
| - 'schemas/frontmatter/**' | |
| - '.github/workflows/frontmatter-validation.yml' | |
| workflow_dispatch: |
🤖 Prompt for AI Agents
In .github/workflows/frontmatter-validation.yml around lines 1 to 20, the
workflow lacks top-level permissions and concurrency settings; add a top-level
permissions block (e.g., permissions: contents: read) to follow least-privilege
and a concurrency block to avoid overlapping runs (e.g., concurrency: group: ${{
github.workflow }}-${{ github.ref }} cancel-in-progress: true), placing both
keys at the top level (immediately after the name: line and before the on:
block).
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
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.
Pin actions to commit SHAs instead of mutable tags.
The workflow uses mutable version tags (@v4) for actions, which can be updated and potentially introduce supply-chain vulnerabilities. Pin all actions to full-length commit SHAs.
As per coding guidelines, find the commit SHAs for these versions and pin them:
#!/bin/bash
# Find latest commit SHAs for the actions in use
echo "=== actions/checkout@v4 ==="
gh api repos/actions/checkout/git/ref/tags/v4 | jq -r '.object.sha'
echo "=== actions/setup-node@v4 ==="
gh api repos/actions/setup-node/git/ref/tags/v4 | jq -r '.object.sha'
echo "=== actions/upload-artifact@v4 ==="
gh api repos/actions/upload-artifact/git/ref/tags/v4 | jq -r '.object.sha'
echo "=== tj-actions/changed-files@v44 ==="
gh api repos/tj-actions/changed-files/git/ref/tags/v44 | jq -r '.object.sha'
echo "=== actions/github-script@v7 ==="
gh api repos/actions/github-script/git/ref/tags/v7 | jq -r '.object.sha'Also applies to: 56-56, 88-88
🤖 Prompt for AI Agents
.github/workflows/frontmatter-validation.yml lines 28, 56 and 88: the workflow
currently uses mutable tags like actions/checkout@v4; replace each action
reference with the corresponding full-length commit SHA to pin the dependency
and avoid supply-chain drift — look up the latest commit SHA for each tag (e.g.,
via the GitHub API or gh CLI for actions/checkout@v4, actions/setup-node@v4,
actions/upload-artifact@v4, tj-actions/changed-files@v44,
actions/github-script@v7) and update the workflow to use the full 40-character
commit SHA instead of the @v* tag in each uses: line, commit the change, and
verify the workflow runs correctly.
| references: | ||
| - path: "../../docs/SECURITY.md" | ||
| description: "Main security documentation" | ||
| - path: "./coding-standards.instructions.md" | ||
| description: "WordPress coding standards" | ||
| - path: "../frontmatter.schema.json" | ||
| description: "Frontmatter schema definition" |
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
Verify referenced file paths exist.
The frontmatter references several files that may not exist yet:
../../docs/SECURITY.md(line 18)./coding-standards.instructions.md(line 20)
Ensure these files exist or are planned, especially since this is an example file that may be used as a template.
🏁 Script executed:
#!/bin/bash
# Check if referenced files exist
echo "Checking referenced files:"
for file in "docs/SECURITY.md" "schemas/frontmatter/examples/coding-standards.instructions.md"; do
if [ -f "$file" ]; then
echo "✓ Found: $file"
else
echo "✗ Missing: $file"
fi
doneLength of output: 127
---
🏁 Script executed:
```shell
#!/bin/bash
# Check the third referenced file and understand context
echo "Checking third reference:"
if [ -f "schemas/frontmatter/frontmatter.schema.json" ]; then
echo "✓ Found: schemas/frontmatter/frontmatter.schema.json"
else
echo "✗ Missing: schemas/frontmatter/frontmatter.schema.json"
fi
echo ""
echo "Directory structure of schemas/frontmatter/:"
find schemas/frontmatter -type f -name "*.md" -o -name "*.json" | head -20
echo ""
echo "Checking if referenced files are mentioned elsewhere:"
rg -i "SECURITY\.md|coding-standards" --type=md --type=json --type=yaml
Length of output: 18715
Correct the reference paths—all three are invalid relative to the example file location.
The paths in instruction.example.md do not resolve correctly from schemas/frontmatter/examples/. Verify against agent.example.md (which uses correct paths):
- Line 18:
../../docs/SECURITY.mdshould be../../SECURITY.md(SECURITY.md is at repository root, not under docs/) - Line 20:
./coding-standards.instructions.mdshould be../../.github/instructions/coding-standards.instructions.md(file is in .github/instructions/, not same directory as example) - Line 22:
../frontmatter.schema.jsonshould be../../frontmatter.schema.json(schema file is at repository root, not parent directory)
🤖 Prompt for AI Agents
In schemas/frontmatter/examples/instruction.example.md around lines 17 to 23,
the three reference paths are incorrect for this file's location; update line 18
from "../../docs/SECURITY.md" to "../../SECURITY.md", update line 20 from
"./coding-standards.instructions.md" to
"../../.github/instructions/coding-standards.instructions.md", and update line
22 from "../frontmatter.schema.json" to "../../frontmatter.schema.json" so each
path correctly resolves from schemas/frontmatter/examples/.
| references: | ||
| - path: "../../docs/BLOCK-PATTERNS.md" | ||
| description: "Block patterns documentation" | ||
| - path: "../../.github/instructions/pattern-development.instructions.md" | ||
| description: "Pattern development guidelines" | ||
| - path: "../frontmatter.schema.json" | ||
| description: "Frontmatter schema definition" |
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
Verify referenced documentation files exist.
The frontmatter references files that may not exist:
../../docs/BLOCK-PATTERNS.md(line 16)../../.github/instructions/pattern-development.instructions.md(line 18)
Since this is an example file, ensure referenced documentation is available or use placeholder references that clearly indicate they are examples.
🏁 Script executed:
#!/bin/bash
# Check if referenced files exist
echo "Checking referenced files:"
for file in "docs/BLOCK-PATTERNS.md" ".github/instructions/pattern-development.instructions.md"; do
if [ -f "$file" ]; then
echo "✓ Found: $file"
else
echo "✗ Missing: $file"
fi
doneLength of output: 126
---
🏁 Script executed:
```shell
#!/bin/bash
# Check the third referenced file
echo "Checking third reference:"
if [ -f "schemas/frontmatter/frontmatter.schema.json" ]; then
echo "✓ Found: schemas/frontmatter/frontmatter.schema.json"
else
echo "✗ Missing: schemas/frontmatter/frontmatter.schema.json"
fi
# Also check if BLOCK-PATTERNS.md exists elsewhere
echo ""
echo "Searching for BLOCK-PATTERNS.md:"
find . -name "*BLOCK-PATTERNS*" -type f 2>/dev/null | head -20
Length of output: 114
Update example references to use paths that exist in the repository.
The example file contains three documentation references, but two are missing:
docs/BLOCK-PATTERNS.md— does not exist (no matches found in repository).github/instructions/pattern-development.instructions.md— exists ✓schemas/frontmatter/frontmatter.schema.json— does not exist
Since this is an example file, users copying it will encounter broken references. Replace the missing paths with real documentation files that exist in the repository, or clearly mark them as placeholder examples.
| @@ -0,0 +1,375 @@ | |||
| --- | |||
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.
Rename migration doc to comply with naming conventions
Documentation files must use lowercase hyphenated names; MIGRATION.md breaks that rule. Please rename the file to migration.md (and update references) so it satisfies the repository constraints. As per coding guidelines.
🤖 Prompt for AI Agents
In schemas/frontmatter/MIGRATION.md at lines 1-1 the filename uses uppercase and
violates the repo's lowercase hyphenated naming convention; rename the file to
migration.md and update all references (README links, docs, imports, CI paths,
and any tooling configs) to point to the new lowercase filename so the repo and
tooling continue to work.
| --- | ||
| title: 'Frontmatter Schema Migration Plan' | ||
| description: 'Step-by-step plan for moving frontmatter.schema.json to its own subfolder with validation' | ||
| version: 'v1.0' | ||
| last_updated: '2025-11-12' | ||
| file_type: 'documentation' | ||
| tags: ['migration', 'schema', 'refactoring'] | ||
| references: | ||
| - path: './README.md' | ||
| description: 'Frontmatter schema documentation' | ||
| - path: '../../docs/DOCUMENTATION_AUDIT.md' | ||
| description: 'Documentation audit that recommended this change' | ||
| --- |
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.
Complete required YAML frontmatter metadata
The doc frontmatter is missing required fields (owners, category) and the version value isn’t semantic (v1.0 vs. v1.0.0). Please add the missing metadata and normalise the version so the file passes automated checks. As per coding guidelines.
-title: 'Frontmatter Schema Migration Plan'
-description: 'Step-by-step plan for moving frontmatter.schema.json to its own subfolder with validation'
-version: 'v1.0'
+title: 'Frontmatter Schema Migration Plan'
+description: 'Step-by-step plan for moving frontmatter.schema.json to its own subfolder with validation'
+version: 'v1.0.0'
last_updated: '2025-11-12'
file_type: 'documentation'
+category: 'migration'
+owners:
+ - REPLACE_WITH_PRIMARY_OWNER
tags: ['migration', 'schema', 'refactoring']📝 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.
| --- | |
| title: 'Frontmatter Schema Migration Plan' | |
| description: 'Step-by-step plan for moving frontmatter.schema.json to its own subfolder with validation' | |
| version: 'v1.0' | |
| last_updated: '2025-11-12' | |
| file_type: 'documentation' | |
| tags: ['migration', 'schema', 'refactoring'] | |
| references: | |
| - path: './README.md' | |
| description: 'Frontmatter schema documentation' | |
| - path: '../../docs/DOCUMENTATION_AUDIT.md' | |
| description: 'Documentation audit that recommended this change' | |
| --- | |
| --- | |
| title: 'Frontmatter Schema Migration Plan' | |
| description: 'Step-by-step plan for moving frontmatter.schema.json to its own subfolder with validation' | |
| version: 'v1.0.0' | |
| last_updated: '2025-11-12' | |
| file_type: 'documentation' | |
| category: 'migration' | |
| owners: | |
| - REPLACE_WITH_PRIMARY_OWNER | |
| tags: ['migration', 'schema', 'refactoring'] | |
| references: | |
| - path: './README.md' | |
| description: 'Frontmatter schema documentation' | |
| - path: '../../docs/DOCUMENTATION_AUDIT.md' | |
| description: 'Documentation audit that recommended this change' | |
| --- |
🤖 Prompt for AI Agents
In schemas/frontmatter/MIGRATION.md around lines 1 to 13, the YAML frontmatter
is missing required fields and uses a non-semantic version; add the required
owners (array of strings or objects) and category (string) keys to the
frontmatter and change version from "v1.0" to a proper semver like "1.0.0" (or
"v1.0.0" only if your linter allows a leading "v"), ensure the new fields follow
existing frontmatter formatting (quotes where used, correct indentation), and
run the repository frontmatter validation to confirm the file now passes
automated checks.
| # Frontmatter Schema | ||
|
|
||
| This folder contains the unified frontmatter schema used across all LightSpeed `.github` configuration files, along with validation tools, examples, and 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.
🛠️ Refactor suggestion | 🟠 Major
Add badges block after the main header.
As per coding guidelines for README files, insert a badges block immediately after the # Frontmatter Schema header using <!-- BADGES-START --> and <!-- BADGES-END --> markers.
Apply this diff:
# Frontmatter Schema
+<!-- BADGES-START -->
+[](https://opensource.org/licenses/MIT)
+[](https://nodejs.org)
+[](https://github.com/lightspeedwp/.github/actions)
+<!-- BADGES-END -->
+
This folder contains the unified frontmatter schema used across all LightSpeed `.github` configuration files, along with validation tools, examples, and documentation.Based on coding guidelines.
📝 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.
| # Frontmatter Schema | |
| This folder contains the unified frontmatter schema used across all LightSpeed `.github` configuration files, along with validation tools, examples, and documentation. | |
| # Frontmatter Schema | |
| <!-- BADGES-START --> | |
| [](https://opensource.org/licenses/MIT) | |
| [](https://nodejs.org) | |
| [](https://github.com/lightspeedwp/.github/actions) | |
| <!-- BADGES-END --> | |
| This folder contains the unified frontmatter schema used across all LightSpeed `.github` configuration files, along with validation tools, examples, and documentation. |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~19-~19: The official name of this software platform is spelled with a capital “H”.
Context: ...atter schema used across all LightSpeed .github configuration files, along with valida...
(GITHUB)
🤖 Prompt for AI Agents
In schemas/frontmatter/README.md around lines 17 to 20, the README is missing a
badges block immediately after the main header; insert a badges placeholder
block directly after the `# Frontmatter Schema` header using the exact markers
`<!-- BADGES-START -->` and `<!-- BADGES-END -->` with whatever badge markdown
(or an empty placeholder) between them so CI/linting can populate badges later.
|
|
||
| **Maintainer**: LightSpeed Team | ||
| **Last Updated**: 2025-11-12 | ||
| **Version**: 1.0 |
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.
🛠️ Refactor suggestion | 🟠 Major
Add required fun footer to README.
As per coding guidelines, all README and documentation files must end with exactly one fun footer chosen from approved variants.
Add a fun footer at the end of the file:
---
_Made with ❤️ by the LightSpeed Team_Based on coding guidelines.
🤖 Prompt for AI Agents
In schemas/frontmatter/README.md around lines 240 to 243, the file is missing
the required fun footer; append the exact approved footer at the very end of the
file: add a horizontal rule line (---) followed by a single blank line then the
line "_Made with ❤️ by the LightSpeed Team_" so the file ends with exactly that
footer; ensure there are no duplicate footers or extra trailing blank lines.
| // Exit with appropriate code | ||
| if (results.invalid.length > 0 || results.errors.length > 0) { | ||
| console.error(`${colors.red}✗ Validation failed!${colors.reset}`); | ||
| process.exit(1); | ||
| } else { | ||
| console.log(`${colors.green}✓ All validations passed!${colors.reset}`); | ||
| process.exit(0); | ||
| } |
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.
Fail validation when frontmatter is missing
Files in the monitored directories are required to carry frontmatter. Currently, no-frontmatter results are reported but don’t fail the run, so CI will pass even when required metadata is absent. Please fail the process when any file lacks frontmatter to enforce the policy.
- if (results.invalid.length > 0 || results.errors.length > 0) {
+ if (
+ results.invalid.length > 0 ||
+ results.errors.length > 0 ||
+ results.noFrontmatter.length > 0
+ ) {
console.error(`${colors.red}✗ Validation failed!${colors.reset}`);
process.exit(1);
} else {
console.log(`${colors.green}✓ All validations passed!${colors.reset}`);
process.exit(0);📝 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.
| // Exit with appropriate code | |
| if (results.invalid.length > 0 || results.errors.length > 0) { | |
| console.error(`${colors.red}✗ Validation failed!${colors.reset}`); | |
| process.exit(1); | |
| } else { | |
| console.log(`${colors.green}✓ All validations passed!${colors.reset}`); | |
| process.exit(0); | |
| } | |
| // Exit with appropriate code | |
| if ( | |
| results.invalid.length > 0 || | |
| results.errors.length > 0 || | |
| results.noFrontmatter.length > 0 | |
| ) { | |
| console.error(`${colors.red}✗ Validation failed!${colors.reset}`); | |
| process.exit(1); | |
| } else { | |
| console.log(`${colors.green}✓ All validations passed!${colors.reset}`); | |
| process.exit(0); | |
| } |
🤖 Prompt for AI Agents
In schemas/frontmatter/validate.js around lines 256 to 263, the script currently
only fails when results.invalid or results.errors have entries but does not fail
when files are reported with missing frontmatter; update the exit condition to
also consider the frontmatter-missing results (e.g. check results.noFrontmatter
or results['no-frontmatter'] depending on how the results object is shaped) so
that if that count > 0 the process logs the failure and exits with code 1; keep
the existing success path otherwise.
name: "Pull Request"
about: "General changes, refactors, and maintenance"
title: "PR: Move frontmatter schema to subfolder"
labels: ["status:needs-review"]
General Pull Request
This prepares for moving frontmatter.schema.json to its own subfolder. The schema file itself will be moved in a subsequent commit after review.
Includes:
Linked issues
Closes #
Changelog
Added
schemas/frontmatter/subfolder to organize JSON schema files for frontmatter formats.validate.jsleveraging AJV for schema and example validation.agent,instructions, andprompttypes as templates and fixtures.README.mdin theschemas/frontmatter/folder with usage documentation and migration plan.Changed
frontmatter.schema.jsonfrom the repo root toschemas/frontmatter/for improved maintainability (actual move will be in a subsequent commit after review).Fixed
Removed
Risk Assessment
Risk Level:
Potential Impact:
Mitigation Steps:
How to Test
Prerequisites
Test Steps
Expected Results
Edge Cases to Verify
Checklist (Global DoD / PR)
References
Summary by CodeRabbit
New Features
Documentation
Tests
Chores