agentleFS
Mark393295827Mark393295827/graph-engineering-architectures/skills/harness-engineering/SKILL.md

harness-engineering

Skill4 starsChanged 4 months agoMITView on GitHub

Use when an agent workflow needs production-like runtime controls for context, tools, permissions, observability, scheduling, evaluation, recovery, or maintenance.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use self-improvement-loops, bdi-mental-states and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • DVwebBiz11Skill

    self-improvement-loops

    This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

    Also in 4 projects that use this

  • Downey6689Skill

    bdi-mental-states

    Transforms external RDF context into BDI mental states. Invoke when modeling beliefs, desires, and intentions.

    Also in 5 projects that use this

  • Downey6689Skill

    hosted-agents

    Guidance for hosted/sandboxed agents. Invoke when running background agents in isolated VMs or multi-client setups.

    Also in 5 projects that use this

  • DVwebBiz11Skill

    long-horizon-prompting

    This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

    Also in 4 projects that use this

  • AbdelrhmanAlquranSkill

    latent-briefing

    This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.

    Also in 4 projects that use this

  • abdullah1854Skill

    context-degradation

    Also in 5 projects that use this

  • +2 more from Downey6689

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 2

    Distinctive

    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
  1. Very specific:

    Treat the harness as the kernel around an LLM OS: context is RAM, durable state is disk, tools are system calls, skills are programs, the …

    line 20
  2. Very specific:

    Run the trace gate: the harness must be able to show what the agent saw, decided, called, changed, and verified.

    line 30
  3. Very specific:

    If state ownership, credential scope, external side effects, retention, or approval authority is unclear, return NEEDS_INPUT.

    line 36
  4. Distinctive:

    Add deterministic feedback (tests, lint, LSP, policy checks) outside context when possible.

    line 51
  5. Distinctive:

    Every delegated action is bounded, observable, independently verifiable, and recoverable.

    line 101

“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness Engineering

<skill_contract> <input>An agent workflow, runtime environment, tools, data sensitivity, effects, cadence, risk, and operator constraints.</input> <output>An auditable runtime kernel with scoped permissions, scheduling, observability, recovery, and eval controls.</output> <done>An end-to-end trace and failure-path tests prove bounded, replayable, recoverable delegated action.</done> <non_goals>Business-task decomposition, prompt-only safety, broad credentials, or unbounded scheduled autonomy.</non_goals>

Treat the harness as the kernel around an LLM OS: context is RAM, durable state is disk, tools are system calls, skills are programs, the scheduler is control, and evals are verifiers. Load references/runtime-control-patterns.md for matrices and schemas.

Usage Template

Provide: workflow, users, agent roles, environment, tools/connections, data sensitivity, delegated actions, cadence, throughput/SLA, failure history, and risk tolerance.

Workflow

<intake>

Run the trace gate: the harness must be able to show what the agent saw, decided, called, changed, and verified. Separate Agent (instructions/capabilities), Environment (network/files/credentials), and Session (mounted context/events/state). Define one auditable control path for high-risk intent and final joins.

</intake>

<unknowns_gate>

If state ownership, credential scope, external side effects, retention, or approval authority is unclear, return NEEDS_INPUT. Probe tools with read-only discovery where possible; unknown side effects default to denied.

</unknowns_gate>

<execute>
  1. Pass Four-C: Context truth/retrieval, Connections scoped accounts/APIs, Capabilities versioned skills/scripts/evals, Cadence trigger/receipt/anomaly/stop.
  2. Map runtime: stored program, control unit, hot context, durable disk, event bus, I/O tools, verifier, and garbage collector.
  3. Choose the lowest-context primitive: deterministic script/hook, skill, static Graph, connector, dynamic workflow, or agent team. Load capabilities lazily. Graph Engineering owns dependency semantics; the harness owns the ready queue, leases, duplicate delivery, concurrency, and executor health.
  4. Define each tool as a narrow system call with purpose, explicit inputs, bounds, timeout, idempotency, failure path, evidence, and audit location.
  5. Enforce least privilege in the environment, not only prose. Escalate autonomy through observe -> co-drive -> scoped reversible action -> monitored routine -> audited low-risk autonomy.
  6. For delegated action require mandate, scope, limit, preview, receipt, and rollback. Human approval governs irreversible/shared/financial/published/credentialed actions.
  7. Add deterministic feedback (tests, lint, LSP, policy checks) outside context when possible; add independent evaluator/red team for high-risk semantic output.
  8. Persist an append-only session event log and checkpoint; define alerts, fallback, incident response, cleanup, permission review, and stale-context/rule review.
  9. For scheduled work define Trigger, Context, Steering, Receipt, budget, stop, recovery, and executor health. A schedule firing is not task success.
  10. For Graph execution, persist node/edge/join transitions before releasing successors, make delivery idempotent, recover from the last verified checkpoint, and test permission denial, worker loss, duplicate events, and compensation without relying on in-memory scheduler state.
</execute><evaluate>

Threat-model normal, denied, timeout, partial-write, stale-context, duplicate-trigger, compromised-input, evaluator-disagreement, and rollback paths. Verify permissions with actual environment boundaries and run an independent end-to-end trace. Adoption fails if operators cannot inspect or recover the system.

</evaluate>

<retry_policy>

max_attempts: 3 per tool/failure class. Retry only idempotent or compensated actions after changing diagnosis/strategy. Use exponential delay for transient dependencies. Stop on repeated signature, permission denial, ambiguous side effect, or NO_PROGRESS.

</retry_policy>

<state_contract>

Persist {run_id, status, attempt, budget, evidence, unknowns, last_error, next_action} plus agent/environment/session versions, context manifest, tool/permission registry, event offsets, approvals, evals, alerts, recovery point, and rollback receipts. State transitions are auditable and replayable.

</state_contract>

Failure Protocol

  • NEEDS_INPUT: ownership, effect, retention, or approval authority is ambiguous.
  • BLOCKED_PERMISSION: deny the call and continue with a safer read-only path when useful.
  • BLOCKED_DEPENDENCY: checkpoint, back off, and expose executor health.
  • VERIFY_FAILED: trace, eval, guardrail, or rollback test fails; block autonomy escalation.
  • NO_PROGRESS: changed attempts repeat the signature. max_attempts: 3.
  • BUDGET_STOP: stop scheduler/workers, checkpoint, and emit a recovery receipt.

Output Contract

Return status, result (runtime architecture and controls), evidence (trace/eval/failure tests), unknowns, and next_action including approval or rollback.

Edge Cases

  • A connector exposes broad account access for a narrow task: create a scoped proxy/allowlist or keep the workflow manual; instructions alone are insufficient.
  • The scheduler ran on time but the state store was stale: block mutation, mark the run failed, and recover from the last verified checkpoint.
  • A Graph worker completes twice after lease expiry: deduplicate by node/run identity and release successors only from one verified transition.

Success Metrics

  • Every delegated action is bounded, observable, independently verifiable, and recoverable.
  • Runtime state can be replayed across sessions without relying on chat history.
  • Autonomy level follows measured reliability and operator review capacity.

Quality Gates

  • Agent, Environment, Session, and serial control ownership are explicit.
  • Tool effects are enforced by real permissions and contracts.
  • Independent eval, approval, manual fallback, and rollback match risk.
  • Schedules have executor receipts, hard budgets, stop, and recovery.
  • Maintenance includes cleanup, permission audit, and rule half-life.

</skill_contract>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.