Agent Skills
› cobusgreyling/loop-engineering
› loop-budget
loop-budget
GitHub在循环迭代前后检查Token预算与日志,根据消耗比例执行报告模式、自动协商或立即退出。新增集成budget-negotiator技能以支持高优先级下的L3自主预算协商,增强安全护栏。
Trigger Scenarios
需要监控循环运行的Token消耗时
达到80%预算阈值需限制子代理时
超过100%预算或存在未处理的高优先级任务需协调时
Install
npx skills add cobusgreyling/loop-engineering --skill loop-budget -g -y
SKILL.md
Frontmatter
{
"name": "loop-budget",
"description": "Check token budget and run-log spend before and after a loop run. Enforces early exit when over budget or when there is no actionable work."
}
Loop Budget Guard
Run at the start and end of every loop iteration.
Start of run
- Read
loop-budget.mdfor daily caps and kill-switch flags. - Read recent entries in
loop-run-log.md(last 24h). - Sum
tokens_estimatefor the active pattern today. - If spend ≥ 80% of the pattern's daily cap → report-only mode (no sub-agents, no auto-fix).
- If spend ≥ 90% and High Priority items remain in
STATE.md, yield to the budget-negotiator skill (if installed). Otherwise, if spend ≥ 100% orloop-pause-allis set → exit immediately with a one-line note in STATE.md. - If watchlist/state has no actionable items → exit in <5k tokens (do not spawn sub-agents).
End of run
Append one JSON object to loop-run-log.md:
{
"run_id": "<ISO8601>",
"pattern": "<pattern-id>",
"duration_s": <number>,
"items_found": <number>,
"actions_taken": <number>,
"escalations": <number>,
"tokens_estimate": <number>,
"outcome": "no-op | report-only | fix-proposed | escalated"
}
Rules
- Never exceed
max sub-agent spawns/runfromloop-budget.md. - High-cadence patterns (CI Sweeper, PR Babysitter) must early-exit when nothing is actionable.
- On self-throttle, append a line to
loop-budget.mdunder Alerts This Period.
Version History
-
07996dc
Current 2026-07-31 00:09
新增与 budget-negotiator 技能的集成,支持 L3 自主预算协商;修复并强化与 loop-budget 的安全护栏交互逻辑。
- e55bb6d 2026-07-05 11:05


