forge-cost: Cost efficiency
Engine: Hybrid — Forge + Google, Cloudflare
Purpose
Tie resource and vendor cost to workloads, ownership, unit economics, budgets, and safe optimization choices.
Deterministic runtime composition
Before loading any provider procedure, run:
Resolve ../../runtime/cli/src/composition-entry.js relative to this SKILL.md, then run:
node "<resolved-absolute-runner-path>" cost compose --workflow audit --root "<repository-root>" --dry-run --json
Add one repeatable --request <provider-or-source> flag for each explicit user request. Add
--condition <task-condition> or --risk-surface <surface> only for a task fact you directly
proved; never infer one from generic wording. The command above is the default for this
audit-oriented module; for implementation use --workflow build, and for a fix, retest, or
release gate use --workflow fix, verify, or ship respectively. Read the JSON response,
keep the Forge contract at index zero, and resolve paths against the absolute runtime_root
reported in that response. Read eager[].runtimePath when entering the module. The full
selected[] list is availability/provenance; load only deferred[].runtimePath when the task
reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported
suppression and context budget. If missing is non-empty, stop and report the installation as
damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin
cache or global installation; never assume they are inside the audited repository.
Resolve and read ../fullstack-forge/references/shared/module-contract.md (applicability,
execution, mutation, verification, completion) and
../fullstack-forge/references/shared/evidence-rules.md (statuses, standards, tools, findings via
../fullstack-forge/references/PROTOCOL.md) relative to this module SKILL.md before reporting.
Never hide failed checks or claim that an operation ran when it did not.
Automatic activation signals
Activate when a request or direct repository evidence involves cost efficiency, when
the user explicitly names forge-cost, or when discovery proves an applicable boundary.
- Paid infrastructure, APIs, AI, storage, messaging, or observability
When not to activate
- No material variable or fixed operating cost
Automated support
Relevant discovery inputs are:
- architecture profile
- usage measurements
- pricing and billing exports
Deterministic support, bounded evidence only:
inspect-deployment-config
Agent inspection procedure
- Attribute current spend: map each paid service, plan, and resource to the workload that uses it.
- Identify waste: always-on resources for bursty loads, oversized instances, unused capacity, and orphaned resources.
- Trace the expensive operations: costly queries, chatty integrations, retry amplification, AI token usage, and egress-heavy paths.
- Compute unit economics where tenancy exists: cost per tenant or user against plan pricing.
- Project cost at the stated growth scenario and check budgets, alerts, and retention policies for logs and storage.
Manual inspection requirements:
- Review current provider pricing and contractual commitments
- Validate product value and growth assumptions
Stack-specific guidance:
- Include managed-service minimums, egress, support, and observability costs
Evidence to collect
Standards used as criteria:
- FinOps Framework concepts
- provider billing documentation
Common production failures
- Map cost centers to services, tenants, features, environments, and owners
- Inspect idle resources, retention, egress, log cardinality, build minutes, queries, storage lifecycle, and retry amplification
- Define budgets, anomaly alerts, unit metrics, and cost-performance-reliability tradeoffs
Missing-control checks
Each item needs direct evidence or one reasoned status.
- Hosting cost
- Database-plan usage
- Storage growth
- Egress
- AI API usage
- Logging cost
- Monitoring cost
- Always-on services
- Oversized resources
- Inefficient jobs
- Cache cost versus value
- Expensive queries
- Third-party subscriptions
- Per-tenant cost
- Projected cost at scale
- Waste caused by retries
- Large-file storage
- Retention cost
Commands and tools
- Run
forge cost audit --json or fullstack-forge cost audit --json when
an explicit audit is requested and the CLI is installed. Normal feature work does not require it.
Safe fixes
- Add cost attribution tags and bounded retention
- Remove a proven unused non-production resource through an approved workflow
Approval-required changes
- Deleting resources, changing service tier, retention, reliability, or customer-visible limits
Verification
- Compare normalized billing before and after over a representative period
- Confirm reliability and performance budgets remain satisfied
Completion contract
Follow fullstack-forge/references/shared/completion.md and the limitations below.
Known limitations
- Pricing is time-sensitive and must be verified at audit time
1---2name: forge-cost-33description: Tie resource and vendor cost to workloads, ownership, unit economics, budgets, and safe optimization choices.4---56# forge-cost: Cost efficiency78Engine: Hybrid — Forge + Google, Cloudflare910## Purpose1112Tie resource and vendor cost to workloads, ownership, unit economics, budgets, and safe optimization choices.131415## Deterministic runtime composition1617Before loading any provider procedure, run:1819Resolve `../../runtime/cli/src/composition-entry.js` relative to this `SKILL.md`, then run:2021`node "<resolved-absolute-runner-path>" cost compose --workflow audit --root "<repository-root>" --dry-run --json`2223Add one repeatable `--request <provider-or-source>` flag for each explicit user request. Add24`--condition <task-condition>` or `--risk-surface <surface>` only for a task fact you directly25proved; never infer one from generic wording. The command above is the default for this26audit-oriented module; for implementation use `--workflow build`, and for a fix, retest, or27release gate use `--workflow fix`, `verify`, or `ship` respectively. Read the JSON response,28keep the Forge contract at index zero, and resolve paths against the absolute `runtime_root`29reported in that response. Read `eager[].runtimePath` when entering the module. The full30`selected[]` list is availability/provenance; load only `deferred[].runtimePath` when the task31reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported32suppression and context budget. If `missing` is non-empty, stop and report the installation as33damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin34cache or global installation; never assume they are inside the audited repository.353637Resolve and read `../fullstack-forge/references/shared/module-contract.md` (applicability,38execution, mutation, verification, completion) and39`../fullstack-forge/references/shared/evidence-rules.md` (statuses, standards, tools, findings via40`../fullstack-forge/references/PROTOCOL.md`) relative to this module `SKILL.md` before reporting.4142Never hide failed checks or claim that an operation ran when it did not.4344## Automatic activation signals4546Activate when a request or direct repository evidence involves cost efficiency, when47the user explicitly names `forge-cost`, or when discovery proves an applicable boundary.4849- Paid infrastructure, APIs, AI, storage, messaging, or observability5051## When not to activate5253- No material variable or fixed operating cost5455## Automated support5657Relevant discovery inputs are:5859- architecture profile60- usage measurements61- pricing and billing exports6263Deterministic support, bounded evidence only:6465- `inspect-deployment-config`6667## Agent inspection procedure68691. Attribute current spend: map each paid service, plan, and resource to the workload that uses it.702. Identify waste: always-on resources for bursty loads, oversized instances, unused capacity, and orphaned resources.713. Trace the expensive operations: costly queries, chatty integrations, retry amplification, AI token usage, and egress-heavy paths.724. Compute unit economics where tenancy exists: cost per tenant or user against plan pricing.735. Project cost at the stated growth scenario and check budgets, alerts, and retention policies for logs and storage.7475Manual inspection requirements:7677- Review current provider pricing and contractual commitments78- Validate product value and growth assumptions7980Stack-specific guidance:8182- Include managed-service minimums, egress, support, and observability costs8384## Evidence to collect8586Standards used as criteria:8788- FinOps Framework concepts89- provider billing documentation9091## Common production failures9293- Map cost centers to services, tenants, features, environments, and owners94- Inspect idle resources, retention, egress, log cardinality, build minutes, queries, storage lifecycle, and retry amplification95- Define budgets, anomaly alerts, unit metrics, and cost-performance-reliability tradeoffs9697## Missing-control checks9899Each item needs direct evidence or one reasoned status.100101- Hosting cost102- Database-plan usage103- Storage growth104- Egress105- AI API usage106- Logging cost107- Monitoring cost108- Always-on services109- Oversized resources110- Inefficient jobs111- Cache cost versus value112- Expensive queries113- Third-party subscriptions114- Per-tenant cost115- Projected cost at scale116- Waste caused by retries117- Large-file storage118- Retention cost119120## Commands and tools121122- Run `forge cost audit --json` or `fullstack-forge cost audit --json` when123 an explicit audit is requested and the CLI is installed. Normal feature work does not require it.124125## Safe fixes126127- Add cost attribution tags and bounded retention128- Remove a proven unused non-production resource through an approved workflow129130## Approval-required changes131132- Deleting resources, changing service tier, retention, reliability, or customer-visible limits133134## Verification135136- Compare normalized billing before and after over a representative period137- Confirm reliability and performance budgets remain satisfied138139## Completion contract140141Follow `fullstack-forge/references/shared/completion.md` and the limitations below.142143## Known limitations144145- Pricing is time-sensitive and must be verified at audit time