kortix-harness-refinement

Inspects agent trajectories for failure signatures and refines prompts, sub-agents, skills, and memory.

20.2k|3.4k|Updated Oct 5, 2024
One-click install
npx skills add https://github.com/kortix-ai/suna --skill kortix-harness-refinement
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kortix-harness-refinement
Source: https://github.com/kortix-ai/suna/tree/main/packages/starter/templates/managed/.kortix/opencode/skills/kortix-harness-refinement
Command: npx skills add https://github.com/kortix-ai/suna --skill kortix-harness-refinement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Agents repeat the same mistakes across sessions because their prompts, skills, and memory never get fixed. This Skill gives an agent a structured protocol to detect failure signatures in its own trajectory and repair its harness mid-session, with changes promoted to main only through a reviewed change request.

Core Features & Use Cases

  • Failure signature detection: Scans recent turns for repeated tool failures, rediscovery loops, stalled objectives, repeated multi-step patterns, and exception-raising code.
  • Four-pass refinement: Runs CRUD passes over prompts, sub-agents, skills/tools, and memory, with deletion treated as a first-class outcome.
  • Two operating modes: In-session self-refinement that lands edits on the session branch immediately, and project-level reflection where the harness-reflector agent fans out session-reviewer sub-agents and aggregates findings.
  • Use Case: An agent notices the same shell command has failed twice in a session, so it pauses, records the working alternative in a skill, commits the harness change, opens a change request, and resumes its task with the fix active on the next turn.

Quick Start

Load the kortix-harness-refinement skill and review my recent turns for failure signatures, then apply the four-pass refinement to the harness.

Frequently Asked Questions about kortix-harness-refinement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an AI agent improve its own prompts and skills?▼

Run the refinement protocol: scan the recent trajectory for failure signatures like repeated tool failures or rediscovery loops, then apply four CRUD passes over prompts, sub-agents, skills/tools, and memory. Commit the edits separately and open a change request for promotion to main.

What failure signatures indicate an agent harness needs refinement?▼

The protocol defines six signatures: repeated tool or command failures, rediscovery loops, stalled objectives, repeated multi-step patterns performed by hand, exception-raising code in tools, and missed opportunities. Each signature maps to the harness component that should be fixed.

Can an agent merge its own harness changes to main?▼

No. Harness edits land on the session branch immediately but reach main only through a change request reviewed by a human or a reviewer agent with merge rights. Self-authored and self-merged scaffolding is known to degrade agent performance.

When should in-session refinement be triggered?▼

Trigger it the moment a failure signature costs you twice, and as a checkpoint roughly every 25 turns on long sessions. The nightly harness-reflector run is a backstop, not the primary mechanism.

Why can't sub-agents run the session review fan-out?▼

The runtime rejects a subagent spawning another subagent with a depth limit error. If the skill is loaded as a subagent, it must run the four passes itself and skip the fan-out, which is reserved for the top-level harness-reflector run.