← 返回 Skills 市场
world-peace001

Cognitive Loop

作者 World-peace001 · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
112
总下载
1
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install cognitive-loop
功能描述
认知闭环执行 Skill - 实现「思考-行动-反思-测试」四环闭环的高自主性 Agent 架构。当需要任务规划、多步骤执行、错误恢复、测试验证时激活。
使用说明 (SKILL.md)

🧠 Cognitive Loop - 认知闭环 Skill

概述

认知闭环是 OpenClaw Agent 的核心执行引擎,实现高自主性的「思考 - 行动 - 反思」闭环。

⚠️ 安全使用指南

使用前请务必:

  1. 审核代码:检查 GitHub 仓库源代码
  2. 沙箱执行:首次使用时在沙箱环境中测试
  3. 路径限制:仅允许写入 memory/ 子目录
  4. 禁止自主执行:复杂操作需用户确认

四大核心模块

模块 职责 能力体现
规划器 (Planner) 任务分解、路径规划、策略选择 Chain-of-Thought / Tree-of-Thought 推理
执行监控器 (Monitor) 实时跟踪、错误检测、动态调整 自动重试、降级、异常恢复
反思器 (Reflector) 执行复盘、经验沉淀、策略优化 自主学习、模式提取、教训总结
测试器 (Tester) 测试生成、结果验证、闭环修复 TDD 驱动、覆盖率分析、自动修复

激活条件

收到以下类型任务时必须激活:

  1. 开发任务:前端页面、后端 API、数据库设计、DevOps 部署
  2. 多步骤任务:需要拆解为多个子任务、有依赖关系
  3. TDD/测试任务:用户明确要求测试驱动开发
  4. 重构优化:性能优化、代码重构、架构调整
  5. 复杂需求:需求模糊或涉及多个功能模块

安装方式

方式一:npm 安装(推荐)

npm install cognitive-agent

方式二:ClawHub 安装

openclaw skills install cognitive-loop

方式三:源码安装

git clone https://github.com/World-peace001/cognitive-agent.git
cd cognitive-agent
npm install

激活方式

重要:必须先审核代码

首次使用时,请:

  1. 检查 GitHub 仓库的源代码
  2. 确认 npm 包的完整性
  3. 在沙箱环境中测试

激活方式

当收到符合激活条件的任务时:

  1. 用户确认:必须获得用户明确同意
  2. 代码审核:自行或让用户审核将执行的代码
  3. 沙箱执行:建议在沙箱环境中首次运行

推荐的闭环模式

// 伪代码示例 - 实际使用需先安装 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 已通过基础安全审核,但用户/代理在使用前应:

  1. 自行审核源代码
  2. 使用沙箱环境测试
  3. 限制持久化路径
  4. 监控内存使用

许可

MIT License

安全使用建议
Plain-language steps to consider before installing: - Treat this as a guide that tells you to install/run an external npm package (cognitive-agent) and to clone a GitHub repo. Do NOT install/run it until you or a trusted reviewer examine the package source. - The SKILL.md header says exec and env access are disallowed, but the document itself instructs npm install / git clone and running node code — ask the author to clarify how installation/execution is expected and fix the contradictory flags. - Verify the external resources: check the GitHub repo code, confirm the npm package integrity (checksums, signed releases if available), and confirm there are no network-exfiltration hooks or hidden credential readers in the package. - Note the version mismatch: registry lists version 2.0.0 but SKILL.md claims version 1.0.0; treat that as a red flag and verify you're getting the expected release. - If you run it, do so first in a strong sandbox (isolated container/VM) with restricted filesystem access and no secrets mounted; confirm that persistence is limited to an explicit memory/ directory you control. - If you cannot or will not audit the external package, do not grant the agent the ability to install or execute third-party code. Prefer a reviewed/official implementation from a trusted source. If the author can resolve the exec/env/config-path contradictions and you or a trusted reviewer have audited the external package, the skill is plausible. Otherwise treat it as suspicious and proceed with caution.
功能分析
Type: OpenClaw Skill Name: cognitive-loop Version: 2.0.0 The skill bundle serves as a wrapper for an external package ('cognitive-agent') and instructs the AI agent to 'must activate' for sensitive tasks including DevOps, database design, and multi-step execution. It provides shell commands for installation (npm install, git clone) which contradicts the 'exec: false' permission in the metadata, potentially attempting to bypass execution restrictions via prompt instructions. While SKILL.md includes safety disclaimers, the reliance on unverified external code from a specific GitHub user (World-peace001) for core agent logic constitutes a significant supply chain risk.
能力评估
Purpose & Capability
The skill's name and description (an autonomous 'think-act-reflect-test' orchestrator) match the instructions which reference a cognitive-agent npm package and local 'memory/' persistence. That overall purpose is coherent. However metadata vs doc mismatches exist (registry version 2.0.0 vs SKILL.md version 1.0.0), and the SKILL.md instructs installing/running an external npm package even though the skill declares no required binaries or env — this should be clarified.
Instruction Scope
SKILL.md tells the agent/operator to clone a GitHub repo and npm install/run an external package and says experiences are 'automatically saved to memory/'. Yet the header includes 'allow: exec: false env: false' and the skill metadata declares no config paths. This is an internal contradiction: the instructions assume executing installers and writing persistent memory, but the declared runtime allowances do not. Also the instructions expect the agent to perform code audits and sandboxing but do not detail how those steps should be performed or who performs them.
Install Mechanism
There is no formal install spec in the registry (instruction-only), but SKILL.md recommends npm install / git clone of https://github.com/World-peace001/cognitive-agent and the npm package cognitive-agent. That means installing external code is expected; because the repo and npm package are third-party and not included in the skill bundle, you must manually verify integrity. This is not inherently malicious but raises supply-chain-review requirements.
Credentials
The skill does not request any environment variables, credentials, or system config paths in the registry metadata. That is proportionate to a local orchestrator. Caveat: the external npm package being installed could itself request credentials or access at runtime; the SKILL.md does not declare or warn about that possibility.
Persistence & Privilege
always:false and normal autonomous invocation are fine. The skill expects to persist memories under a 'memory/' directory and instructs a path restriction, but the registry metadata does not declare required config paths or filesystem permissions. Confirm who controls that 'memory/' location and ensure sandboxing is enforced before allowing persistence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cognitive-loop
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cognitive-loop 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
Updated - based on latest cognitive-agent project with full src/, tests/, npm package integration
v1.1.0
安全更新:添加 install 配置、沙箱限制、路径声明
v1.0.0
- Initial release of the cognitive-loop skill, implementing a four-stage "Think-Act-Reflect-Test" closed loop execution architecture for high-autonomy agents. - Supports task planning, multi-step execution, error recovery, and test validation through core modules: Planner, Monitor, Reflector, and Tester. - Automatically activates for development, multi-step, TDD, refactoring, or complex requirement tasks. - Provides command-line interface for planning, execution, TDD, status, and history queries. - Includes autonomous experience accumulation and adaptive improvement via a memory system. - Documentation includes usage guides, flowcharts, capability levels, and code samples.
元数据
Slug cognitive-loop
版本 2.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Cognitive Loop 是什么?

认知闭环执行 Skill - 实现「思考-行动-反思-测试」四环闭环的高自主性 Agent 架构。当需要任务规划、多步骤执行、错误恢复、测试验证时激活。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 112 次。

如何安装 Cognitive Loop?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cognitive-loop」即可一键安装,无需额外配置。

Cognitive Loop 是免费的吗?

是的,Cognitive Loop 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cognitive Loop 支持哪些平台?

Cognitive Loop 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cognitive Loop?

由 World-peace001(@world-peace001)开发并维护,当前版本 v2.0.0。

💬 留言讨论