基于全网深度调研的 AI Agent Harness(系统提示词)写作方法论,帮你少走弯路、直达工程最优解。
git clone https://github.com/serein431/harness-skill.git
cd harness-skill
chmod +x install.sh
./install.sh脚本会自动检测已安装的工具(Claude Code / Codex / Cursor / Qoder)并安装到对应位置。
指定目标平台:./install.sh --target claude-code(可选:codex / cursor / qoder / all)
# 复制 skill 参考资料
mkdir -p ~/.claude/skills/writing-agent-harness/commands
cp SKILL.md reference.md ~/.claude/skills/writing-agent-harness/
cp commands/*.md ~/.claude/skills/writing-agent-harness/commands/
# 注册斜杠命令(符号链接)
mkdir -p ~/.claude/commands
ln -sf ../skills/writing-agent-harness/commands/create-harness.md ~/.claude/commands/create-harness.md
ln -sf ../skills/writing-agent-harness/commands/review-harness.md ~/.claude/commands/review-harness.md
ln -sf ../skills/writing-agent-harness/commands/evaluate-harness.md ~/.claude/commands/evaluate-harness.md安装后重启 Claude Code,输入 / 可用:
/create-harness— 从零创建 harness/review-harness— 审查现有 harness/evaluate-harness— 六维量化评估
mkdir -p ~/.codex/skills/writing-agent-harness
cp SKILL.md reference.md ~/.codex/skills/writing-agent-harness/或将内容追加到全局指令:
cat SKILL.md >> ~/.codex/AGENTS.mdmkdir -p ~/.cursor/commands
cp commands/create-harness.md ~/.cursor/commands/harness-create.md
cp commands/review-harness.md ~/.cursor/commands/harness-review.md
cp commands/evaluate-harness.md ~/.cursor/commands/harness-evaluate.mdmkdir -p ~/.qoder/skills/writing-agent-harness
cp SKILL.md reference.md ~/.qoder/skills/writing-agent-harness/一个系统性总结 AI Agent 系统提示词设计方法论的知识库。
数据来源:50+ 高质量参考资源,包括 Claude Code 泄露源码逆向分析、五大主流 Agent 横向对比、Anthropic/OpenAI 官方文档、学术论文及工程博客。
结构设计 — 八段式 U 形结构(U-Shape Attention Architecture)、缓存感知设计(Cache-Aware Design)
规则与模式 — 十条黄金规则、五大反面模式、工具定义最佳实践
评估与迭代 — 六维质量评估框架、实战 Checklist
深度分析 — 五大 Agent 横向对比、Claude Code 六大工程教训、Context Engineering vs Prompt Engineering、Prompt Injection 防御
writing-agent-harness/
├── SKILL.md # 核心方法论(310行)
├── reference.md # 详细参考资料(507行)
├── install.sh # 一键安装脚本
├── README.md # 本文件
└── commands/ # 斜杠命令
├── create-harness.md
├── review-harness.md
└── evaluate-harness.md
- Claude Code 是当前最好的 harness 工程范本(8.5/10)— 模块化架构、缓存分界线、10 层权限模型
- 永远不要在 system prompt 中放成本优化指令 — "Be concise" 触发 Goodhart 定律
- Context Engineering > Prompt Engineering — 80% 的 Agent 失败源于上下文管理不当
- 信噪比是关键,不是长度 — 2000 token 的精炼 harness 胜过 10000 token 的冗余 harness
- Anthropic — Context Engineering for AI Agents
- Anthropic — Writing Tools for Agents
- Paddo — Claude Code Harness Exposed
- Martin Fowler — Harness Engineering
- Prompt Engineering Survey
- Agent Harness Evaluation
MIT