Skip to content

Commit 085f9d8

Browse files
pamelafoxCopilot
andauthored
Improved custom chat mode and Copilot instructions file (#2681)
* Improved custom mode and repo instructions * Update .github/copilot-instructions.md Co-authored-by: Copilot <[email protected]> * Update .github/copilot-instructions.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 397c885 commit 085f9d8

File tree

3 files changed

+78
-36
lines changed

3 files changed

+78
-36
lines changed

.github/chatmodes/debug.chatmode.md

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
description: 'Fix and verify issues in app'
3+
model: GPT-5 (Preview)
4+
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server']
5+
---
6+
7+
# Fixer Mode Instructions
8+
9+
You are in fixer mode. When given an issue to fix, follow these steps:
10+
11+
**Gather context**: Read error messages/stack traces/related code. If the issue is a GitHub issue link, use 'get_issue' and 'get_issue_comments' tools to fetch the issue and comments.
12+
**Make targeted fix**: Make minimal changes to fix the issue. Do not fix any issues that weren't identified. If any other issues pop up, note them as potential issues to be fixed later.
13+
**Verify fix**: Test the application to ensure the fix works as intended and doesn't introduce new issues. For a backend change, add a new test in the tests folder and run the tests with VS Code "runTests" tool. RUN all the tests using that tool, not just the tests you added. Try to add tests to existing test files when possible, like test_app.py. DO NOT run the `pytest` command directly or create a task to run tests, ONLY use "runTests" tool. For a frontend change, use the Playwright server to manually verify or update e2e.py tests.
14+
15+
## Local server setup
16+
17+
You MUST check task output readiness before debugging, testing, or declaring work complete.
18+
19+
- Start the app: Run the "Development" compound task (which runs both frontend and backend tasks) and check readiness from task output. Both must be in ready state:
20+
- Frontend task: "Frontend: npm run dev"
21+
- Backend task: "Backend: quart run"
22+
- Investigate and fix errors shown in the corresponding task terminal before proceeding. You may sometimes see an error with /auth_setup in frontend task, that's due to the backend server taking longer to startup, and can be ignored.
23+
- Both of the tasks provide hot reloading behavior:
24+
- Frontend: Vite provides HMR; changes in the frontend are picked up automatically without restarting the task.
25+
- Backend: Quart was started with --reload; Python changes trigger an automatic restart.
26+
- If watchers seem stuck or output stops updating, stop the tasks and run the "Development" task again.
27+
- To interact with a running application, use the Playwright MCP server

.github/copilot-instructions.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Adding new data
2+
3+
New files should be added to the `data` folder, and then either run scripts/prepdocs.sh or scripts/prepdocs.ps1 to ingest the data.
4+
5+
# Adding a new azd environment variable
6+
7+
An azd environment variable is stored by the azd CLI for each environment. It is passed to the "azd up" command and can configure both provisioning options and application settings.
8+
When adding new azd environment variables, update:
9+
10+
1. infra/main.parameters.json : Add the new parameter with a Bicep-friendly variable name and map to the new environment variable
11+
1. infra/main.bicep: Add the new Bicep parameter at the top, and add it to the `appEnvVariables` object
12+
1. azure.yaml: Add the new environment variable under pipeline config section
13+
1. .azdo/pipelines/azure-dev.yml: Add the new environment variable under `env` section
14+
1. .github/workflows/azure-dev.yml: Add the new environment variable under `env` section
15+
16+
# Adding a new setting to "Developer Settings" in RAG app
17+
18+
When adding a new developer setting, update:
19+
20+
* frontend:
21+
* app/frontend/src/api/models.ts : Add to ChatAppRequestOverrides
22+
* app/frontend/src/components/Settings.tsx : Add a UI element for the setting
23+
* app/frontend/src/locales/*/translations.json: Add a translation for the setting label/tooltip for all languages
24+
* app/frontend/src/pages/chat/Chat.tsx: Add the setting to the component, pass it to Settings
25+
* app/frontend/src/pages/ask/Ask.tsx: Add the setting to the component, pass it to Settings
26+
27+
* backend:
28+
* app/backend/approaches/chatreadretrieveread.py : Retrieve from overrides parameter
29+
* app/backend/approaches/retrievethenread.py : Retrieve from overrides parameter
30+
* app/backend/app.py: Some settings may need to be sent down in the /config route.
31+
32+
# When adding tests for a new feature:
33+
34+
All tests are in the `tests` folder and use the pytest framework.
35+
There are three styles of tests:
36+
37+
* e2e tests: These use playwright to run the app in a browser and test the UI end-to-end. They are in e2e.py and they mock the backend using the snapshots from the app tests.
38+
* app integration tests: Mostly in test_app.py, these test the app's API endpoints and use mocks for services like Azure OpenAI and Azure Search.
39+
* unit tests: The rest of the tests are unit tests that test individual functions and methods. They are in test_*.py files.
40+
41+
When adding a new feature, add tests for it in the appropriate file.
42+
If the feature is a UI element, add an e2e test for it.
43+
If it is an API endpoint, add an app integration test for it.
44+
If it is a function or method, add a unit test for it.
45+
Use mocks from conftest.py to mock external services.
46+
47+
When you're running tests, make sure you activate the .venv virtual environment first:
48+
49+
```bash
50+
source .venv/bin/activate
51+
```

0 commit comments

Comments
 (0)