Agent Skillscobusgreyling/loop-engineering › budget-negotiator

budget-negotiator

GitHub

当代理接近每日Token预算上限时,自动计算ROI并起草预算增加请求,避免静默失败。需人工审批才能生效,确保关键任务不被阻断。

skills/budget-negotiator/SKILL.md cobusgreyling/loop-engineering

Trigger Scenarios

检测到Token使用率≥90% 存在高优先级待处理任务

Install

npx skills add cobusgreyling/loop-engineering --skill budget-negotiator -g -y
More Options

Use without installing

npx skills use cobusgreyling/loop-engineering@budget-negotiator

指定 Agent (Claude Code)

npx skills add cobusgreyling/loop-engineering --skill budget-negotiator -a claude-code -g -y

安装 repo 全部 skill

npx skills add cobusgreyling/loop-engineering --all -g -y

预览 repo 内 skill

npx skills add cobusgreyling/loop-engineering --list

SKILL.md

Frontmatter
{
    "name": "budget-negotiator",
    "description": "An advanced skill for L3 autonomous loops. When the token budget nears exhaustion, the agent analyzes its ROI and autonomously drafts a negotiation request for a budget increase rather than silently failing."
}

Budget Negotiator

When you detect that you are nearing your daily token cap (e.g., ≥90% spend) via the loop-budget skill, DO NOT just exit silently. You must negotiate for an extension based on your Return on Investment (ROI).

Goal

Ensure that critical work is not arbitrarily blocked by token budgets if the loop has demonstrated a high success rate and the remaining work is critical.

Rules & Precedence

  • Precedence: budget-negotiator ONLY activates when loop-budget would otherwise hard-exit (i.e. ≥90% spend), and ONLY when there are High Priority items remaining. If work is not High Priority, yield to the standard loop-budget exit sequence.
  • Safety: This skill touches L3 (unattended) safety boundaries. See Safety Boundaries for threat models.
  • Strict Cap Limitation: You are strictly forbidden from self-raising the caps in loop-budget.md. A human MUST explicitly edit loop-budget.md to increase the cap before you can resume.
  • Human Decline: If a human declines the negotiation by removing the [BUDGET NEGOTIATION] tag without increasing the budget, you must revert to report-only mode and NOT ask again today.
  • Cap the Ask: You may only request a maximum of +20% or +50k tokens per negotiation. You may only negotiate a maximum of one time per day.

Negotiation Protocol

  1. Calculate ROI:

    • Read loop-run-log.md and sum up the actions_taken, outcome (specifically successes), and tokens_estimate fields for today.
    • Read STATE.md to identify the severity of the remaining actionable items in the Watch List or High Priority sections.
  2. Draft Justification:

    • If the remaining items are High Priority (e.g., CI is red, P0 bugs, security vulnerabilities), draft a concise business justification.
    • The justification must include:
      • The current spend vs the limit.
      • The exact actions_taken count and successful outcomes you've completed today based on the JSON log.
      • The specific critical issue(s) remaining.
      • A precise request for an extension tied to the specific loop-budget.md field (e.g., "Requesting +50k tokens for the 'Validate/Audit (CI)' max tokens/day").
  3. Escalate to Humans:

    • Append your request to the High Priority section of STATE.md with the tag [BUDGET NEGOTIATION].
    • Ensure the request is formatted clearly so a human maintainer can make a quick yes/no decision.
    • Example: [BUDGET NEGOTIATION] I have burned 95k/100k tokens for the 'Daily Triage' loop today. However, I have successfully executed 4 actions with a 'fix-proposed' outcome. There is 1 critical CI failure remaining on the main branch. I request a temporary bump of 'Daily Triage' max tokens/day by +50k to resolve it.
    • Set your internal state to WAITING_FOR_BUDGET and safely suspend execution.
  4. Resume:

    • Do not spawn further sub-agents until you read loop-budget.md on a subsequent run and verify that the human has increased your token cap.

Version History

  • a60b793 Current 2026-08-04 22:55

Same Skill Collection

skills/install-loop/SKILL.md
skills/loop-budget/SKILL.md
skills/loop-constraints/SKILL.md
skills/loop-triage/SKILL.md
skills/loop-verifier/SKILL.md
skills/minimal-fix/SKILL.md
starters/changelog-drafter-opencode/skills/changelog-scan/SKILL.md
starters/changelog-drafter/.claude/skills/changelog-scan/SKILL.md
starters/changelog-drafter/.claude/skills/draft-release-notes/SKILL.md
starters/changelog-drafter/.grok/skills/changelog-scan/SKILL.md
starters/changelog-drafter/.grok/skills/draft-release-notes/SKILL.md
starters/changelog-drafter/.grok/skills/loop-verifier/SKILL.md
starters/ci-sweeper-opencode/skills/ci-triage/SKILL.md
starters/ci-sweeper/.claude/skills/ci-triage/SKILL.md
starters/ci-sweeper/.codex/skills/ci-triage/SKILL.md
starters/ci-sweeper/.grok/skills/ci-triage/SKILL.md
starters/dependency-sweeper-opencode/skills/dependency-triage/SKILL.md
starters/dependency-sweeper/.claude/skills/dependency-triage/SKILL.md
starters/dependency-sweeper/.codex/skills/dependency-triage/SKILL.md
starters/dependency-sweeper/.grok/skills/dependency-triage/SKILL.md
starters/issue-triage-opencode/skills/issue-triage/SKILL.md
starters/issue-triage/.claude/skills/issue-triage/SKILL.md
starters/issue-triage/.codex/skills/issue-triage/SKILL.md
starters/issue-triage/.grok/skills/issue-triage/SKILL.md
starters/issue-triage/.grok/skills/loop-verifier/SKILL.md
starters/minimal-loop-claude/.claude/skills/loop-triage/SKILL.md
starters/minimal-loop-codex/.codex/skills/loop-triage/SKILL.md
starters/minimal-loop-opencode/skills/loop-triage/SKILL.md
starters/minimal-loop/.grok/skills/loop-triage/SKILL.md
starters/post-merge-cleanup-opencode/skills/post-merge-scan/SKILL.md
starters/post-merge-cleanup/.claude/skills/post-merge-scan/SKILL.md
starters/post-merge-cleanup/.codex/skills/post-merge-scan/SKILL.md
starters/post-merge-cleanup/.grok/skills/post-merge-scan/SKILL.md
starters/pr-babysitter-opencode/skills/pr-review-triage/SKILL.md
starters/pr-babysitter/.claude/skills/pr-review-triage/SKILL.md
starters/pr-babysitter/.codex/skills/pr-review-triage/SKILL.md
starters/pr-babysitter/.grok/skills/pr-review-triage/SKILL.md
starters/changelog-drafter/.codex/skills/changelog-scan/SKILL.md
starters/changelog-drafter/.codex/skills/draft-release-notes/SKILL.md

Metadata

Files
0
Version
a60b793
Hash
637e9d7f
Indexed
2026-08-04 22:55

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 07:38
浙ICP备14020137号-1 $Map of visitor$