rollup
Organize daily notes into a structured summary by categorizing accomplishments, insights, and action items. Focus on extracting long-term value to build meaningful connections between notes.
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 |
|---|---|---|---|
| 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?' | |
| date | No | ||
| 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)The handler function for the 'rollup' tool within the handleToolCall switch statement. It processes the arguments, ensures the Rollups directory exists, formats date, builds a rollup note from accomplishments, insights, todos using a template, writes it to file, and returns success or error.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)The registration of the 'rollup' tool in the getToolDefinitions() function, including its name, description, and input schema definition.{ 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 shape of arguments expected by the rollup handler.interface RollupArgs { date?: string; accomplishments?: string[]; insights?: string[]; todos?: string[]; }
- src/tools/index.ts:74-85 (helper)Helper function formatDate used in the rollup handler to format the target date for the rollup file naming and content.function formatDate(date = new Date()): DateInfo { // Parse the date string in UTC if it's a string const localDate = typeof date === 'string' ? new Date(date + 'T12:00:00.000Z') // Add time component and UTC indicator : new Date(date); return { dayOfWeek: format(localDate, 'EEEE'), fullDate: format(localDate, 'MMMM d, yyyy'), isoDate: format(localDate, 'yyyy-MM-dd') }; }