← Back to Skills Marketplace
lanyasheng

Harness Design Patterns

by _silhouette · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
164
Downloads
1
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install harness-design-patterns
Description
Agent harness 架构设计模式知识库。当设计多阶段任务的上下文传递、选择多 agent 协调方式、或规划 hook 系统架构时使用。纯设计指南,无可执行代码。不用于安装 hook 脚本(用 agent-hooks)或运维监控(用 agent-ops)。
README (SKILL.md)

Harness Design Patterns

Agent harness 架构设计决策参考。蒸馏自 Claude Code 内部架构、OMC、Anthropic/OpenAI harness engineering 博客。

When to Use

  • 设计多阶段任务的上下文传递方案 → Handoff 文档 / Compaction 提取
  • 选择多 agent 的协调模式 → Coordinator / Fork / Swarm 选型
  • 设计 hook 系统架构 → Hook Pair Bracket / Component-Scoped / Profiles
  • 评估任务复杂度以选择执行强度 → Adaptive Complexity

When NOT to Use

  • 需要可执行的 hook 脚本 → 用 agent-hooks
  • 需要运维工具(限速恢复、session 监控) → 用 agent-ops
  • 需要 prompt 硬化 → 用 prompt-hardening

10 个设计模式

# 模式 解决什么 详情
1 Handoff 文档 跨阶段/跨压缩的上下文传递 详情
2 原子文件写入 并发状态文件安全 详情
3 Compaction 记忆提取 压缩前被动抢救知识(PreCompact hook) 详情
4 权限否决追踪 防止 agent 绕过拒绝 详情
5 三门控记忆合并 跨 session 记忆碎片化 详情
6 Hook Pair Bracket 每轮 context/时间测量 详情
7 Component-Scoped Hooks 任务级别的 hook 控制 详情
8 三种委托模式 多 agent 协调方式选型 详情
9 Adaptive Complexity 任务复杂度自适应 详情
10 Hook Runtime Profiles 环境级 hook 强度控制 详情

注:reference 文件名保留原始编号(02/06/08/...)以兼容 monorepo 中的交叉引用。

常见场景选型

场景 推荐模式
多阶段任务(plan → implement → verify) Handoff 文档 + Compaction 提取
选择 Coordinator / Fork / Swarm 三种委托模式选型指南
Hook 太多互相干扰 Component-Scoped Hooks + Hook Profiles
不同环境需要不同保障级别 Hook Runtime Profiles (minimal/standard/strict)
简单任务 overhead 太高 Adaptive Complexity (triage → 自动选执行模式)

工作流程

Step 1: 识别问题

当遇到 agent 可靠性问题时,判断属于哪一类:上下文丢失、协调混乱、hook 冲突、或执行强度不匹配。

Step 2: 选型

根据「常见场景选型」表找到对应模式,MUST 先读 reference 详情再做决策,otherwise 可能误用模式。

Step 3: 应用

如果需要可执行脚本 → 切换到 agent-hooks skill。如果需要运维工具 → 切换到 agent-ops skill。如果不确定 → 先从最简单的模式开始试验。

Output

当被询问 harness 设计建议时,returns:

  • 推荐的模式名称及原因
  • 该模式的 tradeoff 说明
  • 具体的实施步骤指引(指向 agent-hooks 或 agent-ops 中的脚本)

延伸阅读

Usage Guidance
This skill is a documentation-only knowledgebase about harness design — it doesn't ask for credentials or install code itself. Before adopting its patterns: 1) recognize the guide instructs creating hooks and shell scripts that will read/write session files (sessions/*, TMPDIR, ~/.openclaw/shared-context) and use common shell tools (bash, jq, grep); ensure those paths/tools are acceptable in your environment. 2) The SKILL.md references env vars (HARNESS_PROFILE, HARNESS_DISABLED_HOOKS) — these are not secrets but are expected to be set by the implementer. 3) If you implement the examples, review any hook scripts for correct file paths, locking behavior, and to avoid accidentally exposing sensitive files; test in a sandbox before using in production. 4) The doc cites internal Claude Code behaviors and external links that may change; validate assumptions against your agent runtime. Overall the package is coherent and appropriate as a design reference, but treat code snippets as templates to review rather than ready-to-run artifacts.
Capability Analysis
Type: OpenClaw Skill Name: harness-design-patterns Version: 1.1.0 The 'harness-design-patterns' bundle is a comprehensive architectural knowledge base for designing AI agent execution environments. It provides well-documented patterns for context survival (handoff documents), multi-agent coordination (Coordinator/Fork/Swarm), and safety mechanisms (Denial Circuit Breakers). While it contains shell script snippets for tasks like atomic file writing (references/06-atomic-write.md) and task complexity triage (references/16-adaptive-complexity.md), these are local, non-malicious utility functions aligned with the stated purpose. No evidence of data exfiltration, unauthorized remote execution, or harmful prompt injection was found; the content focuses on improving agent reliability and observability.
Capability Assessment
Purpose & Capability
The name/description match the included content: a set of harness design patterns and examples. The skill declares no required binaries, env vars, or installs, which is appropriate for a documentation-only skill. Note: the docs reference environment variables (HARNESS_PROFILE, HARNESS_DISABLED_HOOKS, TMPDIR), shell utilities (bash, jq, grep, mv), and specific filesystem locations (sessions/*, ~/.openclaw/shared-context). Those references are reasonable for implementation guidance but are not declared as requirements — verify your runtime will provide those tools/paths if you adopt the patterns.
Instruction Scope
SKILL.md is purely prose and examples; there are no executable files. However it includes concrete shell snippets and hook configurations that, if implemented, instruct agents or hooks to read/write local files (handoff/denials/bracket files), inspect transcripts, and inject prompts via hooks. This behavior is consistent with the skill's purpose (harness design) but means following the doc will create agents that read/write session state on disk and run hook scripts — review any concrete implementation for safety and correct paths.
Install Mechanism
No install spec and no code files — lowest-risk pattern for a skill. Nothing is downloaded or written by the skill itself.
Credentials
The skill requests no credentials and declares no required env vars, which is appropriate for a patterns knowledgebase. Still, the documentation references several env vars and filesystem locations used to control behavior (e.g., HARNESS_PROFILE, HARNESS_DISABLED_HOOKS, TMPDIR, sessions/*). These are not secrets, but you should be aware the recommended patterns assume access to local filesystem and typical shell utilities.
Persistence & Privilege
always:false and user-invocable:true. The skill does not request persistent presence or special platform privileges and does not modify other skills' configs. Autonomous model invocation default is unchanged and is appropriate for a documentation skill.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install harness-design-patterns
  3. After installation, invoke the skill by name or use /harness-design-patterns
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Version bump, consistency fixes
v1.0.0
Initial release: 10 architecture patterns for agent execution reliability
Metadata
Slug harness-design-patterns
Version 1.1.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Harness Design Patterns?

Agent harness 架构设计模式知识库。当设计多阶段任务的上下文传递、选择多 agent 协调方式、或规划 hook 系统架构时使用。纯设计指南,无可执行代码。不用于安装 hook 脚本(用 agent-hooks)或运维监控(用 agent-ops)。 It is an AI Agent Skill for Claude Code / OpenClaw, with 164 downloads so far.

How do I install Harness Design Patterns?

Run "/install harness-design-patterns" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Harness Design Patterns free?

Yes, Harness Design Patterns is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Harness Design Patterns support?

Harness Design Patterns is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Harness Design Patterns?

It is built and maintained by _silhouette (@lanyasheng); the current version is v1.1.0.

💬 Comments