harness-e2e
Skill4 starsChanged 6 months agoMITView on GitHub
End-to-end and smoke tests that catch what unit tests miss — executable architecture rules and agent-friendly error messages. Use when unit tests pass but the feature fails in runtime or across components.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/agents.mdAGENTS.md
- harness-auditSkill
- harness-diagnoseSkill
- harness-environmentSkill
- harness-evaluatorSkill
- harness-instructionsSkill
- harness-lifecycleSkill
- harness-observabilitySkill
- harness-repo-knowledgeSkill
- harness-scaffoldSkill
- harness-scopeSkill
- harness-stateSkill
- harness-verificationSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Rule: do not proceed to level N+1 if level N fails.
- Very specific: line 69
Add architectural checks to ./init.sh or a scripts/verify-architecture.sh invoked by CI.
- Distinctive: line 73
Every failure message for the agent should include:
- Distinctive: line 88
When a human (or evaluator) catches the same class of mistake twice:
- Very specific: line 90
Write the invariant as a rule in docs/ or AGENTS.md
- Distinctive: line 91
Add an automated check (lint, grep, test)
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harness E2E
What this does for you
- Catch boundary bugs — each component passes alone, system fails together
- Executable architecture — "renderer must not call fs" becomes a CI check
- Errors the agent can fix — WHAT / WHY / FIX, not just "test failed"
Unit tests mock dependencies — they systematically miss interface mismatches, state propagation, and environment differences (Lesson 10). For user-visible features, E2E or smoke is mandatory, not optional.
When E2E is required
Require Level 3 verification when the change:
- Crosses process / service / layer boundaries (UI ↔ API ↔ DB)
- Touches IPC, auth flows, file I/O, or email/webhooks
- Modifies schemas, migrations, or shared contracts
- Is marked
user_visible_behaviorin feature_list
Skip full E2E only for isolated internal refactors with no behavior change — document why in notes.
Verification hierarchy (enforce levels)
Document in AGENTS.md:
## Verification hierarchy
| Level | Command | Required when |
|-------|---------|---------------|
| 1 Unit | `npm test` | Always |
| 2 Integration | `npm run test:integration` | Touches modules + DB/API |
| 3 E2E / smoke | `npm run test:e2e` | User-visible behavior |Rule: do not proceed to level N+1 if level N fails. Do not mark passing if a required level was skipped.
What unit tests miss (checklist)
- Interface format mismatch (relative vs absolute paths, wrong field names)
- State not propagated between layers (cache, session, IPC)
- Resource lifecycle (handles, connections, memory on large inputs)
- Environment differences (mock vs real config, packaged vs dev)
- Errors swallowed before they reach the user-visible surface
Design at least one E2E case per item that applies to your feature.
Executable architecture rules
Convert written rules into checks the agent runs every time:
# Example: no direct fs in renderer (Electron)
if grep -r "require('fs')" src/renderer/ 2>/dev/null; then
echo "ERROR: Direct fs access in renderer"
echo "WHY: Renderer has no Node.js API access"
echo "FIX: Move to src/preload/file-ops.ts and call via window.api"
exit 1
fiAdd architectural checks to ./init.sh or a scripts/verify-architecture.sh invoked by CI.
Agent-oriented error messages
Every failure message for the agent should include:
ERROR: [what failed — file:line or command]
WHY: [constraint or design rule violated]
FIX: [specific steps to correct]Bad: Test failed
Good: POST /api/reset-password returned 500. Check email service env vars. Template: templates/reset-email.html
This turns failures into self-correcting loops (OpenAI harness engineering practice).
Review feedback promotion
When a human (or evaluator) catches the same class of mistake twice:
- Write the invariant as a rule in
docs/orAGENTS.md - Add an automated check (lint, grep, test)
- Link the check from
init.sh
Each promoted rule permanently strengthens the harness — Lesson 10 "review feedback promotion."
E2E workflow with feature_list
1. Pick active feature from feature_list.json
2. Run unit/integration per hierarchy
3. Run E2E/smoke steps listed in verification[]
4. Capture output: tee to .harness/last-e2e.log
5. Only then: evaluator or harness marks passing + evidenceExample verification entry:
"verification": [
"npm test",
"npm run test:e2e -- --grep 'password reset'",
"curl -f http://localhost:3000/health"
]Anti-patterns
- Unit tests only for user-visible features
- E2E exists but agent never runs it before marking done
- Architecture rules only in Confluence / Slack — not in repo checks
- Vague E2E: "manual test in browser" with no script or steps
Related skills
harness-verification— baseline gates and evidenceharness-evaluator— independent pass on E2E evidenceharness-diagnose— attribute "unit green, system red" to verification layerharness-instructions— document hierarchy in AGENTS.md
Course reference
- Lesson 10: Why end-to-end testing changes results
- Lesson 09: Externalize termination judgment
- Project 05–06: Full pipeline verification
- references/course/gotchas.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

