← Back to Skills Marketplace
dragons777-cpu

HAI Agent Framework

by Dragons777-cpu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
105
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hai-agent-framework
Description
企业级 AI Agent 框架,支持 Hook 事件系统、自动记忆抽取和预置四种专业 Agent,实现智能任务管理与对话优化。
README (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

Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hai-agent-framework
  3. After installation, invoke the skill by name or use /hai-agent-framework
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: Hook system, memory extraction, core agents
Metadata
Slug hai-agent-framework
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is HAI Agent Framework?

企业级 AI Agent 框架,支持 Hook 事件系统、自动记忆抽取和预置四种专业 Agent,实现智能任务管理与对话优化。 It is an AI Agent Skill for Claude Code / OpenClaw, with 105 downloads so far.

How do I install HAI Agent Framework?

Run "/install hai-agent-framework" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is HAI Agent Framework free?

Yes, HAI Agent Framework is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does HAI Agent Framework support?

HAI Agent Framework is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created HAI Agent Framework?

It is built and maintained by Dragons777-cpu (@dragons777-cpu); the current version is v1.0.0.

💬 Comments