architecture-overview

architecture-overview is a skill for Claude Code, Codex from ZhangShenao/harness9. It costs 24 tokens per session (1,051 once invoked), scanned A, original, MIT.

An overview of harness9’s architecture, an agent runtime built around a repeated loop of model responses, tool calls, and returned results.

In plain words
What is it for?
It helps understand the command-line and terminal interfaces, prompt and skill loading, model providers, tool registration, event streaming, limits, timeouts, and module dependencies.
Why use it?
It explains how the main modules fit together and how runs stop through natural completion, a turn limit, or cancellation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit It helps understand the command-line and terminal interfaces, prompt and skill loading, model providers, tool registration, event streaming, limits, timeouts, and module dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhangshenao/harness9/architecture-overview
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 ZhangShenao/harness9 --skill architecture-overview
Clone the repo
git clone --depth 1 https://github.com/ZhangShenao/harness9

Made for: Claude Code, Codex.

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 architecture-overview

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhangshenao/harness9/architecture-overview/github.svg)](https://agentmods.dev/skills/zhangshenao/harness9/architecture-overview)
Your own site
<a href="https://agentmods.dev/skills/zhangshenao/harness9/architecture-overview"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/architecture-overview/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 architecture-overview

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhangshenao/harness9/architecture-overview"><img src="https://agentmods.dev/badge/skills/zhangshenao/harness9/architecture-overview.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,051 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00024 $0.01051
Opus 5 $0.00012 $0.00526
Sonnet 5 $0.00005 $0.00210
Haiku 4.5 $0.00002 $0.00105

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

Security

Grade A, and why

architecture-overview 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.

.zcode/skills/architecture-overview/SKILL.md · 129 lines

How it starts

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

harness9 架构概览

核心设计原则

原则 说明
简洁 最小化抽象层,极少的直接依赖
完备 覆盖 Agent 运行所需的全部核心模块
生产可用 错误恢复、超时控制、路径沙箱、并发安全

标准 ReAct 循环

Turn N:
  LLM(messages + tools) → 推理 + 工具调用决策
  → 并发执行所有工具调用 → Observation 注入 context
  → Turn N+1

自然终止:模型不再发起工具调用 → 输出最终回复

三重终止保障:

  1. 自然终止len(responseMsg.ToolCalls) == 0
  2. MaxTurns:默认 50,可通过 WithMaxTurns 配置
  3. Context 取消:外部 cancel() 或超时

模块依赖关系

cmd/harness9 (入口)
    ├── internal/context (System Prompt 组装)
    │       └── internal/skills (Skills 解析 + 索引)
    ├── internal/engine (ReAct 主循环)
    │       ├── internal/provider (LLM 调用)
    │       ├── internal/tools (工具注册 + 执行)
    │       └── internal/schema (数据类型)
    └── internal/env (配置加载)

关键设计决策:接口定义在使用者侧

  • tools.Registry 接口定义在 tools 包,engine 包依赖它
  • engine.PromptBuilder 接口定义在 engine 包,context 包实现它
  • skills.UseSkillTool 通过 Go 结构类型满足 tools.BaseTool 接口,不需要 import tools 包(避免循环依赖)

关键数据流

TUI 模式

用户输入 → RunTUI → eng.RunStream(ctx, prompt)
    → engine.Event stream → 逐 token 追加到对话视图
    → ToolCalls → Spinner 动画 + 耗时计数
    → EventDone → 最终回复渲染到屏幕

CLI 模式(管道 / CI)

用户输入 → RunCLI → eng.Run(ctx, prompt)
    → runLoop → LLM Generate
    → ToolCalls → 并发执行 → ToolResults → 继续循环
    → 最终回复打印到 stdout

System Prompt 组装

DefaultPromptBuilder.Build() 按顺序组装:

  1. 基础 Prompt:角色定义 + workDir
  2. AGENTS.md:项目级规范(文件不存在时跳过)
  3. Skills 索引- name: description 列表(为空时跳过)

完整内容示例:

You are harness9, an expert coding assistant...

## Project Guidelines (AGENTS.md)
{AGENTS.md 全文}

## Available Skills
Use the `use_skill` tool to load full content of any skill when needed.
- go-coding-standards: Use when writing or reviewing Go code...
- debugging-guide: Use when debugging Go errors...

Provider 抽象

type LLMProvider interface {
    Generate(ctx, messages, tools) (Message, error)
    GenerateStream(ctx, messages, tools) (<-chan StreamChunk, error)
}

当前实现:

  • OpenAIProvider:兼容所有 OpenAI Chat Completions API(包括 OpenRouter、Azure)
  • AnthropicProvider:Anthropic Messages API

Read the full file on GitHub · 129 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 · 129 lines · 24 tokens per session scan A 630805dc0190

Subscribe to this mod's changes

architecture-overview is a skill published in the GitHub repository ZhangShenao/harness9 (138 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 1,051 once invoked, about $0.0001 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens