AGENT SKILL

cost-optimization

Use when the user wants to reduce token, compute, or infrastructure costs. Covers context window budget, MCP selection, caching, model routing, and query optimization.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 0
Forks
1

01 前言 Front Matter

name
cost-optimization
triggers
[ "user", "model" ]
description
Use when the user wants to reduce token, compute, or infrastructure costs. Covers context window budget, MCP selection, caching, model routing, and query optimization.

03 SKILL.md 正文

Cost Optimization

Reduce token, compute, and infrastructure spend.

When to use

  • Token bills are high.
  • Need to choose a cheaper model for a subtask.
  • MCP servers are bloating context.
  • Caching or routing can save cost.

Core protocol

  1. Measure current cost. Tokens per request, model tier, cache hit rate.
  2. Audit context usage. Use mcp-context-audit to find heavy MCP tool definitions.
  3. Right-size effort. Use swe-2-max/swe-2-flash-high/swe-2-flash-medium for subagents and swe-2-high for the free primary model; use paid models only when explicitly approved. After the SWE-2 free window closes (2026-11-30), swe-2-flash-medium is the only permanent-free variant.
  4. Add caching. Reuse previous tool outputs and summaries where safe.
  5. Shorten prompts. Remove unused context, prefer file snippets over full reads.
  6. Re-measure. Compare cost before and after.

Context and loop cost controls

  • Subagents first. Delegate heavy exploration to swe-2-max subagents; keep the main context lean.
  • Token limit. Use tokens-limit or equivalent budget guard when available; stop if the threshold is exceeded.
  • Clear vs compact. Default to clear between unrelated tasks; compact only when continuity is required. Compaction is lossy.
  • Parallelism. Limit concurrent subagents to 1-3. If a task suggests more than 3, alert the user and ask for approval.
  • Loops cost money. Every loop iteration increases token count. Cap retries, bounded loops, and unnecessary polling.

See also

  • mcp-context-audit - MCP server context-window cost.
  • context-window-hygiene - context-window management and clear/compact decisions.
  • cost-optimization - general token, compute, and infrastructure spend.

Output rule

  • Report tokens/cost before and after, and the commands used to measure.

04 同仓库更多 Skills

Leostruka
Leostruka/devin-bundle

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/optimization, and high-impact contact surfaces.

★ 0
Leostruka
Leostruka/devin-bundle

git-github-adaptive-engineering

Use when any task touches git history, GitHub issues/PRs/releases/CI, 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/PR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug/finish skills.

★ 0
Leostruka
Leostruka/devin-bundle

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/gcal/wrapper.py.

★ 0
Leostruka
Leostruka/devin-bundle

demo

Use when demonstrating a skill in a fixture project.

★ 0
Leostruka
Leostruka/devin-bundle

duplicate-skill

Use when testing duplicate skill name detection.

★ 0
Leostruka
Leostruka/devin-bundle

duplicate-skill

Use when testing duplicate skill name detection.

★ 0