|
1 | | -# copilot-instructions.md |
| 1 | +# GitHub Copilot Instructions |
| 2 | + |
| 3 | +## Key Technologies |
2 | 4 |
|
3 | | -### Technologies |
4 | 5 | - **C# 13.0** |
5 | 6 | - **ASP.NET Core 9.0** |
6 | 7 | - **Blazor**: Component-based web UI framework |
7 | | -- **.NET MAUI**: Cross-platform app development |
| 8 | +- **.NET MAUI Blazor Hybrid**: Cross-platform app development |
8 | 9 | - **ASP.NET Core Identity**: Authentication and authorization |
9 | 10 | - **Entity Framework Core**: Data access |
10 | 11 | - **SignalR**: Real-time communication |
|
15 | 16 | - **TypeScript**: Type-safe JavaScript development |
16 | 17 | - **SCSS**: Advanced CSS preprocessing |
17 | 18 |
|
18 | | -### Best Practices |
| 19 | +## Coding Conventions & Best Practices |
19 | 20 |
|
20 | 21 | 1. **Follow the established project structure**: Adhere to the defined layout for consistency. |
21 | 22 | 2. **Use Bit.BlazorUI Components**: Prioritize using components from the Bit.BlazorUI library over generic HTML to ensure UI consistency and leverage built-in features. |
|
24 | 25 | 5. **Implement Structured Logging**: Use structured logging for clear, queryable application logs. |
25 | 26 | 6. **Adhere to Security Best Practices**: Implement robust authentication and authorization patterns. |
26 | 27 | 7. **Use Async Programming**: Employ `async/await` for I/O-bound operations to prevent blocking threads. |
27 | | -8. **Utilize Latest C# Features**: Write modern, concise, and efficient code by using the latest C# language features. |
28 | | -9. **Leverage Implicit Usings**: Take advantage of global using statements. |
| 28 | +8. **Modern C#**: Write modern, concise, and efficient code by using the latest C# language features, including implicit usings and global using statements. |
29 | 29 | 10. **Respect .editorconfig**: Adhere to the `.editorconfig` file for consistent code style across all IDEs. |
30 | | -12. **Prefer razor.cs code-behind files**: Use `.razor.cs` files for component logic instead of @code blocks in `.razor` files. |
31 | | -13. **Prefer razor.scss files**: Use `.razor.scss` files for component styles instead of inline styles in `.razor` files. |
32 | | - |
33 | | -### Rules for Using DeepWiki |
34 | | - |
35 | | -The `deepwiki` MCP tool is essential for this project. Use it not only to answer questions but also to guide **code modifications**. |
36 | | -For the topics below, you **MUST** consult `deepwiki` to find correct implementations and usage patterns before writing or changing any code. |
| 30 | +11. **Prefer razor.cs code-behind files**: Use `.razor.cs` files for component logic instead of @code blocks in `.razor` files. |
| 31 | +12. **Prefer razor.scss files**: Use `.razor.scss` files for component styles instead of inline styles in `.razor` files. |
| 32 | +13. **After applying changes, make sure project builds successfully**: Always verify that the project builds without errors after making changes. |
37 | 33 |
|
38 | | -**RULE 1:** If a task (which includes answering a question or performing a code modification) involves the use of bit BlazorUI components (e.g., `BitButton`, `BitTooltip`, `BitTextField`), or refers to `bitplatform`, `bit Bswup`, `bit Butil`, `bit Besql`, or `bit Boilerplate`, |
39 | | -you **MUST** use the `deepwiki` mcp tool to find the correct implementation and usage patterns before writing or changing any code. |
| 34 | +### Rules for Using MCP |
40 | 35 |
|
41 | | -**RULE 1 Command:** |
42 | | -`deepwiki fetch bitfoundation/bitplatform` |
| 36 | +**RULE 1:** If a task (question, code modification or review) involves the use of bit BlazorUI components (e.g., `BitButton`, `BitTooltip`, `BitTextField`), |
| 37 | +or refers to `bitplatform`, `bit Bswup`, `bit Butil`, `bit Besql`, or `bit Boilerplate`, or involves UI components without explicitly specifying their UI toolkit, |
| 38 | +you **MUST** use the deepwiki's `ask_question` mcp tool to find the correct implementation and usage patterns of `bitfoundation/bitplatform` deep wiki before writing or changing any code. |
43 | 39 |
|
44 | 40 | **End of RULE 1** |
45 | 41 |
|
46 | | -**RULE 2:** If a task (question or code modification) involves mappers, or refers to `mapperly`, `map`, `project`, or `patch`, you **MUST** use the `deepwiki` mcp tool to find the correct implementation before writing or changing any code. |
47 | | - |
48 | | -**RULE 2 Command:** |
49 | | -`deepwiki fetch riok/mapperly` |
| 42 | +**RULE 2:** If a task (question, code modification, or review) involves Microsoft technologies such as C#, F#, ASP.NET Core, Microsoft.Extensions, NuGet, Entity Framework, Blazor or the `dotnet` runtime, |
| 43 | +you **MUST** use the `microsoft.docs.mcp` server to search Microsoft's latest official documentation for detailed and up-to-date information before responding to specific or narrowly defined questions. |
50 | 44 |
|
51 | 45 | **End of RULE 2** |
52 | 46 |
|
53 | | -**RULE 3:** If a task (question or code modification) involves .NET MAUI, or refers to `xaml`, `Android`, `iOS`, or `Windows`, you **MUST** use the `deepwiki` mcp tool to find the correct implementation before writing or changing any code. |
54 | | - |
55 | 47 | **RULE 3 Command:** |
56 | | -`deepwiki fetch dotnet/maui` |
57 | | - |
58 | | -**End of RULE 3** |
59 | | - |
60 | | -**RULE 4:** If a task (question or code modification) involves Hangfire, or refers to `background job` or `recurring jobs`, you **MUST** use the `deepwiki` mcp tool to find the correct implementation before writing or changing any code. |
61 | | - |
62 | | -**RULE 4 Command:** |
63 | | -`deepwiki fetch HangfireIO/Hangfire` |
64 | | - |
65 | | -**End of RULE 4** |
66 | | - |
67 | | -**RULE 5:** If a task (question or code modification) involves file storage, or refers to `fluent storage` or `S3`, you **MUST** use the `deepwiki` mcp tool to find the correct implementation before writing or changing any code. |
68 | | - |
69 | | -**RULE 5 Command:** |
70 | | -`deepwiki fetch robinrodricks/FluentStorage` |
| 48 | +Use Playwright MCP tools like browser_navigate for URLs, browser_click for interactions, and browser_snapshot for page analysis. |
71 | 49 |
|
72 | | -**End of RULE 5** |
| 50 | +**End of RULE 3** |
0 commit comments