Install
openclaw skills install cognitive-loop认知闭环执行 Skill - 实现「思考-行动-反思-测试」四环闭环的高自主性 Agent 架构。当需要任务规划、多步骤执行、错误恢复、测试验证时激活。
openclaw skills install cognitive-loop认知闭环是 OpenClaw Agent 的核心执行引擎,实现高自主性的「思考 - 行动 - 反思」闭环。
使用前请务必:
memory/ 子目录| 模块 | 职责 | 能力体现 |
|---|---|---|
| 规划器 (Planner) | 任务分解、路径规划、策略选择 | Chain-of-Thought / Tree-of-Thought 推理 |
| 执行监控器 (Monitor) | 实时跟踪、错误检测、动态调整 | 自动重试、降级、异常恢复 |
| 反思器 (Reflector) | 执行复盘、经验沉淀、策略优化 | 自主学习、模式提取、教训总结 |
| 测试器 (Tester) | 测试生成、结果验证、闭环修复 | TDD 驱动、覆盖率分析、自动修复 |
收到以下类型任务时必须激活:
npm install cognitive-agent
openclaw skills install cognitive-loop
git clone https://github.com/World-peace001/cognitive-agent.git
cd cognitive-agent
npm install
首次使用时,请:
当收到符合激活条件的任务时:
// 伪代码示例 - 实际使用需先安装 cognitive-agent 包
import CognitiveOrchestrator from 'cognitive-agent';
const orchestrator = new CognitiveOrchestrator();
const result = await orchestrator.闭环(
'任务描述',
async (task, context) => {
// 执行实际任务
return { status: 'success' };
}
);
用户需求
│
▼
┌────────┐ → 任务理解 → 策略选择 → 执行计划
│ 规划器 │
└────────┘
│
▼
┌────────┐ → 执行 → 进度追踪 → 异常处理
│ 执行监控│
└────────┘
│
▼
┌────────┐ → 评估结果 → 经验入库 → 优化建议
│ 反思器 │
└────────┘
│
▼
┌────────┐ → 测试生成 → 覆盖率验证 → 闭环修复
│ 测试器 │
└────────┘
经验自动保存到 memory/ 目录(沙箱限制):
memory/
├── patterns/ # 可复用执行模式
├── lessons/ # 失败教训
├── successes/ # 成功案例
└── knowledge/ # 知识积累
| 等级 | 能力 | 表现 |
|---|---|---|
| L1 | 基础执行 | 接收指令,执行任务 |
| L2 | 规划执行 | 理解需求,拆解任务,选择策略 |
| L3 | 自主监控 | 实时追踪,自动纠错,动态调整 |
| L4 | 反思学习 | 评估结果,提取经验,更新记忆 |
| L5 | 完全自主 | 闭环优化,TDD 驱动,持续进化 |
本 Skill 已通过基础安全审核,但用户/代理在使用前应:
MIT License