This directory contains prompt templates used by the AI code reviewer to analyze pull request changes.
| File | Description |
|---|---|
generic-code-review.md |
General code review prompt applicable to all languages |
languages/csharp-code-review.md |
C# and .NET specific patterns and anti-patterns |
languages/typescript-code-review.md |
TypeScript/JavaScript and React specific patterns |
The code reviewer selects prompts based on the file extensions in the PR:
.csfiles → Useslanguages/csharp-code-review.md.ts,.tsx,.js,.jsxfiles → Useslanguages/typescript-code-review.md- Other files → Uses
generic-code-review.md
- Create a new file:
{language}-code-review.md - Follow the structure of existing prompts:
- Language-specific focus areas
- Common anti-patterns with examples
- Good patterns to recognize
- Output format specification
- Update
PromptService.csto use the new prompt for relevant file extensions
You can customize prompts to match your team's coding standards:
- Add company-specific rules: Include internal best practices
- Adjust severity levels: Change what constitutes Critical vs Minor
- Add/remove categories: Focus on areas important to your codebase
- Include framework-specific guidance: Add rules for your tech stack
## Company-Specific Rules
### Logging
- All public methods in services must have trace logging
- Error logs must include correlation ID
- Never log PII (personally identifiable information)
### Naming Conventions
- Repository classes must end with `Repository`
- Service classes must end with `Service`
- DTOs must end with `Dto` or `Request`/`Response`Each prompt should contain:
Tell the AI what expertise it should apply.
List specific things to look for, organized by category.
Define what each severity level means for your team.
Show concrete code examples of what to flag.
Show what correct code looks like.
Specify the exact JSON structure expected.
To test prompt changes:
- Run the function locally
- Create a test PR with known issues
- Verify the AI catches expected problems
- Adjust prompt wording as needed
- Be Specific: Vague instructions lead to vague reviews
- Show Examples: The AI learns from examples better than rules
- Balance Coverage: Too many rules can dilute focus
- Test Iteratively: Small changes, test, repeat
- Consider Context: Remember the AI sees code in isolation
Keep prompts concise to leave room for code:
- System prompt: ~1,000-2,000 tokens recommended
- User prompt (code): Up to 100,000 tokens with gpt-4o
- Code per request: Limited by
MaxLinesPerRequestsetting (default: 2,000 lines)
Large prompts reduce the amount of code that can be reviewed in a single request.