ain3sh/.agents/harness-optimization

Claude Code and agent skill by ain3sh/.agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when droids repeat a mistake despite guidance, skip a skill, or get steered wrong by a hook or tool: trace it to the first control-plane failure.

Install

npx vskill@latest install ain3sh/.agents/harness-optimization

SKILL.md

The same SKILL.md was published earlier as ain3sh/.agents/harness-optimization.

Harness Optimization

Treat the agent harness as a control plane: a model choice is locally rational until the loaded policy, available affordances, and runtime semantics prove otherwise. Correct failed decisions while preserving working behavior; remove representable failure states in execution protocols. This is not micro-tuning latency or token usage.

First question: did the agent disobey, or did the harness make the bad choice locally correct?

Act

GoalAction
Preserve the incidentStop retries. Save the transcript, exact tool input/output, hook decisions, full logs, cancellation state, and process IDs.
Establish the intended contractState one invariant covering observation, ownership, completion, and failure reporting.
Trace the control planeWalk instruction → model choice → hook rewrite/decision → executor → child process → output surface → operator response.
Classify the first breakName it as policy-induced behavior, enforcement gap, runtime drift, executor mismatch, observability distortion, split ownership, or recovery-loop amplification.
Fix the owning layerPreserve the working default; choose the narrowest sufficient correction in references/procedure.md → Choose the fix by hierarchy.
Prove the fixReplay the incident and the behavior to preserve; exercise the applicable lifecycle matrix in references/procedure.md.

Detect

Load this skill when any of these are true:

  • an agent repeats a workflow mistake after being corrected
  • a skill exists for the moment but agents do not load it unprompted
  • a skill says one thing while hooks or tools permit or suggest another
  • backgrounding, polling, filtering, retries, compaction, or cancellation

changes the apparent result

  • a hook blocks an action but emits an unusable or self-contradictory retry
  • the visible failure is downstream of process, cache, registration, or output

ownership

  • the proposed fix is growing regex branches, shell parsing, reminders, or

exception tables

Use root-cause-analysis for the first unintended effect, step-through for temporal state, and single-canon when replacing the broken contract. Do not use this skill for ordinary application bugs, isolated user error, or generic model latency/cost tuning.

Rules

  1. Never blame the model before comparing its exact choice with every loaded

instruction, hook affordance, and executor behavior.

  1. Never fix the final error first. Find the earliest point where the harness

made the bad path valid, attractive, invisible, or hard to recover from.

  1. Never split lifecycle ownership. One primitive owns setup, execution,

observation, persistence, cancellation, cleanup, and exit status.

  1. Never teach shell choreography when an argv protocol or typed tool can

remove the states entirely.

  1. Never repair arbitrary commands with case-based parsing. Accept one tiny

grammar; reject known violations and fail open on uncertainty.

  1. Never call an interrupted run a test failure, or a stored log complete

evidence unless live observation and process termination are also proven.

  1. Never accept prose or unit-only proof. Replay agent decisions for policy

fixes; exercise the registered hook and real executor for execution fixes.

Failure map

SymptomFirst questionCorrect direction
Agent repeats a forbidden commandDid policy examples still recommend or normalize it?Fix policy and affordance before adding punishment.
Hook blocks but retries stay wrongIs the hook reconstructing arbitrary shell?Emit one canonical grammar, not a rewritten command.
Agent sleeps or polls logsWho owns foreground completion and observation?One attached runner owns both live output and persistence.
Cancellation creates false failuresDid cancellation reach the whole child process group?Forward, escalate, reap, and classify as interrupted.
Cache sentinel exists but runtime is brokenDoes the sentinel prove every required artifact?Make creation transactional and validate the completeness invariant.
Interactive works but automation diesDo hook semantics differ by execution mode?Test and document each mode explicitly.
Source is fixed but behavior is unchangedIs the active runtime registration/config still stale?Verify live wiring and delete the competing owner.
Fix accumulates special casesIs the accepted language wider than required?Shrink to one protocol and delete competing mechanisms.

References

  • Load on demand; do not reabsorb into this file:

references/procedure.md — evidence packet, actor-state trace, fix hierarchy, lifecycle verification matrix, stop conditions, and report schema.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ain3sh/.agents/harness-optimization/badge)](https://verified-skill.com/skills/ain3sh/.agents/harness-optimization)

Something wrong with this skill or its page? Tell us.