Community编程与开发github.com

BuilderIO/stay-within-limits

在长时间运行或并行代理任务中,通过检查使用情况、在接近上限时暂停,以及仅在窗口空闲时恢复,来遵守5小时和每周使用限制。

stay-within-limits 是什么?

此技能(Stay Within Limits)专为长时间运行的代理任务设计,确保其遵守5小时和每周的使用限额。它通过在执行大量工作前以及并行子代理各轮次之间检查当前使用情况,主动管理预算。如果5小时或每周使用量达到或超过95%,技能会自动暂停新任务,直到窗口变得足够安全为止。它支持第一方使用检查工具(如Claude Code中的 `ccusage`),并基于活动块开始时间戳等信号做出决策。此技能与需要附加上下文的唤醒/恢复工具、固定定时器的后台休眠以及周期性计划兼容。它默认最多允许3个并行子代理,并鼓励在启动恢复后重新验证实际窗口,而不是仅依赖经过的挂钟时间。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/BuilderIO/skills/tree/main/skills/stay-within-limits

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

保持限制范围内

将长时间运行的代理工作保持在当前5小时和每周使用窗口内。在启动重大工作之前以及并行子代理各轮次之间检查使用情况。如果当前5小时或每周限制达到或超过95%,暂停新工作,直到窗口足够空闲,可以安全继续。

核心循环

  1. 运行一个有限范围的代理工作轮次。默认为最多3个并行子代理,除非用户或主机指定不同的节流值。
  2. 等待该轮次完成。不要为了节省预算而中断进行中的子代理;这通常会导致工作丢失。
  3. 使用主机的使用/预算工具检查当前5小时和每周使用情况。
  4. 如果任一窗口达到或超过95%,停止启动新工作,并安排一个自包含的恢复点,当相关窗口应空闲时进行恢复。
  5. 恢复时,在继续之前重新检查实际窗口或阻塞条件。不要仅依赖经过的挂钟时间。

使用信号

优先使用第一方主机使用工具(如果可用)。在Claude Code中,使用:

npx -y ccusage@latest blocks --active --json

使用JSON输出识别活动块的开始时间、当前成本或百分比以及剩余时间。唤醒时,将活动块的开始时间戳与上一次进行比较;新的时间戳比“已过去足够时间”更有说服力。

如果工具报告的是成本而不是直接百分比,请在已知当前账户限制的情况下进行转换。对于Claude Max风格的5小时块,一些用户更喜欢较早的警告阈值(约$500-550);将其视为用户配置的防护栏,而非通用规则。默认停止规则仍然是95%的当前5小时或每周限制。

暂停和恢复

当唤醒/恢复工具可用时,安排唤醒时间为:

min(3600, secondsUntilWindowClears)

如果运行时将唤醒延迟限制在60-3600秒之间,则为更长的等待链式安排多个唤醒。每次唤醒应重新检查使用情况,如果仍然超出预算则重新安排,只有当窗口安全低于阈值时才继续。

使唤醒提示自包含。包括:

  • 剩余的计划。
  • 检查然后重新安排的规则。
  • 95%阈值和轮次节流值。
  • 确切的使用命令或主机使用工具。
  • 先前的块/窗口标识符(如果可用)。
  • 下一步验证步骤。
  • 如果委托将恢复,提供下一轮次的手续包,包括范围、验证命令和停止条件。

选择等待机制

  • 当代理需要将指令附加到未来恢复时,使用唤醒/恢复工具。
  • 对于固定定时器以及进程可以直接观察的内容,使用后台休眠或观察者。
  • 仅对重复的新会话工作使用cron或定期计划。

避免短间隔轮询那些主机会通知您事情,例如后台任务或子代理完成。对于预算暂停,长时间休眠后提示缓存未命中是可以接受的;保护限制更为重要。

报告

如果暂停,请告知用户哪个窗口超过阈值、观察到的使用情况、您计划或预期下次检查的时间以及剩余的工作。在唤醒提示中保留足够的状态,以便下一次可以恢复而不依赖对话惯性。

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

BuilderIO/adding-a-skill

Use in the BuilderIO/skills repo whenever adding, updating, publishing, documenting, validating, or wiring a public skill. Covers the repo-local skill files, root catalog docs, plugin metadata, @agent-native/skills dynamic install path, optional managed AGENTS/CLAUDE instruction blocks in ../agent-native/framework, and generated/synced Plan skill gotchas.

BuilderIO/agent-watchdog

Use when asked to watch, babysit, audit, review, compare, or fix another agent's work from a Codex session ID, Claude Code session/transcript, chat/thread link, PR, branch, log, or pasted run summary. Monitor until the other agent is done or blocked, reconstruct what the user asked, inspect what the agent actually changed and verified, report gaps, and optionally make scoped fixes when the user authorizes repair.

BuilderIO/efficient-fable

Use when running Claude Fable on codebase-heavy or token-heavy work and the user wants Fable to orchestrate research, coding, and testing while cheaper subagents do bounded heavy lifting.

BuilderIO/efficient-frontier

Apply the same orchestration as `/efficient-fable` to any high-cost frontier model: delegate research, coding, and testing to cheaper subagents while keeping planning, synthesis, and final review with the expensive model.

BuilderIO/plan-arbiter

Use when asked to compare, cross-review, merge, judge, choose, or arbitrate competing plans from multiple agents such as Codex and Claude Code; when given two or more proposed plans, session IDs, transcripts, plan documents, PR descriptions, or pasted strategies; or when the user wants one recommended execution plan after agents review each other's proposals.

BuilderIO/plow-ahead

Use when the user explicitly wants autonomous progress without routine clarification stops: "plow ahead", "do not stop", "use your best judgment", "keep going until done", "finish while I am away", "do not ask questions unless truly blocked", or similar. Convert ordinary ambiguity into stated assumptions, proceed through implementation and validation, stop only for true blockers, and end with a clear recap of decisions, changes, verification, and residual risk.

BuilderIO/quick-recap

Use when adding or following the red/yellow/green final status block convention for agent responses, especially by installing managed AGENTS.md or CLAUDE.md instructions.

BuilderIO/read-the-damn-docs

Use when implementing, integrating, upgrading, debugging, or answering anything involving third-party APIs, libraries, frameworks, CLIs, cloud services, model/provider SDKs, fast-moving product behavior, user requests for latest/current/official behavior, unfamiliar repo docs/specs, errors that may indicate API drift, or high-stakes auth, security, billing, data, migration, deployment, compliance, or privacy behavior. Forces Codex to web-search for current official docs and read primary docs before assuming from memory.

BuilderIO/visual-plan

Turn ordinary text plans into rich interactive visual plans with diagrams, file maps, annotated code, open questions, and UI/prototype review when useful.

BuilderIO/visual-recap

Turn a PR, branch, commit, or git diff into an interactive visual recap with diagrams, file maps, API/schema summaries, annotated diffs, and focused review notes.

相关技能