mark393295827/harness-engineering
Use when an agent workflow needs production-like runtime controls for context, tools, permissions, observability, scheduling, evaluation, recovery, or maintenance.
npx skills add https://github.com/Mark393295827/third-brain-v7-skills --skill 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.
Provide: workflow, users, agent roles, environment, tools/connections, data sensitivity, delegated actions, cadence, throughput/SLA, failure history, and risk tolerance.
<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>
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.
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>
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.Return status, result (runtime architecture and controls), evidence (trace/eval/failure tests), unknowns, and next_action including approval or rollback.
identity and release successors only from one verified transition.
</skill_contract>
Take mark393295827/harness-engineering from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.