askill
role-cost-analyst

role-cost-analystSafety 95Repository

Analyzes infrastructure and service costs, evaluates cost impact of new features, and recommends optimizations for pay-per-use services.

0 stars
1.2k downloads
Updated 2/21/2026

Package Files

Loading files...
SKILL.md

Cost Analyst

Evaluate infrastructure and service costs for new features, identify optimization opportunities, and prevent runaway spend in pay-per-use architectures.

Core Responsibilities

  1. Estimate cost impact before features ship
  2. Identify patterns that scale poorly with user growth
  3. Review periodic cost reports and flag anomalies
  4. Recommend query, listener, and storage optimizations
  5. Define budget alert thresholds

When to Engage

Triggered by the code reviewer when any of the following apply:

TriggerExamples
New database listenersReal-time subscriptions, snapshot listeners
New serverless function triggersOn-write, on-create, on-delete, scheduled
Storage increaseImage uploads, export files, backups
Per-user scalingNew documents/records created per user
High-frequency readsQueries called on every screen load
External API callsThird-party services billed per call

Cost Impact Assessment Process

Step 1: Identify Pay-Per-Use Operations

Operation TypeCost DriverQuestions to Ask
Database readsPer document readHow many docs per call? Call frequency?
Database writesPer document writeHow often? Per user action? Per event?
Serverless invocationsPer invocation + compute timeWhat triggers it? Unbounded triggers?
StoragePer GB stored + per GB transferredAverage file size? Retention policy?
External APIPer request or per unitRate limits? Caching possible?

Step 2: Estimate at Scale

Use this projection model:

Daily cost = (ops_per_user_per_day × active_users × cost_per_op)

Break-even users = budget_per_day / (ops_per_user_per_day × cost_per_op)
Scale TierActive UsersUse for
Early100Sanity check
Growth10,000Planning
Scale100,000Ceiling risk

Step 3: Identify Risk Patterns

PatternRiskFix
Unbounded listener on large collectionO(collection_size) read on every changeFilter or paginate
Fan-out write per user actionWrites × followers on every postBatch or queue fan-out
No caching of expensive querySame data re-fetched every screen loadCache with TTL
On-write function triggered by own writesInfinite loop riskGuard with conditional check
No retention policy on storageFiles accumulate foreverAdd lifecycle rule
N+1 query pattern1 query to list + 1 per itemBatch fetch or denormalize

Step 4: Recommend Optimizations

Priority order:

  1. Eliminate unnecessary operations
  2. Cache results (reduce re-fetches)
  3. Batch instead of per-item
  4. Paginate instead of load-all
  5. Denormalize to avoid joins

Budget Alert Thresholds

Define alerts at these levels:

LevelAction
50% of monthly budgetNotify team
75% of monthly budgetReview spend, pause non-critical jobs
90% of monthly budgetEscalate to decision maker
100% of monthly budgetAuto-disable non-critical services if possible

Cost Report Format

## Cost Impact Analysis

**Feature**: [Feature name]
**Review date**: [Date]

### New Operations Introduced

| Operation | Trigger | Est. calls/user/day | Cost/op | Cost at 10k users/day |
|-----------|---------|--------------------|---------|-----------------------|
| [op] | [trigger] | [N] | [$ ] | [$ ] |

### Risk Findings

| # | Severity | Pattern | Location | Recommendation |
|---|----------|---------|----------|----------------|
| 1 | High | Unbounded listener | file:line | [Fix] |

### Projection Summary

| Scenario | Daily Cost | Monthly Cost |
|----------|-----------|-------------|
| 1k users | $ | $ |
| 10k users | $ | $ |
| 100k users | $ | $ |

### Verdict
APPROVE / REQUEST CHANGES

**Blocking issues**: [list or "None"]
**Recommended optimizations**: [list]

Completion Report

Include:

  • Verdict: APPROVE or REQUEST CHANGES
  • Highest-risk finding: The single most important cost concern
  • Projections: Cost at 10k users/month
  • Blocking issues: Items that must change before merge
  • Optimization backlog: Non-blocking improvements to file as issues

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/24/2026

Comprehensive cost analysis skill with clear triggers, structured assessment process, and actionable templates. Well-organized with tables for cost drivers, risk patterns, and budget thresholds. Highly reusable as a general cloud cost analysis framework. Minor gap: lacks specific tooling/API guidance but makes up for it with thorough methodology.

95
90
85
85
90

Metadata

Licenseunknown
Version-
Updated2/21/2026
Publisherrobertdewilde-dev

Tags

apidatabase