Xpersona
U

utility

CLAWHUB · Unverified

Scores agent actions by expected gain, cost, uncertainty, and redundancy Skill: utility Owner: athola Summary: Scores agent actions by expected gain, cost, uncertainty, and redundancy Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:16:30.066Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:37:05.172Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:53:52.288Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:02:33.962Z | user Release v1.9.14 v1.9.13 | 2026-06-27T16:20:48.586Z | use

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-leyline-utility
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-leyline-utility/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

146,431 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: utility
description: Scores agent actions by expected gain, cost, uncertainty, and redundancy
version: 1.9.8
triggers:
  - orchestration
  - cost-control
  - decision-making
  - agent-dispatch
  - deciding whether to dispatch an agent or invoke a tool
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/leyline", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: leyline
---

> **Night Market Skill** — ported from [claude-night-market/leyline](https://github.com/athola/claude-night-market/tree/master/plugins/leyline). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# Utility Skill

## Overview

A decision framework for agent orchestration based on Liu et al.,
"Utility-Guided Agent Orchestration for Efficient LLM Tool Use"
(arXiv:2603.19896).
Each candidate action is scored by subtracting weighted costs from
expected gain, producing a single utility value that guides action
selection.
The framework prevents over-calling tools and premature stopping by
making both errors costly.
Utility range is [-2.3, 1.0].

## When To Use

- Deciding whether to dispatch another agent or tool call
- Gating expensive tool calls (search, code execution, delegation)
- Selecting the right model tier for a sub-task
- Continuation decisions after receiving partial results
- Verification gating before writing or committing output

## When NOT to Use

- Single-step operations with one obvious action
- Trivial tasks where cost of scoring exceeds benefit
- Already-committed actions that cannot be undone

## Action Space

`A = {respond, retrieve, tool_call, verify, delegate, stop}`

| Action | Description |
|-----------|------------------------------------------------------|
| respond | Emit a final answer from current context |
| retrieve | Fetch additional information (search, read, lookup) |
| tool_call | Execute a tool (code runner, API, file write) |
| verify | Check a prior result for correctness or completeness |
| delegate | Spawn a sub-agent or hand off to a specialist |
| stop | Terminate the loop and return current state |

## Utility Function

```
U(a | s_t) = Gain(a | s_t)
           - λ₁ · StepCost(a | s_t)
           - λ₂ · Uncertainty(a | s_t)
           - λ₃ · Redundancy(a | s_t)
```

| Parameter | Default | Rationale |
|-----------|---------|---------------------------------------------------|
| λ₁ | 1.0 | Cost baseline; all other weights relative to this |
| λ₂ | 0.5 | Weak empirical correlation with outcome (r=0.0131) |
| λ₃ | 0.8 | Redundancy pruning yields ~10% token savings |

Utility range: **[-2.3, 1.0]**.
Positive values indicate the action is worth taking.
Values below the floor (-0.5 default) indicate the action should
be skipped.

## Termination Conditions

Stop the loop when **any** of the following is true:

- (a) Selected action is `stop`
- (b) Step budget exhausted (default: 10 steps)
- (c) All non-`stop` actions score bel

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-leyline-utility",
  "version": "1.9.19",
  "publishedAt": 1787750190066
}

modules/action-selector.md

# Action Selector

Combines scores from all four utility components and selects
the highest-utility action for the current step.
Produces an action report that downstream consumers use to
drive execution.

## Input Requirements

- Session state from `state-builder` (scope, step, max_steps,
  lambda weights)
- Per-candidate scores: `Gain`, `StepCost`, `Uncertainty`,
  `Redundancy`

## Procedure

1. **Enumerate candidates** for the current scope (see
   Scope-Specific Action Sets below).

2. **Compute utility** for each candidate action `a`:

   ```
   U(a) = Gain - lambda_1*StepCost - lambda_2*Uncertainty
          - lambda_3*Redundancy
   ```

3. **Select** `a* = argmax U(a)` over all candidates.

4. **Check termination** conditions (see Termination Logic
   below).

5. **Produce** the action report (see Action Report Template
   below).

## Scope-Specific Action Sets

Different scopes expose different candidate actions.

**self** — the top-level Claude instance answering a user:

- `respond`, `retrieve`, `tool_call`, `verify`, `delegate`,
  `stop`
- `delegate` triggers a new dispatch-scope evaluation;
  the nested scope selects its own `a*` independently.

**subagent** — a spawned agent executing a delegated task:

- `respond`, `retrieve`, `tool_call`, `verify`, `stop`
- No `delegate`; subagents execute, they do not orchestrate.

**dispatch** — an orchestrator managing a fleet of subagents:

- `respond`, `delegate`, `retrieve`, `tool_call`, `verify`,
  `stop`

## Termination Logic

Evaluate in order after selecting `a*`:

1. If `a* == stop`: terminate.

2. If `step >= max_steps`: terminate regardless of utility.

3. If `max(U)` for all non-stop actions `< floor` (default
   `-0.5`): terminate, UNLESS the high-gain override applies.
   The override applies when `Gain >= 0.7` for at least one
   candidate action; in that case, proceed and document the
   override reason in the `Rationale` field of the report.

## Action Report Template

```
Action: <selected>
Utility: <score>
Breakdown: Gain=X StepCost=Y Uncertainty=Z Redundancy=W
Rationale: "<1-sentence justification>"
```

All four breakdown fields are required.
Utility is rounded to two decimal places.

## Canonical Worked Example

Given scores for a `tool_call` candidate:

```
Gain        = 0.7
StepCost    = 0.12
Uncertainty = 0.6
Redundancy  = 0.0
```

With lambda weights `[1.0, 0.5, 0.8]`:

```
U = 0.7 - 1.0*0.12 - 0.5*0.6 - 0.8*0.0
  = 0.7 - 0.12 - 0.30 - 0.0
  = 0.28
```

Resulting report:

```
Action: tool_call
Utility: 0.28
Breakdown: Gain=0.7 StepCost=0.12 Uncertainty=0.6 Redundancy=0.0
Rationale: "Clear gap exists; tool call likely fills it at
            acceptable cost."
```

## Prescriptive Gate

When the consuming skill's frontmatter sets
`utility_gated: true`, the selected action `a*` is mandatory.
The agent must not substitute a different action regardless
of other heuristics or instructions.

modules/gain.md

# Gain Estimation

The LLM self-estimates the marginal value of taking a candidate action
before executing it.
This is a heuristic signal, not a calibrated probability.

## Output

`Gain(a | s_t) -> [0, 1]`

## Anchoring Scale

| Range   | Meaning                                              |
|---------|------------------------------------------------------|
| 0.0-0.2 | Answer is sufficient; action is speculative          |
| 0.3-0.5 | Known gap exists; action might address it            |
| 0.6-0.8 | Clear gap exists; action likely addresses it         |
| 0.9-1.0 | Critical missing piece; action directly fills it     |

## Estimation Prompts

Ask yourself these three questions before acting:

1. Does this action address an open task or an identified gap in my
   current answer?
2. How much new information is expected versus what I have already
   observed?
3. Is the current answer sufficient, or does it have clear, specific
   gaps?

Score higher when the answer to (1) is yes, (2) is substantial, and
(3) points to a specific deficit.
Score lower when the answer is already adequate or the action is
exploratory.

## Scope-Specific Guidance

**self** — Will reading this file or calling this tool fill a specific
gap in my current understanding?

**subagent** — Will this finding advance my assigned task, or am I
exploring outside my scope?

**dispatch** — Will this agent produce findings that existing agents
haven't covered?

Match the question to your current execution scope before scoring.

## Task-Aware Gain Boost

Actions that are directly mapped to the active `current_task_id`
receive a +0.1 bonus, capped at 1.0.
Use this boost only when the action explicitly advances the tracked
task, not for tangentially related work.

## Anti-Pattern

Never assign 0.9+ to a speculative action.
Reserve the top tier for cases where the missing information is
specifically identified and the action is known to retrieve it.
A vague sense that more information might help is a 0.3-0.5 score,
not a 0.9.

modules/integration.md

# Integration

This module defines how consuming skills wire utility scoring into their
orchestration loops.
Two modes are available: advisory (default, no setup required) and
prescriptive (opt-in, frontmatter-controlled).

> **Why prescriptive stays opt-in.** Per
> [docs/inclusive-defaults.md][inc] (TRUE-exception
> category 9), advisory IS the inclusive default —
> prescriptive mode requires per-skill consent because
> it changes orchestration behavior, not just analysis.

[inc]: ../../../../../docs/inclusive-defaults.md

## Advisory Mode

Advisory mode requires no frontmatter changes.
The skill author adds a short evaluation block before each action decision.

4-step checklist:

1. Construct state per `leyline:utility/modules/state-builder`
2. Score candidates per `leyline:utility/modules/action-selector`
3. Prefer the highest-utility action unless you have a specific reason
   to override
4. Log the score and your decision before executing the action

Consumer can override the selected action with stated reasoning.
The override must be recorded in the reasoning trace alongside the
utility score.

**What to add to your skill:**

```
Before taking your next action, evaluate utility:
1. Construct state per leyline:utility/modules/state-builder
2. Score candidates per leyline:utility/modules/action-selector
3. Prefer the highest-utility action unless you have a
   specific reason to override
4. Log the score and your decision
```

## Prescriptive Mode

Prescriptive mode enforces utility gating via frontmatter keys.
The skill MUST follow the selected action; overrides are not permitted
unless `Gain >= 0.7` (document the override and gain value).

**Frontmatter keys:**

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `utility_gated` | bool | false | Enable prescriptive mode |
| `utility_floor` | float | -0.5 | Skip actions scoring below this |
| `utility_max_steps` | int | 10 | Step budget before forced stop |
| `utility_lambdas` | float[3] | [1.0, 0.5, 0.8] | λ₁, λ₂, λ₃ weights |

**Validation rules:**

- `utility_lambdas`: 3-element list of floats, each >= 0.
  Falls back to `[1.0, 0.5, 0.8]` if invalid.
- `utility_floor`: must be in `[-2.3, 1.0]`.
  Falls back to `-0.5` if out of range.
- `utility_max_steps`: positive integer.
  Falls back to `10` if zero or negative.

**Example frontmatter block:**

```yaml
---
name: my-skill
utility_gated: true
utility_floor: -0.3
utility_max_steps: 8
utility_lambdas: [1.0, 0.5, 0.8]
---
```

## Dispatch Mode

Dispatch mode applies when a parent orchestrator manages subagents.
Construct state with `scope: "dispatch"` and evaluate utility before
launching each additional agent.

Per-agent utility evaluation follows the same formula but draws on
dispatch-scope signals: `agents_pending`, `total_agent_tokens`, and
`coordination_overhead`.
Brooks's Law applies: adding agents to a late or saturated task
increases coordination overhead faster than it increases throughput,
driving `Step

Sponsored

Ads related to utility and adjacent AI workflows.