Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

co2-carbon-footprint二氧化碳碳足迹

Agent Skill

co2-carbon-footprint 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

392

周安装

16

GitHub Stars

113

下载量

125
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:co2-carbon-footprint(二氧化碳碳足迹)
来源仓库:https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction
仓库路径:skills/co2-carbon-footprint
安装命令:
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill co2-carbon-footprint
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill co2-carbon-footprint

简介

co2-carbon-footprint 基于 BIM 工程量与环境产品声明(EPD)计算建筑碳排放。

  • 支持材料替代对比与绿色设计优化,满足可持续建造法规要求。
  • 集成 EPD 数据库与碳系数表,实现自动化报告生成与决策支持。
  • 需确保输入数据准确,包括构件体积、材料种类与单位换算一致性。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

CO2 Carbon Footprint Calculator

Business Case

Problem Statement

Sustainability requirements demand carbon tracking:

  • Need to quantify embodied carbon
  • Material selection impact unclear
  • Reporting requirements increasing
  • No integration with BIM workflow

Solution

Calculate CO2 emissions from BIM quantities using EPD (Environmental Product Declaration) data and carbon coefficients.

Business Value

  • Sustainability - Meet green building requirements
  • Design optimization - Identify high-carbon elements
  • Reporting - Automated carbon reports
  • Decision support - Compare material alternatives

Technical Implementation

import pandas as pd
from datetime import datetime
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum

class LifeCycleStage(Enum):
    """EN 15978 Life Cycle Stages."""
    A1_A3 = "a1_a3"  # Product stage
    A4 = "a4"        # Transport to site
    A5 = "a5"        # Construction
    B1_B7 = "b1_b7"  # Use stage
    C1_C4 = "c1_c4"  # End of life
    D = "d"          # Beyond system boundary

class MaterialCategory(Enum):
    """Material categories for carbon calculation."""
    CONCRETE = "concrete"
    STEEL = "steel"
    TIMBER = "timber"
    ALUMINUM = "aluminum"
    GLASS = "glass"
    BRICK = "brick"
    INSULATION = "insulation"
    GYPSUM = "gypsum"
    OTHER = "other"

@dataclass
class CarbonCoefficient:
    """Carbon emission coefficient for a material."""
    material: str
    category: MaterialCategory
    kgco2_per_unit: float  # kg CO2e per unit
    unit: str  # kg, m3, m2, etc.
    stage: LifeCycleStage
    source: str  # EPD reference
    uncertainty: float = 0.1  # 10% default uncertainty

@dataclass
class CarbonResult:
    """Carbon calculation result for an element."""
    element_id: str
    element_name: str
    material: str
    category: MaterialCategory
    quantity: float
    unit: str
    kgco2_per_unit: float
    total_kgco2: float
    stage: LifeCycleStage
    level: str = ""
    notes: str = ""

@dataclass
class CarbonSummary:
    """Carbon footprint summary."""
    total_kgco2: float
    total_tonco2: float
    by_material: Dict[str, float]
    by_category: Dict[str, float]
    by_stage: Dict[str, float]
    by_level: Dict[str, float]
    element_count: int
    gfa: float  # Gross Floor Area
    kgco2_per_m2: float

class CarbonCoefficientDatabase:
    """Database of carbon emission coefficients."""

    def __init__(self):
        self.coefficients: List[CarbonCoefficient] = []
        self._load_default_coefficients()

    def _load_default_coefficients(self):
        """Load standard carbon coefficients (EPD-based)."""
        # Concrete products
        self.add_coefficient(CarbonCoefficient(
            material="Concrete C30/37", category=MaterialCategory.CONCRETE,
            kgco2_per_unit=250, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Concrete"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Concrete C40/50", category=MaterialCategory.CONCRETE,
            kgco2_per_unit=300, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - High Strength Concrete"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Reinforcement Steel", category=MaterialCategory.STEEL,
            kgco2_per_unit=1.99, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Rebar"
        ))

        # Steel products
        self.add_coefficient(CarbonCoefficient(
            material="Structural Steel", category=MaterialCategory.STEEL,
            kgco2_per_unit=2.5, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Structural Steel"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Steel Sheet", category=MaterialCategory.STEEL,
            kgco2_per_unit=2.3, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Sheet Metal"
        ))

        # Timber products
        self.add_coefficient(CarbonCoefficient(
            material="Softwood Timber", category=MaterialCategory.TIMBER,
            kgco2_per_unit=-500, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - CLT (carbon sequestration)"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Glulam", category=MaterialCategory.TIMBER,
            kgco2_per_unit=-350, unit="m3", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Glued Laminated Timber"
        ))

        # Aluminum
        self.add_coefficient(CarbonCoefficient(
            material="Aluminum Profile", category=MaterialCategory.ALUMINUM,
            kgco2_per_unit=8.0, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Aluminum"
        ))

        # Glass
        self.add_coefficient(CarbonCoefficient(
            material="Float Glass", category=MaterialCategory.GLASS,
            kgco2_per_unit=15.0, unit="m2", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Float Glass"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="Double Glazing Unit", category=MaterialCategory.GLASS,
            kgco2_per_unit=35.0, unit="m2", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - IGU"
        ))

        # Masonry
        self.add_coefficient(CarbonCoefficient(
            material="Clay Brick", category=MaterialCategory.BRICK,
            kgco2_per_unit=0.24, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Clay Brick"
        ))

        # Insulation
        self.add_coefficient(CarbonCoefficient(
            material="Mineral Wool", category=MaterialCategory.INSULATION,
            kgco2_per_unit=1.2, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Mineral Wool"
        ))
        self.add_coefficient(CarbonCoefficient(
            material="EPS Insulation", category=MaterialCategory.INSULATION,
            kgco2_per_unit=3.5, unit="kg", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - EPS"
        ))

        # Gypsum
        self.add_coefficient(CarbonCoefficient(
            material="Gypsum Board", category=MaterialCategory.GYPSUM,
            kgco2_per_unit=2.8, unit="m2", stage=LifeCycleStage.A1_A3,
            source="Generic EPD - Plasterboard"
        ))

    def add_coefficient(self, coefficient: CarbonCoefficient):
        """Add carbon coefficient to database."""
        self.coefficients.append(coefficient)

    def find_coefficient(self, material_name: str,
                        stage: LifeCycleStage = LifeCycleStage.A1_A3) -> Optional[CarbonCoefficient]:
        """Find matching coefficient for material."""
        material_lower = material_name.lower()

        # Direct match
        for coef in self.coefficients:
            if coef.material.lower() == material_lower and coef.stage == stage:
                return coef

        # Partial match
        for coef in self.coefficients:
            if material_lower in coef.material.lower() or coef.material.lower() in material_lower:
                if coef.stage == stage:
                    return coef

        # Category match
        category = self._guess_category(material_name)
        for coef in self.coefficients:
            if coef.category == category and coef.stage == stage:
                return coef

        return None

    def _guess_category(self, material_name: str) -> MaterialCategory:
        """Guess material category from name."""
        name_lower = material_name.lower()

        if any(w in name_lower for w in ['concrete', 'cement', 'mortar']):
            return MaterialCategory.CONCRETE
        if any(w in name_lower for w in ['steel', 'iron', 'metal']):
            return MaterialCategory.STEEL
        if any(w in name_lower for w in ['wood', 'timber', 'lumber', 'plywood', 'clt']):
            return MaterialCategory.TIMBER
        if any(w in name_lower for w in ['aluminum', 'aluminium']):
            return MaterialCategory.ALUMINUM
        if any(w in name_lower for w in ['glass', 'glazing']):
            return MaterialCategory.GLASS
        if any(w in name_lower for w in ['brick', 'masonry', 'block']):
            return MaterialCategory.BRICK
        if any(w in name_lower for w in ['insulation', 'wool', 'foam', 'eps', 'xps']):
            return MaterialCategory.INSULATION
        if any(w in name_lower for w in ['gypsum', 'drywall', 'plaster']):
            return MaterialCategory.GYPSUM

        return MaterialCategory.OTHER

class CO2FootprintCalculator:
    """Calculate carbon footprint from BIM data."""

    def __init__(self, coefficient_db: CarbonCoefficientDatabase = None):
        self.db = coefficient_db or CarbonCoefficientDatabase()
        self.results: List[CarbonResult] = []
        self.warnings: List[str] = []

    def calculate_element(self, element: Dict[str, Any],
                         stage: LifeCycleStage = LifeCycleStage.A1_A3) -> Optional[CarbonResult]:
        """Calculate carbon for single element."""
        material = element.get('material', '')
        if not material:
            self.warnings.append(f"Element {element.get('element_id')} has no material")
            return None

        coefficient = self.db.find_coefficient(material, stage)
        if not coefficient:
            self.warnings.append(f"No coefficient found for material: {material}")
            return None

        # Get quantity in correct unit
        quantity = self._get_quantity(element, coefficient.unit)
        if quantity is None or quantity <= 0:
            return None

        total_kgco2 = quantity * coefficient.kgco2_per_unit

        result = CarbonResult(
            element_id=str(element.get('element_id', '')),
            element_name=str(element.get('name', '')),
            material=material,
            category=coefficient.category,
            quantity=quantity,
            unit=coefficient.unit,
            kgco2_per_unit=coefficient.kgco2_per_unit,
            total_kgco2=total_kgco2,
            stage=stage,
            level=str(element.get('level', ''))
        )

        self.results.append(result)
        return result

    def _get_quantity(self, element: Dict[str, Any], unit: str) -> Optional[float]:
        """Get quantity in required unit."""
        unit_lower = unit.lower()

        if unit_lower == 'm3':
            return float(element.get('volume', 0) or 0)
        elif unit_lower == 'm2':
            return float(element.get('area', 0) or 0)
        elif unit_lower in ['kg', 'kilogram']:
            # Try weight, then estimate from volume
            weight = element.get('weight', 0)
            if weight:
                return float(weight)
            # Estimate from volume with density
            volume = element.get('volume', 0)
            if volume:
                density = self._estimate_density(element.get('material', ''))
                return float(volume) * density
        elif unit_lower in ['m', 'meter']:
            return float(element.get('length', 0) or 0)

        return None

    def _estimate_density(self, material: str) -> float:
        """Estimate material density in kg/m3."""
        material_lower = material.lower()

        densities = {
            'concrete': 2400,
            'steel': 7850,
            'timber': 500,
            'aluminum': 2700,
            'glass': 2500,
            'brick': 1800,
            'gypsum': 800
        }

        for key, density in densities.items():
            if key in material_lower:
                return density

        return 1500  # Default density

    def calculate_from_dataframe(self, df: pd.DataFrame,
                                 stage: LifeCycleStage = LifeCycleStage.A1_A3) -> List[CarbonResult]:
        """Calculate carbon for all elements in DataFrame."""
        self.results = []
        self.warnings = []

        for _, row in df.iterrows():
            self.calculate_element(row.to_dict(), stage)

        return self.results

    def get_summary(self, gfa: float = 0) -> CarbonSummary:
        """Generate carbon footprint summary."""
        by_material = {}
        by_category = {}
        by_stage = {}
        by_level = {}

        for result in self.results:
            # By material
            by_material[result.material] = by_material.get(result.material, 0) + result.total_kgco2

            # By category
            cat = result.category.value
            by_category[cat] = by_category.get(cat, 0) + result.total_kgco2

            # By stage
            stg = result.stage.value
            by_stage[stg] = by_stage.get(stg, 0) + result.total_kgco2

            # By level
            if result.level:
                by_level[result.level] = by_level.get(result.level, 0) + result.total_kgco2

        total_kgco2 = sum(r.total_kgco2 for r in self.results)

        return CarbonSummary(
            total_kgco2=round(total_kgco2, 2),
            total_tonco2=round(total_kgco2 / 1000, 2),
            by_material=by_material,
            by_category=by_category,
            by_stage=by_stage,
            by_level=by_level,
            element_count=len(self.results),
            gfa=gfa,
            kgco2_per_m2=round(total_kgco2 / gfa, 2) if gfa > 0 else 0
        )

    def export_results(self, output_path: str):
        """Export results to Excel."""
        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
            # Detailed results
            results_df = pd.DataFrame([{
                'Element ID': r.element_id,
                'Element Name': r.element_name,
                'Material': r.material,
                'Category': r.category.value,
                'Quantity': r.quantity,
                'Unit': r.unit,
                'kg CO2e/unit': r.kgco2_per_unit,
                'Total kg CO2e': round(r.total_kgco2, 2),
                'Level': r.level
            } for r in self.results])

            results_df.to_excel(writer, sheet_name='Details', index=False)

            # Summary
            summary = self.get_summary()
            summary_df = pd.DataFrame([
                {'Metric': 'Total kg CO2e', 'Value': summary.total_kgco2},
                {'Metric': 'Total ton CO2e', 'Value': summary.total_tonco2},
                {'Metric': 'Elements Analyzed', 'Value': summary.element_count}
            ])
            summary_df.to_excel(writer, sheet_name='Summary', index=False)

        return output_path

Quick Start

# Initialize calculator
calculator = CO2FootprintCalculator()

# Load BIM quantities
elements = pd.read_excel("bim_quantities.xlsx")

# Calculate carbon
results = calculator.calculate_from_dataframe(elements)

# Get summary
summary = calculator.get_summary(gfa=5000)  # 5000 m2 GFA
print(f"Total: {summary.total_tonco2} ton CO2e")
print(f"Per m2: {summary.kgco2_per_m2} kg CO2e/m2")

Common Use Cases

1. Material Comparison

# Compare concrete vs timber
concrete_elements = elements[elements['material'].str.contains('Concrete')]
timber_elements = elements[elements['material'].str.contains('Timber')]

2. Target Compliance

TARGET_KGCO2_M2 = 500  # LEED/BREEAM target
if summary.kgco2_per_m2 > TARGET_KGCO2_M2:
    print(f"Warning: Exceeds target by {summary.kgco2_per_m2 - TARGET_KGCO2_M2} kg/m2")

3. Export Report

calculator.export_results("carbon_report.xlsx")

Resources

  • DDC Book: Chapter 3.3 - CO2 Estimation
  • Reference: EN 15978, EPD databases

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.38%
按下载量换算44

Claude

28.74%
按下载量换算36

Cursor

20.37%
按下载量换算25

Gemini CLI

10.09%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills