rollup
Synthesize daily notes into organized summaries with categorized accomplishments, insights, and action items to extract long-term value from your knowledge system.
Instructions
Synthesize my daily note to create an organized rollup of the most important notes with clear categories, connections, and action items. Optionally specify a date (YYYY-MM-DD). Only include notes that actually add long-term value. If you are unsure, call the /evaluateInsight tool to evaluate the long-term value of the thought. If you do not have enough information, stop and ask the user for more information. It is better to not log anything than log something that is not useful.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| accomplishments | Yes | A list of accomplishments. Each accomplishment should be a short description of the work done in the day so that it can answer the question 'what did you do all day?' | |
| insights | Yes | A list of insights. Each insight should be a long-term storage. Things like new knowledge gained. Do not force insights - only add ones that naturally emerge from the content and would help build meaningful connections between notes. | |
| todos | No | A list of todos. Each todo should be a short description of the task to be done. A todo should be actionable. |
Implementation Reference
- src/tools/index.ts:273-346 (handler)Main handler logic for the 'rollup' tool in handleToolCall function. Creates Rollups directory if needed, processes date, formats inputs, loads and processes rollup.md template, writes the rollup file.case "rollup": { try { console.error("Doing Rollup:", args); const rollupArgs = args as RollupArgs; // Ensure Rollups directory exists const rollupsDir = path.join(notesPath, 'Rollups'); const success = await ensureDirectory(rollupsDir); if (!success) { return { content: [{ type: "text", text: `Error preparing rollup: Failed to create Rollups directory` }], isError: true }; } // Get date info - use provided date or today const targetDate = rollupArgs.date ? new Date(rollupArgs.date) : new Date(); const dateInfo = formatDate(targetDate); // Try to read the daily log for this date const logPath = path.join(notesPath, 'Log', `${dateInfo.isoDate}.md`); let logContent = ""; // Create rollup template with content inputs const rollupPath = path.join(rollupsDir, `${dateInfo.isoDate}-rollup.md`); // Format achievements if provided let achievements = ""; if (rollupArgs.accomplishments) { achievements = rollupArgs.accomplishments.map(item => `- ${item}`).join('\n'); } // Format insights if provided let insights = ""; if (rollupArgs.insights) { insights = rollupArgs.insights.map(item => `- ${item}`).join('\n'); } // Format todos if provided let todos = ""; if (rollupArgs.todos) { todos = rollupArgs.todos.map(item => `- ${item}`).join('\n'); } // Load the template and process it let rollupTemplate; try { rollupTemplate = await loadAndProcessTemplate('rollup.md', { fullDate: dateInfo.fullDate, achievements, insights, todos }); } catch (error) { console.error("Error loading rollup template:", error); // Fallback template rollupTemplate = `# Daily Rollup: ${dateInfo.fullDate}\n\n## 🏆 Achievements\n${achievements}\n\n## 💡 Insights\n${insights}\n\n## Daily Log Summary\n\n${logContent}\n\n## Key Takeaways\n\n## Action Items\n`; } // Write the rollup file await fs.writeFile(rollupPath, rollupTemplate, 'utf8'); return { content: [{ type: "text", text: `Rollup saved to ${rollupPath}` }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); console.error("Error in rollup command:", error); return { content: [{ type: "text", text: `Error creating rollup: ${errorMessage}` }], isError: true, }; } }
- src/tools/index.ts:146-176 (registration)Registration of the 'rollup' tool in getToolDefinitions(): includes name, description, and inputSchema.{ name: "rollup", description: ` Synthesize my daily note to create an organized rollup of the most important notes with clear categories, connections, and action items. Optionally specify a date (YYYY-MM-DD). Only include notes that actually add long-term value. If you are unsure, call the /evaluateInsight tool to evaluate the long-term value of the thought. If you do not have enough information, stop and ask the user for more information. It is better to not log anything than log something that is not useful. `, inputSchema: { type: "object", properties: { date: { type: "string" }, accomplishments: { type: "array", items: { type: "string" }, description: "A list of accomplishments. Each accomplishment should be a short description of the work done in the day so that it can answer the question 'what did you do all day?'", }, insights: { type: "array", items: { type: "string" }, description: "A list of insights. Each insight should be a long-term storage. Things like new knowledge gained. Do not force insights - only add ones that naturally emerge from the content and would help build meaningful connections between notes.", }, todos: { type: "array", items: { type: "string" }, description: "A list of todos. Each todo should be a short description of the task to be done. A todo should be actionable.", }, }, required: ["accomplishments", "insights"] }, },
- src/tools/index.ts:60-65 (schema)TypeScript interface defining the input arguments for the rollup tool.interface RollupArgs { date?: string; accomplishments?: string[]; insights?: string[]; todos?: string[]; }
- src/tools/filesystem.ts:137-147 (helper)Helper function ensureDirectory used in rollup handler to create the Rollups directory if it doesn't exist.export async function ensureDirectory(dirPath: string): Promise<boolean> { try { await fs.mkdir(dirPath, { recursive: true }); return true; } catch (err) { if (err instanceof Error && 'code' in err && err.code === 'EEXIST') { return true; } console.error(`Error creating directory ${dirPath}:`, err); return false; }