add_decision
Capture and document technical decisions by specifying a key, value, and reasoning for future reference, ensuring project awareness and clarity in code development.
Instructions
Record an important technical decision
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Decision key/name | |
| reasoning | Yes | Reasoning behind the decision | |
| value | Yes | Decision value |
Input Schema (JSON Schema)
{
"properties": {
"key": {
"description": "Decision key/name",
"type": "string"
},
"reasoning": {
"description": "Reasoning behind the decision",
"type": "string"
},
"value": {
"description": "Decision value",
"type": "string"
}
},
"required": [
"key",
"value",
"reasoning"
],
"type": "object"
}
Implementation Reference
- src/index.ts:579-591 (registration)Tool registration in ListToolsRequestSchema handler, including the input schema definition for add_decision{ name: 'add_decision', description: 'Record an important technical decision', inputSchema: { type: 'object', properties: { key: { type: 'string', description: 'Decision key/name' }, value: { type: 'string', description: 'Decision value' }, reasoning: { type: 'string', description: 'Reasoning behind the decision' } }, required: ['key', 'value', 'reasoning'] } },
- src/index.ts:803-809 (handler)MCP tool handler in CallToolRequestSchema switch statement that extracts parameters and delegates to MemoryManager.addImportantDecisioncase 'add_decision': { const key = args.key as string; const value = args.value as any; const reasoning = args.reasoning as string; await this.memoryManager.addImportantDecision(key, value, reasoning); return { content: [{ type: 'text', text: 'Decision recorded successfully' }] }; }
- src/memory-manager.ts:162-181 (helper)Core implementation in MemoryManager that stores the decision in current session and global decisions, then persists to project memory fileasync addImportantDecision(key: string, value: any, reasoning: string): Promise<void> { const memory = await this.getProjectMemory(); memory.currentSession.importantDecisions[key] = value; const decision: Decision = { id: this.generateId(), decision: `${key}: ${JSON.stringify(value)}`, reasoning, impact: [], timestamp: new Date().toISOString(), approvedBy: 'system', relatedFiles: [] }; memory.globalDecisions.push(decision); await this.saveProjectMemory(memory); console.log(chalk.yellow(`๐ก Decision recorded: ${key} = ${value}`)); }