agentic-harness-patterns-zh

agentic-harness-patterns-zh is a skill for Claude Code from keli-wen/agentic-harness-patterns-skill. It costs 37 tokens per session (4,210 once invoked), scanned A, original, MIT.

A Chinese-language guide to designing the supporting systems around AI coding agents, including memory, permissions, context, delegation, reusable skills, hooks, and startup behavior.

In plain words
What is it for?
Use it when building or extending an agent runtime, custom coding agent, or multi-agent workflow. It covers memory layers, reusable workflows, tool safety, context management, delegation, and lifecycle extensions.
Why use it?
It helps engineers reason about how an agent can remember project rules, use tools safely, control context and costs, and coordinate multiple agents without losing control.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: mentions Claude Code.

Good fit Use it when building or extending an agent runtime, custom coding agent, or multi-agent workflow. It covers memory layers, reusable workflows, tool safety, context management, delegation, and lifecycle extensions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns-zh
Clone the repo
git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentic-harness-patterns-zh

README.md
[![agentmods](https://agentmods.dev/badge/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh/github.svg)](https://agentmods.dev/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh)
Your own site
<a href="https://agentmods.dev/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh"><img src="https://agentmods.dev/badge/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agentic-harness-patterns-zh

Your own site · 80×15
<a href="https://agentmods.dev/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh"><img src="https://agentmods.dev/badge/skills/keli-wen/agentic-harness-patterns-skill/agentic-harness-patterns-zh.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,210 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.04210
Opus 5 $0.00018 $0.02105
Sonnet 5 $0.00007 $0.00842
Haiku 4.5 $0.00004 $0.00421

Measured 10d ago against content hash c660f405de2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

agentic-harness-patterns-zh scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agentic-harness-patterns-zh/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agentic Harness Patterns(中文版)

生产级 AI 编程助手不只是"大模型 + 工具调用循环"。循环本身很简单。Harness — 记忆、技能、安全、上下文控制、委派、可扩展性 — 才是让 Agent 可靠、安全、大规模运行的关键。

适合: 正在构建或扩展 AI Agent 运行时、自定义 Agent、或高级多 Agent 工作流的工程师。 不适合: Prompt 工程、模型选择、通用软件架构、LLM API 入门。

所有原则均从生产级运行时决策中提炼而来。Claude Code 作为实证依据,而非唯一实现。

选择你的问题

你想要... 阅读
让 Agent 跨会话记住并持续改进 记忆系统
打包可复用的工作流和专业知识 技能系统
让 Agent 强大地使用工具但不危险 工具与安全
给 Agent 正确的上下文、合理的成本 上下文工程
将工作拆分给多个 Agent 而不失控 多 Agent 协调
通过 Hook、后台任务或启动逻辑扩展行为 生命周期与可扩展性

开始构建之前: 先读 踩坑指南 — 这些是最不直觉但最烧时间的失败模式。


1. 记忆系统

用户痛点: "我的 Agent 下次对话就忘了所有纠正和项目规则。"

黄金法则: 区分 Agent 知道的(指令记忆)、Agent 学到的(自动记忆)、和 Agent 提取的(会话记忆)。三层的持久性、信任度、审查需求各不相同。

适用场景: 任何跨会话运行或需要持续积累项目知识的 Agent。

工作原理:

  • 指令记忆 是人工策划的、分层的配置,按优先级注入系统上下文(组织级 → 用户级 → 项目级 → 本地级;本地优先)。项目编码规范、行为规则都在这里。它是人类编写的,稳定不变。
  • 自动记忆 是 Agent 自主写入的持久知识,带有类型分类法(用户 / 反馈 / 项目 / 引用)和有上限的索引。写入是两步操作:先写主题文件,再更新索引。上限防止无限增长 — 不清理的话,新条目会被静默截断。
  • 会话提取 以后台 Agent 的形式在会话结束时运行。它直接写入自动记忆 — 先主题文件再索引 — 遵循相同的两步保存不变式。互斥锁确保:如果主 Agent 在当轮已经写过记忆,提取器直接跳过。这是自主学习循环。
  • 审查与晋升 审计所有记忆层并提议跨层移动(自动记忆 → 项目规范、个人设置或团队记忆)。它永远不自主应用更改 — 提议需要用户明确批准。

从这里开始: 定义你的记忆层(指令、自动、提取)。实现两步保存不变式(先主题文件,再索引)。核心写入路径稳定后再加后台提取。

在 Claude Code 中: 使用 /remember 审计和晋升各层自动记忆条目。

权衡:

  • 更多记忆层 = 更丰富的回忆但更高的维护负担。不定期清理的话,索引上限导致静默数据丢失。
  • 会话提取在会话结束时增加延迟,但大幅提升跨会话学习能力。

深入阅读: references/memory-persistence-pattern.md


2. Skills 系统

用户痛点: "我想让 Agent 复用工作流和领域知识,不用每次重新解释。"

黄金法则: 技能是懒加载的指令集,不是立即注入的 prompt。发现必须廉价(仅元数据);完整内容只在激活时加载。

适用场景: 任何需要可复用、可组合工作流并根据用户意图匹配激活的 Agent。

工作原理:

  • 发现 是预算约束的:Agent 看到所有可用技能的紧凑列表(名称、描述、触发提示拼接在一起),每条硬限在固定字符数,总量限制在上下文窗口的约 1%。把触发关键词放在前面 — 后面会被截断。
  • 加载 是懒的:只有元数据进入始终在线的上下文。完整技能内容只在激活时加载,闲置 token 成本接近零。
  • 执行 可以是内联的(共享上下文)或隔离的(fork 子 Agent,有自己的 token 预算)。隔离防止重型技能耗尽父级上下文。
  • 来源 可以是内置的、用户安装的、或从插件动态加载的。通过规范路径去重,防止同一技能在重叠的源目录中出现两次。

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 251 lines · 37 tokens per session scan A c660f405de2d

Subscribe to this mod's changes

agentic-harness-patterns-zh is a skill published in the GitHub repository keli-wen/agentic-harness-patterns-skill (302 stars, last pushed 5mo ago), licensed MIT. It adds 37 tokens to every session and 4,210 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

harness-creator

Build, audit, and improve harnesses that make AI coding agents reliable: AGENTS.md/CLAUDE.md instruction files, feature/state tracking, verification gates, scope boundaries, session handoff, memory persistence, context budgets, tool-permission safety, and multi-agent coordination. Use this whenever a coding agent is…

walkinglabs/learn-harness-engineering · 142 tokens

openloomi-memory

OpenLoomi Memory is the long-lived context layer of OpenLoomi — a tiered, locally-stored knowledge graph that grows on its own from your Connectors, chats, and Screen Capture. Memory is what makes Chat grounded and what Loop reads before it produces a Decision. It is always on your machine (local-first), always…

melandlabs/openloomi · 74 tokens

continual-learn

Persist learning across turns by actively maintaining MENTALMODEL.md in the workspace. Use for iterative coding, debugging, benchmarking, or any feedback-driven task; read and update the file with actual filesystem writes before every response, never just hidden/internal memory.

melandlabs/openloomi · 55 tokens

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright…

alleneee/skill-agent · 62 tokens

slack-gif-creator

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

alleneee/skill-agent · 57 tokens

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external agents through well-designed tools. Use when building MCP servers to integrate external APIs or agents, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

alleneee/skill-agent · 61 tokens