Create initial copilot-instructions.md#680
Conversation
Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Note
|
| Cohort / File(s) | Summary |
|---|---|
GitHub Copilot Configuration .github/copilot-instructions.md |
New file introduced containing repository-wide Copilot guidelines covering project overview, technology stack, coding conventions, build/test commands, discouraged patterns, and agent prompt mappings for code generation workflows. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~2 minutes
- Purely documentation and guideline content with no executable logic or error handling paths
- Single file addition with no impact on codebase functionality
- Straightforward descriptive guidance requiring only verification of technical accuracy and clarity
Possibly related issues
- Refine Copilot coding‑agent instructions to align with our actual plugin context #566: Directly related as both involve creation and refinement of the
.github/copilot-instructions.mdrepository-level Copilot guidance document.
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'Create initial copilot-instructions.md' directly and clearly describes the primary change—introducing a new Copilot instructions file to the repository. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
566-add-copilot-instructions
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.
Pull Request Overview
This PR introduces a new copilot-instructions.md file to provide guidance for GitHub Copilot usage within the repository. However, the instructions describe a JavaScript/TypeScript project structure that contradicts the actual Tour Operator WordPress plugin codebase.
Key Changes:
- Addition of Copilot configuration file with project guidelines
- Documentation of technology stack and coding conventions
- Inclusion of build commands and agent-specific prompts
| .github/ | ||
| src/ | ||
| ├── core/ # Business logic modules | ||
| ├── api/ # API client utilities and request logic | ||
| ├── components/ # UI components (React or framework-agnostic) | ||
| └── utils/ # Helper utilities | ||
| tests/ | ||
| docs/ |
There was a problem hiding this comment.
The documented project structure does not match the actual repository structure. According to the repository context, the actual structure includes includes/ for PHP classes, templates/ for template files, assets/ for compiled assets, and build/ for build files. The structure should be updated to reflect the actual WordPress plugin architecture.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback Please make sure to scan the 2.1-trunk branch to see the current directory structure.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth <krugazul@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth <krugazul@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth <krugazul@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (1)
.github/copilot-instructions.md:117
- This copilot-instructions.md file does not reference or align with the organization's established LightSpeed Copilot and Agent Instructions. The organization has comprehensive coding standards, WordPress-specific guidelines, and testing practices documented at the organization level that should be referenced here rather than creating conflicting instructions. This file should either reference those guidelines or extend them appropriately for this specific repository.
# 🧠 GitHub Copilot Repository Instructions
These are repository-specific instructions to guide GitHub Copilot’s behavior when generating or editing code within this project. They apply to Copilot Chat, Copilot Coding Agent, and Copilot Code Review.
---
## 🔍 Project Overview
This repository is a WordPress plugin (Tour Operator) project. It is built using PHP, leverages WordPress blocks for custom functionality, and strictly follows the WordPress Coding Standards (WPCS). The codebase is structured as a WordPress plugin and may include PHP files, block registration, and other WordPress-specific patterns.
---
## 🛠️ Technologies and Tooling
- **Languages:** JavaScript (ES2022+), TypeScript
- **Runtime:** Node.js
- **Package Manager:** npm or yarn (based on `package.json`)
- **Linting:** ESLint with Prettier
- **Testing:** Vitest / Jest (unit tests), Playwright (E2E tests)
- **Frameworks:** None assumed unless otherwise declared in `/src`
---
## 🧩 Project Structure
.github/
src/
├── core/ # Business logic modules
├── api/ # API client utilities and request logic
├── components/ # UI components (React or framework-agnostic)
└── utils/ # Helper utilities
tests/
docs/
Avoid placing logic in `index.ts` files—prefer explicit imports.
---
## 💡 Coding Conventions
- Prefer functional, stateless patterns when applicable
- Use async/await; avoid `.then()` chains
- Use named exports; avoid default exports unless wrapping a module
- Keep logic modular—each file should have a single clear responsibility
- Avoid adding logic in `src/index.ts` or top-level entry files
- Document public functions with JSDoc
---
## 📦 Build & Run Commands
* **Development**
-
```bash
npm run dev
-
Lint and Format
npm run lint npm run format
-
Run Tests
npm test -
Build
npm run build
⛔ Avoid These Patterns
- Do not include any WordPress-related imports, functions, or file structures
- Do not scaffold routes or components using Express, Next.js, or any framework unless explicitly declared
- Do not generate
.php,.twig, or legacy CMS files - Do not reference or assume plugins like WooCommerce or Wetu
✅ Agent-Specific Prompts
When asked to:
- "Generate an endpoint" → Place it in
src/api/, include a test intests/ - "Create a new module" → Follow folder structure and export pattern
- "Refactor" → Improve modularity, clarify naming, remove dead code
- "Write tests" → Use Vitest or Jest for unit tests, Playwright for E2E tests; place in
tests/, mirror structure ofsrc/
🔒 Content Exclusion (Optional but Recommended)
If supported by your GitHub plan, exclude these directories in settings:
# No content exclusions are necessary for this repository, as it does not contain legacy or CMS-related directories.
# If new directories are added that should be excluded, list them here.
📣 Feedback
We’re actively refining how we use GitHub Copilot. When in doubt, ask the team before suggesting code related to frameworks or languages not in use.
</details>
---
💡 <a href="/lightspeedwp/tour-operator/new/2.1-trunk/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
| - **Languages:** JavaScript (ES2022+), TypeScript | ||
| - **Runtime:** Node.js | ||
| - **Package Manager:** npm or yarn (based on `package.json`) | ||
| - **Linting:** ESLint with Prettier | ||
| - **Testing:** Vitest / Jest (unit tests), Playwright (E2E tests) | ||
| - **Frameworks:** None assumed unless otherwise declared in `/src` | ||
|
|
There was a problem hiding this comment.
The technologies listed are incorrect for this repository. This is a WordPress plugin that uses PHP as its primary language, WordPress coding standards, and WordPress-specific tooling. The repository does have some JavaScript but it's not TypeScript-based. The testing framework should reference WordPress testing tools, not Vitest/Jest/Playwright as the primary testing approach.
| - **Languages:** JavaScript (ES2022+), TypeScript | |
| - **Runtime:** Node.js | |
| - **Package Manager:** npm or yarn (based on `package.json`) | |
| - **Linting:** ESLint with Prettier | |
| - **Testing:** Vitest / Jest (unit tests), Playwright (E2E tests) | |
| - **Frameworks:** None assumed unless otherwise declared in `/src` | |
| - **Languages:** PHP (primary), JavaScript (ESNext for blocks/admin) | |
| - **Coding Standards:** WordPress Coding Standards (WPCS) for PHP, ESLint (optional) for JS | |
| - **Tooling:** WordPress CLI, Composer (for PHP dependencies), npm (for JS build, if present) | |
| - **Testing:** WordPress PHPUnit test suite, WP-specific testing tools (e.g., WP_UnitTestCase) | |
| - **Frameworks:** WordPress (plugin), no JS frameworks unless explicitly declared |
| ``` | ||
|
|
||
| .github/ | ||
| src/ | ||
| ├── core/ # Business logic modules | ||
| ├── api/ # API client utilities and request logic | ||
| ├── components/ # UI components (React or framework-agnostic) | ||
| └── utils/ # Helper utilities | ||
| tests/ | ||
| docs/ | ||
|
|
There was a problem hiding this comment.
The project structure described does not match this WordPress plugin repository. The actual structure includes includes/, post-types/, templates/, assets/, and languages/ directories typical of WordPress plugins. There is no src/core/, src/api/, or src/components/ directory structure as shown here.
| - Use named exports; avoid default exports unless wrapping a module | ||
| - Keep logic modular—each file should have a single clear responsibility | ||
| - Avoid adding logic in `src/index.ts` or top-level entry files | ||
| - Document public functions with JSDoc |
There was a problem hiding this comment.
These coding conventions don't align with this WordPress plugin project. WordPress has established coding standards for PHP that should be referenced instead. The plugin should follow WordPress PHP coding standards, including practices specific to WordPress development such as escaping output, using WordPress APIs, and following WordPress function naming conventions.
| - Document public functions with JSDoc | |
| - Document public functions using WordPress inline documentation standards (PHPDoc) |
| * **Development** | ||
| - | ||
| ```bash | ||
| npm run dev | ||
| ```` | ||
|
|
||
| * **Lint and Format** | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| npm run format | ||
| ``` | ||
|
|
||
| * **Run Tests** | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| * **Build** | ||
|
|
||
| ```bash | ||
| npm run build |
There was a problem hiding this comment.
The build commands listed don't match the actual package.json scripts for this repository. The actual available commands are "start", "build", "build-pot", "build-mopo", and "translate-US" which are WordPress-specific build tasks. There is no "npm run dev", "npm run lint", "npm run format", or generic "npm test" command defined.
| * **Development** | |
| - | |
| ```bash | |
| npm run dev | |
| ```` | |
| * **Lint and Format** | |
| ```bash | |
| npm run lint | |
| npm run format | |
| ``` | |
| * **Run Tests** | |
| ```bash | |
| npm test | |
| ``` | |
| * **Build** | |
| ```bash | |
| npm run build | |
| The following npm scripts are available in this repository: | |
| - **Start (development or local preview, if supported):** | |
| ```bash | |
| npm run start |
-
Build (production build):
npm run build
-
Generate POT file for translations:
npm run build-pot
-
Build MO/PO translation files:
npm run build-mopo
-
Translate to US English:
npm run translate-US
| * Do not include any WordPress-related imports, functions, or file structures | ||
| * Do not scaffold routes or components using Express, Next.js, or any framework unless explicitly declared | ||
| * Do not generate `.php`, `.twig`, or legacy CMS files | ||
| * Do not reference or assume plugins like WooCommerce or Wetu |
There was a problem hiding this comment.
This guidance is contradictory to the actual nature of this repository. This IS a WordPress plugin project, so instructing Copilot to avoid WordPress-related code will prevent it from generating appropriate code. The repository also specifically works with tour operator features that may integrate with services, so blanket exclusions may be inappropriate.
| * Do not include any WordPress-related imports, functions, or file structures | |
| * Do not scaffold routes or components using Express, Next.js, or any framework unless explicitly declared | |
| * Do not generate `.php`, `.twig`, or legacy CMS files | |
| * Do not reference or assume plugins like WooCommerce or Wetu | |
| * Do not scaffold routes or components using Express, Next.js, or any framework unless explicitly declared | |
| * Do not generate `.twig` or legacy CMS files (non-WordPress) unless specifically required | |
| * Do not reference or assume plugins like WooCommerce or Wetu unless explicitly requested |
| - | ||
| ```bash | ||
| npm run dev | ||
| ```` |
There was a problem hiding this comment.
There is an extra hyphen and inconsistent formatting. This should be a proper bullet point list item.
| - | |
| ```bash | |
| npm run dev | |
| ```` | |
| ```bash | |
| npm run dev |
|
|
||
| ## 🔍 Project Overview | ||
|
|
||
| This repository is a WordPress plugin (Tour Operator) project. It is built using PHP, leverages WordPress blocks for custom functionality, and strictly follows the WordPress Coding Standards (WPCS). The codebase is structured as a WordPress plugin and may include PHP files, block registration, and other WordPress-specific patterns. |
There was a problem hiding this comment.
This description is completely inaccurate. This repository is the "Tour Operator" WordPress plugin, not a JavaScript/TypeScript application. The repository contains primarily PHP code for a WordPress plugin with custom post types for tours, accommodations, and destinations. This fundamental misrepresentation will cause Copilot to generate inappropriate code suggestions.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/copilot-instructions.md (4)
13-22: Technologies section contradicts Project Overview and misses WordPress-specific tooling.The Technologies section lists only JavaScript, Node.js, and web testing frameworks—omitting PHP, WordPress, and WordPress Coding Standards (WPCS), which the Project Overview correctly identifies as core to this plugin. This creates confusion for Copilot.
Apply this diff to align the Technologies section with the actual WordPress plugin stack:
## 🛠️ Technologies and Tooling -- **Languages:** JavaScript (ES2022+), TypeScript -- **Runtime:** Node.js -- **Package Manager:** npm or yarn (based on `package.json`) -- **Linting:** ESLint with Prettier -- **Testing:** Vitest / Jest (unit tests), Playwright (E2E tests) -- **Frameworks:** None assumed unless otherwise declared in `/src` +- **Languages:** PHP (primary), JavaScript (ES2022+ for blocks) +- **Runtime:** WordPress (PHP), Node.js (for tooling and blocks) +- **Package Manager:** npm or yarn (for JS tooling) +- **Linting:** WPCS (PHP), @wordpress/eslint-plugin (JS), Prettier +- **Testing:** Playwright (E2E tests), PHPUnit (PHP unit tests) +- **Frameworks:** WordPress (plugin and blocks)
24-40: Project Structure section does not reflect WordPress plugin architecture.The structure shown (src/, api/, components/) is generic for Node.js/JavaScript projects, not a WordPress plugin. A WordPress plugin typically includes
includes/(PHP classes),templates/,assets/,blocks/, etc.The documented project structure needs to align with the actual WordPress plugin layout. Please update to reflect real directory structure used in this repository.
83-89: "Avoid These Patterns" section directly contradicts project nature.Lines 85 and 88 instruct to avoid WordPress-related imports, functions, and patterns—but this is a WordPress plugin project that requires exactly these patterns. This guidance will mislead Copilot into generating unsuitable code.
The patterns section should specify what NOT to do within WordPress (e.g., avoid unsafe global state, insecure data handling) rather than avoiding WordPress entirely. Rewrite to clarify actual anti-patterns for this WordPress plugin context.
92-100: Agent-Specific Prompts lack WordPress context.These prompts reference generic development patterns (endpoints in
src/api/, generic modules, web testing frameworks) but don't address WordPress REST API endpoints, PHP functions, or WordPress-specific testing patterns that this plugin requires.The prompts should specify WordPress-aligned responses. For example, "Generate an endpoint" should clarify WordPress REST API registration patterns, not generic API folder structures.
🧹 Nitpick comments (4)
.github/copilot-instructions.md (4)
43-51: Coding Conventions section is JavaScript-focused; missing PHP and WordPress patterns.The conventions listed (functional patterns, async/await, named exports) apply to JavaScript code. For a WordPress plugin with PHP components, the guide should also include PHP and WordPress-specific conventions such as coding standards, hooks/filters, sanitization, and escaping practices.
Consider expanding this section to address both JavaScript and PHP codebases that comprise this WordPress plugin project.
54-80: Build & Run Commands section omits PHP and WordPress tooling commands.The commands listed focus on Node.js tooling (npm scripts). For a WordPress plugin project, this section should also document PHP-related commands for linting (WPCS), testing (PHPUnit), and other WordPress-specific build steps if applicable.
Add PHP and WordPress-specific build/run commands to provide complete guidance for all contributors.
26-26: Add language identifier to fenced code block.Markdown linting requires language specification for code blocks. Line 26 should declare a language (e.g., markdown, or leave empty with just ```).
Apply this diff:
+```markdown
.github/--- `57-61`: **Add language identifier to fenced code block.** Line 60 is a bash command block that should specify the bash language identifier for markdown compliance. Apply this diff: ```diff * **Development** - - ```bash + ```bash npm run dev -```` + ```Note: Also remove the extra backtick on line 60 (should be 3 backticks, not 4).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/copilot-instructions.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
.github/copilot-instructions.md
26-26: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (3)
.github/copilot-instructions.md (3)
7-11: Project Overview is accurate.The description correctly identifies this as a WordPress plugin project using PHP and WPCS.
103-111: Content Exclusion section is reasonable.The placeholder approach here is appropriate. Teams can populate this if needed in future.
114-116: Feedback section encourages team collaboration.This closing encourages ongoing refinement, which is appropriate for evolving Copilot usage guidelines.
Description
This pull request introduces an initial version of the
copilot-instructions.mdfile to the repository. This file is intended to provide guidance and configuration for using GitHub Copilot within the project, ensuring contributors have clear instructions on leveraging Copilot effectively and in alignment with our coding standards.Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
N/A
Types of changes
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.