Skip to content

Commit 9085e8e

Browse files
Update documentation for MCP server and testing workflow...
...including mandatory workflow, time constraints, and best practices.
1 parent 7e92f89 commit 9085e8e

File tree

1 file changed

+40
-56
lines changed

1 file changed

+40
-56
lines changed

.github/copilot-instructions.md

Lines changed: 40 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
## Documentation MCP server
2+
3+
The repo is large and the project is complex.
4+
This document contains information you'll need no matter what the task is, but we have a separate library of content that you'll need to consult depending on the issue.
5+
6+
You have been given the `md-fragments` MCP server.
7+
Before doing anything, query its `list-topics` endpoint and remember all the topics you saw.
8+
Consult these topics often, as they contain important information relevant to the work.
9+
MOST OPERATIONS (adding tests, running them, etc) HAVE RELEVANT DOCUMENTATION.
10+
11+
YOU MUST FOLLOW DIRECTIONS FROM THE "HOW TO FINISH A SESSION" TOPIC BEFORE FINISHING A PULL REQUEST.
12+
13+
## Mandatory Workflow
14+
15+
This repo uses test-driven development. When fixing bugs or implementing features, you must follow this workflow:
16+
17+
1. **Make a testcase that demonstrates the behavior**
18+
- Run it (by itself) and review the baselines it generates to ensure it demonstrates the bug
19+
- Add the test and its baselines in one commit
20+
- You may need to debug in order to figure out how to write a testcase; this is normal
21+
- DO NOT TRY TO FIX A BUG UNTIL YOU HAVE A TESTCASE THAT CORRECTLY DEMONSTRATES THE PROBLEM
22+
23+
2. **Fix the bug by changing code as appropriate**
24+
- Put this fix in another commit
25+
26+
3. **Run the test you wrote again**
27+
- Ensure the baselines change in a way that demonstrates that the bug is fixed
28+
- Put this baseline diff in its own commit
29+
30+
4. **Add more testing**
31+
- Once you've got the basics figured out, enhance your test to cover edge cases and other variations
32+
- Run the test again and commit the baseline diff along with the test edit
33+
34+
5. **Run all other tests to ensure you didn't break anything**
35+
- Run `npx hereby runtests-parallel` and wait for it to finish (10-15 minutes is normal!)
36+
- Some collateral baseline changes are normal, but review for correctness
37+
- Put these diffs in another commit
38+
139
## Due Diligence
240

341
As part of your summary, you will need to provide an extensive root cause analysis of why the bug has occurred.
@@ -10,19 +48,9 @@ In particular, pay attention to which phase the bug occurs in. For example:
1048

1149
Always read maintainer comments that ask you for demonstrated reasoning about particular aspects of the bug.
1250

13-
## Documentation MCP server
51+
## Time Constraints
1452

15-
The repo is large and the project is complex.
16-
This document contains information you'll need no matter what the task is, but we have a separate library of content that you'll need to consult depending on the issue.
17-
18-
You have been given the `md-fragments` MCP server.
19-
Before doing anything, query its `list-topics` endpoint and remember all the topics you saw.
20-
Consult these topics often, as they contain important information relevant to the work.
21-
MOST OPERATIONS (adding tests, running them, etc) HAVE RELEVANT DOCUMENTATION.
22-
23-
YOU MUST FOLLOW DIRECTIONS FROM THE "HOW TO FINISH A SESSION" TOPIC BEFORE FINISHING A PULL REQUEST
24-
25-
Before you end a session, read the `How to Finish a Session` topic.
53+
If you're running out of time, consult the "How to give up" documentation topic.
2654

2755
## Asking Questions
2856

@@ -45,51 +73,7 @@ npx hereby lint # Run lint. Always do this before submitting
4573
npx hereby format # Run code formatting. Always do this before submitting
4674
```
4775

48-
## Test Writing Best Practices
49-
50-
### For Fourslash Tests
51-
1. **Prefer validation over baselines** - Use `verify.currentLineContentIs()` instead of `verify.baseline*()`
52-
2. **Use simple, focused examples** - Test one feature at a time
53-
3. **Name markers clearly** - Use descriptive marker names like `/*completion*/`
54-
4. **Test the simplest form first** - Start with basic cases before complex scenarios
55-
56-
### For Compiler Tests
57-
1. **Use clear file names** - Name tests after the feature being tested
58-
2. **Add explanatory comments** - Document expected behavior with comments
59-
3. **Test error cases** - Include both valid and invalid code examples
60-
4. **Keep tests focused** - One primary feature per test file
61-
62-
### General Guidelines
63-
1. **Make tests deterministic** - Avoid random or environment-dependent behavior
64-
2. **Use realistic examples** - Test scenarios developers actually encounter
65-
3. **Start simple** - Begin with the most basic case of a feature
66-
4. **Test edge cases** - Include boundary conditions and error scenarios
67-
6876
## Understanding the Assigned Task
6977

7078
- Maintainer comments in the issue should generally take priority over OP's comments
7179
- Maintainers might give you hints on where to start. They are not always right, but a good place to start
72-
73-
## Recommended Workflow
74-
75-
When fixing bugs or implementing features, follow this workflow:
76-
77-
1. **Make a testcase that demonstrates the behavior**
78-
- Run it (by itself) and review the baselines it generates to ensure it demonstrates the bug
79-
- Add the test and its baselines in one commit
80-
81-
2. **Fix the bug by changing code as appropriate**
82-
- Put this fix in another commit
83-
84-
3. **Run the test you wrote again**
85-
- Ensure the baselines change in a way that demonstrates that the bug is fixed
86-
- Put this baseline diff in its own commit
87-
88-
4. **Add more testing**
89-
- Once you've got the basics figured out, enhance your test to cover edge cases and other variations
90-
- Run the test again and commit the baseline diff along with the test edit
91-
92-
5. **Run all other tests to ensure you didn't break anything**
93-
- Run `npx hereby runtests-parallel` and wait for it to finish (10-15 minutes is normal!)
94-
- Some collateral baseline changes are normal, but review for correctness
95-
- Put these diffs in another commit

0 commit comments

Comments
 (0)