Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# 🧠 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.
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.

---

## 🛠️ 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`

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

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


Comment on lines +26 to +36
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.
````

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

---

## 📦 Build & Run Commands

* **Development**
-
```bash
npm run dev
````
Comment on lines +57 to +60
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.

* **Lint and Format**

```bash
npm run lint
npm run format
```

* **Run Tests**

```bash
npm test
```

* **Build**

```bash
npm run build
Comment on lines +56 to +78
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.
```

---

## ⛔ 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
Comment on lines +85 to +88
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.

---

## ✅ 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.
Loading