data-cost-optimization
Use when the user asks to cut Snowflake credits, BigQuery slot or on-demand costs, Databricks DBUs, S3 storage tiering or query cost for data workloads…
от j4flmao★ 47 звёзд на GitHub
Установить data-cost-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Data Cost Optimization
Purpose
Analyze, optimize, and manage cloud data platform costs across Snowflake, BigQuery, and S3, implementing FinOps practices for cost allocation, budgeting, and continuous optimization.
Agent Protocol
Trigger
Exact user phrases: "cost optimization", "cost reduction", "Snowflake cost", "BigQuery cost", "S3 cost", "warehouse cost", "FinOps data", "query cost analysis", "storage tiering", "slot management", "credit usage", "data platform cost", "cloud data cost".
Input Context
Before activating, verify:
- Cloud data platform (Snowflake, BigQuery, Redshift, Databricks)
- Storage systems (S3, GCS, Azure Blob)
- Current monthly spend and growth trend
- Query patterns (ad-hoc, scheduled, BI)
- Data retention requirements (compliance, archival)
- Team structure for cost allocation
Output Artifact
Cost optimization plan with warehouse configuration, query tuning, storage lifecycle policies, and FinOps dashboards.
Response Format
-- Snowflake cost analysis queries
-- Warehouse configuration
# BigQuery reservation config
# S3 lifecycle policies
# Cost allocation script
# Budget monitoring
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Current spend analyzed by warehouse, query, user, and dataset
- Warehouse auto-scaling and multi-cluster configuration optimized
- Query performance tuned to reduce compute consumption
- Storage lifecycle policies implemented for tiered archival
- Cost allocation tags applied and budgets configured
- Monitoring dashboards with cost-per-team breakdown
- Optimization recommendations documented with expected savings
Max Response Length
300 lines of code and configuration.
Snowflake Cost Management
Warehouse Configuration
-- Optimal warehouse config for production workloads
CREATE WAREHOUSE prod_wh
WAREHOUSE_SIZE = 'MEDIUM'
AUTO_SUSPEND = 60 -- suspend after 1 minute idle
AUTO_RESUME = TRUE
MIN_CLUSTER_COUNT = 1
MAX_CLUSTER_COUNT = 3
SCALING_POLICY = 'ECONOMY' -- prioritize cost over performance
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 30
STATEMENT_TIMEOUT_IN_SECONDS = 3600;
-- For ad-hoc/exploratory workloads
CREATE WAREHOUSE analytics_wh
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 300
AUTO_RESUME = TRUE
MIN_CLUSTER_COUNT = 1
MAX_CLUSTER_COUNT = 1;
Credit Usage Analysis
-- Credit consumption by warehouse (last 30 days)
SELECT
warehouse_name,
SUM(credits_used) as total_credits,
SUM(credits_used_compute) as compute_credits,
SUM(credits_used_cloud_services) as cloud_credits,
ROUND(SUM(credits_used) * 2.0, 2) as estimated_cost_usd
FROM snowflake.account_usage.warehouse_metering_history
WHERE start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
GROUP BY warehouse_name
ORDER BY total_credits DESC;
-- Most expensive queries
SELECT
query_id,
query_text,
warehouse_name,
warehouse_size,
credits_used_cloud_services,
execution_time / 1000 as execution_seconds,
partitions_scanned,
bytes_scanned
FROM snowflake.account_usage.query_history
WHERE start_time >= DATEADD('day', -7, CURRENT_TIMESTAMP())
ORDER BY credits_used_cloud_services DESC
LIMIT 20;
Query Optimization for Cost
-- Before: Full scan (expensive)
SELECT * FROM orders WHERE YEAR(order_date) = 2026;
-- After: Partition prune
SELECT * FROM orders WHERE order_date >= '2026-01-01' AND order_date < '2027-01-01';
-- Before: Wide scan
SELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id;
-- After: Clustering on high-cardinality join key
ALTER TABLE orders CLUSTER BY (customer_id);
-- Materialized views for expensive aggregations
CREATE MATERIALIZED VIEW mv_daily_orders
AS SELECT order_date, COUNT(*), SUM(amount)
FROM orders GROUP BY order_date;
BigQuery Slot Management
Reservation Configuration
# reservation.yaml
reservations:
- name: prod-reservation
project: my-data-prod
location: US
slot_count: 100
plan: FLEX # FLEX, MONTHLY, ANNUAL
autoscale:
min_slots: 50
max_slots: 200
- name: analytics-reservation
project: my-data-analytics
location: US
slot_count: 50
plan: MONTHLY
assignments:
- reservation: prod-reservation
job_type: QUERY
project: my-data-prod
- reservation: analytics-reservation
job_type: QUERY
project: my-data-analytics
Slot Usage Monitoring
-- Slot utilization by project
SELECT
project_id,
job_type,
COUNT(*) as job_count,
SUM(total_slot_ms) / 3600000 as total_slot_hours,
ROUND(AVG(total_slot_ms) / 1000, 2) as avg_slot_seconds
FROM `region-US`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
GROUP BY project_id, job_type
ORDER BY total_slot_hours DESC;
-- Unreserve
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/data-cost-budgeting.md
- references/data-cost-optimization-framework.md
- references/data-finops.md
- references/query-cost-optimization.md
- references/storage-tiering-strategies.md
- references/warehouse-cost-optimization.md
FAQ
Что делает скилл data-cost-optimization?
Use when the user asks to cut Snowflake credits, BigQuery slot or on-demand costs, Databricks DBUs, S3 storage tiering or query cost for data workloads. Produces a cost analysis with warehouse sizing, reservations, lifecycle rules and query fixes. Not for overall cloud FinOps (use devops-finops).
Как установить скилл data-cost-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-cost-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…