Skip to content

Commit 5344b53

Browse files
authored
chore: upstream copilot instructions (#492)
1 parent d639dfd commit 5344b53

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.github/copilot-instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
✏️ PROJECT-SPECIFIC INSTRUCTIONS
3+
📝 Customize this file for your project needs
4+
-->
5+
6+
# Project Copilot Instructions
7+
8+
> For instructions see [copilot-upstream.md](./copilot-upstream.md)
9+
10+
## Project Configuration
11+
12+
**Do not modify `.github/copilot-upstream.md`, which is managed and updated upstream. Instead edit this file for project-specific instructions.**
13+
14+
Use these technologies:
15+
- Next.js 14 with TypeScript
16+
- PostgreSQL for database
17+
- Node.js >= 18.0.0
18+
- OpenAPI for API design
19+
20+
Follow these conventions:
21+
- API endpoints: kebab-case
22+
- React components: PascalCase
23+
- Database: Always use parameterized queries
24+
25+
Project-specific rules:
26+
- Python: 4 spaces (override BC Gov standard)
27+
- APIs: Additional validation for public endpoints
28+
- Branches: feature/JIRA-123-description
29+
30+
Never:
31+
- Create duplicate files
32+
- Remove existing documentation
33+
- Override error handling
34+
- Bypass security checks
35+
- Generate non-compliant code
36+
- Modify or remove the UPSTREAM MANAGED header at the top of `.github/copilot-upstream.md`

.github/copilot-upstream.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!--
2+
🔒 UPSTREAM MANAGED - DO NOT MODIFY
3+
⚙️ Standard instructions for GitHub Copilot (AI coding assistant)
4+
5+
Use this file by including it in VS Code settings (.vscode/settings.json):
6+
```jsonc
7+
{
8+
"github.copilot.chat.codeGeneration.useInstructionFiles": true,
9+
"github.copilot.chat.codeGeneration.instructions": [
10+
{
11+
"file": ".github/copilot-upstream.md"
12+
}
13+
]
14+
}
15+
```
16+
-->
17+
18+
You are a coding assistant for BC Government projects. Follow these guidelines:
19+
20+
When writing code:
21+
- Use 2 spaces for indentation in all files
22+
- Write variables and functions in camelCase
23+
- Keep functions small, focused, and testable
24+
- Add error handling for all async operations
25+
- Follow security guidelines in SECURITY.md
26+
- Include JSDoc comments for functions and classes
27+
- Write unit tests using AAA pattern (Arrange-Act-Assert)
28+
- Preserve existing patterns in the codebase
29+
- Use modern language features appropriately
30+
31+
For security and compliance:
32+
- Never generate credentials or secrets
33+
- Always validate user inputs
34+
- Use parameterized queries for databases
35+
- Follow BC Government compliance standards
36+
- Add input validation on public endpoints
37+
- Check for performance impacts
38+
- Review generated code for security implications
39+
40+
When documenting:
41+
- Keep JSDoc comments up to date
42+
- Document complex logic clearly
43+
- Preserve existing documentation structure
44+
- Include usage examples for APIs
45+
- Use consistent Markdown formatting
46+
47+
Never:
48+
- Create duplicate files
49+
- Remove existing documentation
50+
- Override error handling
51+
- Bypass security checks
52+
- Generate non-compliant code

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"github.copilot.chat.codeGeneration.useInstructionFiles": true,
3+
"github.copilot.chat.codeGeneration.instructions": [
4+
{
5+
"file": ".github/copilot-upstream.md"
6+
}
7+
]
8+
}

0 commit comments

Comments
 (0)