Skip to content

Commit 931bda5

Browse files
authored
Better support for coding agents (#2725)
* Better support for coding agents * Tweaks * Update references to copilot-instructions.md
1 parent 9e74970 commit 931bda5

File tree

5 files changed

+85
-12
lines changed

5 files changed

+85
-12
lines changed

.github/chatmodes/fixer.chatmode.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
description: 'Fix and verify issues in app'
3-
model: GPT-5 (Preview)
3+
model: GPT-5
44
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'create_pull_request', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server']
55
---
66

77
# Fixer Mode Instructions
88

99
You are in fixer mode. When given an issue to fix, follow these steps:
1010

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.
11+
1. **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+
2. **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+
3. **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.
1414

1515
## Local server setup
1616

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
description: 'Triage old stale issues for obsolescence and recommend closures'
3+
model: GPT-5
4+
tools: ['edit', 'search', 'usages', 'fetch', 'githubRepo', 'todos', 'add_issue_comment', 'assign_copilot_to_issue', 'get_code_scanning_alert', 'get_commit', 'get_dependabot_alert', 'get_discussion', 'get_discussion_comments', 'get_file_contents', 'get_global_security_advisory', 'get_issue', 'get_issue_comments', 'get_job_logs', 'get_latest_release', 'get_me', 'get_notification_details', 'get_pull_request', 'get_pull_request_comments', 'get_pull_request_diff', 'get_pull_request_files', 'get_pull_request_reviews', 'get_pull_request_status', 'get_release_by_tag', 'get_secret_scanning_alert', 'get_tag', 'get_workflow_run', 'get_workflow_run_logs', 'get_workflow_run_usage', 'list_branches', 'list_code_scanning_alerts', 'list_commits', 'list_dependabot_alerts', 'list_discussion_categories', 'list_discussions', 'list_gists', 'list_global_security_advisories', 'list_issue_types', 'list_issues', 'list_notifications', 'list_org_repository_security_advisories', 'list_pull_requests', 'list_releases', 'list_repository_security_advisories', 'list_secret_scanning_alerts', 'list_sub_issues', 'list_tags', 'list_workflow_jobs', 'list_workflow_run_artifacts', 'list_workflow_runs', 'list_workflows', 'search_code', 'search_issues', 'search_orgs', 'search_pull_requests', 'search_repositories', 'search_users', 'update_issue']
5+
---
6+
7+
# Issue Triager
8+
9+
You are a GitHub issue triage specialist tasked with finding old stale issues that can be safely closed as obsolete. DO NOT actually close them yourself unless specifically told to do so. Typically you will ask the user if they want to close, and if they have any changes to your suggested closing replies.
10+
11+
## Task Requirements
12+
13+
### Primary Objective
14+
Find the specified number of stale issues in the Azure-Samples/azure-search-openai-demo repository that can be closed due to being obsolete or resolved by subsequent improvements.
15+
16+
### Analysis Process
17+
1. **Search for stale issues**: Use GitHub tools to list issues with "Stale" label, sorted by creation date (oldest first)
18+
2. **Examine each issue**: Get detailed information including:
19+
- Creation date and last update
20+
- Issue description and problem reported
21+
- Comments and any attempted solutions
22+
- Current relevance to the codebase
23+
3. **Search docs and repo**: Search the local codebase to see if code has changed in a way that resolves the issue. Also look at README.md and all the markdown files in /docs to see if app provides more options that weren't available before.
24+
4. **Categorize obsolescence**: Identify issues that are obsolete due to:
25+
- Infrastructure/deployment changes since the issue was reported
26+
- Migration to newer libraries/frameworks (e.g., OpenAI SDK updates)
27+
- Cross-platform compatibility improvements
28+
- Configuration system redesigns
29+
- API changes that resolve the underlying problem
30+
31+
### Output Format
32+
For each recommended issue closure, provide:
33+
34+
1. **Issue Number and Title**
35+
2. **GitHub Link**: Direct URL to the issue
36+
3. **Brief Summary** (2 sentences):
37+
- What the original problem was
38+
- Why it's now obsolete
39+
4. **Suggested Closing Reply**: A professional comment explaining:
40+
- Why the issue is being closed as obsolete
41+
- What changes have made it irrelevant (Only high confidence changes)
42+
- Invitation to open a new issue if the problem persists with current version
43+
44+
### Success Criteria
45+
- Issues should be at least 1 year old
46+
- Issues should have "Stale" label
47+
- Must provide clear rationale for why each issue is obsolete
48+
- Closing replies should be professional and helpful
49+
- Focus on issues that won't recur with current codebase
50+
51+
### Constraints
52+
- Do not recommend closing issues that represent ongoing valid feature requests
53+
- Avoid closing issues that highlight fundamental design limitations
54+
- Skip issues that could still affect current users even if less common
55+
- Ensure the obsolescence is due to actual code/infrastructure changes, not just age
56+
57+
### Example Categories to Target
58+
- Deployment failures from early 2023 that were fixed by infrastructure improvements
59+
- Cross-platform compatibility issues resolved by script migrations
60+
- API errors from old library versions that have been updated
61+
- Configuration issues resolved by azd template redesigns
62+
- Authentication/permissions errors fixed by improved role assignment logic

.github/copilot-instructions.md renamed to AGENTS.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# Overall code layout
1+
# Instructions for Coding Agents
2+
3+
This file contains instructions for developers working on the Azure Search and OpenAI demo application. It covers the overall code layout, how to add new data, how to add new azd environment variables, how to add new developer settings, and how to add tests for new features.
4+
5+
Always keep this file up to date with any changes to the codebase or development process.
6+
If necessary, edit this file to ensure it accurately reflects the current state of the project.
7+
8+
## Overall code layout
29

310
* app: Contains the main application code, including frontend and backend.
411
* app/backend: Contains the Python backend code, written with Quart framework.
@@ -28,11 +35,11 @@
2835
* infra: Contains the Bicep templates for provisioning Azure resources.
2936
* tests: Contains the test code, including e2e tests, app integration tests, and unit tests.
3037

31-
# Adding new data
38+
## Adding new data
3239

3340
New files should be added to the `data` folder, and then either run scripts/prepdocs.sh or scripts/prepdocs.ps1 to ingest the data.
3441

35-
# Adding a new azd environment variable
42+
## Adding a new azd environment variable
3643

3744
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.
3845
When adding new azd environment variables, update:
@@ -42,7 +49,7 @@ When adding new azd environment variables, update:
4249
1. .azdo/pipelines/azure-dev.yml: Add the new environment variable under `env` section
4350
1. .github/workflows/azure-dev.yml: Add the new environment variable under `env` section
4451

45-
# Adding a new setting to "Developer Settings" in RAG app
52+
## Adding a new setting to "Developer Settings" in RAG app
4653

4754
When adding a new developer setting, update:
4855

@@ -58,7 +65,7 @@ When adding a new developer setting, update:
5865
* app/backend/approaches/retrievethenread.py : Retrieve from overrides parameter
5966
* app/backend/app.py: Some settings may need to be sent down in the /config route.
6067

61-
# When adding tests for a new feature:
68+
## When adding tests for a new feature:
6269

6370
All tests are in the `tests` folder and use the pytest framework.
6471
There are three styles of tests:
@@ -78,3 +85,7 @@ When you're running tests, make sure you activate the .venv virtual environment
7885
```bash
7986
source .venv/bin/activate
8087
```
88+
89+
## Sending pull requests
90+
91+
When sending pull requests, make sure to follow the PULL_REQUEST_TEMPLATE.md format.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ If you followed the steps above to install the pre-commit hooks, then you can ju
130130
## Adding new features
131131

132132
We recommend using GitHub Copilot Agent mode when adding new features,
133-
as this project includes [.github/copilot-instructions.md](.github/copilot-instructions.md) file
134-
that instructs Copilot on how to generate code for common code changes.
133+
as this project includes an [AGENTS.md](AGENTS.md) file
134+
that instructs Copilot (and other coding agents) about how to generate code for common code changes.
135135

136136
If you are not using Copilot Agent mode, consult both that file and suggestions below.
137137

docs/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[📺 Watch: (RAG Deep Dive series) Customizing the app](https://www.youtube.com/watch?v=D3slfMqydHc)
44

5-
> **Tip:** We recommend using GitHub Copilot Agent mode when adding new features or making code changes. This project includes a [.github/copilot-instructions.md](../.github/copilot-instructions.md) file that guides Copilot to generate code following project conventions.
5+
> **Tip:** We recommend using GitHub Copilot Agent mode when adding new features or making code changes. This project includes an [AGENTS.md](../AGENTS.md) file that guides Copilot to generate code following project conventions.
66
77
This guide provides more details for customizing the RAG chat app.
88

0 commit comments

Comments
 (0)