算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
capacity-and-cost-engineering【设计与创意】Model technical capacity, unit cost, and budget constraints connected to demand, performance, and reliability decisions. Use when projecting capacity from growth forecasts, sizing for peak events, designing cost-aware scaling policies, defining budget thresholds or quota/rate-limit enforcement, running or planning load/soak tests as capacity evidence…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Connect demand, performance, reliability, and spend into defensible capacity and cost decisions. This skill models technical capacity, calculates unit cost at the infrastructure level, defines budget and quota controls, requires load/soak evidence for capacity claims, and makes cost-performance tradeoffs explicit — producing evidence that feeds production-readiness launch decisions and constrains or supports site-reliability-engineering SLO choices.
Demand (traffic and growth), performance (latency and throughput), reliability (SLOs and error budgets), and spend (cost) are treated as connected dimensions — a change in any one dimension affects the others. The skill's core method is tracing the connection:
| Dimension | Capacity impact | Cost impact |
|---|---|---|
| Demand (traffic, growth rate) | Drives compute, storage, network requirements | Drives baseline and projected spend |
| Performance (latency, throughput target) | Constrains resource headroom per request | Tighter targets increase unit cost |
| Reliability (SLO, error budget) | Requires redundancy, over-provisioning, or isolation | Higher SLOs increase cost non-linearly |
| Spend (budget, cost constraint) | Caps capacity; may force degraded-mode operation | Limits what SLO/performance targets are achievable |
A capacity decision that changes one dimension without modeling the others is incomplete. Every capacity model, unit-cost calculation, and budget decision in this skill must name at least one connection to another dimension with evidence or an explicit assumption.
Load this skill when the task involves any of:
| Trigger | What to load |
|---|---|
| Project capacity from a growth forecast | SKILL.md + templates/capacity-model.md |
| Size capacity for a peak event (launch, Black Friday, seasonal) | SKILL.md + templates/capacity-model.md + templates/load-soak-test-plan.md |
| Calculate unit cost and connect to SLO or demand decisions | SKILL.md + templates/unit-economics-record.md |
| Define a budget threshold, spending alert, or hard cap | SKILL.md + templates/budget-quota-decision.md |
| Design quota or rate-limit enforcement in operational context | SKILL.md + templates/budget-quota-decision.md |
| Plan or review a load/soak test as capacity evidence | SKILL.md + templates/load-soak-test-plan.md |
| Resolve an SLO-cost tradeoff or cost-constrained reliability decision | SKILL.md + templates/slo-cost-tradeoff-record.md |
| Review a cost anomaly or attribute cost to services/teams | SKILL.md + templates/unit-economics-record.md |
| Model multi-tenant demand, skew, fairness, or tenant-variable unit cost | SKILL.md + references/multi-tenant-capacity-and-unit-cost.md + templates/tenant-capacity-model.md |
| Understand ownership boundaries with adjacent skills | SKILL.md + references/discovery-brief.md |
Start with the demand signal: current traffic, growth rate, and any known peak events. Translate demand into capacity requirements using a capacity model that connects:
A capacity model is incomplete without a stated utilization target, the evidence for that target (why 70% and not 85%?), and the scaling trigger that fires when utilization approaches the target.
Use the capacity model template (templates/capacity-model.md) which captures demand assumptions, capacity-unit mapping, utilization targets with rationale, scaling triggers, and a projection over the relevant horizon. The template requires fields for assumptions, evidence source, ownership, and tradeoffs.
Unit cost is the cost of serving one unit of demand — cost per request, cost per user per month, cost per GB stored, cost per provisioned capacity unit. Unit cost connects infrastructure spend to product and reliability decisions.
Calculate unit cost as:
unit cost = total cost of capacity / number of demand units served
Both numerator and denominator must be measured over the same period, with the same scope (service, team, or platform), and with the same allocation method stated (direct resource cost, attributed shared cost, or fully loaded cost including overhead).
The unit-economics record template (templates/unit-economics-record.md) requires: the unit definition, the cost numerator with allocation method, the demand denominator with measurement source, the resulting unit cost, a cost-per-SLO comparison (what happens to unit cost at 99.9% vs 99.99%?), and an assumptions/evidence/ownership/tradeoffs section. The template includes a structured field for the unit-cost calculation formula.
For a multi-tenant service, do not use a fleet average as the only unit. Load
references/multi-tenant-capacity-and-unit-cost.md and distinguish platform
baseline cost from tenant-variable cost, then report a distribution of tenant
costs or resource consumption. A tenant's variable unit cost may depend on
request mix, storage, background work, burst shape, placement, and tier
entitlements. Shared-cost allocation is an explicit modeling choice, not a
claim that every tenant consumes an equal share.
Budget controls are spending limits with operational consequences — spending alerts at thresholds, hard caps that prevent further spend, and the operational behavior when a cap is hit (degrade, throttle, or stop). Quota and rate-limit enforcement are the mechanisms that implement budget controls at the request or resource level.
Budget controls operate at three levels:
| Level | Mechanism | Operational consequence |
|---|---|---|
| Alert | Spending threshold notification | No automated action; triggers review |
| Soft cap | Throttling, degraded mode, reduced provisioning | Service continues at reduced capacity |
| Hard cap | Rate limiting, quota enforcement, resource denial | Requests above cap are rejected |
Budget controls must specify what happens at each threshold — the operational behavior, the user-facing impact, and the owner accountable for responding. A budget threshold without a defined operational consequence is incomplete.
The budget/quota decision template (templates/budget-quota-decision.md) captures: budget owner, period, thresholds (alert/soft/hard), quota or rate-limit configuration, enforcement mechanism, operational behavior at each threshold, cost attribution method, anomaly detection triggers, and approval record.
Load and soak test evidence is required for capacity decisions. A capacity model alone — without observed system behavior under representative load — is insufficient evidence for a capacity claim or a scaling policy.
The load/soak test plan template (templates/load-soak-test-plan.md) captures: test objective, target throughput with rationale, duration, environment (must be representative — a dev-environment test is not sufficient), success criteria (latency percentiles, error rate, resource utilization), data collection plan, and the evidence record. The template distinguishes a component-level benchmark from an end-to-end test; a capacity decision must state which boundary was exercised.
Modeling without test evidence, or testing without a model, is incomplete. Both are required.
For multi-tenant claims, the evidence must exercise representative tenant profiles together, including ordinary tenants, high-demand tenants, bursty tenants, and relevant tier or placement variants. A single-tenant benchmark or fleet-average test cannot establish protection against hot tenants, partition skew, or fairness behavior.
An SLO-cost tradeoff arises when the cost of meeting an SLO at projected demand exceeds the budget, or when a budget constraint forces a lower SLO than the team would otherwise target. This is a structured decision, not an implicit acceptance.
The SLO-cost tradeoff record template (templates/slo-cost-tradeoff-record.md) captures: the SLO under discussion, current cost to meet it, projected cost at demand forecast, alternative SLO with cost comparison, degradation path if the lower SLO is chosen, error budget impact, accountable owner, and approval record. The template requires surfacing the tradeoff with evidence (cost projection, load-test data) and ownership (who decides and who is accountable).
Demand is growing predictably (e.g., 15% month-over-month). The question: when does current capacity become insufficient, and what does it cost to stay ahead of growth?
Guidance:
A known event will drive traffic well above baseline (product launch, Black Friday, seasonal peak). The question: how much capacity is needed for the peak, what does it cost, and is the cost justified?
Guidance:
A dependency fails or a resource constraint forces operation below full capacity. The question: what does the system look like in degraded mode, what capacity is needed for the core path, and what does degraded operation cost?
Guidance:
A budget constraint prevents provisioning to the ideal capacity or SLO target. The question: what is the best achievable reliability and performance within the budget, and who decides?
Guidance:
Cost optimization must not justify degrading reliability, privacy, or user outcomes. If a cost constraint forces a choice between budget and these non-negotiables, the tradeoff is escalated to an accountable owner with the evidence — it is never silently accepted as an optimization.
This skill does not provide generic cloud-cost tips (reserved instances, spot instances, "turn off unused resources," "right-size," savings plans). Those are platform-specific implementation tactics that belong in platform-engineering references or cloud-provider documentation, not in a capacity-and-cost methodology skill. This skill owns the decision framework and evidence standard for capacity and cost — not a list of cost-cutting tips.
This skill does not prescribe universal utilization targets. A utilization target of 70% for a latency-sensitive service with spiky traffic is not the same as 85% for a batch-processing pipeline with predictable load. Every utilization target must be stated with context, rationale, and the evidence that supports it. "Target 70% utilization" without context is not a capacity decision — it is a guess.
This skill does not permit cost optimization to justify degrading reliability, privacy, or user outcomes. These are non-negotiable constraints. A cost-constrained scenario that would violate them must be escalated, not optimized around.
| When the task involves... | Route to... |
|---|---|
| P&L, fundraising, SaaS metrics (ARR/churn/NDR), pricing strategy | financial-modeling |
| Infrastructure implementation, autoscaling, cloud provisioning, cost-allocation tags | platform-engineering |
| SLO definition, error budget policy, incident command, on-call operations | site-reliability-engineering |
| Demand measurement, traffic forecasting instrumentation, tracking plans | product-analytics-and-measurement |
| Launch decisions, cross-domain evidence assembly, go/no-go/defer/exception | production-readiness |
| Portfolio capacity allocation, bet sequencing, roadmap tradeoffs | product-roadmapping-and-portfolio |
| Degradation-path design, recovery verification, RTO/RPO decisions, game days | resilience-and-recovery |
| Statistical modeling of demand, time-series forecasting, causal inference on growth drivers | data-scientist |
| Cost data pipeline implementation, spend-data ETL, cost-dashboard data models | data-engineering |
| End-to-end tenant semantics, control/application planes, tenancy choice, lifecycle, or billing handoffs | multi-tenant-saas-architecture |
| Tenant isolation threats, authorization, privileged support, or security controls | secure-software-engineering |
| General architecture boundaries, topology, or decomposition decisions | software-architecture |
| Path | Loaded when |
|---|---|
| references/discovery-brief.md | Understanding ownership boundaries and routing rules with adjacent skills |
| templates/capacity-model.md | Building a demand-to-capacity projection with utilization targets and scaling triggers |
| templates/unit-economics-record.md | Calculating unit cost and connecting it to SLO or demand decisions |
| templates/budget-quota-decision.md | Defining budget thresholds, quota limits, rate-limit enforcement, and operational consequences |
| templates/load-soak-test-plan.md | Designing or reviewing a load or soak test as capacity evidence |
| templates/slo-cost-tradeoff-record.md | Resolving an SLO-cost tradeoff with evidence, accountability, and approval |
| references/multi-tenant-capacity-and-unit-cost.md | Modeling tenant distributions, skew, pooled/siloed headroom, tier promises, admission, fairness evidence, and cost allocation |
| templates/tenant-capacity-model.md | Recording tenant profiles, partition behavior, headroom, quota/admission evidence, and tenant-variable unit cost |
| references/source-index.md | Public provenance and original-writing boundary for this methodology |