bootstrap
Initializes the AI coding assistant by automatically loading project context, daily logs, recent activities, summaries, todos, and module records in one step.
Instructions
【一键启动】自动读取传递链(context.md + daily + recent-5 + summary-10 + todos + 模块记录)。智能体启动时第一步调用。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:322-329 (handler)The MCP tool handler for 'bootstrap'. Calls the bootstrap() function and formatBootstrap() to produce the response.
private async handleBootstrap() { const result = bootstrap(); const formatted = formatBootstrap(result); return { content: [{ type: 'text', text: formatted }], }; } - src/prompts-loader.ts:71-79 (schema)The BootstrapResult interface defines the return type of bootstrap(), containing all context data like context.md, daily log, recent-5, summary-10, todos, logState, and modules.
export interface BootstrapResult { context: LoadedContext; daily: LoadedContext | null; recent5: LoadedContext; summary10: LoadedContext; todos: LoadedContext; logState: LogState | null; modules: string[]; } - src/prompts-loader.ts:143-153 (helper)The core bootstrap() function implementation – loads all prompts context (context.md, daily, recent-5, summary-10, todos, log-state.json, module list) and returns them as a BootstrapResult.
export function bootstrap(): BootstrapResult { const context = loadContext(); const daily = loadDaily(); const recent5 = loadRecent5(); const summary10 = loadSummary10(); const todos = loadTodos(); const logState = loadLogState(); const modules = listModules(); return { context, daily, recent5, summary10, todos, logState, modules }; } - src/prompts-loader.ts:158-228 (helper)Formats the bootstrap result into human-readable text with checkmarks, context summary, recent-5, summary-10, todos, log state, and module list.
export function formatBootstrap(result: BootstrapResult): string { const lines: string[] = []; lines.push('# 🚀 Prompts MCP Server - Bootstrap'); lines.push(''); lines.push('## ✅ 加载清单'); lines.push(''); lines.push(`✓ context.md: ${result.context.content ? '已加载' : '未找到'}`); lines.push(`✓ daily log: ${result.daily ? '已加载' : '今日无日志'}`); lines.push(`✓ recent-5.md: ${result.recent5.content ? '已加载' : '未找到'}`); lines.push(`✓ summary-10.md: ${result.summary10.content ? '已加载' : '未找到'}`); lines.push(`✓ todos.md: ${result.todos.content ? '已加载' : '未找到'}`); lines.push(`✓ 模块记录: ${result.modules.length > 0 ? result.modules.join(', ') : '无'}`); lines.push(''); // Context 摘要 if (result.context.content) { lines.push('## 📋 Context 摘要'); lines.push(''); const ctxLines = result.context.content.split('\n').slice(0, 20); lines.push(...ctxLines); if (result.context.content.split('\n').length > 20) lines.push('... (截断)'); lines.push(''); } // Recent 5 if (result.recent5.content) { lines.push('## 🔄 最近 5 条'); lines.push(''); lines.push(result.recent5.content); lines.push(''); } // Summary if (result.summary10.content) { lines.push('## 📊 摘要状态'); lines.push(''); lines.push(result.summary10.content); lines.push(''); } // Todos if (result.todos.content) { lines.push('## 📝 待办事项'); lines.push(''); lines.push(result.todos.content); lines.push(''); } // Log state if (result.logState) { lines.push('## 📈 日志状态'); lines.push(''); lines.push(`- 下一个 Entry ID: ${result.logState.nextEntryId}`); lines.push(`- 当前窗口: ${result.logState.windowId}`); lines.push(`- 窗口进度: ${result.logState.windowCount}/10`); lines.push(''); } // Modules if (result.modules.length > 0) { lines.push('## 📦 已有模块记录'); lines.push(''); for (const mod of result.modules) { lines.push(`- \`${mod}\``); } lines.push(''); } return lines.join('\n'); } - src/index.ts:101-108 (registration)Tool registration: defines the 'bootstrap' tool with name, description, and inputSchema (no parameters required).
{ name: 'bootstrap', description: '【一键启动】自动读取传递链(context.md + daily + recent-5 + summary-10 + todos + 模块记录)。智能体启动时第一步调用。', inputSchema: { type: 'object', properties: {}, }, },