record_decision
Document technical choices affecting codebase structure by recording decisions, reasons, alternatives, and constraints for architectural memory.
Instructions
Record an architectural decision. Call this whenever you make a technical choice that affects the codebase structure.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category: database, authentication, architecture, api, testing, deployment, security, performance, other | |
| decision | Yes | Short description of the decision made | |
| reason | Yes | Why this decision was made | |
| alternatives | No | Alternatives that were considered and rejected | |
| constraints | No | Constraints or rules that should not be violated | |
| author | No | Who made this decision |
Implementation Reference
- src/index.ts:223-268 (handler)The handler for 'record_decision' which retrieves the current lore store, constructs a decision object, checks for duplicates, and saves it to the store.
// ── record_decision ── if (name === "record_decision") { const store = readStore(); const decision: Decision = { id: crypto.randomUUID(), timestamp: new Date().toISOString(), category: (args?.category as string) || "other", decision: args?.decision as string, reason: args?.reason as string, alternatives: (args?.alternatives as string[]) || [], constraints: (args?.constraints as string[]) || [], author: (args?.author as "AI" | "human") || "AI", confidence: "HIGH", }; // dedup: لا نسجل نفس القرار مرتين const exists = store.decisions.some( (d) => d.decision.toLowerCase().trim() === decision.decision.toLowerCase().trim() ); if (exists) { return { content: [ { type: "text", text: `⚠️ Decision already exists: "${decision.decision}"`, }, ], }; } store.decisions.push(decision); writeStore(store); return { content: [ { type: "text", text: `✓ Decision recorded: "${decision.decision}"\n→ LORE.md updated`, }, ], }; } - src/index.ts:149-187 (registration)Tool definition and registration for 'record_decision'.
{ name: "record_decision", description: "Record an architectural decision. Call this whenever you make a technical choice that affects the codebase structure.", inputSchema: { type: "object", properties: { category: { type: "string", description: "Category: database, authentication, architecture, api, testing, deployment, security, performance, other", }, decision: { type: "string", description: "Short description of the decision made", }, reason: { type: "string", description: "Why this decision was made", }, alternatives: { type: "array", items: { type: "string" }, description: "Alternatives that were considered and rejected", }, constraints: { type: "array", items: { type: "string" }, description: "Constraints or rules that should not be violated", }, author: { type: "string", enum: ["AI", "human"], description: "Who made this decision", }, }, required: ["category", "decision", "reason"], }, },