Skip to content

Commit 3cfdfc3

Browse files
Copilotkarpikpl
andauthored
Configure Copilot instructions following best practices (#282)
* Initial plan * Initial analysis: Review Copilot instructions setup Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com> * Enhance Copilot instructions with best practices Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
1 parent 58bb2d2 commit 3cfdfc3

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

.github/copilot-instructions.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1+
---
2+
name: copilot-metrics-viewer
3+
description: Nuxt 3 web application for GitHub Copilot usage metrics and analytics
4+
stack: Vue.js, TypeScript, Nuxt 3, Vuetify, Chart.js
5+
version: 2.1.0
6+
---
7+
18
# GitHub Copilot Metrics Viewer
29

310
GitHub Copilot Metrics Viewer is a Nuxt 3 web application that displays GitHub Copilot usage metrics and analytics for organizations and enterprises. The application visualizes data from the GitHub Copilot Metrics API using Vue.js, TypeScript, Vuetify, and Chart.js.
411

512
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
613

14+
## Security and Boundaries
15+
16+
### Critical Rules
17+
- **NEVER commit secrets or credentials** to the repository
18+
- **NEVER modify `.env` file** - environment variables should only be documented, not changed
19+
- **DO NOT modify** the following without explicit approval:
20+
- Production configuration files (azure.yaml, Dockerfile)
21+
- GitHub workflows in `.github/workflows/`
22+
- Security policies (SECURITY.md, CODE_OF_CONDUCT.md)
23+
- License files (LICENSE.txt)
24+
- **ALWAYS validate** that changes don't introduce security vulnerabilities
25+
- **ALWAYS run security scanning** before finalizing changes
26+
27+
### Safe Modification Areas
28+
- Application source code in `app/`, `server/`, `shared/`
29+
- Tests in `tests/` and `e2e-tests/`
30+
- Documentation files (README.md, CONTRIBUTING.md, DEPLOYMENT.md)
31+
- Configuration files specific to your changes
32+
733
## Working Effectively
834

935
### Initial Setup
@@ -29,8 +55,9 @@ Always reference these instructions first and fallback to search or bash command
2955
### Testing
3056
- **Unit tests**: `npm test` (using Vitest)
3157
- **NEVER CANCEL**: Takes 15 seconds to complete. Set timeout to 2+ minutes.
32-
- Runs 83 tests, all should pass
58+
- Runs 97 tests, all should pass
3359
- Uses mocked data environment
60+
- Test files are located in `tests/` directory
3461
- **E2E tests**: `npm run test:e2e` (using Playwright)
3562
- **NOTE**: Playwright browser installation may fail in some environments due to download issues
3663
- Install browsers first: `npx playwright install`
@@ -106,12 +133,27 @@ Always test these scenarios after making changes (use development mode for relia
106133

107134
### Always Run Before Committing
108135
1. **Build verification**: `npm run build` - Must complete successfully
109-
2. **Unit tests**: `npm test` - All 83 tests must pass
136+
2. **Unit tests**: `npm test` - All 97 tests must pass
110137
3. **Basic functionality**: Start dev server and verify health endpoints respond
111138
4. **Linting awareness**: Run `npm run lint` (expect existing errors, don't introduce new ones)
139+
5. **Security check**: Ensure no secrets or credentials are committed
112140

113141
## Common Tasks
114142

143+
### Code Style and Conventions
144+
- **TypeScript**: Always use TypeScript for new code, with proper type annotations
145+
- **Vue Components**: Follow Vue 3 Composition API patterns
146+
- **File Naming**:
147+
- Components: PascalCase (e.g., `MetricsViewer.vue`)
148+
- Utilities: camelCase (e.g., `dateUtils.ts`)
149+
- Tests: Match source file with `.spec.ts` or `.nuxt.spec.ts` suffix
150+
- **Code Organization**:
151+
- Keep components focused and single-purpose
152+
- Extract reusable logic into composables or utilities
153+
- Use TypeScript interfaces for data models in `app/model/`
154+
- **Comments**: Add comments only when necessary to explain complex logic
155+
- **Error Handling**: Always handle errors gracefully with user-friendly messages
156+
115157
### Repo Structure
116158
```
117159
├── app/ # Vue.js application source

0 commit comments

Comments
 (0)