wangguode

Coding Agent Harness Patterns — Development skill for Claude Code

Development community

从零拆解 Codex / Claude Code 式编码智能体:Agent Loop、上下文压缩、Skills、子智能体、Hooks、记忆 —— 单文件零依赖可运行的 Harness 设计模式.

How to install Coding Agent Harness Patterns

This entry records only its repository, not the path inside it, so there is no exact command to give. Open wangguode/coding-agent-harness-patterns and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Coding Agent Harness Patterns does

从零拆解 Codex / Claude Code 式编码智能体:Agent Loop、上下文压缩、Skills、子智能体、Hooks、记忆 —— 单文件零依赖可运行的 Harness 设计模式.

Alternatives in Development

  • Pi — PI Wisdom-in-Action Engine v23 — top mandates, scene router, delivery quality gates, anti-patterns, battle mom 107 ★
  • Raw CLI — The agent harness you can fork 105 ★
  • Loop Maker — Interviews you, then scaffolds a self-running agent loop 69 ★

README

Coding Agent Harness Patterns

从零构建生产级编码智能体:Java 17 (Spring Boot 3) 全栈可视化工作台 + Python 零依赖模式库

[![Zhihu](https://img.shields.io/badge/知乎-@王果ai-0084FF?style=flat-square&logo=zhihu)](https://www.zhihu.com/people/wang-guo-ha-53) [![Java](https://img.shields.io/badge/Java-17_+_Spring_Boot_3.3-ED8B00?style=flat-square&logo=springboot&logoColor=white)](#-一java-17--spring-boot-3-全栈工作台wg-harness-studio) [![Python](https://img.shields.io/badge/Python-3.9+_Zero_Deps-3776AB?style=flat-square&logo=python&logoColor=white)](#-二python-零依赖-8-大模式库与-wg-harness-cli) [![MCP](https://img.shields.io/badge/Protocol-MCP_JSON--RPC_2.0-2E5AA8?style=flat-square)](#-核心-harness-模式清单) [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](./LICENSE) [![Stars](https://img.shields.io/github/stars/wangguode/coding-agent-harness-patterns?style=flat-square)](https://github.com/wangguode/coding-agent-harness-patterns/stargazers)

**模型决定上限,Harness(马具工程)决定下限。**
提供 **Java 17 + Spring Boot 3 全栈 Web Studio 工作台** 与 **Python 零依赖 CLI/模式库** 双引擎实现,无需任何 API Key 即可一键跑通 Agent Loop、HITL 人工审批拦截、`/compact` 上下文压缩、MCP JSON-RPC 2.0 沙箱与单测自修复闭环;配置一行环境变量即可无缝切换 DeepSeek / 通义千问。


架构总览 (Editorial Architecture)

Coding Agent Harness Architecture


为什么做这个项目?

Codex、Claude Code、AgentScope 等主流智能体系统的工程代码动辄数十万行,开发者在企业内部落地 Java / Python 智能体控制平面时,最常卡在五个核心工程问题上:

  1. Agent Loop 收敛与自验证:如何让智能体在“推理 → 调工具改代码 → 跑单测 → 读报错自修复”闭环里稳定收敛,而不是改完不测直接交差?
  2. PreToolUse / PostToolUse 安全护栏与 HITL 审批:rm -rf / 如何在毫秒内硬阻断?kubectl rollout restart 如何在 Java 后端挂起 CompletableFuture 等待人工点击放行,同时自动脱敏输出中的 sk-* 密钥?
  3. 两级 /compact 上下文压缩:长任务上下文快爆时,如何裁剪历史工具大输出并提炼结构