npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-plugin-harness

v0.2.18

Published

Harness Engineering plugin for OpenClaw - constraints, feedback loops, and control systems for AI agents

Downloads

532

Readme

openclaw-plugin-harness

OpenClaw Harness Engineering 插件 - 为 AI Agent 构建约束、反馈与控制系统

npm: openclaw-plugin-harness — 必须用 OpenClaw CLI 安装到 ~/.openclaw/extensions/,见下文。


🎯 功能

  • 配置验证:修改 openclaw.json 前自动验证
  • Skill 审核:安装 Skill 前自动安全扫描
  • 循环检测:防止 AI 反复修改同一文件
  • 文件保护:保护关键文件(SOUL.md 等)不被误删
  • 操作审计:记录所有关键操作
  • Trace 追踪:完整的工具调用链路
  • 文件监听器 (v0.2.0 新增):实时监听配置文件变化,用户手动编辑也能触发验证

🚀 快速开始

安装(正确方式)

OpenClaw 不会从你在任意目录执行的 npm install 里加载插件;它只扫描 ~/.openclaw/extensions/。请用官方 CLI 从 npm 拉取并登记插件:

openclaw plugins install openclaw-plugin-harness
openclaw gateway restart

可选固定版本(建议 ≥ 0.2.18,已修正 plugins.entries.harness.config 的 JSON Schema,与插件实际字段一致):

openclaw plugins install [email protected]

不要把下面这种当成「安装 OpenClaw 插件」的唯一步骤(这只会把包装进当前目录的 node_modules,Gateway 仍然找不到 harness):

# ❌ 单独执行这一句通常不够
npm install openclaw-plugin-harness

若你已经在 openclaw.json 里写了 plugins.allow / plugins.entries.harness,但从未执行过 openclaw plugins install …,就会出现 plugin not found: harness 一类提示;按上面 CLI 安装后即可,或删掉多余配置项。

若安装时报 plugins.entries.harness.config: invalid config: must NOT have additional properties:说明当时装的包版本较旧,configSchema 与插件真实配置字段不一致。请升级到 ≥0.2.18 后重装,或先执行 openclaw doctor --fix,并确保 plugins.entries.harness.config 里只有:autoValidateConfigautoAuditSkillloopDetectionEnabledprotectedFileslogsDirenabled 应写在 plugins.entries.harness 顶层,不要塞进 config)。

手动配置(可选)

如果你想自定义配置,编辑 ~/.openclaw/openclaw.json

{
  "plugins": {
    "allow": ["harness"],
    "entries": {
      "harness": {
        "enabled": true,
        "config": {
          "autoValidateConfig": true,
          "autoAuditSkill": true,
          "loopDetectionEnabled": true,
          "protectedFiles": [
            "SOUL.md",
            "USER.md",
            "AGENTS.md",
            "TOOLS.md",
            "MEMORY.md",
            "openclaw.json"
          ],
          "logsDir": "logs/harness"
        }
      }
    }
  }
}

然后重启 gateway:

openclaw gateway restart

📋 配置选项

| 选项 | 类型 | 默认值 | 说明 | |------|------|--------|------| | autoValidateConfig | boolean | true | 配置修改前自动验证 | | autoAuditSkill | boolean | true | Skill 安装前自动审核 | | loopDetectionEnabled | boolean | true | 启用循环检测 | | protectedFiles | string[] | 见上文 | 受保护的文件列表 | | logsDir | string | logs/harness | 日志目录 |


🔍 使用示例

配置验证(自动)

// 修改 openclaw.json 时自动触发
const result = await plugin.onConfigChange(newConfig);
// 如果验证失败,会抛出异常阻止修改

Skill 审核(自动)

// 安装 Skill 时自动触发
const auditResult = await plugin.onSkillInstall('/path/to/skill');
if (!auditResult.passed) {
  throw new Error(`Skill 审核未通过:${auditResult.riskLevel}`);
}

手动查询

# 查看最近的配置变更
harness get-config-changes -l 10

# 查看操作日志
harness get-operations -l 20

# 查看循环检测统计
harness loop-stats

🛡️ 安全机制

保护文件

以下文件默认受保护,修改/删除前会告警:

  • SOUL.md - 身份定义
  • USER.md - 用户信息
  • AGENTS.md - Agent 指南
  • TOOLS.md - 工具配置
  • MEMORY.md - 长期记忆
  • openclaw.json - 核心配置

风险等级

| 等级 | 标识 | 处理 | |------|------|------| | LOW | 🟢 | 允许 | | MEDIUM | 🟡 | 警告,但允许 | | HIGH | 🟠 | 阻止,需人工确认 | | CRITICAL | 🔴 | 阻止,禁止操作 |


📚 文档


🔧 开发

# 安装依赖
npm install

# 构建
npm run build

# 测试
npm test

# 链接到 OpenClaw
npm link

📝 变更日志

v0.1.0 (2026-03-19)

  • ✅ 初始版本
  • ✅ 配置验证
  • ✅ Skill 审核
  • ✅ 循环检测
  • ✅ 操作日志
  • ✅ Trace 追踪

📄 许可证

MIT


@openclaw/plugin-harness | 蓝山 | 2026-03-19