Skip to content

Conversation

ashleyshaw
Copy link
Member

Pull Request: Add Copilot Docs and Instruction Files

Description

This pull request introduces new documentation and Copilot instruction files to the repository. It includes agent guides, markdown standards, accessibility, performance, and security best practices, aiming to improve onboarding, code quality, and contributor guidance.

Related Issue: Fixes #[issue-number] (replace with actual issue number)

Type of Change

  • 📝 Documentation update (content changes, new guidance)
  • ✨ New feature (new instruction sets, agent personas, substantial content)

Quality Gate Checklist

  • Linked Issue referenced above
  • Clear test/verification steps provided below
  • Changes respect existing file structure and conventions
  • No secrets or sensitive data included in changes
  • Accessibility considerations (semantic markup, clear language, contrast)
  • Performance impact considered (no obvious regressions, efficient examples)
  • Security considerations (safe code examples, proper escaping/sanitisation)
  • i18n: user‑facing strings properly wrapped/explained (where applicable)
  • Documentation updated (README/CHANGELOG/inline docs) if needed
  • UK English spelling normalised (npm run lang:en-gb applied if broad changes)
  • WordPress-first context provided (hooks, filters, theme.json where relevant)
  • Links and cross-references verified as functional
  • Generated catalogues updated (npm run build) if catalogue changes made
  • Agent persona structure follows conventions (if applicable)
  • Changes align with coding standards in coding-standards/

Testing Instructions

  1. Run npm run build and verify no unexpected diffs.
  2. Check that new links and cross-references resolve correctly.
  3. Review documentation for accessibility, security, and performance compliance.

Screenshots (if applicable)

N/A

Changelog Entry

Category: Added

Entry: Added Copilot agent documentation, markdown standards, and best practice instruction files for accessibility, performance, and security.

Additional Context

This update is part of ongoing efforts to improve contributor experience and code quality. No breaking changes are introduced.


By submitting this pull request, I confirm that my contribution abides by the repository governance and will be licensed under the GPL-3.0-only licence.

- Introduced JSON schema for wp-env configuration files.
- Established accessibility guidelines based on WCAG 2.2 AA.
- Documented alignment decisions and matrix for coding practices.
- Outlined standards for block development and inline documentation.
- Created checklists for accessibility, performance, PRs, releases, and security.
- Compiled common standards for PHP, JS, CSS, HTML, and documentation.
- Defined CSS standards including BEM naming and fluid typography.
- Added examples for blocks, CSS, HTML, JS, and PHP.
- Specified theme.json guidelines for token definitions and formatting.
- Implemented tooling documentation for CI, EditorConfig, ESLint, PHPCS, Stylelint, and WooCommerce guidelines.
- Implemented `lint-agents.js` to validate AGENTS.md and AGENT.md files structure.
- Created `migrate-copilot-extensions.js` to rename legacy asset extensions to new plural forms, with deprecation stubs for legacy files.
- Added a backup for the YAML parser in `yaml-parser-backup.js`.
- Updated `.prettierignore` to exclude additional files and directories from formatting.
- Introduced a new Stylelint configuration in `.stylelintrc copy.json` and linked it in `stylelint.config.js`.
- Configured Webpack with multiple entry points for CSS and JS files, utilizing `RemoveEmptyScriptsPlugin` to clean up empty scripts.
…unctionalities, including accessibility review, lint fixing, block generation, and BEM refactoring. Update workspace settings for improved development experience.
- Removed stylelint configuration and related linting scripts from package.json.
- Deleted webpack.config.js as it is no longer needed.
- Added a new WordPress documentation specialist agent for inline documentation.
- Introduced an interactive chat mode for generating and reviewing WordPress documentation.
- Created comprehensive instructions for WordPress inline documentation standards.
- Added a prompt for generating WordPress-compliant inline documentation for PHP and JavaScript.
- Updated package.json to remove stylelint dependencies and adjust linting scripts accordingly.
Copy link

coderabbitai bot commented Sep 25, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

101 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 reviews.review_status to false in the CodeRabbit configuration file.

Warning

.coderabbit.yml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid enum value. Expected 'chill' | 'assertive', received 'balanced' at "reviews.profile"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-docs-copilot-files

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member Author

@ashleyshaw ashleyshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lightspeed team,

Please review the newly added documentation and Copilot instruction files in this branch. These updates include agent guides, markdown standards, and best practices for accessibility, performance, and security.

Kindly check each file for accuracy, clarity, and compliance with our coding standards. Pay special attention to accessibility, security, and WordPress-specific guidance. Feedback and suggestions for improvement are welcome.

Thank you!
Ash

Copy link

@Copilot Copilot AI left a 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 pull request adds comprehensive coding standards and linting improvements for WordPress development, introducing new Copilot documentation assets and instruction files to improve onboarding, code quality, and contributor guidance. The changes focus on establishing consistent documentation standards, AI-assisted development workflows, and quality gates for WordPress block themes and plugins.

Key changes include:

  • Addition of WordPress inline documentation Copilot assets following official coding standards
  • Enhanced VS Code configuration with proper file associations for plural extensions
  • Repository cleanup removing unnecessary build tool configurations

Reviewed Changes

Copilot reviewed 206 out of 741 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs-unified/ai-copilot/prompts/*.md New WordPress-specific prompts for block patterns, Gutenberg blocks, theme.json configuration, and accessibility auditing
.github/prompts/*.prompts.md WordPress inline documentation generator and various development prompts
.vscode/settings.json Enhanced file associations for plural extensions and improved MCP server configuration
.github/scripts/*.js Updated build scripts with support for new file extensions and improved collection validation
Configuration files Cleanup of unnecessary build tools and enhanced linting configurations
Comments suppressed due to low confidence (1)

docs-unified/ai-copilot/prompts/accessibility-expert.chatmode.md:1

  • This concluding statement excellently demonstrates the people-first language and inclusive design principles outlined in the accessibility coding guidelines. This is a good example of how to frame accessibility work positively and comprehensively.
---

Comment on lines +1 to +3
# Prompt — PR Description

Template for strong PRs.
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file lacks frontmatter metadata required by the coding guidelines. According to CodingGuidelineID 1000000, prompt files should include markdown front matter with fields like mode, description, model, and tools. Add proper YAML frontmatter to make this file compliant with the established standards.

Copilot uses AI. Check for mistakes.

Comment on lines +1 to +3
# Prompt: Playwright e2e scenarios

Happy path + edge case; stable selectors; deterministic.
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing required frontmatter metadata. According to the coding guidelines, prompt files should include YAML frontmatter with at least a description field and mode field specified as either 'agent' or 'ask'. Add proper frontmatter to comply with the prompt file guide standards.

Copilot uses AI. Check for mistakes.

Comment on lines +1 to +3
# Agent — Performance Coach

Checklist for Core Web Vitals.
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This agent file lacks the required frontmatter structure. Per CodingGuidelineID 1000000, agent files should include markdown front matter with a description field that is not empty and wrapped in single quotes. The current content is too minimal for an agent specification.

Copilot uses AI. Check for mistakes.

@@ -0,0 +1,20 @@
---
mode: 'agent'
name: 'Scrumban Project Planner'
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name field in the frontmatter is not part of the standard schema according to the coding guidelines. Chat mode files should focus on description, mode, model, and tools fields. Consider removing the name field or clarifying its purpose if it's intentionally extended beyond the standard.

Suggested change
name: 'Scrumban Project Planner'

Copilot uses AI. Check for mistakes.

---
applyTo: "**/*.{js,jsx,ts,tsx}"
description: "JavaScript and React development standards for WordPress Gutenberg blocks and modern WordPress development"
license: "GPL-3.0-or-later"
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction file includes a license field in the frontmatter, but according to CodingGuidelineID 1000000, instruction files should focus on applyTo and description fields. While the license information is valuable, consider whether it belongs in the coding guidelines or should be documented separately to maintain frontmatter consistency.

Suggested change
license: "GPL-3.0-or-later"

Copilot uses AI. Check for mistakes.

if(!item.path||typeof item.path!=="string") return `Item ${i+1} must have a path string`;
if(!item.kind||typeof item.kind!=="string") return `Item ${i+1} must have a kind string`;
if(!['prompt','instruction','chat-mode'].includes(item.kind)) return `Item ${i+1} kind must be one of: prompt, instruction, chat-mode`;
if(!['prompt','instruction','chat-mode','agent'].includes(item.kind)) return `Item ${i+1} kind must be one of: prompt, instruction, chat-mode, agent`;
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation logic for file extensions is duplicated and complex. Consider extracting the extension validation logic into a separate function to improve maintainability and reduce code duplication across lines 50-53.

Copilot uses AI. Check for mistakes.

}
inFM = false; fmDone = false;
if (/(\.prompt|\.chatmode|\.instructions)\.md$/.test(filePath)) {
if (CURRENT_EXT_PATTERN.test(filePath) || LEGACY_EXT_PATTERN.test(filePath) || AGENT_EXT_PATTERN.test(filePath)) {
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file extension pattern matching is becoming complex with multiple patterns. Consider consolidating these patterns into a single comprehensive regex or creating a helper function to determine if a file matches any of the supported extensions.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] Important [Status] Ready [Type] Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants