| name | gc-measure-sci |
| description | Measure the SCI (Software Carbon Intensity) for a specific operation, endpoint, or feature. Use when the user asks to measure carbon, energy consumption, or SCI for their code. Requires the sustainable-code MCP server for calculations, or falls back to manual estimation. |
| license | MIT |
| metadata | {"author":"fullo","version":"1.1"} |
Measure SCI
Compute the Software Carbon Intensity for $ARGUMENTS.
Pick the right SCI profile
SCI is now ISO/IEC 21031:2024, with two domain profiles on the same formula.
Choose before you measure:
- Generic operation (API request, file processed, job) → standard SCI, steps below.
- AI training or inference → SCI for AI (
SCI = C / R). State whether it is
a Provider score (training/development) or a Consumer score
(inference/operation) and pick a matching functional unit (per token, per image,
per inference, per workflow). See gsf-projects.md.
- Web application → estimate with SWD v4 today (
/gc-estimate-emissions), and
structure boundaries + disclosure to align with the emerging SCI for Web.
- Kubernetes / cloud fleet → measure with Carmen (carbon) or Kepler
(energy) instead of per-operation profiling; see
gsf-projects.md.
Steps
-
Identify the functional unit R — what counts as "one operation"? (API request, page load, file processed, user session, inference, CI run, etc.)
-
Measure energy E (kWh per operation):
- JS/TS projects: integrate SCI Profiler — uses
performance.now() to estimate energy per operation
- PHP projects: integrate sci-profiler-php — zero-code-changes via
auto_prepend_file
- Other languages: use wall-clock CPU time benchmarks (
hyperfine, profiler output) and convert to energy using TDP-based estimation
- Cloud workloads: use Cloud Carbon Footprint or provider billing data
-
Determine carbon intensity I (gCO2eq/kWh):
- Use the
grid_carbon_intensity MCP tool with the deployment region's country code
- If MCP is not available: use 494 gCO2eq/kWh (2022 global average, Ember data)
-
Estimate embodied carbon M (gCO2eq per operation):
- Shared infrastructure (serverless, CDN): M is near zero per operation
- Dedicated server: amortize total embodied carbon over expected lifespan and operations
- Default: use 0 if unknown, note as assumption
-
Calculate SCI:
- Use the
sci_calculate MCP tool with:
wallTimeMs (required): wall-clock execution time in milliseconds
carbonIntensity: grid intensity in gCO2eq/kWh (from step 3)
devicePowerW: device power in watts (default: 18W for M1 Pro)
embodiedTotalG: total embodied emissions in gCO2eq (default: 211000)
lifetimeHours: expected device lifetime in hours (default: 11680)
- If MCP is not available: compute manually as
SCI = ((E x I) + M) / R
-
Report results:
## SCI Measurement: [operation name]
| Variable | Value | Source |
|----------|-------|--------|
| E (energy) | ? kWh | [method used] |
| I (carbon intensity) | ? gCO2eq/kWh | [region/source] |
| M (embodied) | ? gCO2eq | [estimation method] |
| R (functional unit) | 1 [unit] | [definition] |
| **SCI** | **? gCO2eq/[unit]** | |
### Recommendations
- [concrete actions to reduce SCI]
### Methodology and sources
- Formula: SCI = ((E x I) + M) / R — [Green Software Foundation SCI Specification](https://sci-guide.greensoftware.foundation/) (ISO/IEC 21031:2024)
- Grid carbon intensity: [value] gCO2eq/kWh — [Ember Global Electricity Review](https://ember-energy.org/) [year]
- Device power: [value] W — [source]
- Embodied carbon: [value] gCO2eq — [source]
- Measurement tool: [tool name and version]
- Compare with baseline (if a previous measurement exists):
- Use the
sci_compare MCP tool with:
baselineSciMg: previous SCI value in mgCO2eq
currentSciMg: new SCI value in mgCO2eq
baselineLabel: description of baseline (e.g., "before optimization")
currentLabel: description of current (e.g., "after tree-shaking")
- If no baseline: record this as the initial baseline
Gotchas
- Grid carbon intensity varies by hour and region: A fixed national average (e.g., Italy = 371 gCO2eq/kWh, Ember 2022) is a rough proxy. Real-time intensity (via Electricity Maps or similar) can vary by 3x within a single day.
- Cloud provider energy data is not real-time: AWS/Azure/GCP carbon reports are delayed by weeks or months. For current SCI calculations, use regional grid intensity as a proxy.
- CPU utilization is not equal to energy consumption: The relationship between CPU load and energy is non-linear (idle power can be 30-50% of peak). Don't assume 50% CPU = 50% of max energy.
Post-report verification
After presenting the SCI measurement report, automatically run /gc-verify in quick mode. This triggers a Chain-of-Verification (CoVe) process: extract claims from the report, generate adversarial questions, answer each independently, and present findings under a ## Verification (CoVe) heading.
Notes
- SCI is a rate, not a total — lower is better
- Always document assumptions and data sources
- For a full sustainability audit, use
/gc-setup instead