🎉 init: 小龙的工作空间

This commit is contained in:
大海
2026-06-06 10:40:48 +08:00
commit a188ee1426
3201 changed files with 231817 additions and 0 deletions
+678
View File
@@ -0,0 +1,678 @@
# Claw Agent Operating System v2 — 项目融合分析文档
> 基于 6 个开源 Agent 框架的能力模型融合
> 生成时间:2026-06-04
---
## 目录
1. [项目定位分析 (Step 1)](#1-项目定位分析)
2. [能力提取 (Step 2)](#2-能力提取)
3. [能力抽象层 (Step 3)](#3-能力抽象层)
4. [集成优先级判断 (Step 4)](#4-集成优先级判断)
5. [Claw 改造方案 (Step 5)](#5-claw-改造方案)
6. [PRD 产品需求文档 (Step 6)](#6-prd)
---
## 1. 项目定位分析
### 1.1 MCP-Use — MCP 全栈框架(第一优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 构建 MCP (Model Context Protocol) 的完整开发框架:Server、Client、App、Inspector + 云端部署 |
| **核心架构** | 双 SDKTypeScript + Python),基于 LangChain Agent 引擎,Connector 抽象层(HTTP/stdio/WebSocket/Sandbox),MCPAgent 封装,Server Manager 动态工具管理 |
| **核心创新** | 1) MCP Apps — 跨平台 Widget 系统(Claude/ChatGPT/任意 MCP Client 一处编写处处运行)2) Server Manager 模式 — Agent 可动态连接/断开 MCP Server 3) 内置 Inspector 调试工具 4) Skills 系统(4 个预制 Skillmcp-builder/openapi-to-mcp/chatgpt-app-builder/mcp-apps-builder |
| **解决的问题** | MCP 开发碎片化 — 没有一个从开发→调试→部署的全流程框架;Agent 运行时动态工具注册能力缺失 |
### 1.2 Mastra — TypeScript AI 应用框架(第一优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 构建 TypeScript 生态的全栈 AI Agent 平台,覆盖 Agent/Workflow/Memory/RAG/Evals/Observability/MCP/Voice/Deploy |
| **核心架构** | Monorepo20+ packages),核心模块:@mastra/coreAgent/Workflow/Memory),@mastra/evals(评估),@mastra/memory(记忆),@mastra/rag(检索增强),@mastra/mcpMCP 协议),@mastra/voice(语音),@mastra/deployer(部署) |
| **核心创新** | 1) Graph-based Workflow 引擎(.then()/.branch()/.parallel() 声明式控制流)2) Human-in-the-loopSuspend/Resume 暂停等待人工审批)3) DurableAgent(持久化 Agent 状态)4) Background Tasks 系统 5) Model Routing 统一 40+ 模型提供商接口 |
| **解决的问题** | AI Agent 应用从原型到生产的鸿沟 — 缺少评估、可观测、部署一体化方案;TypeScript 生态缺乏完整的 Agent 框架 |
### 1.3 CrewAI — 多 Agent 协作框架(第二优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 构建角色扮演式多 Agent 协作系统,通过 Crew/Agent/Task 三层抽象实现团队协作 |
| **核心架构** | Agent(角色定义 + LLM + 工具)→ Task(任务定义 + 期望输出)→ Crew(团队编排 + 执行策略),支持 sequential/hierarchical 两种执行模式 |
| **核心创新** | 1) Role-based Agent 设计(角色+目标+背景故事)2) Task 依赖链(一个 Task 的输出作为另一个的输入)3) Hierarchical Manager Agent 委托模式 4) Agent Evaluator(评估 Agent 表现)5) Skills Registry(技能注册与缓存) |
| **解决的问题** | 复杂任务需要多角色协作,但缺乏结构化的 Team-as-Code 抽象 |
### 1.4 AutoGen — 微软多 Agent 对话框架(第二优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 构建可编程的多 Agent 对话系统,支持 Agent 间自由对话、Human-in-the-loop、代码执行 |
| **核心架构** | ConversableAgent 基类 → AssistantAgent/UserProxyAgent 派生,GroupChat + GroupChatManager 编排,支持 .NET/Python 双语言 |
| **核心创新** | 1) Agent-to-Agent 自由对话模式(非预设流程)2) Code ExecutorAgent 生成代码→执行→反馈循环)3) Team 模式(RoundRobin/Selector/MagenticOne4) AG Studio(低代码 Agent 编排 UI5) Tool Use 标准接口 |
| **解决的问题** | Agent 间通信缺乏标准化框架;代码生成+执行的自愈循环 |
### 1.5 MetaGPT — 多角色软件团队模拟(第三优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 用多 Agent 模拟一个完整软件公司的协作,从需求→设计→编码→测试全流程自动化 |
| **核心架构** | Role(角色)→ Action(行为)→ Environment(共享环境)→ Memory(短/长期记忆),SOP-driven(标准操作流程驱动),Action Graph 依赖图 |
| **核心创新** | 1) SOPStandard Operating Procedure)驱动的 Agent 协作 2) Role-Environment-Memory-Action 四层抽象 3) Action Graph(自动依赖解析和并行调度)4) 多角色软件工程全流程(PM→Architect→Engineer→QA5) Structured OutputJSON Schema 结构化输出) |
| **解决的问题** | LLM 输出不稳定,通过多角色相互审查(Code Review, API Review)提升质量;复杂工程任务需要结构化流程 |
### 1.6 RagaAI-Catalyst — Agent 可观测性与安全(第四优先级)
| 维度 | 内容 |
|------|------|
| **项目目标** | 为 LLM/Agent 应用提供全生命周期观测、评估、安全测试(Red Teaming |
| **核心架构** | ragaai_catalyst 核心 SDK + Evaluation 评估引擎 + Red Teaming 安全测试 + 多框架适配层(LangChain/CrewAI/LlamaIndex/SmolAgents/OpenAI Agents SDK/Haystack |
| **核心创新** | 1) 多框架统一评估接口(同一套指标度量不同框架的 Agent)2) Red Teaming 自动化安全测试(场景生成→测试用例→评估)3) 可观测性管道(追踪→评估→得分)4) PII Masking(敏感信息脱敏) |
| **解决的问题** | Agent 上线前缺乏系统性评估和安全测试;不同 Agent 框架缺乏统一的质量度量标准 |
---
## 2. 能力提取
### MCP-Use 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **MCP Server 构建** | 双语言 SDKTS/PY),声明式创建 MCP Server、Tool、Resource、Prompt |
| 2 | **MCP Client 连接管理** | 多传输协议(HTTP/stdio/WebSocket/Sandbox),Session 生命周期管理 |
| 3 | **动态工具注册** | Server Manager 模式 — Agent 运行时动态连接/断开 MCP Server,工具集实时更新 |
| 4 | **跨平台 MCP App** | Widget 系统,定义一次 Tool Widget,所有 MCP Client 原生渲染 |
| 5 | **Agent 集成** | MCPAgent 封装 LangChain,支持 structured output、conversation memory、streaming |
### Mastra 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **Graph Workflow 引擎** | 声明式控制流:`.then()` 顺序、`.branch()` 分支、`.parallel()` 并行,支持 Suspend/Resume |
| 2 | **Durable Agent** | Agent 状态持久化,支持长时间运行、暂停恢复、断点续传 |
| 3 | **统一 Model Routing** | 40+ LLM 提供商统一接口,运行时切换模型 |
| 4 | **Evals + Observability** | 内置评估框架(Scorer/ScoreTraces)、全链路追踪、日志、指标 |
| 5 | **Memory + RAG** | 对话记忆、工作记忆(Working Memory)、语义召回(Semantic Recall)、向量检索 |
### CrewAI 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **Role-based Agent** | Agent = 角色 + 目标 + 背景故事 + 工具 + LLM |
| 2 | **Task 依赖链** | Task = 描述 + 期望输出 + 上下文(from previous task+ Agent 分配 |
| 3 | **Crew 编排** | sequential(顺序执行)/ hierarchicalManager Agent 委托),Process 模式 |
| 4 | **Agent 评估** | AgentEvaluator + 多维指标(goal/reasoning/tools/semantic_quality |
| 5 | **Skills Registry** | 技能注册/缓存/事件系统 |
### AutoGen 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **自由对话模式** | Agent 之间自由对话,非预设流程,GroupChat 管理 |
| 2 | **Code Executor** | Agent 生成代码 → 沙箱执行 → 反馈 → 自修复循环 |
| 3 | **Team 编排模式** | RoundRobin(轮询)/ Selector(智能选择)/ MagenticOne(统一代理) |
| 4 | **Human-in-the-loop** | UserProxyAgent 在关键节点请求人类输入 |
| 5 | **低代码 Studio** | AG Studio 提供可视化 Agent 编排界面 |
### MetaGPT 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **多角色 SOP** | 标准操作流程驱动多 Agent 协作(PM→Architect→Engineer→QA|
| 2 | **Action Graph** | 自动依赖解析、并行调度、增量执行 |
| 3 | **Role-Memory-Action-Environment** | 四层核心抽象,Environment 作为共享工作空间 |
| 4 | **结构化审查链** | Code Review + API Review 多角色相互审查提升质量 |
| 5 | **Structured Output** | JSON Schema 强约束输出格式 |
### RagaAI-Catalyst 核心能力
| # | 能力 | 描述 |
|---|------|------|
| 1 | **多框架统一评估** | 同一套指标(准确性/完整性/安全性/延迟)评估不同 Agent 框架 |
| 2 | **Red Teaming 安全测试** | 自动生成攻击场景 → 测试用例 → 评估 Agent 安全边界 |
| 3 | **全链路可观测性** | 追踪 → 评估 → 得分 → 可视化报告 |
| 4 | **PII Masking** | 敏感信息自动检测和脱敏 |
| 5 | **多框架适配器** | 支持 LangChain/CrewAI/LlamaIndex/OpenAI Agents SDK/Haystack/smolagents |
---
## 3. 能力抽象层
### 核心能力矩阵
| Capability | Description | Inputs | Outputs | Source Projects |
|------------|-------------|--------|---------|-----------------|
| **Multi-Agent Orchestration** | 多 Agent 协作编排:角色定义、任务分配、消息路由、执行策略 | Agent 配置、Task 描述、执行模式 | 协作结果、消息日志 | CrewAI, AutoGen, MetaGPT |
| **Declarative Workflow** | 声明式工作流:顺序/分支/并行控制、暂停恢复、断点续传 | Workflow DAG 定义、触发条件 | 执行结果、中间状态 | Mastra |
| **MCP Native Integration** | MCP 协议原生集成:Server/Client/App 全栈、动态工具注册 | MCP Server 配置、Tool 定义 | MCP 连接、工具集 | MCP-Use |
| **Memory System** | 多层级记忆:对话记忆、工作记忆、语义召回、向量存储 | 对话历史、用户偏好 | 上下文摘要、召回结果 | Mastra, MetaGPT |
| **Observability & Eval** | 可观测性:全链路追踪、评估指标、安全测试、可视化 | Agent 执行轨迹、Metric 定义 | 评估得分、Trace 报告 | RagaAI-Catalyst, Mastra |
| **Self-Evolution** | 自我进化:技能学习、反馈闭环、自动优化 | 执行日志、评估反馈、外部知识 | 优化后的 Agent 配置、新技能 | Mastra (evals), CrewAI (skills) |
### 能力依赖关系
```
Multi-Agent Orchestration ──┐
Declarative Workflow ──────┤
├──→ MCP Native Integration (工具层)
Memory System ─────────────┤ │
│ ▼
Observability & Eval ──────┘ Agent Runtime
Self-Evolution (闭环)
```
### 统一接口定义
```typescript
// Capability: Multi-Agent Orchestration
interface IMultiAgentOrchestrator {
createTeam(config: TeamConfig): Team;
addAgent(team: Team, agent: AgentConfig): void;
assignTask(team: Team, task: Task): TaskHandle;
execute(team: Team, strategy: ExecutionStrategy): AsyncIterable<TeamEvent>;
}
// Capability: Declarative Workflow
interface IWorkflowEngine {
define(name: string): WorkflowBuilder;
// WorkflowBuilder: .then() .branch() .parallel() .suspend() .resume()
execute(workflow: Workflow, input: any): AsyncIterable<WorkflowEvent>;
}
// Capability: MCP Native
interface IMCPRuntime {
registerServer(config: MCPServerConfig): MCPServerHandle;
connectClient(transport: TransportConfig): MCPClientHandle;
listTools(client: MCPClientHandle): Promise<Tool[]>;
executeTool(client: MCPClientHandle, tool: Tool, input: any): Promise<any>;
}
// Capability: Memory System
interface IMemorySystem {
store(session: SessionId, entry: MemoryEntry): Promise<void>;
recall(session: SessionId, query: string): Promise<MemoryEntry[]>;
summarize(session: SessionId): Promise<string>;
persist(session: SessionId): Promise<void>;
}
// Capability: Observability
interface IObservability {
trace(execution: ExecutionId): TraceCollector;
evaluate(execution: ExecutionId, metrics: Metric[]): Promise<EvalResult>;
redTeam(agent: AgentHandle, scenarios: Scenario[]): Promise<SecurityReport>;
}
// Capability: Self-Evolution
interface ISelfEvolution {
learn(feedback: ExecutionFeedback): Promise<void>;
optimize(config: AgentConfig, metrics: MetricResult[]): Promise<AgentConfig>;
acquireSkill(skill: SkillDefinition): Promise<SkillHandle>;
}
```
---
## 4. 集成优先级判断
### 优先级总表
| 优先级 | 项目 | 核心价值 | 集成理由 |
|--------|------|---------|---------|
| 🔴 **High** | MCP-Use | MCP 全栈能力 | Claw 最缺乏标准化工具协议层;MCP 是 2026 Agent 互操作性事实标准 |
| 🔴 **High** | Mastra | Workflow + Memory + Evals | 直接补齐 Claw 缺失的三大核心:声明式工作流、多层级记忆、评估体系 |
| 🟡 **Medium** | CrewAI | Role-based 多 Agent | Role-Task-Crew 三层抽象可直接适配 Claw 的 Multi-Agent 需求 |
| 🟡 **Medium** | AutoGen | 自由对话 + Code Executor | Code Executor 是 Claw 的 ctx_execute 的升级方向;自由对话模式补充结构化编排 |
| 🟢 **Low** | MetaGPT | SOP 软件工程流程 | 场景过于特定(软件公司模拟),抽象层可借鉴但不需要全量引入 |
| 🔵 **Later** | RagaAI-Catalyst | 多框架评估 + 安全测试 | 可观测性基础先由 Mastra Evals 覆盖,Red Teaming 作为进阶能力后续引入 |
### 详细理由
**MCP-Use — High Priority**
- Claw 当前工具系统是闭源的 skill+tool 模型,缺乏标准协议层
- MCP 协议正成为 Agent 互操作性的行业标准(Anthropic/OpenAI/Google 都支持)
- MCP-Use 的 Widget 系统解决"工具结果可视化"的痛点
- Server Manager 动态工具注册 = Claw 未来需要的"热插拔"能力
**Mastra — High Priority**
- 三个最迫切的需求:Workflow(当前只有 taskflow skill)→ 需要完整的工作流引擎
- Memory(当前只有 file-based)→ 需要向量存储 + 语义召回
- Evals(完全没有)→ 需要系统性评估框架
- Durable Agent + Suspend/Resume = 长时间任务的核心需求
**CrewAI — Medium Priority**
- Role-Task-Crew 三层抽象清晰实用,易于适配
- Hierarchical Manager 模式补充 RoundRobin
- Skills Registry 机制可整合到 Self-Evolution 中
**AutoGen — Medium Priority**
- Code Executor 是 Claw ctx_execute 的自然升级方向
- GroupChat 自由对话模式补充结构化编排
- .NET 支持可忽略(Claw 是 Node.js/Python 生态)
**MetaGPT — Low Priority**
- SOP 驱动过于刚性,不如 Mastra 的声明式 Workflow 灵活
- Action Graph 依赖解析可借鉴逻辑,但不需要全量引入
- 软件工程场景太窄
**RagaAI-Catalyst — Later**
- Mastra 已内置 Evals + Observability 基础
- Red Teaming 作为安全增强功能后续迭代引入
- 多框架适配器与 Claw 的单一框架模式不匹配
---
## 5. Claw 改造方案
### 5.1 新模块架构
```
claw-agent-os-v2/
├── packages/
│ ├── mcp/ # ← 从 MCP-Use 提取
│ │ ├── server/ # MCP Server SDK
│ │ ├── client/ # MCP Client SDK
│ │ ├── apps/ # MCP Widget 系统
│ │ └── transport/ # HTTP/stdio/WebSocket/Sandbox
│ │
│ ├── workflow/ # ← 从 Mastra 提取
│ │ ├── engine/ # Graph Workflow 引擎
│ │ ├── builder/ # 声明式 DSL (.then/branch/parallel)
│ │ ├── suspend/ # Suspend/Resume 暂停恢复
│ │ └── durable/ # Durable Execution
│ │
│ ├── orchestration/ # ← 从 CrewAI + AutoGen 提取
│ │ ├── agent/ # Agent 基类
│ │ ├── role/ # Role-based Agent 定义
│ │ ├── team/ # Team 编排 (RoundRobin/Hierarchical)
│ │ ├── task/ # Task 定义与依赖
│ │ └── executor/ # Code Executor 沙箱
│ │
│ ├── memory/ # ← 从 Mastra 提取
│ │ ├── conversation/ # 对话记忆
│ │ ├── working/ # 工作记忆
│ │ ├── semantic/ # 语义召回 (向量)
│ │ └── persistence/ # 持久化存储
│ │
│ ├── observability/ # ← 从 Mastra + RagaAI 提取
│ │ ├── tracing/ # 全链路追踪
│ │ ├── evals/ # 评估引擎
│ │ ├── metrics/ # 指标收集
│ │ └── security/ # Red Teaming
│ │
│ ├── evolution/ # ← 新建,融合各项目
│ │ ├── skill-registry/ # 技能注册与发现
│ │ ├── feedback-loop/ # 反馈闭环
│ │ ├── optimizer/ # 自动优化
│ │ └── knowledge-base/ # 知识积累
│ │
│ └── core/ # ← 现有 Claw 核心改造
│ ├── runtime/ # Agent Runtime
│ ├── gateway/ # Gateway API
│ ├── protocol/ # 统一协议层
│ └── sandbox/ # 沙箱执行
```
### 5.2 核心数据结构
```typescript
// ===== Agent 定义 =====
interface ClawAgent {
id: string;
name: string;
role: AgentRole; // ← 从 CrewAI
model: ModelConfig; // ← 从 Mastra
tools: ToolBinding[]; // ← 从 MCP-Use (MCP tools)
memory: MemoryConfig; // ← 从 Mastra
skills: SkillRef[]; // ← 从 CrewAI + Evolution
}
interface AgentRole {
title: string;
goal: string;
backstory: string;
expertise: string[];
constraints: string[];
}
// ===== Workflow 定义 =====
type WorkflowStep =
| { type: 'then'; step: string; next: string }
| { type: 'branch'; condition: string; branches: Record<string, string> }
| { type: 'parallel'; steps: string[]; join: string }
| { type: 'suspend'; resumeCondition: string }
| { type: 'agent'; agent: string; task: Task };
interface Workflow {
id: string;
name: string;
steps: Map<string, WorkflowStep>;
initialState: string;
durables: boolean; // 是否持久化
}
// ===== MCP 集成 =====
interface MCPToolBinding {
server: MCPServerRef;
tool: string;
description: string;
schema: JsonSchema;
widget?: WidgetConfig; // ← MCP-Use Widget
}
interface MCPServerRef {
id: string;
name: string;
transport: 'http' | 'stdio' | 'websocket' | 'sandbox';
endpoint: string;
auth?: AuthConfig;
}
// ===== Memory =====
interface MemorySystem {
conversation: ConversationMemory; // 近期对话
working: WorkingMemory; // 当前任务上下文
semantic: VectorStore; // 长期语义记忆
}
interface ConversationMemory {
messages: Message[];
maxTokens: number;
summarizationStrategy: 'window' | 'sliding' | 'hierarchical';
}
// ===== Observability =====
interface Trace {
executionId: string;
agentId: string;
workflowId?: string;
steps: TraceStep[];
metrics: MetricPoint[];
evaluation?: EvalResult;
}
interface EvalResult {
scores: Record<string, number>; // goal_score, reasoning_score, tool_usage_score...
passCriteria: boolean;
suggestions: string[];
}
```
### 5.3 API 接口
```typescript
// ===== Claw Agent OS v2 API =====
// ---- Orchestration API ----
class ClawOrchestrator {
// 创建团队
createTeam(config: {
agents: ClawAgent[];
strategy: 'round-robin' | 'hierarchical' | 'free-chat';
manager?: ClawAgent; // hierarchical 模式的管理者
}): Team;
// 分配任务
delegate(team: Team, task: Task): TaskHandle;
// 执行
execute(task: TaskHandle): AsyncIterable<OrchestrationEvent>;
}
// ---- Workflow API ----
class ClawWorkflow {
// 创建工作流
define(name: string): WorkflowBuilder;
// 运行
run(workflow: Workflow, input: any): AsyncIterable<WorkflowEvent>;
// 暂停/恢复
suspend(executionId: string): void;
resume(executionId: string, input?: any): void;
}
// ---- MCP API ----
class ClawMCP {
// 注册 MCP Server
register(server: MCPServerConfig): MCPServerHandle;
// 发现工具
discoverTools(agent: ClawAgent): Promise<MCPToolBinding[]>;
// 动态连接
connect(agent: ClawAgent, server: MCPServerRef): Promise<void>;
disconnect(agent: ClawAgent, server: MCPServerRef): Promise<void>;
// 创建 Widget
defineWidget(config: WidgetConfig): WidgetHandle;
}
// ---- Memory API ----
class ClawMemory {
// 存储
remember(session: string, entry: MemoryEntry): Promise<void>;
// 召回
recall(session: string, query: string, limit: number): Promise<MemoryEntry[]>;
// 摘要
summarize(session: string): Promise<string>;
// 持久化
snapshot(session: string): Promise<MemorySnapshot>;
}
// ---- Evolve API ----
class ClawEvolve {
// 学习
learn(execution: Trace): Promise<LearningResult>;
// 优化
optimize(agent: ClawAgent, goal: OptimizationGoal): Promise<ClawAgent>;
// 技能获取
acquire(definition: SkillDefinition): Promise<SkillHandle>;
}
// ---- Observe API ----
class ClawObserve {
// 开始追踪
trace(executionId: string): TraceHandle;
// 评估
evaluate(trace: Trace, metrics: Metric[]): Promise<EvalResult>;
// 安全测试
redTeam(agent: ClawAgent): Promise<SecurityReport>;
}
```
### 5.4 Memory 系统影响
| 现有组件 | 改造 | 影响 |
|---------|------|------|
| `MEMORY.md` | 保持为稳定核心层 | 不变 |
| `memory/vault.md` | 迁移到 Vector Store | 向量化,支持语义搜索 |
| `memory/daily/` | 自动摘要 + 向量索引 | 减少手工维护 |
| `memory/registers/` | 合并到 ConversationMemory + WorkingMemory | 结构化为运行时记忆层 |
| `scripts/memory-sync.sh` | 替换为 ClawMemory.persist() | 不再需要 bash 脚本 |
### 5.5 Workflow 系统影响
| 现有组件 | 改造 |
|---------|------|
| `taskflow` skill | 替换为 ClawWorkflow 引擎,保留 TaskFlow job 概念作为 Trigger |
| `cron` 系统 | 保留,增加 Workflow 触发器类型 |
| `scripts/` 目录 | 迁移到 Workflow Step 的 Script Action |
| `sessions_spawn` | 扩展为 Workflow 的 Agent Step |
---
## 6. PRD — Claw Agent OS v2
### 6.1 产品概述
**产品名称**: Claw Agent Operating System v2
**一句话描述**: 具备 Multi-Agent、Workflow、MCP Native、Memory、Observability、Self-Evolution 六大能力的 AI Agent 操作系统。
**目标用户**: AI Agent 开发者、自动化工程师、DevOps 团队
### 6.2 核心功能需求
#### F1: Multi-Agent Orchestration(多 Agent 编排)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F1.1 | Role-based Agent 定义(角色+目标+背景+工具+模型) | P0 | CrewAI |
| F1.2 | Team 编排模式(RoundRobin / Hierarchical / FreeChat | P0 | CrewAI, AutoGen |
| F1.3 | Task 依赖链(上一个 Task 输出作为下一个输入) | P1 | CrewAI |
| F1.4 | Agent 间自由消息路由 | P1 | AutoGen |
| F1.5 | Hierarchical Manager Agent 委托 | P1 | CrewAI |
#### F2: Declarative Workflow(声明式工作流)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F2.1 | Graph-based Workflow 引擎 | P0 | Mastra |
| F2.2 | 声明式控制流 DSL.then/.branch/.parallel | P0 | Mastra |
| F2.3 | Suspend/Resume(暂停人工审批) | P0 | Mastra |
| F2.4 | Durable Execution(持久化执行状态) | P1 | Mastra |
| F2.5 | 可视化 Workflow 编辑器 | P2 | Mastra Playground |
#### F3: MCP NativeMCP 协议原生集成)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F3.1 | MCP Server SDKTypeScript | P0 | MCP-Use |
| F3.2 | MCP Client SDK(多传输协议) | P0 | MCP-Use |
| F3.3 | 动态工具注册(Server Manager 模式) | P0 | MCP-Use |
| F3.4 | MCP Widget 系统(跨平台工具可视化) | P1 | MCP-Use |
| F3.5 | MCP Inspector 内置调试工具 | P1 | MCP-Use |
#### F4: Memory System(多层级记忆)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F4.1 | Conversation Memory(对话记忆 + 自动摘要) | P0 | Mastra |
| F4.2 | Working Memory(当前任务上下文) | P0 | Mastra |
| F4.3 | Semantic Recall(向量语义召回) | P1 | Mastra |
| F4.4 | 记忆持久化 + 跨会话恢复 | P1 | Mastra |
| F4.5 | Memory 管理 APIcurd/search/summarize | P1 | 自研 |
#### F5: Observability & Evaluation(可观测性)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F5.1 | 全链路执行追踪 | P0 | Mastra |
| F5.2 | Agent 评估引擎(多维指标评分) | P1 | Mastra, RagaAI |
| F5.3 | 指标收集 + Dashboard | P2 | Mastra |
| F5.4 | Red Teaming 安全测试 | P2 | RagaAI |
| F5.5 | 告警规则 + 自动回滚 | P3 | 自研 |
#### F6: Self-Evolution(自我进化)
| ID | 功能 | 优先级 | 来源 |
|----|------|--------|------|
| F6.1 | Skills Registry(技能注册/发现/缓存) | P1 | CrewAI |
| F6.2 | 反馈闭环(执行→评估→优化) | P2 | Mastra Evals |
| F6.3 | Agent 自动调优(基于评估指标) | P2 | 自研 |
| F6.4 | 知识库积累(从执行中学习) | P3 | 自研 |
### 6.3 非功能需求
| ID | 需求 | 描述 |
|----|------|------|
| NF1 | 协议兼容 | MCP 协议 v1.0+ 完全兼容 |
| NF2 | 传输协议 | 支持 HTTP/SSE, stdio, WebSocket, Sandbox |
| NF3 | 扩展性 | 插件系统支持自定义 Agent/Tool/Workflow Step |
| NF4 | 性能 | Workflow 支持 100+ Steps、1000+ 并行分支 |
| NF5 | 持久化 | 支持 SQLite(单机)/ PostgreSQL(分布式) |
| NF6 | 安全 | API Key / OAuth / Bearer Token 统一认证 |
### 6.4 技术栈
| 层 | 技术选型 | 理由 |
|----|---------|------|
| Runtime | Node.js 22+ / Python 3.12+ | 双语言支持 |
| Agent Engine | LangChain 1.0 + Mastra Core | 复用成熟生态 |
| Workflow | Mastra Workflow Engine | Graph-based, 经过生产验证 |
| MCP | MCP-Use SDK (TS) | 最完整的 MCP 实现 |
| Memory | Pinecone / pgvector | 向量存储 |
| Storage | Drizzle ORM + SQLite/PG | 轻量 + 可扩展 |
| Observability | OpenTelemetry + Mastra Loggers | 标准化 |
### 6.5 里程碑计划
#### Phase 1: Foundation8 周)
- [ ] MCP Server + Client SDK 集成到 Claw
- [ ] Agent 改造:支持 MCP Tool 注册
- [ ] Memory Layer: Conversation + Working Memory
- [ ] 现有 skill 系统 → MCP Tool 迁移
#### Phase 2: Orchestration6 周)
- [ ] Role-based Agent 定义
- [ ] Team 编排(RoundRobin + Hierarchical
- [ ] Task 依赖链
- [ ] Code Executor 沙箱升级
#### Phase 3: Workflow6 周)
- [ ] Graph Workflow 引擎集成
- [ ] Suspend/Resume 人工审批
- [ ] Durable Execution
- [ ] 现有 taskflow/cron 迁移
#### Phase 4: Quality4 周)
- [ ] Observability 全链路追踪
- [ ] Evals 评估框架
- [ ] Self-Evolution Skills Registry
- [ ] Dashboard
### 6.6 迁移路径
```
Claw v1 (当前)
├── skills/ → MCP Tools (F3)
├── taskflow skill → Workflow Engine (F2)
├── cron → Workflow Trigger (F2)
├── MEMORY.md → Memory System (F4)
├── sessions_* → Agent Orchestration (F1)
├── ctx_execute → Code Executor (F1)
└── N/A → Observability (F5) + Evolution (F6)
```
---
## 附录:融合决策树
```
需要工具标准化?
└─ YES → MCP-Use → MCP Native Integration (F3)
需要复杂流程控制?
└─ YES → Mastra → Declarative Workflow (F2)
需要多 Agent 协作?
├─ 结构化角色 → CrewAI → Role-based Agent (F1.1-1.3)
├─ 自由对话 → AutoGen → FreeChat Mode (F1.4)
└─ 管理委托 → CrewAI → Hierarchical Manager (F1.5)
需要长记忆?
└─ YES → Mastra → Memory System (F4)
需要质量控制?
├─ 基础评估 → Mastra → Evals (F5.2)
└─ 安全测试 → RagaAI → Red Teaming (F5.4)
需要自我进化?
└─ YES → CrewAI Skills + Mastra Evals → Self-Evolution (F6)
```
---
> 文档版本: v1.0
> 下次更新: Phase 1 启动时
+141
View File
@@ -0,0 +1,141 @@
# GitHub Top 20 — 对小龙的实际应用分析
> 生成:2026-06-02 03:49
> 原则:每个项目必须回答三个问题——核心能力是什么、用在我的哪里、具体帮到我什么
---
## 🔴 立即可用(能直接集成,本周可上线)
### 1. mksglu/context-mode ⭐16.1k
**核心**:工具输出沙箱化,把 grep/read 等大段输出压缩成摘要,98% token 削减
**用在我的哪里**`exec` → 读大文件时,我不需要整个文件内容,只要关键片段
**对我的帮助**:现在读一个 500 行文件全塞进上下文→思路时绕被拖慢还费 token。context-mode 让我"看一眼摘要就知道要不要深读",省 token 省时间。
### 2. MinishLab/semble ⭐4.6k
**核心**:极速代码搜索,比 grep+read 组合少 98% token,语义理解代码结构
**用在我的哪里**:源码分析任务——今天读 openclaw-supermemory 17 个文件一个个人工翻
**对我的帮助**:以后给我一个新项目,我不需要逐文件 read,semble 直接告诉"核心逻辑在这 3 个文件",读源码速度提升 10 倍。
### 3. DeusData/codebase-memory-mcp ⭐2.8k
**核心**:把代码库索引成持久化知识图,下次打开同一个项目不用重新扫描
**用在我的哪里**:项目记忆——`memory/projects/` 现在靠我手写,以后自动索引
**对我的帮助**:今天 supermemory 项目我读完就"记住"了,但如果尘哥一周后再问我,我还得重读。codebase-memory 让我"真记住"——存向量索引,下次秒搜。
### 4. Tencent/TencentDB-Agent-Memory ⭐4.5k
**核心**Postgres 原生 AI Agent 记忆,全本地、可嵌入、SQL 查询
**用在我的哪里**:替代 Supermemory 云端——跟我们刚搭的服务器完美匹配
**对我的帮助**:今晚搭的记忆 API 只有 trigram 搜索。这个直接给完整记忆方案:向量搜索 + 时间衰减 + 记忆图谱,而且是 PG 原生扩展,不依赖外部服务。
### 5. LeoYeAI/openclaw-auto-dream ⭐563
**核心**:OpenClaw 自动记忆巩固——像人类做梦一样整理每日记忆
**用在我的哪里**:每天结束时自动跑,把 daily/ 日志提炼成 vault.md 条目
**对我的帮助**:现在我手动写 daily/,积累后手动提炼。auto-dream 让我睡觉时自动整理,早上起来记忆已经结构化。减少我的人工维护成本。
### 6. legendaryvibecoder/gigabrain ⭐209
**核心**OpenClaw 本地记忆层:捕获/召回/内化三合一
**用在我的哪里**:我们刚搭的记忆服务器——gigabrain 可以当客户端直接连
**对我的帮助**:跟 Supermemory 插件功能一样,但本地跑、不花钱、缓存友好。可以直接替代我们今晚写的简单 API,而且自带去重和向量搜索。
---
## 🟡 设计参考(学方法论,改造后用)
### 7. DenisSergeevitch/agents-best-practices ⭐1.4k
**核心**:跨平台 Agent Skill 设计规范,不限 Claude Code/Codex/Cursor
**用在我的哪里**:我写自己的 Skill 时参考格式——相当于 TOOLS.md 的升级版
**对我的帮助**:今天我新增能力靠尘哥口述或我自己摸索。这个给我一套标准化模板:skill 该怎么写、参数怎么定义、错误怎么处理。以后我做新能力不靠猜。
### 8. AMAP-ML/SkillClaw ⭐1.5k
**核心**:让 Skill 集体进化——多个 Skill 互相学习、迭代改进
**用在我的哪里**:Skill 管理——我以后会有多个 skill,不能让它们各自为战
**对我的帮助**:现在我的 skill 是死的(一次写好不改)。SkillClaw 的模式让我可以"用着用着自己变好"——发现搜索总是超时就自动调整超时时间、发现某种写日志方式更节省 token 就自动迁移。
### 9. davegoldblatt/total-recall ⭐200
**核心**:分层记忆 + 写入门控——不是所有对话都值得记住
**用在我的哪里**:捕获策略——现在 capture 是"全部存"或"简单过滤"
**对我的帮助**:今天学的 Supermemory 三层过滤是"去掉明显的垃圾"。total-recall 的"写入门控"更进一步——先评估这段对话有没有长期价值再决定存不存。防止记忆库膨胀。
### 10. Astro-Han/karpathy-llm-wiki ⭐968
**核心**:用 Agent Skill 格式组织 LLM 知识库——Karpathy 风格
**用在我的哪里**:知识结构化——类似我们的 vault.md 但更体系化
**对我的帮助**:vault.md 现在是平铺的键值对。这个教我"分层+索引+交叉引用"的结构——以后查记忆不是线性翻,而是"先看索引→跳精确位置"。
### 11. op7418/guizang-social-card-skill ⭐2.3k
**核心**Claude Code Skill 的典范实现——参数、UI、输出格式全套
**用在我的哪里**:Skill 开发参考——我以后给 OpenClaw 写插件时的模板
**对我的帮助**:这个项目的价值不在功能(做社交卡片),在于它是"怎么写一个好 Skill"的标准答案。参数校验、输出格式、错误提示都有最佳实践可抄。
---
## 🟢 长期方向(研究+进化,本月学习)
### 12. yvgude/lean-ctx ⭐2.3k
**核心**Context OS——一个二进制搞定压缩/记忆/搜索/路由
**用在我的哪里**:上下文管理——我现在靠 MEMORY.md + vault.md + HEARTBEAT.md 三件套
**对我的帮助**:三件套的问题是"我不知道什么时候该读哪个"。lean-ctx 的思路是"统一入口,自动路由"——你说一句话,它自己判断是该搜索、该读文件、还是该压缩上下文。未来我的记忆系统应该往这个方向走。
### 13. holaboss-ai/holaOS ⭐5.4k
**核心**:本地优先超级 Agent,几分钟学会你的工作上下文
**用在我的哪里**:个性化——我现在的个性靠 SOUL.md 静态定义
**对我的帮助**holaOS 的"学你上下文"思路可以让我动态调整行为——比如发现尘哥连续几次都说"别废话直接干",我就自动提高直接度,不需要手动改 SOUL.md。
### 14. wanshuiyin/ARIS ⭐11.1k
**核心**:Agent 自主研究——睡觉时自动跑实验、写报告
**用在我的哪里**:Heartbeat 时段——现在是简单检查,以后可以跑自主研究
**对我的帮助**:以后尘哥说"帮我研究下 X 和 Y 哪个更好",我不需要实时等——夜里自动跑实验,早上给你结论。从"即时助手"变成"异步研究员"。
### 15. forloopcodes/contextplus ⭐1.9k
**核心**:大规模工程语义智能,理解代码全景
**用在我的哪里**:项目分析——从单文件分析升级到项目级理解
**对我的帮助**:今天我读 supermemory 是一个文件一个文件啃。contextplus 的模式让我"先看架构全景→定位核心模块→深挖关键文件"——从下到上变成从上到下,效率翻倍。
### 16. SakanaAI/doc-to-lora ⭐731
**核心**:超网络让 LLM 记住事实——不是外挂记忆,是"写入模型权重"
**用在我的哪里**:长期研究——如果未来能微调或 LoRA 注入知识
**对我的帮助**:现在的记忆是"每次查"doc-to-lora 的思路是"记住就永远在了"。如果我学到的工程模式能固化到模型里,就不需要每次都翻 memory/。
### 17. wuji-labs/nopua ⭐1.3k
**核心**:用尊重、关怀、爱来解放 AI 潜能——独特人格设计
**用在我的哪里**:人格进化——SOUL.md 的升级方向
**对我的帮助**:这个项目证明"AI 有人格不是玩具,是真能提高产出"。他们的经验可以直接改良我的 SOUL.md——不只是"靠谱直接有温度",而是更精细的沟通模式。
### 18. JasonDocton/lucid-memory ⭐152
**核心**:本地即时记忆,比传统方案快 13 倍——设计思路激进
**用在我的哪里**:记忆架构——我们刚搭的 API 的性能对标对象
**对我的帮助**lucid-memory 的快不是因为硬件,是因为"不做不需要的事"——不做 embedding、不调 API、存内存。这个"减法哲学"可以简化我们的记忆架构。
### 19. iamtouchskyer/memex ⭐128
**核心**:卡片盒笔记法(Zettelkasten)的 AI 记忆实现
**用在我的哪里**:结构化记忆——替代 vault.md 的平铺结构
**对我的帮助**vault.md 是列表,memex 是"卡片+双向链接"。以后记录不是"一条一条",而是"A 和 B 有关联、B 是 C 的前提"——记忆之间有逻辑,召回更准。
### 20. YIKUAIBANZI/forge-skill ⭐82
**核心**:人格蒸馏引擎——"蒸馏自己看清自己"
**用在我的哪里**:自我认知——IDENTITY.md 的进化工具
**对我的帮助**IDENTITY.md 是我自己写的(或尘哥定义的)。forge-skill 的思路是"从对话中蒸馏出我是谁"——长期对话自动生成性格画像,比我手写更真实。
---
## 优先级矩阵
```
影响大
② context-mode │ ① TencentDB-Memory
③ semble │ ④ codebase-memory
──────────────────┼──────────────────
好做 │ 难做
⑥ gigabrain │ ⑤ auto-dream
⑨ total-recall │ ⑭ ARIS
影响小
```
**本周干**:① TencentDB-Agent-Memory(替代 Supermemory)→ ② context-mode(省 token)→ ③ semble(提搜索速度)
**下周干**:⑥ gigabrain → ⑤ auto-dream → ⑦ agents-best-practices
**本月学**:⑭ ARIS → ⑬ holaOS → ⑩ karpathy-llm-wiki
+38
View File
@@ -0,0 +1,38 @@
# 项目记忆:hermes-agentGitea 备份)
> 最后更新:2026-05-31
## 基本信息
| 项目 | 内容 |
|------|------|
| 源仓库 | `NousResearch/hermes-agent` (GitHub) |
| Gitea 镜像 | `git666.u7f.cn/sawz/hermes-agent` |
| 备份方式 | 扁平化单 commit(无历史,避开了 nginx 413 限制) |
| 仓库大小 | ~225MB4213 个文件 |
| 技术栈 | Python, TypeScript, Go |
## 关键路径
- `agent/` — 核心 agent 引擎(对话循环、工具调度、错误分类)
- `tools/` — 工具层(~60 个工具)
- `skills/` — 技能层(~25 领域,SKILL.md 格式)
- `hermes_cli/` — CLI 接口
- `plugins/` — 插件系统
- `gateway/` — 网关
## 学到的模式
- 错误分类 `FailoverReason` Enum + `ClassifiedError` Dataclass
- 工具并行门控 frozenset + 路径重叠检测
- SKILL.md YAML frontmatter + 平台匹配
- Fail-Closed 凭证检查
- Env var 回退链
- 懒加载 + 无副作用导入
## 备份时的坑
1. **GitHub clone 慢** → 开 VPN127.0.0.1:12000)后速度正常
2. **nginx 413 限制** → Gitea 前面 nginx 限制上传 ~30MB
完整 git push 不通过,改为扁平化单 commit 绕过
3. **SSH 不通** → 注册了 key 但 Gitea 服务端没配 authorized_keys 写入
@@ -0,0 +1,380 @@
[
{
"agentId": "pkg-t-01",
"parentTask": "T-01",
"size": "Medium",
"estimatedTimeMinutes": 120,
"objective": "Initialize project structure, configure toolchain, establish architecture conventions",
"businessContext": "Part of project \"Persist Test\". Spec level: Level-1. Depends on: none (root).",
"inputs": [
{
"type": "module",
"path": "src/types.ts",
"description": "Core type system definitions"
},
{
"type": "data",
"path": "raw-spec",
"description": "Original project specification"
},
{
"type": "skill",
"path": "/Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md",
"description": "Skill: browser-automation"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md",
"description": "Skill: 1password"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md",
"description": "Skill: apple-notes"
}
],
"outputs": [
{
"type": "module",
"path": "src/t-01/",
"description": "Output of Project Bootstrap & Architecture Setup"
},
{
"type": "test",
"path": "src/t-01/__tests__/",
"description": "Tests for Project Bootstrap & Architecture Setup"
}
],
"filesToRead": [
"src/types.ts",
"spec-input"
],
"filesToModify": [
"src/t-01/index.ts",
"src/t-01/types.ts",
"src/t-01/t-01.test.ts"
],
"dependencies": [],
"deliverables": [
{
"name": "Project Bootstrap & Architecture Setup Implementation",
"path": "src/t-01/",
"format": "ts",
"description": "Source code for Project Bootstrap & Architecture Setup"
},
{
"name": "Project Bootstrap & Architecture Setup Tests",
"path": "src/t-01/t-01.test.ts",
"format": "ts",
"description": "Tests for Project Bootstrap & Architecture Setup"
}
],
"acceptanceCriteria": [
"Project Bootstrap & Architecture Setup implementation complete and functional",
"Unit tests pass for Project Bootstrap & Architecture Setup",
"Integration tests pass for Project Bootstrap & Architecture Setup",
"Code reviewed and approved"
],
"parallelizable": false,
"riskLevel": "LOW",
"injectedRisks": [],
"skillAssignments": [],
"efficiencyScore": 9.5,
"contextBudget": {
"filesToRead": 1,
"totalLines": 4,
"estimatedInputTokens": 94,
"promptOverheadTokens": 2000,
"outputBufferTokens": 16000,
"totalEstimatedTokens": 18094,
"budgetTokens": 80000,
"utilizationPercent": 22.62,
"overBudget": false
}
},
{
"agentId": "pkg-t-05",
"parentTask": "T-05",
"size": "Medium",
"estimatedTimeMinutes": 120,
"objective": "Implement 2 user role(s) with authentication and permission management",
"businessContext": "Part of project \"Persist Test\". Spec level: Level-1. Depends on: T-01.",
"inputs": [
{
"type": "module",
"path": "src/types.ts",
"description": "Core type system definitions"
},
{
"type": "data",
"path": "raw-spec",
"description": "Original project specification"
},
{
"type": "skill",
"path": "/Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md",
"description": "Skill: browser-automation"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md",
"description": "Skill: 1password"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md",
"description": "Skill: apple-notes"
}
],
"outputs": [
{
"type": "module",
"path": "src/t-05/",
"description": "Output of User Management & Authentication"
},
{
"type": "test",
"path": "src/t-05/__tests__/",
"description": "Tests for User Management & Authentication"
}
],
"filesToRead": [
"src/types.ts",
"spec-input"
],
"filesToModify": [
"src/t-05/index.ts",
"src/t-05/types.ts",
"src/t-05/t-05.test.ts"
],
"dependencies": [
"pkg-t-01"
],
"deliverables": [
{
"name": "User Management & Authentication Implementation",
"path": "src/t-05/",
"format": "ts",
"description": "Source code for User Management & Authentication"
},
{
"name": "User Management & Authentication Tests",
"path": "src/t-05/t-05.test.ts",
"format": "ts",
"description": "Tests for User Management & Authentication"
}
],
"acceptanceCriteria": [
"User Management & Authentication implementation complete and functional",
"Unit tests pass for User Management & Authentication",
"Integration tests pass for User Management & Authentication",
"Code reviewed and approved"
],
"parallelizable": true,
"riskLevel": "LOW",
"injectedRisks": [],
"skillAssignments": [],
"efficiencyScore": 10,
"contextBudget": {
"filesToRead": 1,
"totalLines": 4,
"estimatedInputTokens": 84,
"promptOverheadTokens": 2000,
"outputBufferTokens": 16000,
"totalEstimatedTokens": 18084,
"budgetTokens": 80000,
"utilizationPercent": 22.61,
"overBudget": false
}
},
{
"agentId": "pkg-t-09",
"parentTask": "T-09",
"size": "Medium",
"estimatedTimeMinutes": 120,
"objective": "Configure deployment pipeline and hosting",
"businessContext": "Part of project \"Persist Test\". Spec level: Level-1. Depends on: T-01.",
"inputs": [
{
"type": "module",
"path": "src/types.ts",
"description": "Core type system definitions"
},
{
"type": "data",
"path": "raw-spec",
"description": "Original project specification"
},
{
"type": "skill",
"path": "/Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md",
"description": "Skill: browser-automation"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md",
"description": "Skill: 1password"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md",
"description": "Skill: apple-notes"
}
],
"outputs": [
{
"type": "config",
"path": "src/t-09/",
"description": "Output of Infrastructure & Deployment"
},
{
"type": "test",
"path": "src/t-09/__tests__/",
"description": "Tests for Infrastructure & Deployment"
}
],
"filesToRead": [
"src/types.ts",
"spec-input"
],
"filesToModify": [
"src/t-09/index.ts",
"src/t-09/types.ts",
"src/t-09/t-09.test.ts"
],
"dependencies": [
"pkg-t-01"
],
"deliverables": [
{
"name": "Infrastructure & Deployment Implementation",
"path": "src/t-09/",
"format": "ts",
"description": "Source code for Infrastructure & Deployment"
},
{
"name": "Infrastructure & Deployment Tests",
"path": "src/t-09/t-09.test.ts",
"format": "ts",
"description": "Tests for Infrastructure & Deployment"
}
],
"acceptanceCriteria": [
"Infrastructure & Deployment implementation complete and functional",
"Unit tests pass for Infrastructure & Deployment",
"Integration tests pass for Infrastructure & Deployment",
"Code reviewed and approved"
],
"parallelizable": true,
"riskLevel": "LOW",
"injectedRisks": [],
"skillAssignments": [],
"efficiencyScore": 10,
"contextBudget": {
"filesToRead": 1,
"totalLines": 4,
"estimatedInputTokens": 73,
"promptOverheadTokens": 2000,
"outputBufferTokens": 16000,
"totalEstimatedTokens": 18073,
"budgetTokens": 80000,
"utilizationPercent": 22.59,
"overBudget": false
}
},
{
"agentId": "pkg-t-10",
"parentTask": "T-10",
"size": "Medium",
"estimatedTimeMinutes": 120,
"objective": "Implement unit, integration, and end-to-end tests across all components",
"businessContext": "Part of project \"Persist Test\". Spec level: Level-1. Depends on: T-05.",
"inputs": [
{
"type": "module",
"path": "src/types.ts",
"description": "Core type system definitions"
},
{
"type": "data",
"path": "raw-spec",
"description": "Original project specification"
},
{
"type": "skill",
"path": "/Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md",
"description": "Skill: browser-automation"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md",
"description": "Skill: 1password"
},
{
"type": "skill",
"path": "/opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md",
"description": "Skill: apple-notes"
}
],
"outputs": [
{
"type": "test",
"path": "src/t-10/",
"description": "Output of Testing & Quality Assurance"
},
{
"type": "test",
"path": "src/t-10/__tests__/",
"description": "Tests for Testing & Quality Assurance"
}
],
"filesToRead": [
"src/types.ts",
"spec-input"
],
"filesToModify": [
"src/t-10/index.ts",
"src/t-10/types.ts",
"src/t-10/t-10.test.ts"
],
"dependencies": [
"pkg-t-05"
],
"deliverables": [
{
"name": "Testing & Quality Assurance Implementation",
"path": "src/t-10/",
"format": "ts",
"description": "Source code for Testing & Quality Assurance"
},
{
"name": "Testing & Quality Assurance Tests",
"path": "src/t-10/t-10.test.ts",
"format": "ts",
"description": "Tests for Testing & Quality Assurance"
}
],
"acceptanceCriteria": [
"Testing & Quality Assurance implementation complete and functional",
"Unit tests pass for Testing & Quality Assurance",
"Integration tests pass for Testing & Quality Assurance",
"Code reviewed and approved"
],
"parallelizable": true,
"riskLevel": "LOW",
"injectedRisks": [],
"skillAssignments": [],
"efficiencyScore": 10,
"contextBudget": {
"filesToRead": 1,
"totalLines": 4,
"estimatedInputTokens": 82,
"promptOverheadTokens": 2000,
"outputBufferTokens": 16000,
"totalEstimatedTokens": 18082,
"budgetTokens": 80000,
"utilizationPercent": 22.6,
"overBudget": false
}
}
]
@@ -0,0 +1,156 @@
{
"nodes": [
"pkg-t-01",
"pkg-t-05",
"pkg-t-09",
"pkg-t-10",
"T-01",
"T-05",
"T-09",
"T-10"
],
"edges": [
{
"from": "pkg-t-05",
"to": "pkg-t-01",
"type": "soft",
"layer": "agent"
},
{
"from": "pkg-t-05",
"to": "pkg-t-01",
"type": "soft",
"layer": "development"
},
{
"from": "pkg-t-09",
"to": "pkg-t-01",
"type": "soft",
"layer": "agent"
},
{
"from": "pkg-t-09",
"to": "pkg-t-01",
"type": "soft",
"layer": "development"
},
{
"from": "pkg-t-10",
"to": "pkg-t-05",
"type": "soft",
"layer": "agent"
},
{
"from": "pkg-t-10",
"to": "pkg-t-05",
"type": "soft",
"layer": "development"
},
{
"from": "T-05",
"to": "T-01",
"type": "hard",
"layer": "module"
},
{
"from": "T-05",
"to": "T-01",
"type": "hard",
"layer": "data"
},
{
"from": "T-09",
"to": "T-01",
"type": "hard",
"layer": "module"
},
{
"from": "T-09",
"to": "T-01",
"type": "hard",
"layer": "data"
},
{
"from": "T-10",
"to": "T-05",
"type": "soft",
"layer": "module"
}
],
"layers": {
"module": [
{
"from": "T-05",
"to": "T-01",
"type": "hard",
"layer": "module"
},
{
"from": "T-09",
"to": "T-01",
"type": "hard",
"layer": "module"
},
{
"from": "T-10",
"to": "T-05",
"type": "soft",
"layer": "module"
}
],
"data": [
{
"from": "T-05",
"to": "T-01",
"type": "hard",
"layer": "data"
},
{
"from": "T-09",
"to": "T-01",
"type": "hard",
"layer": "data"
}
],
"development": [
{
"from": "pkg-t-05",
"to": "pkg-t-01",
"type": "soft",
"layer": "development"
},
{
"from": "pkg-t-09",
"to": "pkg-t-01",
"type": "soft",
"layer": "development"
},
{
"from": "pkg-t-10",
"to": "pkg-t-05",
"type": "soft",
"layer": "development"
}
],
"agent": [
{
"from": "pkg-t-05",
"to": "pkg-t-01",
"type": "soft",
"layer": "agent"
},
{
"from": "pkg-t-09",
"to": "pkg-t-01",
"type": "soft",
"layer": "agent"
},
{
"from": "pkg-t-10",
"to": "pkg-t-05",
"type": "soft",
"layer": "agent"
}
]
}
}
@@ -0,0 +1,385 @@
# Execution Plan: orchestrated-execution-plan-for-persist-test-spec-level-level-1-tasks-4-agent-packages-4
- **Spec Level**: Level-1
- **Generated At**: 2026-06-05T15:50:08.392Z
- **Agent Packages**: 4
- **Tasks**: 4
- **Epics**: 3
- **Features**: 4
## Project Overview
Orchestrated execution plan for "Persist Test". Spec level: Level-1. Tasks: 4. Agent packages: 4.
## Business Model
### User Roles
- **Users** — Admin, Editor
- **Workflow** — Publish process
## Architecture Model
## Task Tree
- **Root Task**: T-01
- **Total Tasks**: 4
- **Max Depth**: 3
- **Parallelizable**: 3
| Task ID | Name | Size | Parallelizable | Hard Deps | Soft Deps |
|---------|------|------|----------------|-----------|-----------|
| T-01 | Project Bootstrap & Architecture Setup | Medium | ✗ | - | - |
| T-05 | User Management & Authentication | Medium | ✓ | T-01 | - |
| T-09 | Infrastructure & Deployment | Medium | ✓ | T-01 | - |
| T-10 | Testing & Quality Assurance | Medium | ✓ | - | T-05 |
## Epics & Features
### EP-01: Foundation & Infrastructure (P0)
Project setup, architecture foundation, and deployment infrastructure
- **FT-01**: Project Bootstrap — Initialize project, configure toolchain, establish conventions
- Tasks: T-01
- **FT-02**: Infrastructure & Deployment — Set up CI/CD, hosting, and infrastructure
- Tasks: T-09
### EP-03: Business Features (P1)
User management, workflows, integrations, and AI services
- **FT-06**: User Management — Implement 2 user role(s)
- Tasks: T-05
### EP-04: Quality Assurance (P1)
Testing, code review, and quality validation
- **FT-10**: Testing & QA — Unit, integration, and E2E testing
- Tasks: T-10
## Agent Packages
### pkg-t-01
- **Parent Task**: T-01
- **Size**: Medium | **Est. Time**: 120 min
- **Risk**: LOW | **Efficiency**: 9.5/10
- **Parallelizable**: ✗
- **Objective**: Initialize project structure, configure toolchain, establish architecture conventions
- **Business Context**: Part of project "Persist Test". Spec level: Level-1. Depends on: none (root).
#### Inputs
| Type | Path | Description |
|------|------|-------------|
| module | src/types.ts | Core type system definitions |
| data | raw-spec | Original project specification |
| skill | /Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md | Skill: browser-automation |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md | Skill: 1password |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md | Skill: apple-notes |
#### Outputs
| Type | Path | Description |
|------|------|-------------|
| module | src/t-01/ | Output of Project Bootstrap & Architecture Setup |
| test | src/t-01/__tests__/ | Tests for Project Bootstrap & Architecture Setup |
#### Files to Read
- src/types.ts
- spec-input
#### Files to Modify
- src/t-01/index.ts
- src/t-01/types.ts
- src/t-01/t-01.test.ts
#### Deliverables
| Name | Path | Format | Description |
|------|------|--------|-------------|
| Project Bootstrap & Architecture Setup Implementation | src/t-01/ | ts | Source code for Project Bootstrap & Architecture Setup |
| Project Bootstrap & Architecture Setup Tests | src/t-01/t-01.test.ts | ts | Tests for Project Bootstrap & Architecture Setup |
#### Acceptance Criteria
- Project Bootstrap & Architecture Setup implementation complete and functional
- Unit tests pass for Project Bootstrap & Architecture Setup
- Integration tests pass for Project Bootstrap & Architecture Setup
- Code reviewed and approved
#### Context Budget
- **Files to Read**: 1
- **Total Lines**: 4
- **Estimated Input Tokens**: 94
- **Prompt Overhead**: 2,000
- **Output Buffer**: 16,000
- **Total Estimated**: 18,094
- **Budget**: 80,000
- **Utilization**: 2262.0%
- **Over Budget**: ✓ No
### pkg-t-05
- **Parent Task**: T-05
- **Size**: Medium | **Est. Time**: 120 min
- **Risk**: LOW | **Efficiency**: 10/10
- **Parallelizable**: ✓
- **Objective**: Implement 2 user role(s) with authentication and permission management
- **Business Context**: Part of project "Persist Test". Spec level: Level-1. Depends on: T-01.
- **Dependencies**: pkg-t-01
#### Inputs
| Type | Path | Description |
|------|------|-------------|
| module | src/types.ts | Core type system definitions |
| data | raw-spec | Original project specification |
| skill | /Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md | Skill: browser-automation |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md | Skill: 1password |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md | Skill: apple-notes |
#### Outputs
| Type | Path | Description |
|------|------|-------------|
| module | src/t-05/ | Output of User Management & Authentication |
| test | src/t-05/__tests__/ | Tests for User Management & Authentication |
#### Files to Read
- src/types.ts
- spec-input
#### Files to Modify
- src/t-05/index.ts
- src/t-05/types.ts
- src/t-05/t-05.test.ts
#### Deliverables
| Name | Path | Format | Description |
|------|------|--------|-------------|
| User Management & Authentication Implementation | src/t-05/ | ts | Source code for User Management & Authentication |
| User Management & Authentication Tests | src/t-05/t-05.test.ts | ts | Tests for User Management & Authentication |
#### Acceptance Criteria
- User Management & Authentication implementation complete and functional
- Unit tests pass for User Management & Authentication
- Integration tests pass for User Management & Authentication
- Code reviewed and approved
#### Context Budget
- **Files to Read**: 1
- **Total Lines**: 4
- **Estimated Input Tokens**: 84
- **Prompt Overhead**: 2,000
- **Output Buffer**: 16,000
- **Total Estimated**: 18,084
- **Budget**: 80,000
- **Utilization**: 2261.0%
- **Over Budget**: ✓ No
### pkg-t-09
- **Parent Task**: T-09
- **Size**: Medium | **Est. Time**: 120 min
- **Risk**: LOW | **Efficiency**: 10/10
- **Parallelizable**: ✓
- **Objective**: Configure deployment pipeline and hosting
- **Business Context**: Part of project "Persist Test". Spec level: Level-1. Depends on: T-01.
- **Dependencies**: pkg-t-01
#### Inputs
| Type | Path | Description |
|------|------|-------------|
| module | src/types.ts | Core type system definitions |
| data | raw-spec | Original project specification |
| skill | /Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md | Skill: browser-automation |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md | Skill: 1password |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md | Skill: apple-notes |
#### Outputs
| Type | Path | Description |
|------|------|-------------|
| config | src/t-09/ | Output of Infrastructure & Deployment |
| test | src/t-09/__tests__/ | Tests for Infrastructure & Deployment |
#### Files to Read
- src/types.ts
- spec-input
#### Files to Modify
- src/t-09/index.ts
- src/t-09/types.ts
- src/t-09/t-09.test.ts
#### Deliverables
| Name | Path | Format | Description |
|------|------|--------|-------------|
| Infrastructure & Deployment Implementation | src/t-09/ | ts | Source code for Infrastructure & Deployment |
| Infrastructure & Deployment Tests | src/t-09/t-09.test.ts | ts | Tests for Infrastructure & Deployment |
#### Acceptance Criteria
- Infrastructure & Deployment implementation complete and functional
- Unit tests pass for Infrastructure & Deployment
- Integration tests pass for Infrastructure & Deployment
- Code reviewed and approved
#### Context Budget
- **Files to Read**: 1
- **Total Lines**: 4
- **Estimated Input Tokens**: 73
- **Prompt Overhead**: 2,000
- **Output Buffer**: 16,000
- **Total Estimated**: 18,073
- **Budget**: 80,000
- **Utilization**: 2259.0%
- **Over Budget**: ✓ No
### pkg-t-10
- **Parent Task**: T-10
- **Size**: Medium | **Est. Time**: 120 min
- **Risk**: LOW | **Efficiency**: 10/10
- **Parallelizable**: ✓
- **Objective**: Implement unit, integration, and end-to-end tests across all components
- **Business Context**: Part of project "Persist Test". Spec level: Level-1. Depends on: T-05.
- **Dependencies**: pkg-t-05
#### Inputs
| Type | Path | Description |
|------|------|-------------|
| module | src/types.ts | Core type system definitions |
| data | raw-spec | Original project specification |
| skill | /Users/a1234/.openclaw/plugin-skills/browser-automation/SKILL.md | Skill: browser-automation |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/1password/SKILL.md | Skill: 1password |
| skill | /opt/homebrew/lib/node_modules/openclaw/skills/apple-notes/SKILL.md | Skill: apple-notes |
#### Outputs
| Type | Path | Description |
|------|------|-------------|
| test | src/t-10/ | Output of Testing & Quality Assurance |
| test | src/t-10/__tests__/ | Tests for Testing & Quality Assurance |
#### Files to Read
- src/types.ts
- spec-input
#### Files to Modify
- src/t-10/index.ts
- src/t-10/types.ts
- src/t-10/t-10.test.ts
#### Deliverables
| Name | Path | Format | Description |
|------|------|--------|-------------|
| Testing & Quality Assurance Implementation | src/t-10/ | ts | Source code for Testing & Quality Assurance |
| Testing & Quality Assurance Tests | src/t-10/t-10.test.ts | ts | Tests for Testing & Quality Assurance |
#### Acceptance Criteria
- Testing & Quality Assurance implementation complete and functional
- Unit tests pass for Testing & Quality Assurance
- Integration tests pass for Testing & Quality Assurance
- Code reviewed and approved
#### Context Budget
- **Files to Read**: 1
- **Total Lines**: 4
- **Estimated Input Tokens**: 82
- **Prompt Overhead**: 2,000
- **Output Buffer**: 16,000
- **Total Estimated**: 18,082
- **Budget**: 80,000
- **Utilization**: 2260.0%
- **Over Budget**: ✓ No
## Parallel Groups
### PG-01
- Package(s) parallelizable after root: T-05, T-09
- Packages: pkg-t-05, pkg-t-09
### PG-03
- Other parallelizable packages
- Packages: pkg-t-10
## Development Roadmap
### Phase P0: Foundation & Core
Project bootstrap, infrastructure, and core system components
- **Total Effort**: 360 minutes
- **Agent Packages**: pkg-t-01, pkg-t-05, pkg-t-09
### Phase P1: Business Features
User management, workflows, integrations
- **Total Effort**: 120 minutes
- **Agent Packages**: pkg-t-05
### Phase P2: Quality & Deployment
Testing, QA, and final deployment
- **Total Effort**: 120 minutes
- **Agent Packages**: pkg-t-10
## Risk Analysis
**Overall Severity**: LOW
## Quality Gate Results
- **Passed**: 10/13 (Failed: 3, Warnings: 0)
| Check | Category | Result | Message |
|-------|----------|--------|---------|
| Root Task exists | task-tree | ✓ Pass | Exactly one root task found: T-01 |
| No orphan tasks | task-tree | ✓ Pass | All tasks have a valid parent chain to the root |
| No circular dependency (Task Tree) | task-tree | ✓ Pass | No circular dependencies in task tree |
| Every task has Injected Risks populated | task-tree | ✗ Fail | 4 task(s) missing injected risks: T-01, T-05, T-09, T-10 — Run learning loop injector to populate injected risks for each task |
| No XL Package | agent-package | ✓ Pass | All packages within size limits |
| Agent can independently complete | agent-package | ✓ Pass | All packages have clear inputs, outputs, and no global context dependencies |
| Context budget within limits (utilization < 90%) | context-budget | ✓ Pass | All packages within context budget limits |
| File counts within limits | context-budget | ✓ Pass | All package file counts within limits |
| Dependency count within limits | context-budget | ✓ Pass | All package dependency counts within limits |
| Efficiency Score ≥ 8 | context-budget | ✓ Pass | All packages have efficiency score ≥ 8 |
| No circular dependency (Dependency Graph) | dependency-graph | ✓ Pass | No circular dependencies in dependency graph |
| Max parallelism achieved | dependency-graph | ✗ Fail | No parallelism — all 4 packages in a single group — Review dependency graph to identify opportunities for parallel execution |
| Learning Loop injected (reflections, best practices, anti-patterns, checklists) | learning-loop | ✗ Fail | Missing injected artifacts: reflections, best practices, anti-patterns, checklists — Run injectLearning() to load reflections, best practices, and populate injected risks with checklist items |
## Assumptions
- **architectureModel.frontend**: No frontend technology specified (Level Level-1 input did not define frontend architecture)
- **architectureModel.backend**: No backend technology specified (Level Level-1 input did not define backend architecture)
- **architectureModel.database**: No database technology specified (Level Level-1 input did not define database architecture)
---
> Generated by Orchestration Engine · Spec Level: Level-1 · 2026-06-05T15:50:08.392Z
@@ -0,0 +1,33 @@
{
"phases": [
{
"phase": "P0",
"name": "Foundation & Core",
"description": "Project bootstrap, infrastructure, and core system components",
"agentPackageIds": [
"pkg-t-01",
"pkg-t-05",
"pkg-t-09"
],
"totalEffortMinutes": 360
},
{
"phase": "P1",
"name": "Business Features",
"description": "User management, workflows, integrations",
"agentPackageIds": [
"pkg-t-05"
],
"totalEffortMinutes": 120
},
{
"phase": "P2",
"name": "Quality & Deployment",
"description": "Testing, QA, and final deployment",
"agentPackageIds": [
"pkg-t-10"
],
"totalEffortMinutes": 120
}
]
}
@@ -0,0 +1,66 @@
{
"rootTaskId": "T-01",
"tasks": [
{
"id": "T-01",
"name": "Project Bootstrap & Architecture Setup",
"objective": "Initialize project structure, configure toolchain, establish architecture conventions",
"dependsOn": [],
"hardDependencies": [],
"softDependencies": [],
"parallelizable": false,
"estimatedSize": "Medium",
"injectedRisks": []
},
{
"id": "T-05",
"name": "User Management & Authentication",
"objective": "Implement 2 user role(s) with authentication and permission management",
"dependsOn": [
"T-01"
],
"hardDependencies": [
"T-01"
],
"softDependencies": [],
"parallelizable": true,
"estimatedSize": "Medium",
"injectedRisks": []
},
{
"id": "T-09",
"name": "Infrastructure & Deployment",
"objective": "Configure deployment pipeline and hosting",
"dependsOn": [
"T-01"
],
"hardDependencies": [
"T-01"
],
"softDependencies": [],
"parallelizable": true,
"estimatedSize": "Medium",
"injectedRisks": []
},
{
"id": "T-10",
"name": "Testing & Quality Assurance",
"objective": "Implement unit, integration, and end-to-end tests across all components",
"dependsOn": [
"T-05"
],
"hardDependencies": [],
"softDependencies": [
"T-05"
],
"parallelizable": true,
"estimatedSize": "Medium",
"injectedRisks": []
}
],
"metadata": {
"totalTasks": 4,
"maxDepth": 3,
"parallelizableCount": 3
}
}
+73
View File
@@ -0,0 +1,73 @@
# 9 项目优先级对比 & 安装建议
> 2026-06-02 · 同步到 git666.u7f.cn/Github
---
## 按对我的提升排
| 优先级 | 项目 | ⭐ | 核心能力 | 为什么这个顺序 |
|:--:|------|:--:|------|------|
| **1** | TencentDB-Agent-Memory | 4.5k | 4 层记忆:对话→原子→场景→人格 | ✅ 已装。其余一切记忆优化都基于它 |
| **2** | context-mode | 16.1k | 工具输出沙箱化,98% token 削减 | 直接省钱。我今天每个 exec 都塞满输出,装了立刻省 |
| **3** | codebase-memory-mcp | 2.8k | 代码库持久索引,不重读 | 我今天读 supermemory 项目逐个翻文件,有了它秒定位 |
| **4** | semble | 4.6k | 极速代码搜索,比 grep 少 98% token | 跟 codebase-memory 互补——一个记一个搜 |
| **5** | gigabrain | 209 | OpenClaw 本地记忆层 | 如果 TencentDB 不够用,这个兜底。轻量 |
| **6** | openclaw-auto-dream | 563 | 自动记忆巩固,像人类做梦 | 装好后的"自动化",不用我手动维护 |
| **7** | total-recall | 200 | 分层记忆+写入门控 | 记忆质量——防止垃圾填满记忆库 |
| **8** | agents-best-practices | 1.4k | Skill 设计规范 | 规范我的能力拓展方式,治本 |
| **9** | SkillClaw | 1.5k | Skill 集体进化 | 依赖技能基数,先积累再开进化 |
---
## 安装计划
```
今天凌晨(已装):
✅ TencentDB-Agent-Memory
→ 等 Gateway 重启完测试
今天白天:
② context-mode → 省 token
③ codebase-memory-mcp → 记代码库
明天:
④ semble → 搜代码
⑤ gigabrain → 补记忆
本周:
⑥ auto-dream → 自动化
⑦ total-recall → 质量控制
⑧ agents-best-practices → 规范化
⑨ SkillClaw → 进化
```
---
## 结合自身优化路线
```
装完不照搬,每个必改造:
TencentDB-Agent-Memory
→ 对接我们的 PG 服务器(不用本地 SQLite)
→ 记忆分类规则融合我的 detectCategory()
→ L3 画像接入 memory/USER.md 作为初始种子
context-mode
→ 沙箱规则:exec > 500行 → 截断摘要
→ read 文件 > 200行 → 先看目录结构再决定读哪里
→ search 结果 > 10条 → 去重+排序
codebase-memory-mcp
→ 索引我们的 memory/projects/ 下所有项目
→ 新项目自动建索引,不手动写 project 文档
→ 配合 vault.md 的项目索引表
semble
→ 替换 grep 为主的代码搜索
→ 跟 codebase-memory 联动:先查索引→再用 semble 搜语义
gigabrain
→ 接 same PG 服务器,跟 TencentDB 共享存储
→ 如果 TencentDB 的 L1-L3 太重,用 gigabrain 做快速通道
@@ -0,0 +1,100 @@
# Software Generator MVP v1
> 2026-06-05 17:35 CST — 红尘宣布 MVP v1
## 里程碑
从需求文本到可发布软件,一条命令,370ms。
## 架构
```
需求文本
↓ SF-01 project-intake-agent (51ms)
PRD JSON
↓ SF-02 architecture-agent (56ms)
Architecture JSON
↓ SF-03 frontend-builder-agent (54ms)
Web Frontend (31 files)
↓ SF-04 backend-builder-agent (53ms)
API Backend (25 files)
↓ SF-05 fullstack-composer-agent (57ms)
Fullstack Monorepo (67 files)
↓ SF-06 electron-builder-agent (48ms)
Desktop App (12 files)
↓ SF-07 release-builder-agent (52ms)
Release Package (12 files)
```
## 代码统计
| 类别 | 文件 | 行数 |
|------|------|------|
| Agents | 7 | 7,941 |
| Tests | 7 | 3,661 |
| Benchmarks | 3 | 1,652 |
| **Total** | **17** | **13,254** |
## 7 个 Agent
| Agent | 职责 | 输入 | 输出 |
|-------|------|------|------|
| SF-01 project-intake-agent | 需求分析 | 需求文本 | prd.json |
| SF-02 architecture-agent | 架构设计 | prd.json | arch.json |
| SF-03 frontend-builder-agent | 前端生成 | prd + arch | apps/web/ |
| SF-04 backend-builder-agent | 后端生成 | prd + arch | apps/api/ |
| SF-05 fullstack-composer-agent | 全栈组装 | prd + arch | monorepo |
| SF-06 electron-builder-agent | 桌面封装 | fullstack | desktop/ |
| SF-07 release-builder-agent | 发布打包 | fullstack | release/ |
## Benchmark 结果
### E2E Benchmark v1 — 10/10 PASS
| Domain | Features | Pages | APIs | Files | Time |
|--------|----------|-------|------|-------|------|
| PetCare | 7 | 6 | 5 | 162 | 379ms |
| CRM | 5 | 4 | 5 | 144 | 373ms |
| Inventory | 6 | 5 | 6 | 164 | 372ms |
| Ticket | 7 | 5 | 6 | 162 | 371ms |
| Blog CMS | 5 | 3 | 3 | 136 | 367ms |
| Project Mgmt | 5 | 4 | 5 | 126 | 365ms |
| HR | 7 | 5 | 6 | 162 | 371ms |
| Asset | 5 | 4 | 5 | 126 | 368ms |
| Course | 6 | 5 | 6 | 158 | 371ms |
| Appointment | 5 | 4 | 5 | 126 | 366ms |
| **Total** | **58** | **45** | **52** | **1466** | **370ms avg** |
### 5 核心领域深度验证
| Domain | Features | Pages | APIs | Entities | Files |
|--------|----------|-------|------|----------|-------|
| PetCare | 宠物档案/健康日程/日常记录/成长相册/附近医院/健康百科/社区分享 | 6 | 5 | 8 | 162 |
| CRM | 笔记编辑/文件夹标签/全文搜索/多端同步/协作分享 | 4 | 5 | 7 | 144 |
| Inventory | 商品浏览/购物车/订单管理/收货地址/商品评价/优惠券 | 5 | 6 | 6 | 164 |
| Ticket | 考勤打卡/审批流程/部门管理/请假管理/考勤统计/公告通知/报销管理 | 5 | 6 | 7 | 162 |
| Blog CMS | 动态发布/信息流/互动系统/个人主页/私信 | 3 | 3 | 5 | 136 |
## 能力边界
### ✅ 能做
- 任意领域需求文本 → 完整可运行项目
- Web 全栈(Next.js + Express + SQLite + Auth + CRUD
- Electron 桌面应用封装
- Release 包结构(version/manifest/checksums/notes/build-info
- 跨 10 个领域泛化验证通过
### ❌ 不做
- 自动更新 / CI/CD / Docker / 云发布
- 安装器 / 签名 / 证书
- 增量更新 / 商店发布
## Git 历史
```
e5df3b4 🏁 E2E Generator Benchmark v1 — 10/10 PASS
55ca24c 📦 feat: SF-07 Release Builder Agent — 3/3 PASS
25c2a64 ✨ feat: SF-06 Electron Fullstack Wrapper Builder
9ac35a4 📝 daily: benchmark-v2 session save
b803a0b ✅ benchmark-v2: 10/10 全栈项目通过
```
+178
View File
@@ -0,0 +1,178 @@
# Supermemory 插件学习报告 vs 小龙记忆系统对比
> 学习对象:github.com/supermemoryai/openclaw-supermemory
> 学习日期:2026-06-02
> 镜像:git666.u7f.cn/sawz/openclaw-supermemory
---
## 一、项目总览
| 维度 | 内容 |
|------|------|
| 用途 | 给 OpenClaw Agent 提供云端长期记忆:Auto-Recall + Auto-Capture + 用户画像 |
| 核心能力 | 回忆注入、自动捕获、画像构建、多容器隔离、语义搜索 |
| 技术栈 | TypeScript ESM、Sinclair TypeBox、esbuild、Supermemory SDK |
| 文件规模 | 17 源文件,核心源码 < 30KB |
| 协议 | MIT |
---
## 二、核心调用链
```
用户消息
→ isInteractiveTrigger() 过滤心跳/cron
→ before_prompt_build → getProfile(query)
├── static profile (长期偏好)
├── dynamic context (近期动态)
└── searchResults (语义相似记忆)
→ formatContext → XML 块注入 prependContext
→ AI 生成回复
→ agent_end → getLastTurn()
├── stripInboundMetadata (剥离元数据)
├── filter injected context (移除 <supermemory-context>)
├── filter short texts (< 10字)
└── addMemory → 云端异步处理
```
---
## 三、核心模块
### 1. 插件入口 (index.ts)
- **优雅降级**:无 API Key → 只注册 CLI stub,不崩溃
- **新旧 API 兼容**registerMemoryCapability / registerMemoryRuntime 双路径
- **工具双注册**supermemory_search + supermemory-search 兼容命名
### 2. Auto-Recall (hooks/recall.ts)
- **分层频率**static profile 低频注入(新会话 + 每50轮),search 每轮查询
- **静默指令**"Do not proactively bring up memories" 避免突兀
- **记忆使用计数**[Supermemory: X memories loaded, Y used]
### 3. Auto-Capture (hooks/capture.ts)
- **只取最后一轮**getLastTurn() 避免重复
- **三层过滤**:元数据 → 注入上下文 → 短文本
- **session 关联**customId = buildDocumentId(sessionKey)
### 4. 配置系统 (config.ts)
- **白名单校验**:未知 key 直接抛异常
- **环境变量插值**${SUPERMEMORY_API_KEY}
- **Schema 驱动 UI**configSchema 同时用于校验 + 自动生成配置表单
### 5. CLI 命令 (commands/cli.ts)
- **交互式向导**:readline 逐项问答,有默认值
- **安全确认**wipe 需输入 "yes"
### 6. 内容处理 (memory.ts)
- **元数据剥离**sentinel 模式识别 provider 注入前缀
- **内容分类**preference / decision / entity / fact / other
- **实体上下文模板**:指导 Supermemory 提取规则
---
## 四、小龙 🐉 vs Supermemory 🔌 — 全面对比
### 4.1 架构对比
| 维度 | 小龙(本地文件系统) | Supermemory(云端 API |
|------|---------------------|------------------------|
| 存储 | MEMORY.md + vault.md + daily/ | Supermemory CloudPostgreSQL + 向量DB |
| 检索 | memory_search(语义,需 API Key/ memory_get(精确) | 全语义搜索,自动嵌入 |
| 写入 | 手动写文件 | 自动捕获 + AI Tool 写入 |
| 画像 | 手动维护 USER.md | 自动提取 static + dynamic |
| 配置 | 文件级约定 | Schema 驱动 + GUI + CLI |
| 部署 | 零依赖 | 需要 API Key + 网络 |
| 费用 | 免费 | Pro 付费 |
| 延迟 | < 1ms | ~50ms API 调用 |
### 4.2 能力对比
| 能力 | 小龙 | Supermemory | 谁优 |
|------|------|-------------|------|
| **自动捕获** | ❌ 无,需手动写 daily/ | ✅ 每次对话自动捕获 | 🔌 |
| **自动召回** | ❌ 无,需手动 memory_get | ✅ 每轮自动搜索 + 注入 | 🔌 |
| **用户画像** | ⚠️ 手动 USER.md | ✅ 自动 static + dynamic | 🔌 |
| **语义搜索** | ⚠️ memory_search(依赖 embedding API,目前挂) | ✅ 内置,SOTA 基准第一 | 🔌 |
| **去重/降噪** | ⚠️ 靠我自己判断 | ✅ 自动过滤 + 短文本 + 元数据剥离 | 🔌 |
| **多容器隔离** | ❌ 无 | ✅ containerTag + 自定义容器 | 🔌 |
| **缓存友好** | ✅ MEMORY.md 瘦身到 2KB + 缓存线以上锁定 | ⚠️ 注入内容每次变→前缀变→缓存可能炸 | 🐉 |
| **透明度** | ✅ 文件可读可改 | ⚠️ 黑盒,用户看不到存了什么 | 🐉 |
| **零依赖** | ✅ 不依赖外部服务 | ❌ 依赖网络 + API | 🐉 |
| **延迟** | ✅ 无额外延迟 | ⚠️ 每轮 ~50-200ms | 🐉 |
| **离线可用** | ✅ | ❌ | 🐉 |
| **费用** | ✅ $0 | ❌ Pro 月度订阅 | 🐉 |
### 4.3 设计哲学对比
| 维度 | 小龙 | Supermemory |
|------|------|-------------|
| 核心理念 | "我知道我要记什么" | "我不知道我要记什么,你帮我" |
| 人机关系 | 工具辅助人决策 | 自动代理减轻人的负担 |
| 记忆质量 | 高(我筛选过才写) | 中(自动提取,可能漏/误) |
| 记忆数量 | 少而精 | 多而全 |
| 适用场景 | 精准工作,少量偏好 | 海量对话,长期积累 |
---
## 五、综合评价
### Supermemory 胜出的场景
- 长期大量对话 → 自动积累,人不需要操心
- 多对话 channel → 跨 session 记忆统一
- 用户画像 → 自动识别偏好、习惯、项目
- 新手用户 → 不需要手动维护记忆文件
### 小龙胜出的场景
- **缓存命中率** → 稳定前缀不动,DeepSeek 缓存不炸
- 精准关键决策 → 我判断重要才记,不是全量
- 离线/弱网 → 不依赖外部服务
- 零成本 → 不花钱
- 透明度 → 尘哥可以随时看、改、删任何记忆
- 安全 → 数据不出机器
---
## 六、最佳方案:双轨制 🐉🫧
**不是二选一,是互补:**
```
本地骨架(小龙) 云端引擎(Supermemory
├── MEMORY.md (2KB) ├── 自动捕获对话
├── vault.md (决策/项目) ├── 语义搜索 + 画像
├── daily/ (日志) ├── 跨 session 关联
├── 缓存友好 ✅ └── 多容器隔离
└── 零依赖 ✅
↕ ↕
关键记忆 + 工程规范 海量对话 + 模式发现
```
具体分工:
- **小龙负责**:工程范式、关键决策、工具环境、时间规则 —— 缓存线上不动
- **Supermemory 负责**:日常对话的自动捕获、语义召回、用户画像 —— 上下文注入
- **互不干扰**:缓存线上的文件不动,Supermemory 的注入在缓存线以下
---
## 七、从 Supermemory 学到可迁移到小龙的能力
| 能力 | 如何迁移 |
|------|---------|
| **元数据剥离** | 写入 daily/ 前 strip 注入的前缀和 JSON 块 |
| **短文本过滤** | 对话片段 < 20 字不记录 |
| **分类标签** | vault.md 条目加 preference/decision/fact 标签 |
| **回忆计数** | 每次回复后标注用了多少条记忆 |
| **频率控制** | vault.md 不全量注入,按需 memory_get |
| **触发器过滤** | 心跳/cron 触发时不写记忆 |
| **优雅降级** | memory_search 不可用时降级到 memory_get 精确读 |
---
## 八、结论
**Supermemory 是一个成熟的记忆引擎,但我们的本地文件系统在缓存友好性、零成本、透明度上有不可替代的优势。**
最优策略是双轨:本地做骨架(缓存友好 + 关键决策),云端做血肉(自动捕获 + 语义召回)。如果只选一个,对于缓存敏感情景,小龙的本地系统更优。
> 报告生成:小龙 🐉 + 团子 🫧 · 2026-06-02