Skip to content
Back to skills

Refine

ASecurity

Trigger continual harness refinement from the Python REPL. Use when you notice a repeated failure, reusable tactic, delegation role, or behavior policy that should be persisted as a harness entry. Returns immediately; refinement runs when the current turn ends.

  • 24 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 8, 2026
toolspythongitapi

Works with

  • api

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill refine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refine?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-refine/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-refine)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refine
description: Trigger continual harness refinement from the Python REPL. Use when you notice a repeated failure, reusable tactic, delegation role, or behavior policy that should be persisted as a harness entry. Returns immediately; refinement runs when the current turn ends.
---

# Refine

Refinement consolidates existing harness entries and applies small, evidence-backed
updates to the continual harness (prompts, memories, skills, subagent specs).
The implementation lives in the host (the same one behind the user's `/refine`
command); this skill is the kernel-side interface to it. Call it directly from
the Python REPL:

```python
await refine.status()
await refine.run()
await refine.run("create a memory about always checking git status before committing")
await refine.run("distill reusable session lessons into global memories", global_=True)
```

## API

- `await refine.status()` — current refine state as a dict: `pending` (whether a
  requested refine is already queued for this turn) and `in_flight` (whether a
  refine is currently planning or applying).
- `await refine.run(instructions=None, global_=False)` — schedule refinement.
  Returns `{"scheduled": True}` immediately, or `{"scheduled": False, "reason": ...}`
  when refinement cannot start. Optional `instructions` focus the refinement on a
  specific observation. Set `global_=True` to target the global harness store
  (cross-session); omit for local (session-scoped) refinement. Global requests also
  review bounded session-memory candidates, preserving the local entries. Only
  stable, qualified lessons become global memories; temporary progress and
  unverified trajectory candidates are excluded. Empty edits are valid.

## Rules

- Refinement never runs mid-cell. A scheduled refinement runs when the current
  turn ends; the harness applies changes and rebuilds the system prompt for
  your next turn. Continue working normally after calling it — `run` returns
  immediately and the turn itself stays ended afterwards.
- One request per turn is enough; calling `run` again before the turn ends only
  updates the instructions.
- Use refinement after observing a repeated failure, a reusable tactic, a
  repeated delegation role, or a behavior policy worth persisting. Do not
  rewrite the whole harness when a focused memory, skill, prompt note, or
  subagent spec is enough.

## Direct harness entries

Use the host-backed harness facade for a specific change. Mutations are awaited
and refresh the local view. Read helpers inspect that cached view, so load it
explicitly before inspecting entries saved by an earlier turn:

```python
await rlm.harness.load()
await rlm.harness.create_memory(title="Useful lesson", content="...")
rlm.harness.overview()
```

Use `global_=True` for stable cross-session lessons. Persistent local writes are
unavailable in ephemeral sessions; the host rejects mutations in Plan mode.
Python does not choose persistence paths or write harness state files.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.