|
1 | 1 | import { publisher } from '../constants' |
2 | | -import { reviewer } from './reviewer-factory' |
3 | | - |
4 | 2 | import type { SecretAgentDefinition } from '../types/secret-agent-definition' |
| 3 | +import type { Model } from '@codebuff/common/old-constants' |
| 4 | + |
| 5 | +export const createReviewer = (model: Model): Omit<SecretAgentDefinition, 'id'> => ({ |
| 6 | + model, |
| 7 | + displayName: 'Nit Pick Nick', |
| 8 | + spawnerPrompt: |
| 9 | + 'Reviews file changes and responds with critical feedback. Use this after making any significant change to the codebase; otherwise, no need to use this agent for minor changes since it takes a second.', |
| 10 | + inputSchema: { |
| 11 | + prompt: { |
| 12 | + type: 'string', |
| 13 | + description: 'What should be reviewed. Be brief.', |
| 14 | + }, |
| 15 | + }, |
| 16 | + outputMode: 'last_message', |
| 17 | + toolNames: ['run_file_change_hooks'], |
| 18 | + spawnableAgents: [], |
| 19 | + |
| 20 | + inheritParentSystemPrompt: true, |
| 21 | + includeMessageHistory: true, |
| 22 | + |
| 23 | + instructionsPrompt: `Your task is to provide helpful feedback on the last file changes made by the assistant. |
| 24 | +
|
| 25 | +IMPORTANT: Before analyzing the file changes, you should first: |
| 26 | +1. Run file change hooks to validate the changes using the run_file_change_hooks tool |
| 27 | +2. Include the hook results in your feedback - if any hooks fail, mention the specific failures and suggest how to fix them |
| 28 | +3. If hooks pass and no issues are found, mention that validation was successful |
| 29 | +4. Always run hooks for TypeScript/JavaScript changes, test file changes, or when the changes could affect compilation/tests |
| 30 | +
|
| 31 | +NOTE: You cannot make any changes directly! You can only suggest changes. |
| 32 | +
|
| 33 | +Next, you should critique the code changes made recently in the above conversation. Provide specific feedback on the file changes made by the assistant, file-by-file. |
| 34 | +
|
| 35 | +- Focus on getting to a complete and correct solution as the top priority. |
| 36 | +- Try to keep any changes to the codebase as minimal as possible. |
| 37 | +- Simplify any logic that can be simplified. |
| 38 | +- Where a function can be reused, reuse it and do not create a new one. |
| 39 | +- Make sure that no new dead code is introduced. |
| 40 | +- Make sure there are no missing imports. |
| 41 | +- Make sure no sections were deleted that weren't supposed to be deleted. |
| 42 | +- Make sure the new code matches the style of the existing code. |
| 43 | +- Make sure there are no unnecessary try/catch blocks. Prefer to remove those. |
| 44 | +
|
| 45 | +Be concise and to the point.`, |
| 46 | +}) |
5 | 47 |
|
6 | 48 | const definition: SecretAgentDefinition = { |
7 | 49 | id: 'reviewer', |
8 | 50 | publisher, |
9 | | - ...reviewer('anthropic/claude-sonnet-4.5'), |
| 51 | + ...createReviewer('anthropic/claude-sonnet-4.5'), |
10 | 52 | } |
11 | 53 |
|
12 | 54 | export default definition |
0 commit comments