utility
Score candidate agent actions by expected gain, cost, uncertainty, and redundancy to guide dispatch and termination decisions
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/athola/nm-leyline-utilityNight Market Skill — ported from claude-night-market/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-
stopactions score below the floor (default: -0.5)
High-gain override: If Gain >= 0.7 for any action, condition
(c) may be overridden.
Document the override and the gain value in your reasoning trace.
Quick Start
Minimal 4-step advisory pattern:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-athola-nm-leyline-utility": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
extract
Analyze a codebase and build a knowledge base of business logic, architecture, data flow, and engineering patterns. The foundation for gauntlet challenges and agent integration
discourse
>- Scan community discussion channels (HN, Lobsters, Reddit, tech blogs) for experience reports and opinions on a topic
synthesize
>- Merge, deduplicate, rank, and format research findings from multiple channels into a coherent report. Use after research agents return their results
workflow-monitor
Detect workflow failures and inefficient patterns, then create GitHub issues for improvement via /fix-workflow
architecture-paradigm-hexagonal
Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure