Custom Preambles

Add custom instructions to guide how AI tools interpret your code review feedback.

Preambles are text blocks prepended to your extracted comments. They provide context and instructions to AI tools, helping them understand how to process the feedback.

Why Use Preambles

Without a preamble, AI tools receive only the raw review comments. While this works, a preamble can:

  • Set expectations for the response format
  • Provide project-specific context (language, framework, conventions)
  • Define how to handle different types of feedback
  • Include relevant coding standards or guidelines

Creating a Preamble

  1. Click the GitSniper icon in your browser toolbar
  2. Enable Use Preamble if not already enabled
  3. Click Add New
  4. Enter a Name (for your reference) and the Preamble Text
  5. Click Save

Your preamble is now saved and will be included in all future extractions (while enabled).

Example Preambles

General Code Review

You are helping me address code review feedback on a pull request.

For each comment:
1. Explain what the reviewer is asking for
2. Provide the corrected code
3. Explain why the change improves the code

If a suggestion seems incorrect or has trade-offs, explain both perspectives.

TypeScript Project

This is a TypeScript project using:
- Strict mode enabled
- ESLint with Airbnb config
- Jest for testing

When addressing review comments:
- Ensure all code is properly typed (no `any`)
- Follow existing naming conventions
- Add JSDoc comments for public APIs
- Include relevant test cases when changing behaviour

Security-Focused Review

This review includes security-related feedback.

For each security comment:
1. Explain the vulnerability being addressed
2. Show the secure implementation
3. Reference relevant OWASP guidelines if applicable
4. Note any additional hardening that could be applied

Prioritise security comments over style suggestions.

Quick Fixes Only

Provide only the code changes needed to address each comment.
Use this format:

**File:** `path/to/file.ts`
**Lines:** X-Y
**Change:**
\`\`\`typescript
// corrected code here
\`\`\`

Skip explanations unless the change is non-obvious.

Managing Preambles

Selecting a Preamble

If you have multiple preambles, click on one to select it. The selected preamble appears highlighted and will be used for extractions.

Editing a Preamble

  1. Select the preamble you want to edit
  2. Click Edit
  3. Modify the name or text
  4. Click Save

Deleting a Preamble

  1. Select the preamble
  2. Click Delete
  3. Confirm the deletion

Disabling Preambles

To extract comments without any preamble, uncheck Use Preamble. Your saved preambles are preserved for later use.

Tips for Effective Preambles

Be Specific

Generic instructions produce generic responses. Include details about:

  • Your tech stack
  • Coding conventions
  • Response format preferences
  • Priority of different feedback types

Keep It Focused

Long preambles consume AI context. Include only information that affects how feedback should be handled.

Test and Iterate

Try your preamble on a few extractions. Refine based on how well the AI responses match your expectations.

Project-Specific Preambles

Create different preambles for different projects or contexts:

  • Frontend vs backend work
  • Security reviews vs feature reviews
  • Quick fixes vs detailed refactoring

Where Preambles Appear

When you extract with a preamble enabled, it appears at the very start of the output:

[Your preamble text here]

==================================================

EXTRACTED: PR #123 COMMENTS

...

This ensures the AI sees your instructions before processing the review comments.