claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops;…
Scores agent actions by expected gain, cost, uncertainty, and redundancy. Use when deciding whether to dispatch an agent or invoke a tool.
Claude Code
$ npx -y skills add athola/claude-night-market --skill utility --agent claude-code
Codex
$ npx skills add athola/claude-night-market --skill utility -a codex -y
Cursor
$ npx skills add athola/claude-night-market --skill utility -a cursor -y
Gemini CLI
$ npx skills add athola/claude-night-market --skill utility -a gemini-cli -y
GitHub Copilot
$ npx skills add athola/claude-night-market --skill utility -a github-copilot -y
OpenCode
$ npx skills add athola/claude-night-market --skill utility -a opencode -y
Windsurf
$ npx skills add athola/claude-night-market --skill utility -a windsurf -y
name: utility description: Scores agent actions by expected gain, cost, uncertainty, and redundancy. Use when deciding whether to dispatch an agent or invoke a tool. alwaysApply: false category: infrastructure tags: - orchestration - cost-control - decision-making - agent-dispatch dependencies: [] provides: infrastructure: - utility-scoring - action-selection - termination-control patterns: - gain-estimation - cost-computation - redundancy-detection usage_patterns: - agent-dispatch-gating - tool-call-decisions - continuation-decisions - model-tier-selection complexity: intermediate estimated_tokens: 600 progressive_loading: true modules: - modules/state-builder.md - modules/gain.md - modules/step-cost.md - modules/uncertainty.md - modules/redundancy.md - modules/action-selector.md - modules/integration.md
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].
`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 |
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.
Stop the loop when **any** of the following is true:
**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.
Minimal 4-step advisory pattern:
1. **Construct state**: gather task context per `modules/state-builder.md` 2. **Score candidates**: evaluate each action in `A` per `modules/action-selector.md` 3. **Prefer highest utility**: select the action with the maximum `U(a | s_t)`, subject to termination conditions 4. **Log score and decision**: record the winning action, its utility value, and step count before executing
populate `s_t` from task context
or progress gain
monetary cost tables
estimation and calibration
or low-delta actions
loop and tie-breaking rules
scoring into existing orchestration loops
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops;…
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use…
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily…
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use…
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled…
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.