Skip to content

Harness engineering beginner tutorial, from 0 to 1

Fix harness-creator bugs and sharpen skill triggering

xuwentao.599b69c48fddd5
diff --git a/skills/harness-creator/SKILL.md b/skills/harness-creator/SKILL.md
index 802fed8..89734d0 100644
--- a/skills/harness-creator/SKILL.md
+++ b/skills/harness-creator/SKILL.md
@@ -1,9 +1,13 @@
---
name: harness-creator
description: >-
- Build, audit, and improve lightweight harnesses for AI coding agents: AGENTS.md/CLAUDE.md,
- feature state, verification workflows, scope boundaries, lifecycle handoff,
- memory persistence, context control, tool safety, and multi-agent coordination.
+ 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 unreliable across sessions — forgets context,
+ drifts out of scope, claims "done" before tests pass, or starts each session inconsistently —
+ or when creating or assessing AGENTS.md, CLAUDE.md, feature_list.json, init.sh, progress.md, or
+ session-handoff files. Reach for it even if the user never says the word "harness."
license: MIT
---
diff --git a/skills/harness-creator/SKILL.md.en b/skills/harness-creator/SKILL.md.en
index 802fed8..89734d0 100644
--- a/skills/harness-creator/SKILL.md.en
+++ b/skills/harness-creator/SKILL.md.en
@@ -1,9 +1,13 @@
---
name: harness-creator
description: >-
- Build, audit, and improve lightweight harnesses for AI coding agents: AGENTS.md/CLAUDE.md,
- feature state, verification workflows, scope boundaries, lifecycle handoff,
- memory persistence, context control, tool safety, and multi-agent coordination.
+ 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 unreliable across sessions — forgets context,
+ drifts out of scope, claims "done" before tests pass, or starts each session inconsistently —
+ or when creating or assessing AGENTS.md, CLAUDE.md, feature_list.json, init.sh, progress.md, or
+ session-handoff files. Reach for it even if the user never says the word "harness."
license: MIT
---
diff --git a/skills/harness-creator/references/tool-registry-pattern.md b/skills/harness-creator/references/tool-registry-pattern.md
index 1a38db9..ffb9a44 100644
--- a/skills/harness-creator/references/tool-registry-pattern.md
+++ b/skills/harness-creator/references/tool-registry-pattern.md
@@ -161,8 +161,7 @@ protected_commands:
## Related Patterns
-- [Lifecycle & Bootstrap](lifecycle-bootstrap-pattern.md) — How tools are registered at init
-- Hook Lifecycle (`hook-lifecycle-pattern.md`) — Pre/post tool execution hooks
+- [Lifecycle & Bootstrap](lifecycle-bootstrap-pattern.md) — How tools are registered at init, and pre/post-tool hook dispatch
## Template: Tool Safety Checklist
diff --git a/skills/harness-creator/scripts/lib/harness-utils.mjs b/skills/harness-creator/scripts/lib/harness-utils.mjs
index fbe3571..60602a3 100644
--- a/skills/harness-creator/scripts/lib/harness-utils.mjs
+++ b/skills/harness-creator/scripts/lib/harness-utils.mjs
@@ -272,7 +272,10 @@ export function scoreHarness(files) {
const total = Object.values(subsystems).reduce((sum, item) => sum + item.score, 0);
const overall = Math.round((total / (SUBSYSTEMS.length * 5)) * 100);
- const bottleneck = Object.entries(subsystems).sort((a, b) => a[1].score - b[1].score)[0][0];
+ const ranked = Object.entries(subsystems).sort((a, b) => a[1].score - b[1].score);
+ // A bottleneck only means something when a subsystem is weaker than the rest.
+ // When every subsystem already maxes out, reporting one is misleading.
+ const bottleneck = ranked[0][1].score === 5 ? null : ranked[0][0];
return { overall, bottleneck, subsystems };
}
@@ -324,7 +327,7 @@ export function formatScoreReport(result, root = '.') {
const lines = [
`Harness validation for ${root}`,
`Overall: ${result.overall}/100`,
- `Bottleneck: ${result.bottleneck}`,
+ `Bottleneck: ${result.bottleneck ?? 'none — all subsystems at full score'}`,
''
];
@@ -378,7 +381,7 @@ export function htmlReport(result, title = 'Harness Assessment') {
<p>Five-subsystem harness validation report.</p>
<div class="summary">
<div class="metric">Overall<strong>${result.overall}/100</strong></div>
- <div class="metric">Bottleneck<strong>${escapeHtml(result.bottleneck)}</strong></div>
+ <div class="metric">Bottleneck<strong>${escapeHtml(result.bottleneck ?? 'none')}</strong></div>
</div>
</header>
${rows}