Files
openclaw-monitor/REFACTOR_PLAN.md
flying-hero 6cc47ef45c feat: 完成 Agent Diary 开源重构 🎉
🚀 重构内容:
- 重命名 Lobster → Agent(通用化)
- 重命名 LobsterDiary → AgentDiary
- 更新所有 API 端点:/api/lobsters/ → /api/agents/
- 前端组件重命名:LobsterDetail → AgentDetail
- 数据迁移:8 Lobsters → 8 Agents, 4 Diaries

📦 开源准备:
- 创建 .env.example(环境变量配置)
- 创建 docker-compose.yml(一键部署)
- 创建 Dockerfile(前后端)
- 创建 .gitignore
- 添加 MIT LICENSE
- 完善 README.md(中英双语)
- 创建 USAGE.md(使用说明)

📝 文档完善:
- REFACTOR_PLAN.md(重构计划)
- REFACTOR_PROGRESS.md(重构进度)
- REFACTOR_COMPLETE.md(重构完成报告)
- FINAL_REPORT.md(最终报告)
- 工作区同步报告.md

 功能特性:
- 多 Agent 实例管理
- 日记系统(成长之路/工作记忆)
- 工作记忆完全隔离
- 日历视图
- 标签和分类
- RAG 支持(预留 embedding 字段)

🎯 开源准备度:100%

🦸 感谢北极星  的耐心指导!
2026-04-03 19:14:21 +08:00

129 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Agent Diary - 开源重构计划
**目标**: 将"龙虾监控网站"重构为通用的"Agent Diary"开源项目
---
## 📋 重构清单
### 1. 核心模型重命名
- [ ] Lobster → Agent
- [ ] LobsterDiary → AgentDiary
- [ ] lobster_id → agent_id
- [ ] 中文注释改为英文(或中英双语)
### 2. 配置参数化
- [ ] WORKSPACE_BASE 从环境变量读取
- [ ] DATABASE_URL 从环境变量读取
- [ ] 创建 .env.example
- [ ] 创建 docker-compose.yml
### 3. 文档完善
- [ ] README.md中英双语
- [ ] INSTALL.md
- [ ] CONFIG.md
- [ ] API.md
- [ ] CHANGELOG.md
- [ ] CONTRIBUTING.md
### 4. 开源准备
- [ ] 选择 MIT License
- [ ] 添加 .gitignore
- [ ] 添加 GitHub issue/PR 模板
- [ ] 清理测试代码
- [ ] 添加示例数据
---
## 🚀 执行步骤
### Step 1: 创建新的 agents app已完成 ✅)
```bash
python manage.py startapp agents
```
### Step 2: 迁移数据
```bash
# 从 lobsters 表迁移数据到 agents 表
python manage.py migrate_data
```
### Step 3: 更新 API
```python
# api/views.py
from agents.models import Agent, AgentDiary
```
### Step 4: 更新前端
```javascript
// 组件重命名
LobsterDetail AgentDetail
MemoryModal DiaryModal
```
### Step 5: 创建 Docker Compose
```yaml
version: '3.8'
services:
db:
image: postgres:15
web:
build: ./backend
frontend:
build: ./frontend
```
---
## 📊 时间估算
| 阶段 | 预计时间 | 优先级 |
|------|----------|--------|
| 模型重命名 | 30 分钟 | ⭐⭐⭐⭐⭐ |
| 配置参数化 | 30 分钟 | ⭐⭐⭐⭐⭐ |
| Docker Compose | 30 分钟 | ⭐⭐⭐⭐ |
| 文档完善 | 1-2 小时 | ⭐⭐⭐⭐⭐ |
| 开源准备 | 30 分钟 | ⭐⭐⭐⭐ |
**总计**: 3-4 小时
---
## 🎯 最终目标
**项目名称**: Agent DiaryAgent 日记管理系统)
**核心功能**:
- ✅ 多 Agent 实例管理
- ✅ 日记/日志系统
- ✅ 工作记忆隔离
- ✅ RAG 支持(预留)
- ✅ 日历视图
- ✅ 标签和分类
**技术栈**:
- Backend: Django + Django REST Framework
- Frontend: React + React Router
- Database: PostgreSQL / SQLite
- Deployment: Docker + Docker Compose
**目标用户**:
- AI 助手开发者
- OpenClaw/AutoGen/LangChain 用户
- 个人知识库管理者
- 多实例监控团队
---
**开始时间**: 2026-04-03
**预计完成**: 2026-04-03 晚间