zhangshenao/harness9/architecture-overview
Claude Code and agent skill by zhangshenao/harness9
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Use when asked about harness9 architecture, module design, or how components interact — explains the system design
Install
npx vskill@latest install zhangshenao/harness9/architecture-overviewSKILL.md
harness9 架构概览
核心设计原则
| 原则 | 说明 | |
|---|---|---|
| 简洁 | 最小化抽象层,极少的直接依赖 | |
| 完备 | 覆盖 Agent 运行所需的全部核心模块 | |
| 生产可用 | 错误恢复、超时控制、路径沙箱、并发安全 |
标准 ReAct 循环
三重终止保障:
- 自然终止:
len(responseMsg.ToolCalls) == 0 - MaxTurns:默认 50,可通过
WithMaxTurns配置 - Context 取消:外部
cancel()或超时
模块依赖关系
关键设计决策:接口定义在使用者侧
tools.Registry接口定义在tools包,engine包依赖它engine.PromptBuilder接口定义在engine包,context包实现它skills.UseSkillTool通过 Go 结构类型满足tools.BaseTool接口,不需要 importtools包(避免循环依赖)
关键数据流
TUI 模式
CLI 模式(管道 / CI)
System Prompt 组装
DefaultPromptBuilder.Build() 按顺序组装:
- 基础 Prompt:角色定义 + workDir
- AGENTS.md:项目级规范(文件不存在时跳过)
- Skills 索引:
- name: description列表(为空时跳过)
完整内容示例:
Provider 抽象
当前实现:
OpenAIProvider:兼容所有 OpenAI Chat Completions API(包括 OpenRouter、Azure)AnthropicProvider:Anthropic Messages API
Anthropic 约束:user/assistant 消息必须严格交替,禁止连续 assistant 消息。
工具系统
内置工具:
| 工具 | 说明 | |
|---|---|---|
bash | Shell 命令执行,workDir 为 CWD | |
read_file | 文件读取,4096 字节截断 | |
write_file | 文件写入,自动 mkdir | |
edit_file | 字符串替换编辑,多级模糊匹配 | |
use_skill | 按需加载 Skill 全文 |
所有文件工具通过 safePath() 校验路径,防止 Path Traversal 攻击。
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/architecture-overview/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhangshenao/harness9/architecture-overview)