Skip to content

Commit 381bd1b

Browse files
authored
Merge pull request #680 from lightspeedwp/566-add-copilot-instructions
Create initial copilot-instructions.md
2 parents 5284be6 + 8d52e4f commit 381bd1b

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

.github/copilot-instructions.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# 🧠 GitHub Copilot Repository Instructions
2+
3+
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.
4+
5+
---
6+
7+
## 🔍 Project Overview
8+
9+
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.
10+
11+
---
12+
13+
## 🛠️ Technologies and Tooling
14+
15+
- **Languages:** JavaScript (ES2022+), TypeScript
16+
- **Runtime:** Node.js
17+
- **Package Manager:** npm or yarn (based on `package.json`)
18+
- **Linting:** ESLint with Prettier
19+
- **Testing:** Vitest / Jest (unit tests), Playwright (E2E tests)
20+
- **Frameworks:** None assumed unless otherwise declared in `/src`
21+
22+
---
23+
24+
## 🧩 Project Structure
25+
26+
```
27+
28+
.github/
29+
src/
30+
├── core/ # Business logic modules
31+
├── api/ # API client utilities and request logic
32+
├── components/ # UI components (React or framework-agnostic)
33+
└── utils/ # Helper utilities
34+
tests/
35+
docs/
36+
37+
````
38+
39+
Avoid placing logic in `index.ts` files—prefer explicit imports.
40+
41+
---
42+
43+
## 💡 Coding Conventions
44+
45+
- Prefer functional, stateless patterns when applicable
46+
- Use async/await; avoid `.then()` chains
47+
- Use named exports; avoid default exports unless wrapping a module
48+
- Keep logic modular—each file should have a single clear responsibility
49+
- Avoid adding logic in `src/index.ts` or top-level entry files
50+
- Document public functions with JSDoc
51+
52+
---
53+
54+
## 📦 Build & Run Commands
55+
56+
* **Development**
57+
-
58+
```bash
59+
npm run dev
60+
````
61+
62+
* **Lint and Format**
63+
64+
```bash
65+
npm run lint
66+
npm run format
67+
```
68+
69+
* **Run Tests**
70+
71+
```bash
72+
npm test
73+
```
74+
75+
* **Build**
76+
77+
```bash
78+
npm run build
79+
```
80+
81+
---
82+
83+
## ⛔ Avoid These Patterns
84+
85+
* Do not include any WordPress-related imports, functions, or file structures
86+
* Do not scaffold routes or components using Express, Next.js, or any framework unless explicitly declared
87+
* Do not generate `.php`, `.twig`, or legacy CMS files
88+
* Do not reference or assume plugins like WooCommerce or Wetu
89+
90+
---
91+
92+
## ✅ Agent-Specific Prompts
93+
94+
When asked to:
95+
96+
* "Generate an endpoint" → Place it in `src/api/`, include a test in `tests/`
97+
* "Create a new module" → Follow folder structure and export pattern
98+
* "Refactor" → Improve modularity, clarify naming, remove dead code
99+
* "Write tests" → Use Vitest or Jest for unit tests, Playwright for E2E tests; place in `tests/`, mirror structure of `src/`
100+
101+
---
102+
103+
## 🔒 Content Exclusion (Optional but Recommended)
104+
105+
If supported by your GitHub plan, exclude these directories in settings:
106+
107+
```
108+
# No content exclusions are necessary for this repository, as it does not contain legacy or CMS-related directories.
109+
# If new directories are added that should be excluded, list them here.
110+
```
111+
112+
---
113+
114+
## 📣 Feedback
115+
116+
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.

0 commit comments

Comments
 (0)