[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ADA9WGZRYHZ52VSYMP49HW":3,"skill-same:01M7ADA9WGZRYHZ52VSYMP49HW":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7ADA9WGZRYHZ52VSYMP49HW","agent-cost-guard",null,"Use when monitoring token cost per loop, detecting token maxing, or limiting parallel subagents to control cost and context pressure.","Leostruka\u002Fdevin-bundle","Leostruka","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F81370685?v=4","01M7AD8MAK63VDNAWRDRRRW04N","leandro ostruka","01M7AD8MBS65YDS1KMMV7YPM07",0,"MIT","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fagent-cost-guard\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agent-cost-guard\ndescription: Use when monitoring token cost per loop, detecting token maxing, or limiting parallel subagents to control cost and context pressure.\ntriggers: [user, model]\n---\n\n# Agent Cost Guard\n\nMonitors token cost and agent parallelism to prevent runaway spending. Enforces the 1-3 subagent limit and alerts when a loop or task is consuming excessive tokens.\n\n## When to use\n\n- When a task involves loops, retries, or polling.\n- When multiple subagents are being dispatched.\n- When the conversation is long and context is tight.\n- When the user asks about cost or token usage.\n\n## Limits\n\n| Limit | Action |\n|-------|--------|\n| 1-3 subagents | Default maximum. Alert if more are requested. |\n| >3 subagents | Require explicit user approval. |\n| Token maxing | Detect when effort is disproportionate to task difficulty. |\n| Loop cost | Bound retries and polling; each iteration multiplies cost. |\n\n## What to check\n\n1. **Subagent count.** Are more than 3 subagents being dispatched at once? The PreToolUse hook `scripts\u002Fvalidate-tool-args.py` enforces `run_subagent` `max_parallel \u003C= 3` and requires `max_parallel` to be an integer.\n2. **Loop bounds.** Are retries, polling, or verification loops bounded?\n3. **Token cost.** Is the effort level appropriate for the task difficulty?\n4. **Context pressure.** Is the active context approaching the threshold?\n\n## Process\n\n```\nBefore dispatching subagents or starting a loop\n  → Check subagent count (limit: 3)\n  → Check loop bounds (max retries, max polls)\n  → Check effort level (match to task difficulty)\n  → If any limit exceeded: alert user or split into batches\n```\n\n## Example\n\n```python\n# Bad: unbounded retry loop\nwhile not success:\n    retry()  # costs tokens each iteration\n\n# Good: bounded retry with max attempts\nfor attempt in range(3):\n    if success:\n        break\n    retry()\n```\n\n## Anti-patterns\n\n- Dispatching >3 subagents without approval.\n- Unbounded retry or polling loops.\n- Using maximum effort for trivial tasks.\n- Ignoring token cost when the parent model is paid.\n\n## Dispatch budgets (opt-in)\n\n`validate-tool-args.py` enforces optional caps when\n`\u003Cdevin-home>\u002Fstate\u002Fsubagent-budget.json` exists (absent = uncapped):\n\n| Knob | Effect |\n|---|---|\n| `max_dispatches` | Block dispatch when session's recorded dispatches reach cap. |\n| `session_max_minutes` | Block new dispatches when minutes since session's first dispatch exceed cap. |\n| `max_cost_usd` + `spent_usd` | Block when `spent_usd >= max_cost_usd`. `spent_usd` must be updated by an external recorder — the hook cannot observe token spend. |\n\nEvery dispatch appends to `state\u002Fsubagent-ledger.jsonl` (ts, session_id,\nprofile, title) once a policy exists. Override the state dir with\n`DEVIN_STATE_DIR` (used by tests).\n\nHonest limits: no per-agent wall-clock kill (hooks see no subagent\nlifecycle events), no real-time cost (no token telemetry) — enforcement\nis at dispatch time only.\n\n## Cross-skills\n\n- `effort-calibration` - chooses the right effort level for the task.\n- `cost-optimization` - broader cost guidance (models, cache, MCPs).\n- `context-window-hygiene` - context pressure and clear\u002Fcompact decisions.\n- `dispatching-parallel-agents` - parallel work, but bounded by this guard.\n","# Agent Cost Guard\n\nMonitors token cost and agent parallelism to prevent runaway spending. Enforces the 1-3 subagent limit and alerts when a loop or task is consuming excessive tokens.\n\n## When to use\n\n- When a task involves loops, retries, or polling.\n- When multiple subagents are being dispatched.\n- When the conversation is long and context is tight.\n- When the user asks about cost or token usage.\n\n## Limits\n\n| Limit | Action |\n|-------|--------|\n| 1-3 subagents | Default maximum. Alert if more are requested. |\n| >3 subagents | Require explicit user approval. |\n| Token maxing | Detect when effort is disproportionate to task difficulty. |\n| Loop cost | Bound retries and polling; each iteration multiplies cost. |\n\n## What to check\n\n1. **Subagent count.** Are more than 3 subagents being dispatched at once? The PreToolUse hook `scripts\u002Fvalidate-tool-args.py` enforces `run_subagent` `max_parallel \u003C= 3` and requires `max_parallel` to be an integer.\n2. **Loop bounds.** Are retries, polling, or verification loops bounded?\n3. **Token cost.** Is the effort level appropriate for the task difficulty?\n4. **Context pressure.** Is the active context approaching the threshold?\n\n## Process\n\n```\nBefore dispatching subagents or starting a loop\n  → Check subagent count (limit: 3)\n  → Check loop bounds (max retries, max polls)\n  → Check effort level (match to task difficulty)\n  → If any limit exceeded: alert user or split into batches\n```\n\n## Example\n\n```python\n# Bad: unbounded retry loop\nwhile not success:\n    retry()  # costs tokens each iteration\n\n# Good: bounded retry with max attempts\nfor attempt in range(3):\n    if success:\n        break\n    retry()\n```\n\n## Anti-patterns\n\n- Dispatching >3 subagents without approval.\n- Unbounded retry or polling loops.\n- Using maximum effort for trivial tasks.\n- Ignoring token cost when the parent model is paid.\n\n## Dispatch budgets (opt-in)\n\n`validate-tool-args.py` enforces optional caps when\n`\u003Cdevin-home>\u002Fstate\u002Fsubagent-budget.json` exists (absent = uncapped):\n\n| Knob | Effect |\n|---|---|\n| `max_dispatches` | Block dispatch when session's recorded dispatches reach cap. |\n| `session_max_minutes` | Block new dispatches when minutes since session's first dispatch exceed cap. |\n| `max_cost_usd` + `spent_usd` | Block when `spent_usd >= max_cost_usd`. `spent_usd` must be updated by an external recorder — the hook cannot observe token spend. |\n\nEvery dispatch appends to `state\u002Fsubagent-ledger.jsonl` (ts, session_id,\nprofile, title) once a policy exists. Override the state dir with\n`DEVIN_STATE_DIR` (used by tests).\n\nHonest limits: no per-agent wall-clock kill (hooks see no subagent\nlifecycle events), no real-time cost (no token telemetry) — enforcement\nis at dispatch time only.\n\n## Cross-skills\n\n- `effort-calibration` - chooses the right effort level for the task.\n- `cost-optimization` - broader cost guidance (models, cache, MCPs).\n- `context-window-hygiene` - context pressure and clear\u002Fcompact decisions.\n- `dispatching-parallel-agents` - parallel work, but bounded by this guard.\n",{"name":5,"triggers":24,"description":7},[25,26],"user","model","main","02b95ddb62959a00b3c31442c2046aca0d19563c","skills\u002Fagent-cost-guard",1,"https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle","https:\u002F\u002Fleostruka.github.io\u002Fdevin-bundle\u002F","https:\u002F\u002Fgithub.com\u002FLeostruka","2026-11-15 05:19:58",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Leostruka\u002Fdevin-bundle --skill agent-cost-guard",{"tool":41,"command":42},"bunx","bunx skills add Leostruka\u002Fdevin-bundle --skill agent-cost-guard",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Leostruka\u002Fdevin-bundle --skill agent-cost-guard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fagent-cost-guard\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E0K3MG2XC4FSRV0MK6SFR1","montador-de-ideias","Use when assembling, expanding, or elevating a raw project idea or initial prompt into an ultra-detailed, first-principles dossier and compiled master prompt with journalistic OSINT market research, Tech Lead and Staff Architect justifications, atomic and modular hardening\u002Foptimization, and high-impact contact surfaces.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fmontador-de-ideias\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E0J7JJWZ8QMK01RZ3B3C9Z","git-github-adaptive-engineering","Use when any task touches git history, GitHub issues\u002FPRs\u002Freleases\u002FCI, repo governance, or branch and merge decisions. Runs the Fase Zero situational-awareness battery, picks one of five delivery flows via the adaptive decision engine, and enforces commit\u002FPR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug\u002Ffinish skills.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fgit-github-adaptive-engineering\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7E0GJFRPFEVQQMXEM58EWDM","adaptive-agenda-calendar-routine-engine","Use when planning or executing work across hours, days, weeks, or sprints. Turns the calendar into a strict time-blocked agenda (HH:MM-HH:MM blocks carrying a routine profile, expected inputs, and a handoff output artifact), runs the 5-stage cognitive flow (Radar and Hunt -> Triage plus Steve Jobs conception -> workbench manifest -> >=32-cycle loop -> Close plus Open-Minded Scrum), and unfolds macro calendar milestones into micro agenda blocks through extensions\u002Fgcal\u002Fwrapper.py.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fadaptive-agenda-calendar-routine-engine\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7AE2K9FTY0BVS48N0A9JFKF","demo","Use when demonstrating a skill in a fixture project.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7AE2G3DP38PTV3B1N7MW5TS","duplicate-skill","Use when testing duplicate skill name detection.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":86,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AE2DBR8ZHT6T875MJ392GK","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Falpha\u002FSKILL.md",[],[]]