Skip to content

Create initial copilot-instructions.md#680

Merged
krugazul merged 4 commits into2.1-trunkfrom
566-add-copilot-instructions
Dec 10, 2025
Merged

Create initial copilot-instructions.md#680
krugazul merged 4 commits into2.1-trunkfrom
566-add-copilot-instructions

Conversation

@ashleyshaw
Copy link
Member

@ashleyshaw ashleyshaw commented Oct 21, 2025

Description

This pull request introduces an initial version of the copilot-instructions.md file 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

  • Establishes a baseline for Copilot usage instructions.
  • Enhances contributor onboarding by clarifying expected usage patterns and standards.

How Has This Been Tested?

  • Documentation reviewed for clarity and accuracy.
  • Previewed markdown rendering to ensure readability.

Screenshots (if appropriate):

N/A

Types of changes

  • Documentation addition

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have added necessary documentation (if appropriate).

Summary by CodeRabbit

  • Documentation
    • Updated development guidelines and workflow documentation for project contributors.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Note

Other AI code review bot(s) detected

CodeRabbit 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

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'commands', 'linked_issues'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

Walkthrough

A new Markdown guide is added to .github/copilot-instructions.md establishing GitHub Copilot usage conventions for the project. The document outlines project structure, coding standards, technologies, build commands, patterns to avoid, and agent prompt mappings for generating endpoints and tests.

Changes

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

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.

❤️ Share

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

@serenvdmerwe serenvdmerwe requested a review from Copilot October 21, 2025 16:11
Copy link
Contributor

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 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

Comment on lines +28 to +35
.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/
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@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>
@github-actions github-actions bot added lang:md Markdown content/docs status:needs-review Awaiting code review meta:needs-changelog Requires a changelog entry before merge labels Dec 10, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Warwick Booth <krugazul@users.noreply.github.com>
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Dec 10, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Warwick Booth <krugazul@users.noreply.github.com>
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Dec 10, 2025
Copy link
Contributor

Copilot AI commented Dec 10, 2025

@krugazul I've opened a new pull request, #810, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

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

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 in tests/
  • "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 of src/

🔒 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>.

Comment on lines +15 to +21
- **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`

Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
- **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

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +36
```

.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/

Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
- 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
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
- Document public functions with JSDoc
- Document public functions using WordPress inline documentation standards (PHPDoc)

Copilot uses AI. Check for mistakes.
Comment on lines +56 to +78
* **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
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
* **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

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +88
* 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
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +60
-
```bash
npm run dev
````
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

There is an extra hyphen and inconsistent formatting. This should be a proper bullet point list item.

Suggested change
-
```bash
npm run dev
````
```bash
npm run dev

Copilot uses AI. Check for mistakes.

## 🔍 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.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added status:needs-review Awaiting code review and removed status:needs-review Awaiting code review labels Dec 10, 2025
@krugazul krugazul merged commit 381bd1b into 2.1-trunk Dec 10, 2025
6 of 10 checks passed
@krugazul krugazul deleted the 566-add-copilot-instructions branch December 10, 2025 20:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7819b40 and 8d52e4f.

📒 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge status:needs-review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refine Copilot coding‑agent instructions to align with our actual plugin context

3 participants