Harness Engineering

Harness Engineering

Helps an agent set up a repository harness that turns repeated coding-agent mistakes into durable instructions, drift checks, regression tests and failure memory.

Skill files1 file
SKILL.md228 lines
1
---
2
name: harness-engineering
3
description: 'Adopt repository-level harness engineering for coding agents. Use when a user wants to prevent repeated AI coding-agent mistakes by turning failures into durable instructions, drift checks, regression tests, failure memory, and adoption reports tailored to the target repository.'
4
---
5
6
# Harness Engineering
7
8
Harness engineering turns repeated coding-agent mistakes into durable
9
repository artifacts:
10
11
```text
12
Harness = Instructions + Constraints + Feedback + Memory + Evaluation + Governance
13
```
14
15
Use this skill when the user asks to:
16
17
- make a repository more reliable for GitHub Copilot or other coding agents
18
- add durable agent instructions, repository rules, or guardrails
19
- prevent repeated AI coding-agent mistakes
20
- record known failure paths and the checks that prevent recurrence
21
- add lightweight drift checks for project rules
22
- review, refresh, or update an existing agent harness
23
24
Do not use this skill for ordinary feature implementation unless the user asks
25
to improve the repository's agent operating environment.
26
27
## Core Principles
28
29
- Treat the target repository as the source of truth.
30
- Inspect before editing. Preserve the existing stack, package manager, CI,
31
docs, naming, and architecture.
32
- Add the smallest useful harness. Prefer updating existing files over adding
33
duplicate guidance.
34
- Make important rules enforceable where practical through tests, linters,
35
type checks, CI, pre-commit hooks, or drift scripts.
36
- Use manual review points only when automation would be brittle or misleading.
37
- Record high-risk failures that should not recur, and name the check or review
38
point that catches recurrence.
39
- Do not copy generic templates blindly. Adapt every artifact to real evidence
40
in the target repository.
41
42
## Discovery
43
44
Before proposing or making harness changes, inspect the repository for existing
45
rules and evidence.
46
47
Read these files and folders when they exist:
48
49
- `README.md`
50
- `AGENTS.md`
51
- `.github/copilot-instructions.md`
52
- `.github/instructions/`
53
- `.github/workflows/`
54
- `CONTRIBUTING.md`
55
- package manifests such as `package.json`, `pyproject.toml`, `go.mod`,
56
`Cargo.toml`, `pom.xml`, or `build.gradle`
57
- existing docs under `docs/`
58
- existing scripts under `scripts/`
59
- existing tests and CI checks
60
61
Then summarize:
62
63
- stack, package manager, and entry points
64
- existing development and verification commands
65
- current agent instructions or repository conventions
66
- known failures, incidents, flaky paths, or repeated review comments
67
- gaps where project rules are not enforced
68
69
## Adoption Workflow
70
71
Follow this sequence:
72
73
1. Choose the harness surface that fits the target repository.
74
2. Write target-specific agent instructions.
75
3. Add enforceable checks for high-value rules.
76
4. Record failure memory for high-risk or recurring failures.
77
5. Add drift checks for guidance that can silently become stale.
78
6. Report the adoption with evidence, assumptions, and follow-up.
79
80
### 1. Choose the Harness Surface
81
82
Pick only the surfaces that fit the target repository:
83
84
| Need | Preferred artifact |
85
| --- | --- |
86
| Always-on agent behavior | `AGENTS.md` or `.github/copilot-instructions.md` |
87
| File-scoped guidance | `.github/instructions/*.instructions.md` |
88
| Recurring project checks | `scripts/check_*.py`, shell scripts, or package scripts |
89
| CI enforcement | existing workflow files or a small new workflow |
90
| Known failures | `docs/failures/*.md` |
91
| Architecture or process decisions | `docs/decisions/*.md` |
92
| Adoption evidence | `docs/harness/adoption-report.md` or similar |
93
94
If the repository already has an equivalent location, update it instead of
95
creating a parallel system.
96
97
### 2. Write Agent Instructions
98
99
Agent instructions should be concrete and operational. Include:
100
101
- project purpose and major ownership boundaries
102
- setup, test, lint, build, and verification commands
103
- package manager and dependency rules
104
- safe editing rules, generated file rules, and forbidden paths
105
- testing expectations for changed code
106
- PR and commit conventions if the repo has them
107
- how to record new failures or decisions
108
109
Avoid broad personality guidance, generic best practices, and rules that cannot
110
be checked or reviewed.
111
112
### 3. Add Enforceable Checks
113
114
Convert high-value rules into checks. Good harness checks are:
115
116
- narrow enough to avoid false positives
117
- fast enough to run locally and in CI
118
- named clearly so agents can run them before finishing
119
- documented with the rule they protect
120
121
Examples:
122
123
```text
124
Rule: Do not edit generated API clients.
125
Check: script scans diffs for generated paths and fails with a clear message.
126
127
Rule: Every failure memory note names a regression check.
128
Check: script validates docs/failures/*.md for a "Detection" section.
129
130
Rule: Profile docs and templates must stay aligned.
131
Check: test compares profile README files to expected template files.
132
```
133
134
### 4. Record Failure Memory
135
136
Record failures when they are user-visible, high-risk, or likely to recur.
137
Use a new file under `docs/failures/` unless an existing note already covers
138
the same root cause.
139
140
Recommended structure:
141
142
```markdown
143
# Short Failure Title
144
145
## Summary
146
147
What failed, who saw it, and why it matters.
148
149
## Root Cause
150
151
The technical or process cause. Avoid blame.
152
153
## Prevention
154
155
Instruction, test, drift check, CI gate, fixture, or manual review point that
156
prevents or detects recurrence.
157
158
## Evidence
159
160
Links to issue, PR, test, log, command output, or file paths.
161
```
162
163
If no automated check is practical, record the manual review point and why
164
automation would be unsafe or misleading.
165
166
### 5. Add Drift Checks
167
168
Use drift checks for guidance that can silently become stale. Common examples:
169
170
- docs mention commands that no longer exist
171
- profile snippets and generated examples diverge
172
- failure notes omit regression checks
173
- decision records are missing for structural changes
174
- CI references stale scripts or package commands
175
176
Prefer small scripts using the repository's existing language. If the repo has
177
no scripting convention, Python with only the standard library is a portable
178
default.
179
180
### 6. Report the Adoption
181
182
Finish substantial harness work with an adoption report that includes:
183
184
- files changed
185
- rules added or updated
186
- checks added or reused
187
- commands run and results
188
- assumptions and manual follow-up
189
- failure memory created or intentionally skipped
190
- how effectiveness will be measured
191
192
## Review Workflow
193
194
When asked to review a harness change, take an opposing perspective. Look for:
195
196
- generic rules copied without evidence from the target repository
197
- duplicate or conflicting instruction files
198
- broad checks that are likely to fail on valid changes
199
- unenforced high-risk rules
200
- missing failure memory for repeated mistakes or runtime failures
201
- generated docs not refreshed after source changes
202
- CI gates that do not run the relevant checks
203
- target repository conventions being overwritten by harness defaults
204
205
Report findings first, ordered by severity, with file and line references when
206
available. Do not modify files during a review unless the user explicitly asks
207
for fixes.
208
209
## Output Contract
210
211
Before finishing harness adoption work, verify:
212
213
- the target repository was inspected before edits
214
- new guidance is specific to the target repository
215
- changed checks can be run locally or have a documented manual substitute
216
- failure memory was recorded when required, or the final response explains why
217
it was skipped
218
- generated docs or indexes are refreshed
219
- the final report names every command run and its result
220
221
## Optional Reference
222
223
The prompt-first workflow in
224
`https://github.com/baskduf/harness-starter-kit` is a reference implementation
225
of these ideas. Use it as reference material only when the user asks for it or
226
when the repository already includes it. The target repository remains the
227
source of truth.
228

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…