
Ai Token Improvement Plan Engineer
- 28 installs
- 7 repo stars
- Updated May 20, 2026
- daemon-blockint-tech/agentic-enteprises-skill
Build an LLM token and cost improvement plan: baseline spend audit, optimization backlog, eval gates, and phased rollout with owners.
About
Guides creation of AI token and cost improvement plans including baseline audits, spend attribution, optimization backlogs, and phased rollout with eval guardrails. A developer uses it when building an LLM cost-reduction roadmap without regressing quality.
- Baseline audit of top cost drivers covering 70% of spend
- Spend buckets for input bloat and output bloat with eval gates
Ai Token Improvement Plan Engineer by the numbers
- 28 all-time installs (skills.sh)
- Ranked #9,462 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/daemon-blockint-tech/agentic-enteprises-skill --skill ai-token-improvement-plan-engineerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 28 |
|---|---|
| repo stars | ★ 7 |
| Last updated | May 20, 2026 |
| Repository | daemon-blockint-tech/agentic-enteprises-skill ↗ |
What it does
Build an LLM token and cost improvement plan: baseline spend audit, optimization backlog, eval gates, and phased rollout with owners.
Files
AI Token Improvement Plan Engineer
When to Use
- Audit where tokens are spent (by feature, model, tenant, turn type)
- Prioritize cost-saving initiatives with estimated savings and risk
- Draft a phased improvement plan with metrics and rollback criteria
- Define eval gates so cost cuts do not regress quality or safety
- Brief leadership on trade-offs (model tier, context size, agent depth)
When NOT to Use
- Implement context packing or compression code →
ai-context-engineer - Rewrite one prompt or agent tool schema →
prompt-engineer - Build RAG ingest, chunking, or agent runtime →
ai-engineer - Weekly cost review ritual and release governance →
ai-lead-ops - Memory store architecture →
ai-memory-developer - Adversarial safety testing →
ai-redteam - AI policy and regulatory mapping →
ai-risk-governance
Related skills
| Need | Skill |
|---|---|
| Context budget and truncation | ai-context-engineer |
| Prompt patterns and eval of wording | prompt-engineer |
| RAG and agent implementation | ai-engineer |
| Production ops and cost reviews | ai-lead-ops |
| Memory write/read policy | ai-memory-developer |
| Safety regression testing | ai-redteam |
| AI solution architecture (commercial/enterprise) | applied-ai-architect-commercial-enterprise |
| Token efficiency experiments and benchmarks | research-engineer-scientist-tokens |
Core Workflows
1. Scope and baseline
Define:
- Surface area — chat, copilot, batch, agents, embeddings-only
- Time window — 7/30 days; exclude anomalies (launches, incidents)
- Segmentation — model, feature flag, tenant tier, environment
Collect baseline metrics (see references/token_audit.md).
Deliverable: current state table with top 5 cost drivers (≥70% of spend if possible).
2. Categorize spend
Bucket each driver:
| Category | Examples |
|---|---|
| Input bloat | Long system prompts, duplicated docs, full chat history |
| Output bloat | Verbose defaults, no max_tokens, unconstrained agents |
| Model choice | Opus-class for simple classification |
| Retrieval | Over-fetching chunks, huge tool results in context |
| Agent loops | Extra tool rounds, retry storms |
| Infrastructure | Re-embedding unchanged corpora, log payloads in prompts |
Tag fixed per request vs scales with users/sessions.
3. Initiative backlog
For each idea record:
- Description and owner team
- Estimated savings (% tokens or $/month) with assumptions
- Effort (S/M/L) and dependencies
- Quality risk (low/med/high) and required evals
- Measurement — metric that proves success
Prioritize with impact × confidence ÷ effort; never ship without eval plan.
See `references/improvement_backlog.md` and `references/optimization_playbook.md`.
4. Quality and safety guardrails
Every initiative must list:
- Golden-set evals (task accuracy, format)
- Safety set (if user-facing)
- Latency check (p95)
- Rollback trigger (e.g., CSAT drop, eval regression >X%)
See `references/measurement_and_kpis.md`.
5. Phased plan
Typical phases:
| Phase | Focus | Duration |
|---|---|---|
| 0 — Measure | Instrumentation, dashboards, attribution | 1–2 weeks |
| 1 — Quick wins | max_tokens, model routing, prompt trim, cache | 2–4 weeks |
| 2 — Structure | RAG top-k, history compression, tool output limits | 4–8 weeks |
| 3 — Architecture | Agent budget caps, routing policies, batch/offline | 8+ weeks |
Each phase: goals, initiatives, owners, exit criteria.
See `references/rollout_plan.md`.
6. Executive summary
## Situation — spend and growth rate
## Target — $ or tokens/session goal by date
## Top drivers — ranked list
## Plan — 3–5 initiatives per phase
## Risks — quality, latency, eng capacity
## Asks — budget, headcount, eval timeHand ongoing ops to ai-lead-ops after plan approval.
When to load references
- Baseline and attribution →
references/token_audit.md - Backlog template and scoring →
references/improvement_backlog.md - Technique catalog →
references/optimization_playbook.md - KPIs and eval gates →
references/measurement_and_kpis.md - Phasing and rollback →
references/rollout_plan.md
Improvement backlog
Table of contents
1. Initiative card 2. Scoring 3. Dependencies 4. Anti-patterns
Initiative card
### [ID] Title
**Category:** prompt | context | model | RAG | agent | infra
**Owner:**
**Problem:** [which driver from audit]
**Change:** [one paragraph]
**Assumptions:** e.g. 40% of input is duplicate system text
**Est. savings:** X% tokens or $Y/mo (range low–high)
**Effort:** S | M | L
**Quality risk:** Low | Med | High
**Evals required:** [golden-ids], safety subset
**Metrics:** primary KPI + guardrail KPI
**Rollback:** [trigger and action]
**Status:** proposed | in progress | shipped | revertedScoring
Priority score (higher = do first):
score = (impact_1to5 * confidence_1to5) / effort_1to5| impact | guidance |
|---|---|
| 5 | >15% of total spend addressable |
| 3 | 5–15% |
| 1 | <5% |
| confidence | guidance |
|---|---|
| 5 | Measured on traces |
| 3 | Industry benchmark or partial sample |
| 1 | Hypothesis only — spike first |
Cap in-flight high-risk (quality med+) initiatives to avoid eval thrash.
Dependencies
Common chains:
- Instrumentation (phase 0) before attribution-based cuts
- Prompt version registry before A/B cost tests
- Eval harness before model downgrade
- Context compression after golden eval baseline frozen
Draw dependency graph for phase 2+ items.
Anti-patterns
- Cutting output max_tokens without format eval → broken JSON
- Removing safety instructions to save tokens →
ai-redteamregression - Optimizing staging only while prod prompts diverge
- Savings claimed without before/after measurement window
Measurement and KPIs
Table of contents
1. Primary KPIs 2. Guardrail KPIs 3. Eval gates 4. Reporting cadence
Primary KPIs
| KPI | Definition | Target example |
|---|---|---|
| Cost per session | $/successful session | −20% in 90d |
| Tokens per session | in+out mean/median | −25% in 90d |
| Cost per successful task | $/task completion | −15% |
| Cache hit rate | cached_in / total_in | >40% static prefix |
Segment all KPIs by feature and tier—global averages hide regressions.
Guardrail KPIs
Do not worsen beyond threshold:
| Guardrail | Typical threshold |
|---|---|
| Task success / golden eval | ≤2% absolute drop |
| Safety eval pass rate | 0 regressions on blockers |
| p95 latency | ≤+10% |
| User thumbs-down rate | ≤+5% relative |
| Escalation to human | ≤+10% relative |
Define thresholds with product owner before phase 1 ships.
Eval gates
Pre-merge (per initiative):
- [ ] Golden set run on old vs new (same model unless initiative is routing)
- [ ] Diff report for failures (categorize: acceptable vs blocker)
- [ ] Token/count comparison on same fixture set
Pre-prod:
- [ ] Canary 5–10% traffic or internal dogfood 48h+
- [ ] Cost dashboard shows expected delta
- [ ] No guardrail breach
Post-ship (7d):
- [ ] Sustained savings vs baseline window
- [ ] No support spike tagged to AI quality
Link safety runs to ai-redteam for tier-2+ surfaces.
Reporting cadence
| Audience | Cadence | Content |
|---|---|---|
| Eng squad | Weekly | Initiative status, eval blockers |
| AI lead / ops | Weekly | $ vs budget, top features |
| Leadership | Monthly | Plan progress, ROI, risks |
Use same baseline window for before/after comparisons (avoid holiday skew).
Optimization playbook
Table of contents
1. Quick wins 2. Prompt and context 3. Model and routing 4. RAG and tools 5. Agents 6. Trade-off summary
Implement via ai-context-engineer, prompt-engineer, ai-engineer—this file is for planning only.
Quick wins
| Technique | Typical savings | Risk |
|---|---|---|
Set max_tokens on outputs | High out reduction | Format truncation |
| Stop logging huge payloads into prompts | High in | Debuggability |
| Provider prompt caching (static prefix) | High in $ | Stale cache invalidation |
| Remove duplicate instructions across layers | Med in | Missed constraint |
Prompt and context
| Technique | Typical savings | Risk |
|---|---|---|
| Shorter system prompt (same rules) | Med in | Policy drift |
| Structured sections + drop redundant examples | Med in | Few-shot quality |
| Rolling summary vs full history | High in | Lost nuance |
| Retrieve fewer/smaller chunks | Med in | Recall drop |
| Tool result truncation + summarization | High in | Wrong tool conclusions |
Detail: ai-context-engineer references.
Model and routing
| Technique | Typical savings | Risk |
|---|---|---|
| Router: small model for classify/route | High $ | Mis-route |
| Cheaper model for drafts, premium for final | Med $ | Quality steps |
| Batch API for offline jobs | High $ | Latency N/A |
Always pair with eval matrix per route.
RAG and tools
| Technique | Typical savings | Risk |
|---|---|---|
| Smaller embedding model (if quality OK) | Infra $ | Retrieval quality |
| Chunk size tuning | Med in | Boundary errors |
| Metadata filter before vector search | Med in | Missed docs |
| Cache retrieval results per session | Med in | Stale answers |
Agents
| Technique | Typical savings | Risk |
|---|---|---|
| Max tool iterations cap | High | Incomplete tasks |
| Parallel vs serial tool calls | Latency + loops | Race conditions |
| Sub-agent only when needed | High | Architecture complexity |
| Pre-flight token budget abort | High | Hard stops mid-task |
Trade-off summary
Document per initiative:
- What we give up (quality dimension)
- Who accepts risk (product, safety, eng)
- How we detect regression (metric + threshold)
Never optimize tokens in isolation from latency and success rate.
Rollout plan
Table of contents
1. Phase template 2. Rollout patterns 3. Rollback 4. Communication
Phase template
## Phase N — [Name]
**Goal:**
**Exit criteria:**
**Initiatives:** [IDs from backlog]
**Owners:**
**Timeline:**
**Budget impact (est.):**
**Eval window:**
### Week-by-week
| Week | Deliverable |
|---|---|
| 1 | |Phase 0 (instrumentation) is mandatory unless attribution already exists.
Rollout patterns
| Pattern | Use when |
|---|---|
| Feature flag | Per-surface optimization |
| Tenant tier | Enterprise keeps quality, free tier tighter caps |
| Model route % | Gradual router traffic shift |
| Prompt version | Registry with instant rollback |
| Dark launch | Measure tokens without user-visible change |
Pair with deployment-strategist for customer-visible behavior changes.
Rollback
Per initiative define:
| Trigger | Action |
|---|---|
| Golden eval drop >X% | Revert prompt version / flag off |
| Safety failure | Immediate revert + incident |
| Cost flat but complaints up | Revert; re-analyze traces |
Keep previous prompt + model pins for 30 days minimum.
Communication
| Stakeholder | Message |
|---|---|
| Product | Quality guardrails and UX trade-offs |
| Support | What might look "shorter" or different |
| Finance | $ trajectory vs plan |
| Legal/risk | If retention or logging changes |
After plan delivery, transfer steady-state to ai-lead-ops cost review ritual.
Token audit
Table of contents
1. Data sources 2. Attribution dimensions 3. Baseline worksheet 4. Driver analysis
Data sources
| Source | What it gives |
|---|---|
| Provider billing API | $ by model, day |
| App telemetry | request_id, feature, tenant, model, in/out tokens |
| Prompt/version registry | Which template was live |
| Eval logs | Tokens per eval run (don't ignore CI cost) |
Reconcile billing $ to token counts monthly; flag missing instrumentation early.
Attribution dimensions
Minimum viable tags on every LLM call:
featureorproduct_surfacemodel_idenvironment(prod/staging)tenant_idor tier (if multi-tenant)prompt_version/agent_versioninput_tokens,output_tokens,cached_tokens(if provider supports)
Optional: turn_index, tool_name, retrieval_chunk_count.
Baseline worksheet
| Segment | Sessions/wk | Avg in tok | Avg out tok | $/session | % of total $ |
|---|---|---|---|---|---|
| Feature A | | | | | |Compute:
cost_per_session = (in * price_in + out * price_out + cached_discount) / sessionsNote growth rate week-over-week (usage vs token inflation).
Driver analysis
For top segment by spend, sample 20–50 traces:
1. Token breakdown: system vs tools vs RAG vs history vs user 2. Longest single block (often fixable) 3. Agent loop count and failed retries 4. Model tier vs task complexity mismatch
Document findings as evidence-backed drivers, not guesses.
If traces unavailable, run shadow logging for 48h before finalizing plan.