Skip to content

Commit f5b98aa

Browse files
authored
Merge pull request #390 from github/readme-for-robots
Readme for robots
2 parents 49b2bbd + f7b72fa commit f5b98aa

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

.github/copilot-instructions.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copilot Instructions
2+
3+
## Environment Setup
4+
5+
Bootstrap the project by running:
6+
7+
```bash
8+
npm install
9+
```
10+
11+
## Testing
12+
13+
Ensure all unit tests pass by running the following:
14+
15+
```bash
16+
npm run test
17+
```
18+
19+
This project should include unit tests for all lines, functions, and branches of code.
20+
21+
This project **requires 100% test coverage** of code.
22+
23+
Unit tests should exist in the `__tests__` directory. They are powered by `jest`.
24+
25+
## Bundling
26+
27+
The final commit should always be a bundle of the code. This is done by running the following command:
28+
29+
```bash
30+
npm run all
31+
```
32+
33+
This uses Vercel's `ncc` to bundle JS code for running in GitHub Actions.
34+
35+
## Project Guidelines
36+
37+
- Follow:
38+
- Object-Oriented best practices, especially abstraction and encapsulation
39+
- GRASP Principles, especially Information Expert, Creator, Indirection, Low Coupling, High Cohesion, and Pure Fabrication
40+
- SOLID principles, especially Dependency Inversion, Open/Closed, and Single Responsibility
41+
- Base new work on latest `main` branch
42+
- Changes should maintain consistency with existing patterns and style.
43+
- Document changes clearly and thoroughly, including updates to existing comments when appropriate. Try to use the same "voice" as the other comments, mimicking their tone and style.
44+
- When responding to code refactoring suggestions, function suggestions, or other code changes, please keep your responses as concise as possible. We are capable engineers and can understand the code changes without excessive explanation. If you feel that a more detailed explanation is necessary, you can provide it, but keep it concise. After doing any refactoring, ensure to run `npm run test` to ensure that all tests still pass.
45+
- When suggesting code changes, always opt for the most maintainable approach. Try your best to keep the code clean and follow DRY principles. Avoid unnecessary complexity and always consider the long-term maintainability of the code.
46+
- When writing unit tests, try to consider edge cases as well as the main path of success. This will help ensure that the code is robust and can handle unexpected inputs or situations.
47+
- Hard-coded strings should almost always be constant variables.
48+
- In writing code, take the following as preferences but not rules:
49+
- understandability over concision
50+
- syntax, expressions, and blocks that are common across many languages over language-specific syntax.
51+
- more descriptive names over brevity of variable, function, and class names
52+
- the use of whitespace (newlines) over compactness of files
53+
- naming of variables and methods that lead to expressions and blocks reading more like English sentences.
54+
- less lines of code over more. Keep changes minimal and focused.
55+
56+
## Pull Request Requirements
57+
58+
- All tests must pass.
59+
- The linter must pass.
60+
- Documentation must be up-to-date.
61+
- The body of the Pull Request should:
62+
- contain a summary of the changes
63+
- make special note of any changes to dependencies
64+
- comment on the security of the changes being made and offer suggestions for further securing the code
65+
66+
## Repository Organization
67+
68+
- `.github/` - GitHub configurations and settings
69+
- `docs/` - Main documentation storage
70+
- `script/` - Repository maintenance scripts
71+
- `src/` - Main code for the project. This is where the main application/service code lives
72+
- `__tests__/` - Tests for the project. This is where the unit tests live
73+
- `dist/` - This is where the JS compiled code lives for the GitHub Action
74+
- `action.yml` - The GitHub Action file. This is where the GitHub Action is defined
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Allows you to test the setup steps from your repository's "Actions" tab
4+
on: workflow_dispatch
5+
6+
jobs:
7+
copilot-setup-steps:
8+
runs-on: ubuntu-latest
9+
# Set the permissions to the lowest permissions possible needed for *your steps*. Copilot will be given its own token for its operations.
10+
permissions:
11+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
12+
contents: read
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
19+
- name: setup node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: .node-version
23+
cache: 'npm'
24+
25+
- name: install dependencies
26+
run: npm install

0 commit comments

Comments
 (0)