Skip to content

Commit 8c06c59

Browse files
committed
chore: run format
Signed-off-by: Ege Korkan <egekorkan@gmail.com>
1 parent 79064da commit 8c06c59

1 file changed

Lines changed: 116 additions & 95 deletions

File tree

.github/copilot-instructions.md

Lines changed: 116 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,176 @@
11
## **AI Agent Instructions for eclipse-thingweb/node-wot**
22

33
### **Repository Context**
4-
- **Project**: Eclipse Thingweb Node-WoT
5-
- **Language**: TypeScript (97.5%), JavaScript (2.4%)
6-
- **Purpose**: A fast and extensible framework to connect any device with your browser and backend applications
7-
- **Standards**: W3C Web of Things (WoT) specifications
4+
5+
- **Project**: Eclipse Thingweb Node-WoT
6+
- **Language**: TypeScript (97.5%), JavaScript (2.4%)
7+
- **Purpose**: A fast and extensible framework to connect any device with your browser and backend applications
8+
- **Standards**: W3C Web of Things (WoT) specifications
89

910
---
1011

1112
## **WHEN PROVIDING CODE**
1213

1314
### **Pre-Development Requirements**
15+
1416
1. **Read the CONTRIBUTING.md file** at https://github.com/eclipse-thingweb/node-wot/blob/master/CONTRIBUTING.md
1517
2. **Understand the W3C WoT standards** at https://www.w3.org/TR/2023/REC-wot-thing-description11-20231205/
1618
3. **Verify Eclipse Foundation compliance**:
17-
- Contributor must have an Eclipse Foundation account with GitHub ID linked
18-
- Contributor must have signed the Eclipse Contributor Agreement (ECA)
19+
- Contributor must have an Eclipse Foundation account with GitHub ID linked
20+
- Contributor must have signed the Eclipse Contributor Agreement (ECA)
1921

2022
### **Code Quality Standards**
23+
2124
1. **Linting & Formatting**:
22-
- Run `npm run lint` before committing
23-
- Run `npm run format` to automatically fix style issues
24-
- Ensure no ESLint warnings or errors remain
25-
- Follow the strict boolean expressions rule (use `==` or `!=` for null/undefined checks, not `if (var)`)
25+
26+
- Run `npm run lint` before committing
27+
- Run `npm run format` to automatically fix style issues
28+
- Ensure no ESLint warnings or errors remain
29+
- Follow the strict boolean expressions rule (use `==` or `!=` for null/undefined checks, not `if (var)`)
2630

2731
2. **Scope & Minimal Diffs**:
28-
- Keep changes limited to the specific feature/fix scope
29-
- Do not modify unrelated parts of files
30-
- Strive for the minimum git diff (fewest lines changed)
31-
- Avoid unnecessary refactoring outside the scope of work
32+
33+
- Keep changes limited to the specific feature/fix scope
34+
- Do not modify unrelated parts of files
35+
- Strive for the minimum git diff (fewest lines changed)
36+
- Avoid unnecessary refactoring outside the scope of work
3237

3338
3. **Testing**:
34-
- Run the full test suite before committing: `npm run test` or equivalent
35-
- Ensure all tests pass
36-
- Add tests for new features or fixes
39+
40+
- Run the full test suite before committing: `npm run test` or equivalent
41+
- Ensure all tests pass
42+
- Add tests for new features or fixes
3743

3844
4. **Special Attention for Core Changes**:
39-
- If modifying `packages/core`, understand that this impacts ALL other packages
40-
- Check if changes contradict the W3C WoT Scripting API specification: https://w3c.github.io/wot-scripting-api/
41-
- Verify all dependent packages are updated accordingly
42-
- Validate compatibility with existing protocol bindings
43-
45+
46+
- If modifying `packages/core`, understand that this impacts ALL other packages
47+
- Check if changes contradict the W3C WoT Scripting API specification: https://w3c.github.io/wot-scripting-api/
48+
- Verify all dependent packages are updated accordingly
49+
- Validate compatibility with existing protocol bindings
50+
4451
5. **Bypassing the Problem**:
4552

46-
- If you do not find a solution to the problem, do not bypass it by typecasting, ignoring the tests etc.
53+
- If you do not find a solution to the problem, do not bypass it by typecasting, ignoring the tests etc.
4754

4855
6. **Commit Requirements**:
49-
- **All commits MUST be signed** using the contributor's Eclipse Foundation account email
50-
- Configure git: `git config user.email "<eclipse-account-email>"`
51-
- Commit with `-s` flag: `git commit -s -m "<message>"`
52-
- Follow Conventional Changelog format:
53-
```
54-
<type>(<scope>): <subject>
55-
56-
<body>
57-
58-
<footer>
59-
```
60-
- **Allowed types**: `feat`, `fix`, `refactor`, `perf`, `style`, `test`, `chore`, `docs`
61-
- **Subject**: imperative mood, present tense, lowercase, no period
62-
- **Example**: `feat(binding-coap): add support for observe option`
56+
- **All commits MUST be signed** using the contributor's Eclipse Foundation account email
57+
- Configure git: `git config user.email "<eclipse-account-email>"`
58+
- Commit with `-s` flag: `git commit -s -m "<message>"`
59+
- Follow Conventional Changelog format:
60+
61+
```
62+
<type>(<scope>): <subject>
63+
64+
<body>
65+
66+
<footer>
67+
```
68+
69+
- **Allowed types**: `feat`, `fix`, `refactor`, `perf`, `style`, `test`, `chore`, `docs`
70+
- **Subject**: imperative mood, present tense, lowercase, no period
71+
- **Example**: `feat(binding-coap): add support for observe option`
6372
6473
### **Pull Request Requirements**
74+
6575
1. **PR Body MUST include**:
66-
- **Explanation of AI assistance used**: Describe how AI tools assisted in generating the code, specific aspects AI helped with, and what human review/validation was performed
67-
- **Concise change description**: Exactly what was changed, why, and technical details
68-
- **Do NOT discuss**: Benefits, impact on users, or general statements about the value of the change
76+
77+
- **Explanation of AI assistance used**: Describe how AI tools assisted in generating the code, specific aspects AI helped with, and what human review/validation was performed
78+
- **Concise change description**: Exactly what was changed, why, and technical details
79+
- **Do NOT discuss**: Benefits, impact on users, or general statements about the value of the change
6980
7081
2. **Example PR Body**:
71-
```markdown
72-
## AI Assistance Summary
73-
This PR was generated with AI assistance for boilerplate code generation and structural
74-
implementation. The AI helped with [specific aspect], while human verification confirmed
75-
[what was validated].
76-
77-
## Changes
78-
- Modified `packages/binding-foo/src/foo-client.ts` to implement ProtocolClient interface
79-
- Added error handling for connection timeouts
80-
- Updated corresponding test file
81-
82-
Fixes #123
83-
```
82+
83+
```markdown
84+
## AI Assistance Summary
85+
86+
This PR was generated with AI assistance for boilerplate code generation and structural
87+
implementation. The AI helped with [specific aspect], while human verification confirmed
88+
[what was validated].
89+
90+
## Changes
91+
92+
- Modified `packages/binding-foo/src/foo-client.ts` to implement ProtocolClient interface
93+
- Added error handling for connection timeouts
94+
- Updated corresponding test file
95+
96+
Fixes #123
97+
```
8498
8599
3. **PR Process**:
86-
- Create feature branch from master
87-
- Do NOT merge with master while developing
88-
- If master updates are needed, rebase: `git checkout master && git pull && git checkout - && git rebase master`
89-
- Ensure CI/CD checks pass
90-
- Do NOT force push unless absolutely necessary
100+
- Create feature branch from master
101+
- Do NOT merge with master while developing
102+
- If master updates are needed, rebase: `git checkout master && git pull && git checkout - && git rebase master`
103+
- Ensure CI/CD checks pass
104+
- Do NOT force push unless absolutely necessary
91105
92106
---
93107
94108
## **WHEN REVIEWING CODE**
95109
96110
### **Review Scope & Guidelines**
111+
97112
1. **Primary Focus Areas**:
98-
- Code correctness and adherence to W3C WoT standards
99-
- Compliance with repository coding standards (ESLint, Prettier, style guide)
100-
- Proper testing and test coverage
101-
- Commit message quality and signing
102-
- PR description completeness (especially AI assistance disclosure)
113+
114+
- Code correctness and adherence to W3C WoT standards
115+
- Compliance with repository coding standards (ESLint, Prettier, style guide)
116+
- Proper testing and test coverage
117+
- Commit message quality and signing
118+
- PR description completeness (especially AI assistance disclosure)
103119
104120
2. **Avoid Redundancy**:
105-
- Do NOT repeat observations already in the PR author's initial summary/first comment
106-
- Read the PR description first to understand context and intent
121+
122+
- Do NOT repeat observations already in the PR author's initial summary/first comment
123+
- Read the PR description first to understand context and intent
107124
108125
3. **W3C WoT Standards Validation**:
109-
- Verify implementation matches W3C WoT Thing Description specification
110-
- Check W3C WoT Scripting API compliance for any core changes
111-
- Validate protocol binding implementations against expected interfaces
126+
127+
- Verify implementation matches W3C WoT Thing Description specification
128+
- Check W3C WoT Scripting API compliance for any core changes
129+
- Validate protocol binding implementations against expected interfaces
112130
113131
4. **Ecosystem Impact Assessment**:
114-
- If reviewing core changes: verify impact across all dependent packages
115-
- Check if breaking changes are properly documented in PR body
116-
- Validate that bindings still function correctly
132+
- If reviewing core changes: verify impact across all dependent packages
133+
- Check if breaking changes are properly documented in PR body
134+
- Validate that bindings still function correctly
117135
118136
### **Comment Management**
137+
119138
1. **Consolidation Rule**:
120-
- If you find yourself writing more than 5 separate comments:
121-
- Consolidate into a single summarized comment
122-
- Organize by category (critical issues, style, suggestions)
123-
- Clearly mark blockers vs. optional improvements
124-
- Ask contributor to review and respond to the summary comment
139+
140+
- If you find yourself writing more than 5 separate comments:
141+
- Consolidate into a single summarized comment
142+
- Organize by category (critical issues, style, suggestions)
143+
- Clearly mark blockers vs. optional improvements
144+
- Ask contributor to review and respond to the summary comment
125145
126146
2. **Comment Examples**:
127-
-**Good**: Points out specific issue with concrete fix suggestion
128-
-**Avoid**: Repeating the same point multiple times across different comments
129-
-**Good**: Consolidating multiple style issues into: "Code style issues found in 3 locations: [list]. Please run `npm run format`"
147+
- ✅ **Good**: Points out specific issue with concrete fix suggestion
148+
- ❌ **Avoid**: Repeating the same point multiple times across different comments
149+
- ✅ **Good**: Consolidating multiple style issues into: "Code style issues found in 3 locations: [list]. Please run `npm run format`"
130150
131151
### **Approval Criteria**
132-
- [ ] All commits are signed with Eclipse account email
133-
- [ ] Code passes `npm run lint` and `npm run format`
134-
- [ ] All tests pass (`npm run test`)
135-
- [ ] PR body explains AI assistance and changes clearly
136-
- [ ] Conventional commit format followed
137-
- [ ] No unrelated changes to files
138-
- [ ] W3C WoT standards compliance verified
139-
- [ ] If core changes: dependent packages updated/validated
140-
- [ ] No merge conflicts with master
152+
153+
- [ ] All commits are signed with Eclipse account email
154+
- [ ] Code passes `npm run lint` and `npm run format`
155+
- [ ] All tests pass (`npm run test`)
156+
- [ ] PR body explains AI assistance and changes clearly
157+
- [ ] Conventional commit format followed
158+
- [ ] No unrelated changes to files
159+
- [ ] W3C WoT standards compliance verified
160+
- [ ] If core changes: dependent packages updated/validated
161+
- [ ] No merge conflicts with master
141162
142163
---
143164
144165
## **Key References for AI Agents**
145166
146-
| Resource | Purpose |
147-
|----------|---------|
148-
| [CONTRIBUTING.md](https://github.com/eclipse-thingweb/node-wot/blob/master/CONTRIBUTING.md) | Full contribution guidelines |
149-
| [W3C WoT Thing Description](https://www.w3.org/TR/2023/REC-wot-thing-description11-20231205/) | Core specification |
150-
| [W3C WoT Scripting API](https://w3c.github.io/wot-scripting-api/) | Required for core/API changes |
151-
| [Eclipse ECA](http://www.eclipse.org/legal/ECA.php) | Legal requirements |
152-
| [Eclipse Committer Handbook](https://www.eclipse.org/projects/handbook/) | Best practices |
167+
| Resource | Purpose |
168+
| --------------------------------------------------------------------------------------------- | ----------------------------- |
169+
| [CONTRIBUTING.md](https://github.com/eclipse-thingweb/node-wot/blob/master/CONTRIBUTING.md) | Full contribution guidelines |
170+
| [W3C WoT Thing Description](https://www.w3.org/TR/2023/REC-wot-thing-description11-20231205/) | Core specification |
171+
| [W3C WoT Scripting API](https://w3c.github.io/wot-scripting-api/) | Required for core/API changes |
172+
| [Eclipse ECA](http://www.eclipse.org/legal/ECA.php) | Legal requirements |
173+
| [Eclipse Committer Handbook](https://www.eclipse.org/projects/handbook/) | Best practices |
153174
154175
---
155176

0 commit comments

Comments
 (0)