|
1 | | -<p align="center"> |
2 | | - <a href="../README.md"><img alt="English" src="https://img.shields.io/badge/English-d9d9d9"></a> |
3 | | - <a href="../README-CN.md"><img alt="简体中文" src="https://img.shields.io/badge/简体中文-d9d9d9"></a> |
4 | | - <a href="../README-ZH-TW.md"><img alt="繁體中文" src="https://img.shields.io/badge/繁體中文-d9d9d9"></a> |
5 | | - <a href="../README-JA.md"><img alt="日本語" src="https://img.shields.io/badge/日本語-d9d9d9"></a> |
6 | | - <a href="../README-ES.md"><img alt="Español" src="https://img.shields.io/badge/Español-d9d9d9"></a> |
7 | | - <a href="../README-FR.md"><img alt="Français" src="https://img.shields.io/badge/Français-d9d9d9"></a> |
8 | | - <a href="../README-KO.md"><img alt="한국어" src="https://img.shields.io/badge/한국어-d9d9d9"></a> |
9 | | - <a href="../README-AR.md"><img alt="العربية" src="https://img.shields.io/badge/العربية-d9d9d9"></a> |
10 | | - <a href="../README-VI.md"><img alt="Tiếng_Việt" src="https://img.shields.io/badge/Tiếng_Việt-d9d9d9"></a> |
11 | | - <a href="../README-DE.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-d9d9d9"></a> |
12 | | -</p> |
| 1 | +# harness-creator |
13 | 2 |
|
14 | | -# harness-creator Skill |
| 3 | +A compact skill for building and auditing harnesses around AI coding agents. |
15 | 4 |
|
16 | | -Production harness engineering skill for AI coding agents, distilled from Learn Harness Engineering course and industry best practices. |
| 5 | +It helps a repository provide five things agents need: instructions, state, verification, scope boundaries, and lifecycle handoff. |
17 | 6 |
|
18 | | -## Installation |
| 7 | +## Install |
19 | 8 |
|
20 | 9 | ```bash |
21 | 10 | npx skills add walkinglabs/learn-harness-engineering --skill harness-creator |
22 | 11 | ``` |
23 | 12 |
|
24 | | -Or manually copy the `skills/harness-creator/` directory to your skill path. |
| 13 | +Or copy `skills/harness-creator/` into your skill path. |
25 | 14 |
|
26 | | -## What This Skill Does |
| 15 | +## Use |
27 | 16 |
|
28 | | -This skill helps you: |
29 | | -- **Create harnesses from scratch** — AGENTS.md, feature lists, verification workflows |
30 | | -- **Improve existing harnesses** — Five-subsystem assessment with prioritized improvements |
31 | | -- **Design session continuity** — Memory persistence, progress tracking, handoff procedures |
32 | | -- **Benchmark effectiveness** — Before/after comparison with quantitative metrics |
33 | | -- **Apply production patterns** — Memory, context engineering, tool safety, multi-agent coordination |
34 | | - |
35 | | -## Core Framework: Five Subsystems |
36 | | - |
37 | | -Every harness consists of five subsystems: |
38 | | - |
39 | | -1. **Instructions** — AGENTS.md as routing layer, progressive disclosure via docs/ hierarchy |
40 | | -2. **State** — feature_list.json, progress.md, session handoff files |
41 | | -3. **Verification** — Explicit commands that agent MUST run before claiming done |
42 | | -4. **Scope** — One-feature-at-a-time policy, clear definition of done |
43 | | -5. **Lifecycle** — init.sh, clean-state checklists, session continuity mechanisms |
44 | | - |
45 | | -## Reference Patterns |
46 | | - |
47 | | -This skill includes 6 deep-dive reference documents: |
48 | | - |
49 | | -| Pattern | When to Use | |
50 | | -|---------|-------------| |
51 | | -| [Memory Persistence](references/memory-persistence-pattern.md) | Agent forgets between sessions, need persistent project knowledge | |
52 | | -| [Context Engineering](references/context-engineering-pattern.md) | Context budget management, JIT loading, delegation isolation | |
53 | | -| [Tool Registry](references/tool-registry-pattern.md) | Tool safety, concurrency control, permission pipelines | |
54 | | -| [Multi-Agent Coordination](references/multi-agent-pattern.md) | Parallelism, specialization, researcher→implementer workflows | |
55 | | -| [Lifecycle & Bootstrap](references/lifecycle-bootstrap-pattern.md) | Hooks, background tasks, initialization sequences | |
56 | | -| [Gotchas](references/gotchas.md) | 15 non-obvious failure modes with fixes | |
57 | | - |
58 | | -## Usage Examples |
59 | | - |
60 | | -### Create Minimal Harness |
61 | | - |
62 | | -``` |
63 | | -User: "I need to set up AGENTS.md for my TypeScript project" |
64 | | -
|
65 | | -Skill will: |
66 | | -1. Ask about project context (stack, size, agent tool) |
67 | | -2. Generate AGENTS.md with startup workflow and working rules |
68 | | -3. Create feature_list.json template with placeholder features |
69 | | -4. Create init.sh with verification commands |
70 | | -5. Explain how to use each file |
71 | | -``` |
72 | | - |
73 | | -### Assess Existing Harness |
74 | | - |
75 | | -``` |
76 | | -User: "My agent still breaks things even with AGENTS.md" |
77 | | -
|
78 | | -Skill will: |
79 | | -1. Request current AGENTS.md content |
80 | | -2. Score each of 5 subsystems (1-5 scale) |
81 | | -3. Identify the lowest-scoring subsystem as the highest-priority improvement area |
82 | | -4. Provide prioritized improvement plan with concrete steps |
83 | | -``` |
84 | | - |
85 | | -### Design Session Continuity |
86 | | - |
87 | | -``` |
88 | | -User: "Agent forgets everything between sessions" |
89 | | -
|
90 | | -Skill will: |
91 | | -1. Explain memory layers (instruction vs auto-memory) |
92 | | -2. Design progress.md template for session tracking |
93 | | -3. Create session-handoff.md structure |
94 | | -4. Implement two-step save invariant (topic file → index) |
| 17 | +```bash |
| 18 | +node skills/harness-creator/scripts/create-harness.mjs --target /path/to/project |
| 19 | +node skills/harness-creator/scripts/validate-harness.mjs --target /path/to/project |
| 20 | +node skills/harness-creator/scripts/run-benchmark.mjs --target /path/to/project --html /path/to/report.html |
95 | 21 | ``` |
96 | 22 |
|
97 | | -## When to Trigger |
| 23 | +The scripts use only Node.js built-in modules. They can be run after copying the skill directory into another repository. |
98 | 24 |
|
99 | | -This skill triggers on: |
100 | | -- "Create AGENTS.md / CLAUDE.md" |
101 | | -- "Improve agent reliability" |
102 | | -- "Agent forgets between sessions" |
103 | | -- "Multi-session continuity needed" |
104 | | -- "Benchmark harness effectiveness" |
105 | | -- "Design verification workflow" |
106 | | -- "Memory persistence patterns" |
107 | | -- "Context engineering for agents" |
| 25 | +## What It Creates |
108 | 26 |
|
109 | | -## When NOT to Use |
| 27 | +- `AGENTS.md` or `CLAUDE.md` |
| 28 | +- `feature_list.json` |
| 29 | +- `progress.md` |
| 30 | +- `init.sh` |
| 31 | +- `session-handoff.md` |
110 | 32 |
|
111 | | -This skill does NOT cover: |
112 | | -- Prompt engineering or system prompt design |
113 | | -- Model selection or fine-tuning |
114 | | -- Generic software architecture |
115 | | -- LLM API integration basics |
| 33 | +`create-harness.mjs` detects common project types and package managers. It supports Node/npm/pnpm/yarn/bun, Python, Go, Rust, Maven, Gradle, and .NET at a basic verification-command level. |
116 | 34 |
|
117 | | -## Templates Included |
| 35 | +## What It Checks |
118 | 36 |
|
119 | | -- `templates/agents.md` — AGENTS.md scaffold with working rules |
120 | | -- `templates/feature-list.json` — JSON Schema + example |
121 | | -- `templates/init.sh` — Standard initialization script |
122 | | -- `templates/progress.md` — Session progress log template |
123 | | -- `templates/session-handoff.md` — Handoff structure |
| 37 | +`validate-harness.mjs` scores the five harness subsystems: |
124 | 38 |
|
125 | | -## Evaluation Framework |
| 39 | +1. Instructions |
| 40 | +2. State |
| 41 | +3. Verification |
| 42 | +4. Scope |
| 43 | +5. Lifecycle |
126 | 44 |
|
127 | | -5 test cases in `evals/evals.json`: |
128 | | -1. **Minimal Harness Creation** — Full setup from scratch |
129 | | -2. **Session Continuity Setup** — Memory and handoff design |
130 | | -3. **Harness Assessment** — Five-subsystem scoring |
131 | | -4. **Verification Workflow Design** — Force agent to verify before done |
132 | | -5. **Memory Taxonomy Design** — What to save vs skip |
| 45 | +The score is structural. It tells you whether the harness is present and coherent; it does not replace real before/after agent-session testing. |
133 | 46 |
|
134 | | -Run evaluation with skill-creator framework for quantitative benchmarks. |
| 47 | +## Status |
135 | 48 |
|
136 | | -## Compatibility |
| 49 | +- [x] Minimal harness scaffolding |
| 50 | +- [x] Five-subsystem validation |
| 51 | +- [x] HTML assessment report |
| 52 | +- [x] Structural benchmark report |
| 53 | +- [x] 10 eval cases |
| 54 | +- [x] Generic verification detection for common stacks |
| 55 | +- [ ] Optional real before/after agent-session replay |
137 | 56 |
|
138 | | -- **Agents**: Claude Code, Codex, Cursor, Windsurf, generic |
139 | | -- **License**: MIT |
140 | | -- **Languages**: English / 中文 (bilingual support in SKILL.md) |
| 57 | +## Files |
141 | 58 |
|
142 | | -## 兼容性 |
143 | | - |
144 | | -- **代理工具**: Claude Code, Codex, Cursor, Windsurf, generic |
145 | | -- **许可证**: MIT |
146 | | -- **语言**: 英文 / 中文 (SKILL.md 中双语支持) |
147 | | - |
148 | | -## Project Structure |
149 | | - |
150 | | -``` |
| 59 | +```text |
151 | 60 | harness-creator/ |
152 | | -├── SKILL.md # Main skill definition |
153 | | -├── metadata.json # Skill metadata, triggers, compatibility |
154 | | -├── evals/ |
155 | | -│ └── evals.json # 5 test cases with expectations |
| 61 | +├── SKILL.md |
| 62 | +├── metadata.json |
| 63 | +├── agents/openai.yaml |
| 64 | +├── scripts/ |
| 65 | +│ ├── create-harness.mjs |
| 66 | +│ ├── validate-harness.mjs |
| 67 | +│ ├── render-assessment-html.mjs |
| 68 | +│ ├── run-benchmark.mjs |
| 69 | +│ └── lib/harness-utils.mjs |
156 | 70 | ├── templates/ |
157 | | -│ ├── agents.md # AGENTS.md template |
158 | | -│ ├── feature-list.json # Feature tracker template |
159 | | -│ ├── init.sh # Initialization script |
160 | | -│ └── progress.md # Session progress template |
161 | | -└── references/ |
162 | | - ├── memory-persistence-pattern.md |
163 | | - ├── context-engineering-pattern.md |
164 | | - ├── tool-registry-pattern.md |
165 | | - ├── multi-agent-pattern.md |
166 | | - ├── lifecycle-bootstrap-pattern.md |
167 | | - └── gotchas.md # 15 failure modes |
| 71 | +│ ├── agents.md |
| 72 | +│ ├── feature-list.json |
| 73 | +│ ├── feature-list.schema.json |
| 74 | +│ ├── init.sh |
| 75 | +│ ├── progress.md |
| 76 | +│ └── session-handoff.md |
| 77 | +├── references/ |
| 78 | +└── evals/evals.json |
168 | 79 | ``` |
169 | 80 |
|
170 | | -## Development Roadmap |
171 | | - |
172 | | -- [x] Chinese translation in SKILL.md (bilingual support added) |
173 | | -- [ ] Python scripts for automated harness generation |
174 | | -- [ ] HTML viewer for harness assessment results |
175 | | -- [ ] Expanded eval set (10+ test cases) |
176 | | -- [ ] Integration with skill-creator benchmark framework |
177 | | -- [ ] Full Chinese localization (harness-creator-zh directory) |
178 | | - |
179 | | -## 开发路线图 |
180 | | - |
181 | | -- [x] SKILL.md 中文翻译(已添加双语支持) |
182 | | -- [ ] Harness 自动生成 Python 脚本 |
183 | | -- [ ] Harness 评估结果 HTML 查看器 |
184 | | -- [ ] 扩展测试用例(10+ 个) |
185 | | -- [ ] 集成 skill-creator 基准测试框架 |
186 | | -- [ ] 完整中文本地化(harness-creator-zh 目录) |
187 | | - |
188 | | -## Contributing |
189 | | - |
190 | | -Issues and PRs welcome. Key areas for contribution: |
191 | | -- Additional reference patterns (skill runtime, hook lifecycle, etc.) |
192 | | -- More eval test cases covering edge cases |
193 | | -- Script automation for common harness tasks |
194 | | -- Case studies from production deployments |
195 | | - |
196 | | -## License |
197 | | - |
198 | | -MIT — See LICENSE file for details. |
199 | | - |
200 | | -## Acknowledgments |
| 81 | +## Boundaries |
201 | 82 |
|
202 | | -This skill synthesizes: |
203 | | -- Learn Harness Engineering course framework |
204 | | -- OpenAI Harness Engineering principles |
205 | | -- Anthropic effective harnesses research |
206 | | -- Agentic Harness Patterns skill (pattern extraction methodology) |
| 83 | +This skill is for harness engineering, not model selection, prompt tuning alone, or app architecture. Keep project-specific facts in the target repository. |
0 commit comments