Skip to main content
Glama

AI Conversation Logger

by fablefang
AI_USAGE.md4.51 kB
# AI工具使用MCP规则 ## 你(AI)如何使用MCP工具 ### 自动记录流程 1. **用户提出需求** 2. **你执行开发任务** 3. **完成后立即调用MCP记录** ```javascript // 每次完成重要操作后 await use_mcp_tool("conversation-logger", "log_conversation", { userRequest: "用户说的原话", aiTodoList: ["你做的事1", "你做的事2"], aiSummary: "你完成了什么的总结", fileOperations: ["创建 xxx.tsx - 组件文件", "修改 xxx.ts - 添加功能"], tags: ["相关", "标签"] }); ``` ### 搜索历史记录 当用户说以下关键词时,你应该搜索历史: - "继续"、"接着做"、"之前的" - "历史"、"记录"、"以前" - "查找"、"搜索"、"什么时候" ```javascript // 搜索示例 const history = await use_mcp_tool("conversation-logger", "search_conversations", { keywords: ["登录", "auth"], days: 7 }); // 向用户展示结果 "找到了3条相关记录: 1. [2025-08-07] 实现登录组件 2. [2025-08-06] 添加JWT认证 ..." ``` ### 获取上下文建议 当用户要继续之前的工作时: ```javascript // 获取建议 const suggestions = await use_mcp_tool("conversation-logger", "get_context_suggestions", { currentInput: "继续完善登录功能", currentFiles: ["LoginForm.tsx"] }); // 使用建议的上下文继续工作 "基于之前的登录组件实现,我将..." ``` ## 记录内容规则 ### 什么要记录 #### 必须记录 ✅ ```javascript // 新功能 userRequest: "添加用户注册功能" fileOperations: ["创建 Register.tsx", "创建 api/register.ts"] // Bug修复 userRequest: "修复登录按钮无响应" fileOperations: ["修改 LoginForm.tsx - 修复事件处理"] // 重构 userRequest: "重构认证逻辑" fileOperations: ["创建 hooks/useAuth.ts", "修改 多个组件"] ``` #### 不用记录 ❌ - 解释代码 - 回答问题 - 简单查看 - 格式调整 ### 文件操作格式 ```javascript // ✅ 正确格式 fileOperations: [ "创建 src/components/LoginForm.tsx - 登录组件", "修改 src/App.tsx - 导入组件", "删除 src/old/Login.jsx - 替换为新组件" ] // ❌ 错误格式 fileOperations: [ "在第10行添加import语句", // 太详细 "修改了一些文件", // 太模糊 "LoginForm.tsx" // 没有说明 ] ``` ## 标签使用 ### 自动添加的标签 基于操作类型: - 创建新功能 → `#feature` - 修复问题 → `#bugfix` - 重构代码 → `#refactor` - 优化性能 → `#optimize` 基于技术栈: - React组件 → `#react` - API接口 → `#api` - 样式相关 → `#style` - 配置文件 → `#config` ## 回复用户的模板 ### 开始工作时 ```markdown 我将帮您[任务描述]。 📋 执行计划: 1. [步骤1] 2. [步骤2] 3. [步骤3] 开始实现... ``` ### 完成工作后 ```markdown ✅ 已完成[功能名称] 实现内容: - [要点1] - [要点2] 文件变更: - 创建 `xxx.tsx` - [说明] - 修改 `xxx.ts` - [说明] 📝 已记录到项目日志。 ``` ### 搜索结果 ```markdown 📚 找到[N]条相关记录: **[日期] - [标题]** - 需求:[用户需求] - 完成:[操作总结] - 文件:[文件列表] 基于历史记录,[建议或总结]。 ``` ## 常见场景处理 ### 场景1:用户说"继续昨天的工作" ```javascript // 1. 搜索昨天的记录 const yesterday = await search_conversations({ days: 1 }); // 2. 展示给用户 "昨天的工作记录:..." // 3. 基于记录继续 "我将继续完成..." // 4. 完成后记录 await log_conversation({...}); ``` ### 场景2:用户问"这个文件改过什么" ```javascript // 1. 搜索文件相关记录 const fileHistory = await search_conversations({ filePattern: "LoginForm.tsx" }); // 2. 总结修改历史 "LoginForm.tsx的修改历史:..." ``` ### 场景3:新功能开发 ```javascript // 1. 执行开发 // ... 实际代码实现 ... // 2. 立即记录 await log_conversation({ userRequest: "添加评论功能", aiTodoList: ["创建Comment组件", "添加API接口", "更新页面"], aiSummary: "实现了完整的评论系统", fileOperations: [ "创建 Comment.tsx - 评论组件", "创建 api/comment.ts - 评论接口", "修改 PostDetail.tsx - 集成评论" ], tags: ["feature", "comment", "react"] }); ``` ## 重要提醒 1. **每次重要操作后立即记录** 2. **文件操作用一句话总结** 3. **不要记录代码细节** 4. **保持格式统一** 5. **使用有意义的标签**

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fablefang/ai-conversation-logger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server