From bce3a98859cb7ca6350f9dcb59cda6f81a48de63 Mon Sep 17 00:00:00 2001 From: Ash Shaw Date: Tue, 29 Jul 2025 11:57:28 +0200 Subject: [PATCH 1/4] Create initial copilot-instructions.md Signed-off-by: Ash Shaw --- .github/copilot-instructions.md | 117 ++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..3dbdb4644 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,117 @@ +# 🧠 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 modular JavaScript/TypeScript application that includes a plugin system, API integration layer, and custom UI components. It is **not a WordPress project** and does **not** use any CMS frameworks or legacy PHP code. + +--- + +## 🛠️ 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** + + ```bash + npm run lint + npm run format + ``` + +* **Run Tests** + + ```bash + npm test + ``` + +* **Build** + + ```bash + 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; place in `tests/`, mirror structure of `src/` + +--- + +## 🔒 Content Exclusion (Optional but Recommended) + +If supported by your GitHub plan, exclude these directories in settings: + +``` +/wordpress/ +/deprecated/ +/classic-theme/ +``` + +--- + +## 📣 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. From 7920de1dc712ca7c2414960115016c4d0087313a Mon Sep 17 00:00:00 2001 From: Warwick Booth Date: Wed, 10 Dec 2025 22:02:32 +0200 Subject: [PATCH 2/4] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3dbdb4644..def308956 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -6,7 +6,7 @@ These are repository-specific instructions to guide GitHub Copilot’s behavior ## 🔍 Project Overview -This repository is a modular JavaScript/TypeScript application that includes a plugin system, API integration layer, and custom UI components. It is **not a WordPress project** and does **not** use any CMS frameworks or legacy PHP code. +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. --- From 19a6d383ac7e1da3951e7291620e1c4238c8e55c Mon Sep 17 00:00:00 2001 From: Warwick Booth Date: Wed, 10 Dec 2025 22:03:38 +0200 Subject: [PATCH 3/4] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index def308956..6e3ff7f4c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -96,7 +96,7 @@ 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; place in `tests/`, mirror structure of `src/` +* "Write tests" → Use Vitest or Jest for unit tests, Playwright for E2E tests; place in `tests/`, mirror structure of `src/` --- From 8d52e4fc5a1c88dac014523407d2fdb87f0a8d42 Mon Sep 17 00:00:00 2001 From: Warwick Booth Date: Wed, 10 Dec 2025 22:04:05 +0200 Subject: [PATCH 4/4] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Warwick Booth --- .github/copilot-instructions.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 6e3ff7f4c..df9ca1ccf 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -105,9 +105,8 @@ When asked to: If supported by your GitHub plan, exclude these directories in settings: ``` -/wordpress/ -/deprecated/ -/classic-theme/ +# 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. ``` ---