← 返回 Skills 市场
dragons777-cpu

HAI Agent Framework

作者 Dragons777-cpu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
105
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hai-agent-framework
功能描述
企业级 AI Agent 框架,支持 Hook 事件系统、自动记忆抽取和预置四种专业 Agent,实现智能任务管理与对话优化。
使用说明 (SKILL.md)

HAI Agent Framework

版本: 1.0.0
作者: 小 D
描述: 企业级 AI Agent 框架 - Hook 事件系统、自动记忆抽取、核心 Agent 定义


🚀 功能特性

1. Hook 事件系统

在关键事件发生时自动触发脚本,实现:

  • 会话开始/结束自动处理
  • 工具调用前后验证
  • 文件操作审计
  • 自定义事件响应

支持的 Hook 事件:

  • SessionStart - 会话开始
  • SessionEnd - 会话结束
  • PreToolUse - 工具调用前
  • PostToolUse - 工具调用后
  • UserMessage - 用户消息
  • AgentResponse - Agent 回复前

2. 自动记忆抽取

从对话中自动学习:

  • 用户偏好提取
  • 挫折信号检测
  • 成功模式识别
  • 纠正记录保存
  • 决策追踪

3. 核心 Agent 定义

预置 4 个专业 Agent:

  • code-reviewer - 代码审查专家
  • test-generator - 测试用例生成
  • security-scanner - 安全扫描专家
  • documentation-writer - 文档撰写专家

4. 四层记忆架构

  • L1 会话记忆 - 当前对话记录
  • L2 项目记忆 - 项目特定上下文
  • L3 全局记忆 - 用户偏好和习惯
  • L4 市场记忆 - 共享知识和规则

📦 安装

clawhub install hai-agent-framework

🔧 配置

1. 启用 Hook

.hai/hooks/ 目录下创建 Hook 配置文件:

{
  "name": "load-memory",
  "description": "加载用户记忆",
  "event": "SessionStart",
  "priority": 100,
  "enabled": true,
  "action": {
    "type": "script",
    "script": ".hai/scripts/load-memory.py"
  }
}

2. 使用 Agent

在任务中指定 Agent:

---
agent: code-reviewer
---

请审查这段代码...

3. 记忆抽取

自动运行,无需配置。对话记录会自动分析并保存到 memory/ 目录。


📖 使用示例

示例 1:会话开始加载记忆

python3 .hai/scripts/hook-executor.py SessionStart

示例 2:工具调用验证

python3 .hai/scripts/hook-executor.py PreToolUse \
  --context '{"tool":"write","args":{"path":"test.txt"}}'

示例 3:对话分析

python3 .hai/scripts/conversation-analyzer.py \
  --text "我喜欢用深色模式,不要用浅色"

📁 目录结构

.hai/
├── agents/           # Agent 定义
│   ├── code-reviewer.md
│   ├── test-generator.md
│   ├── security-scanner.md
│   └── documentation-writer.md
├── hooks/            # Hook 配置
│   ├── SessionStart/
│   ├── SessionEnd/
│   ├── PreToolUse/
│   └── PostToolUse/
├── scripts/          # 执行脚本
│   ├── hook-executor.py
│   ├── load-memory.py
│   ├── save-summary.py
│   ├── validate-params.py
│   └── conversation-analyzer.py
├── rules/            # 用户规则
│   └── *.local.md
└── memory/           # 记忆文件
    ├── transcript/
    ├── project/
    └── global/

🧪 测试

# 测试 Hook 系统
python3 .hai/scripts/hook-executor.py --list

# 测试 SessionStart Hook
python3 .hai/scripts/hook-executor.py SessionStart

# 测试对话分析
python3 .hai/scripts/conversation-analyzer.py --text "测试文本"

📊 效果

Hook 系统

  • ✅ 自动加载用户记忆
  • ✅ 自动保存会话总结
  • ✅ 工具调用安全验证

记忆抽取

  • ✅ 用户偏好自动学习
  • ✅ 纠正记录自动保存
  • ✅ 决策追踪

Agent 定义

  • ✅ 标准化 System Prompt
  • ✅ 专业化分工
  • ✅ 可并行执行

🤝 贡献

欢迎提交 Issue 和 Pull Request!

GitHub: https://github.com/your-repo/hai-agent-framework


📄 License

MIT


HAI Agent Framework v1.0 · 2026-04-03

安全使用建议
This package is an instruction-only README that tells users/agents to run local Python scripts and store conversation memories, but it provides no code, no installer, and doesn't declare the filesystem paths it will use. Before installing or following its instructions: (1) obtain and review the actual code repository/installer referenced by the README (do not run 'clawhub install' or execute .hai scripts from an untrusted source); (2) verify what the scripts do (especially any network calls, telemetry, or data-export) and where memory is stored and how it's protected; (3) ask the publisher to add an explicit install spec, include the script files or a canonical download URL (signed GitHub release or similar), and declare required config paths and any environment variables; (4) if you must test, run in a sandboxed environment and audit the .hai/scripts content first. If the author cannot provide the missing code/install details, treat this skill as untrusted.
能力评估
Purpose & Capability
The description claims an 'enterprise AI Agent framework' with hooks, scripts, and persistent memory, but the skill bundle contains only an instruction file (no code, no install spec, no declared config paths). The README instructs users/agents to run .hai/scripts/*.py and store data in memory/, yet the skill requests no files or privileges — inconsistent with the stated purpose.
Instruction Scope
Runtime instructions tell the agent or user to execute local Python scripts (hook-executor.py, load-memory.py, conversation-analyzer.py), create hook config JSON, and automatically analyze and save conversation data to memory/. Those steps involve file I/O and executing arbitrary code on the host and imply persistent collection of user conversations, but the skill does not limit or document what data is collected, where it's stored, or whether scripts are provided or safe.
Install Mechanism
SKILL.md shows a 'clawhub install hai-agent-framework' command, but the skill has no install specification and no code files. This mismatch means either the install flow is missing from the registry entry or the documentation is inaccurate — both are risky because a user may attempt to run non-existent installers or fetch code from undocumented sources.
Credentials
No environment variables, credentials, or config paths are declared, yet the instructions reference .hai/ directories and persistent memory storage. The skill implicitly needs filesystem access to create/read .hai/scripts and memory/, but those required paths are not declared. That omission hides the real scope of data the skill will access and store.
Persistence & Privilege
The skill is not marked always:true and is user-invocable (normal), but its design centers on persistent memory (L1–L4) and executing hook scripts that can run on each session. That implies persistent local state and the ability to execute code across sessions — a privacy and safety consideration even though no special platform privileges are requested in the metadata.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hai-agent-framework
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hai-agent-framework 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Hook system, memory extraction, core agents
元数据
Slug hai-agent-framework
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

HAI Agent Framework 是什么?

企业级 AI Agent 框架,支持 Hook 事件系统、自动记忆抽取和预置四种专业 Agent,实现智能任务管理与对话优化。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 105 次。

如何安装 HAI Agent Framework?

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

HAI Agent Framework 是免费的吗?

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

HAI Agent Framework 支持哪些平台?

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

谁开发了 HAI Agent Framework?

由 Dragons777-cpu(@dragons777-cpu)开发并维护,当前版本 v1.0.0。

💬 留言讨论