get_modification_actions
Retrieve recommended actions to execute after modifying a file, ensuring compliance with project guidelines and safety protocols. Input the file path to generate actionable steps.
Instructions
Get actions that should be taken after modifying a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the file |
Implementation Reference
- src/index.ts:840-845 (handler)Main tool handler that extracts filePath argument, parses metadata using MetadataParser, calls RuleEngine.getActionsAfterModification, and returns JSON stringified actions.case 'get_modification_actions': { const filePath = args.filePath as string; const fileMetadata = await this.metadataParser.parseFileMetadata(filePath); const actions = this.ruleEngine.getActionsAfterModification(filePath, fileMetadata); return { content: [{ type: 'text', text: JSON.stringify(actions, null, 2) }] }; }
- src/index.ts:639-649 (schema)Tool schema definition with input validation for filePath parameter.{ name: 'get_modification_actions', description: 'Get actions that should be taken after modifying a file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the file' } }, required: ['filePath'] } },
- src/index.ts:639-649 (registration)Tool registration in the listTools response, defining name, description, and schema.{ name: 'get_modification_actions', description: 'Get actions that should be taken after modifying a file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the file' } }, required: ['filePath'] } },
- src/rule-engine.ts:99-115 (helper)Core helper function that computes the list of post-modification actions based on file metadata, including default actions and conditional ones for high-risk files or files with tests.getActionsAfterModification(filePath: string, metadata: AIMetadata | null): string[] { const actions: string[] = [ 'invalidate_approvals', 'update_last_modified', 'add_to_changelog' ]; if (metadata?.breakingChangesRisk === 'high') { actions.push('require_immediate_review'); } if (metadata?.tests && metadata.tests.length > 0) { actions.push('run_tests'); } return actions; }