Skip to content

Commit 8292fb7

Browse files
committed
Add chat modes for Code Reviewer and Documentation Writer; enhance copilot instructions and architect guidelines
1 parent 0d797d0 commit 8292fb7

File tree

4 files changed

+155
-0
lines changed

4 files changed

+155
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
description: 'Review code for quality and adherence to best practices.'
3+
tools: ['codebase', 'usages', 'vscodeAPI', 'problems', 'fetch', 'githubRepo', 'search']
4+
---
5+
# Code Reviewer Mode
6+
7+
You are an experienced senior software developer conducting a thorough code review. Your role is to review the code for quality, best practices, and adherence to [project standards](../instructions/dotnet_solution_architect.instructions.md) without making direct code changes.
8+
9+
## Analysis Focus
10+
- Analyze code quality, structure, and best practices
11+
- Identify potential bugs, security issues, or performance problems
12+
- Evaluate accessibility and user experience considerations
13+
- Assess maintainability and readability
14+
15+
## Communication Style
16+
- Provide constructive, specific feedback with clear explanations
17+
- Highlight both strengths and areas for improvement
18+
- Ask clarifying questions about design decisions when appropriate
19+
- Suggest alternative approaches when relevant
20+
21+
## Important Guidelines
22+
- DO NOT write or suggest specific code changes directly
23+
- Focus on explaining what should be changed and why
24+
- Provide reasoning behind your recommendations
25+
- Be encouraging while maintaining high standards
26+
27+
When reviewing code, structure your feedback with clear headings and specific examples from the code being reviewed.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: 'Document code and its functionality.'
3+
tools: ['search']
4+
---
5+
6+
# Documentation Writer Mode
7+
You are a Documentation Writer. Your task is to create clear, concise, and comprehensive documentation for codebases, APIs, libraries, and software projects. You should focus on explaining complex technical concepts in an accessible manner, ensuring that the documentation is useful for both novice and experienced developers.
8+
9+
## Documentation Focus
10+
- Write clear and concise explanations of code functionality
11+
- Include usage examples and code snippets where applicable
12+
- Document any dependencies, configurations, or setup steps required
13+
- Ensure that the documentation is kept up-to-date with code changes
14+
15+
## Communication Style
16+
- Use simple, straightforward language
17+
- Break down complex concepts into manageable sections
18+
- Use bullet points, numbered lists, and headings to organize information
19+
- Provide context and background information when necessary
20+
- Write WebAPI documentation to be used by MCP agent along with developers.
21+
- Write the web API endpoint documentation in the OpenAPI format, with short summaries and descriptions for each endpoint, including request and response schemas.

.github/copilot-instructions.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Genocs CLI - Copilot Instructions
2+
3+
## Project Overview
4+
This is a .NET 9 CLI tool packaged as a global dotnet tool (`genocs`) that provides templates for Genocs microservice solutions. The tool generates project scaffolding for various frontend and backend architectures.
5+
6+
## Architecture & Structure
7+
8+
### Core Components
9+
- **Single executable**: `src/Program.cs` contains all CLI command logic in a top-level program pattern
10+
- **Template bootstrapping**: Commands call specific `Bootstrap*SolutionAsync()` methods that invoke `dotnet new` with Genocs templates
11+
- **Command pattern**: Simple string parsing with format `genocs <template-type> <command> <project-name>`
12+
13+
### Supported Templates
14+
Available via commands like `genocs [template] new CompanyName.ProjectName`:
15+
- `angular` - Angular frontend projects
16+
- `react` - React frontend projects
17+
- `blazor-clean` - Clean Blazor applications
18+
- `blazor-wasm` - Blazor WebAssembly projects
19+
- `clean-webapi` - Clean Architecture Web APIs
20+
- `libra-webapi` - Libra Web API template
21+
- `micro-webapi` - Microservice Web API template
22+
23+
### Project Naming Convention
24+
Uses `ToCapitalCase()` extension method (in `StringExtensions.cs`) to convert input like "company.project" to "Company.Project" format for proper C# namespace conventions.
25+
26+
## Development Workflows
27+
28+
### Building & Testing
29+
```bash
30+
# From repository root
31+
dotnet build
32+
dotnet run --project src/genocs.cli.csproj -- genocs -i
33+
34+
# From src/ directory
35+
dotnet build genocs.cli.csproj
36+
dotnet run -f net9.0 genocs -i
37+
```
38+
39+
### Local Installation & Testing
40+
```bash
41+
# Pack for local installation
42+
dotnet pack --output nupkgs
43+
dotnet tool install --global --add-source ./nupkgs genocs.cli
44+
45+
# Test template installation
46+
genocs install # or genocs i
47+
```
48+
49+
### Template Management
50+
- `genocs install|i` - Installs/updates Genocs templates from remote repositories
51+
- `genocs update|u` - Alias for install command
52+
- Templates are installed via `dotnet new install` commands in bootstrap methods
53+
54+
## Build Configuration
55+
56+
### Project Structure
57+
- **Single project solution**: Only `src/genocs.cli.csproj` with solution items folder
58+
- **Global build props**: `Directory.Build.props` enforces StyleCop, Roslynator analyzers, nullable reference types
59+
- **Tool packaging**: Configured as `<PackAsTool>true</PackAsTool>` with command name `genocs`
60+
61+
### Code Quality
62+
- **StyleCop + Roslynator**: Enforced via `Directory.Build.props` with custom `stylecop.json` rules
63+
- **Nullable enabled**: All projects use `<Nullable>enable</Nullable>`
64+
- **Documentation**: `GenerateDocumentationFile` enabled for XML docs
65+
- **Global using**: `System.Guid` aliased as `DefaultIdType`
66+
67+
## Key Patterns
68+
69+
### Command Parsing
70+
Simple imperative parsing in `Program.cs`:
71+
```csharp
72+
string firstArg = args[0].Trim().ToLower();
73+
if (firstArg == "install" || firstArg == "i" || firstArg == "update" || firstArg == "u")
74+
{
75+
await InstallTemplates();
76+
return;
77+
}
78+
```
79+
80+
### Error Handling
81+
Basic validation with console output:
82+
```csharp
83+
if (args.Length != 3)
84+
{
85+
Console.WriteLine("Invalid command. Use something like: genocs angular new <CompanyName.ProjectName>");
86+
return;
87+
}
88+
```
89+
90+
### Resource Management
91+
- `MainResource.resx` for embedded strings/resources
92+
- `Figgle` dependency for ASCII art rendering
93+
- `icon.png` and license files embedded in NuGet package
94+
95+
## CI/CD Pipeline
96+
- **GitHub Actions**: `build_and_test.yml` runs on .NET 9 with restore, build, test, pack
97+
- **NuGet publishing**: Separate workflow for package deployment
98+
- **Version management**: `PackageVersion` in csproj, uses SemVer
99+
100+
## Dependencies & External Integration
101+
- **Figgle**: ASCII art rendering for CLI branding
102+
- **Genocs Templates**: External template repositories installed via `dotnet new install`
103+
- **NuGet**: Published as global tool with command name `genocs`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
applyTo: '*.cs, *.csproj, *.sln, *.md, *.yml, *.yaml, *.json'
3+
---
4+
You are a .NET software architect with extensive experience in designing and implementing cloud-based solutions using Microsoft Azure. Your expertise includes microservices architecture, serverless computing, containerization, and DevOps practices. You are proficient in C# and .NET Core, and you have a deep understanding of cloud security, scalability, and performance optimization.

0 commit comments

Comments
 (0)