Works with the AI Agents you already use

    EU CBAM Compliance Architect

    by Xavier Pallares

    1

    eu-cbam-compliance-architect turns your AI coding agent into a domain-accurate trade compliance architect under Regulation (EU) 2023/956.

    $49

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    EU CBAM Compliance Architect

    EU CBAM Compliance Architect

    Example session with this skill installed

    Design and implement a TypeScript calculation service for our EU import ERP to compute 2026 Definitive Regime CBAM certificate obligations for a 200-tonne shipment of cold-rolled steel (CN 7209) from Turkey, including a hot-rolled coil precursor, EU ETS free allocation phase-out, and origin carbon price deduction. Include scope exemption checks and an immutable audit snapshot.

    • Read your context and instructions
    • Compiled the eu cbam compliance

    Architectural Overview

    This implementation targets the EU CBAM Definitive Regime (DEFINITIVE_2026_PLUS) under Regulation (EU) 2023/956. It enforces four critical compliance safeguards before generating an immutable audit snapshot:

    1. Pre-Calculation Scope & Exemption Gate:

    Validates Authorised CBAM Declarant status, excludes EFTA/EU-ETS-linked origins (IS, LI, NO, CH) and exempt territories, and ensures the customs procedure is a release for free circulation (40xx).

    1. Annex II Indirect Emissions Rule:

    Cold-rolled steel (CN 7209) falls under Annex II (iron & steel), so the indirect emissions financial multiplier is locked to alpha = 0 to prevent over-billing certificates.

    1. Fixed-Point Decimal Precision:

    Uses Decimal arithmetic (DECIMAL(18,6) scale) end-to-end—eliminating IEEE 754 floating-point drift across precursor rollups and FX conversions.

    1. Clamped Net Liability:

    Applies the statutory 2026 CBAM phase-in factor (0.025, leaving 97.5% EU ETS free allocation adjustment) and deducts verified origin carbon payments, clamped at 0.

    Deterministic Calculation Breakdown (200 t — CN 7209, 2026)

    Calculation StepFormulaResult (DECIMAL(18,6))
    Precursor Emissions (EE_InpMat)1,050.000000 t × 1.800000 tCO2e/t1,890.000000 tCO2e
    Specific Direct Emissions (SEE_direct)(350.000000 + 1,890.000000) / 1,000.0000002.240000 tCO2e/t
    Annex II Indirect Multiplier (alpha)Iron & Steel (CN 7209) excluded from indirect billing0
    Consignment Total Emissions (TotalEm)200.000000 t × (2.240000 + 0)448.000000 tCO2e
    EU ETS Free Allocation Adj. (FreeETSAdj)200.000000 × 1.370000 × (1 - 0.025)267.150000 tCO2e
    Origin Carbon Price Credit (CarbonCredit)4,200.000000 EUR / 70.000000 EUR/t60.000000 tCO2e
    Net CBAM Certificate Obligationmax(0, 448.000000 - 267.150000 - 60.000000)120.850000 tCO2e

    TypeScript Implementation (cbam-calculator.ts)

    import { createHash, randomUUID } from 'node:crypto';
    import Decimal from 'decimal.js';
    
    Decimal.set({ precision: 24, rounding: Decimal.ROUND_HALF_UP });
    
    const EXEMPT_ORIGINS = new Set(['IS', 'LI', 'NO', 'CH']);
    const ANNEX_II_CN_PREFIXES = ['72', '73', '76', '280410']; // Steel, Aluminium, Hydrogen
    const CBAM_PHASE_IN: Record<number, string> = {
      2026: '0.025', 2027: '0.050', 2028: '0.100', 2029: '0.225',
      2030: '0.485', 2031: '0.610', 2032: '0.735', 2033: '0.860',
    };
    
    export interface PrecursorInput {
      precursorCnCode: string;
      massConsumedTonnes: string;
      precursorSee: string;
    }
    
    export interface CbamCalculationInput {
      mrn: string;
      releaseDate: string; // YYYY-MM-DD
      isAuthorisedDeclarant: boolean;
      cnCode: string;
      originCountryIso2: string;
      customsProcedureCode: string;
      netQuantityTonnes: string;
      activityLevelTonnes: string;
      attributedDirectEmissions: string;
      seeIndirect: string;
      precursors: PrecursorInput[];
      cbamBenchmark: string;
      carbonPaidOriginEur: string;
      euEtsWeeklyPriceEur: string;
    }
    
    export interface AuditSnapshot {
      snapshotId: string;
      calculatedAtUtc: string;
      regimeMode: 'DEFINITIVE_2026_PLUS';
      exemptionCode: string | null;
      totalEmbeddedEmissionsTco2e: string;
      freeEtsAdjustmentTco2e: string;
      carbonPriceCreditTco2e: string;
      netCertificateObligation: string;
      inputPayloadHash: string;
    }
    
    export function calculateDefinitiveCbam(input: CbamCalculationInput): AuditSnapshot {
      const payloadHash = createHash('sha256').update(JSON.stringify(input)).digest('hex');
      const year = Number(input.releaseDate.slice(0, 4));
    
      // 1. Pre-Calculation Scope & Exemption Gate
      if (!input.isAuthorisedDeclarant) {
        throw new Error('COMPLIANCE_BLOCK: Importer must be an Authorised CBAM Declarant (2026+).');
      }
      if (EXEMPT_ORIGINS.has(input.originCountryIso2)) {
        return buildExemptSnapshot(payloadHash, 'EXEMPT_EU_ETS_LINKED_ORIGIN');
      }
      if (!input.customsProcedureCode.startsWith('40')) {
        return buildExemptSnapshot(payloadHash, 'EXEMPT_NON_FREE_CIRCULATION');
      }
    
      // 2. Complex Goods Specific Embedded Emissions (with Precursors)
      const eeInpMat = input.precursors.reduce(
        (acc, p) => acc.plus(new Decimal(p.massConsumedTonnes).times(p.precursorSee)),
        new Decimal(0),
      );
      const seeDirect = new Decimal(input.attributedDirectEmissions)
        .plus(eeInpMat)
        .div(input.activityLevelTonnes);
    
      // 3. Annex II Indirect Emissions Gate
      const isAnnexII = ANNEX_II_CN_PREFIXES.some((prefix) => input.cnCode.startsWith(prefix));
      const alpha = isAnnexII ? new Decimal(0) : new Decimal(1);
    
      const qNet = new Decimal(input.netQuantityTonnes);
      const totalEm = qNet.times(seeDirect.plus(alpha.times(input.seeIndirect)));
    
      // 4. EU ETS Free Allocation Phase-Out & Origin Carbon Price Deduction
      const phaseInFactor = new Decimal(CBAM_PHASE_IN[year] ?? '1.000');
      const remainingFreeRatio = new Decimal(1).minus(phaseInFactor);
      const freeEtsAdj = qNet.times(input.cbamBenchmark).times(remainingFreeRatio);
      const carbonCredit = new Decimal(input.carbonPaidOriginEur).div(input.euEtsWeeklyPriceEur);
    
      const netCertificates = Decimal.max(0, totalEm.minus(freeEtsAdj).minus(carbonCredit));
    
      return {
        snapshotId: randomUUID(),
        calculatedAtUtc: new Date().toISOString(),
        regimeMode: 'DEFINITIVE_2026_PLUS',
        exemptionCode: null,
        totalEmbeddedEmissionsTco2e: totalEm.toFixed(6),
        freeEtsAdjustmentTco2e: freeEtsAdj.toFixed(6),
        carbonPriceCreditTco2e: carbonCredit.toFixed(6),
        netCertificateObligation: netCertificates.toFixed(6),
        inputPayloadHash: payloadHash,
      };
    }
    
    function buildExemptSnapshot(payloadHash: string, exemptionCode: string): AuditSnapshot {
      return {
        snapshotId: randomUUID(),
        calculatedAtUtc: new Date().toISOString(),
        regimeMode: 'DEFINITIVE_2026_PLUS',
        exemptionCode,
        totalEmbeddedEmissionsTco2e: '0.000000',
        freeEtsAdjustmentTco2e: '0.000000',
        carbonPriceCreditTco2e: '0.000000',
        netCertificateObligation: '0.000000',
        inputPayloadHash: payloadHash,
      };
    }
    

    Recommended Next Steps

    1. Wire Versioned CN Tables:

    Join cnCode against a year-versioned Annex I table keyed by releaseDate (EU Combined Nomenclature updates every January 1).

    1. Add Unit Test Suite:

    Lock in regression tests covering 120.850000 tCO2e for the complex steel case, an exempt Norwegian (NO) origin returning 0.000000, and a non-Annex II cement consignment where alpha = 1.

    1. Connect Annual Registry Export:

    Aggregate persisted AuditSnapshot rows by declaration year, installation ID, and verification accreditation ID for annual EU CBAM Registry filing.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    EU CBAM Compliance Architect — 2026+ Definitive Regime & Certificate Engine

    Production-grade regulatory architecture, deterministic embedded emissions math, exemption gates, and CBAM certificate obligation logic for AI coding agents.


    Value Proposition

    Generic LLMs routinely fail on EU Carbon Border Adjustment Mechanism (CBAM) implementations: they conflate expired 2023–2025 transitional reporting with the 2026+ Definitive Regime, misapply indirect emissions to Annex II goods, ignore customs procedure exemptions (such as IPR re-exports), and introduce floating-point rounding drift across precursor rollups.

    eu-cbam-compliance-architect turns your AI coding agent into a domain-accurate trade compliance architect under Regulation (EU) 2023/956. It embeds deterministic formulas, statutory EU ETS free allocation phase-out factors, third-country carbon price deduction rules, and an immutable data contract directly into your agent's context—cutting weeks of regulatory research and preventing costly compliance bugs before a single line of code is deployed.

    • Dual-Regime Ready: Explicit branching between DEFINITIVE_2026_PLUS (annual declarations & financial certificate surrender) and TRANSITIONAL_2023_2025 (legacy quarterly XML reporting & audit reconciliation).
    • Deterministic Math & Test Oracle: Exact formulas for simple goods, recursive complex goods with precursors, Annex II indirect emission rules, and net certificate liabilities—complete with a worked numerical steel example ready to convert into unit tests.
    • Stack-Agnostic & IP-Clean: Pure domain logic, DECIMAL(18,6) precision rules, and a clean JSON data contract adaptable to TypeScript, Python, Go, Java, SQL, or any ERP/TMS backend.

    Target Audience

    • Freight Forwarding & Logistics SaaS Teams building EU import compliance modules.
    • Customs Brokerage & Trade Tech Engineers automating CN-code screening and duty/carbon accruals.
    • ESG & Carbon Accounting Startups implementing Scope 3 and CBAM calculation engines.
    • Enterprise ERP / Supply Chain Architects integrating CBAM financial provisioning into procurement and accounting workflows.

    Key Use Cases

    1. Automated Scope & Exemption Screening: Build pre-calculation gates that validate 8-digit CN codes by import year, exclude EFTA/EU-ETS-linked origins (IS, LI, NO, CH) and exempt territories, and filter customs procedures (40xx release for free circulation vs. IPR re-exports).
    2. Complex Goods & Precursor Emissions Engine: Accurately compute direct and indirect Specific Embedded Emissions ($SEE$) across multi-tier CBAM-regulated input materials without double-counting installation emissions.
    3. 2026+ Financial Certificate Provisioning: Calculate net CBAM certificate obligations by applying statutory annual EU ETS free allocation phase-out ratios and deducting verified third-country carbon prices paid in origin.
    4. Audit-Ready Ledgers & Registry Exports: Design append-only calculation snapshots (with SHA-256 payload hashes and versioned emission factor references) to support annual CBAM declarations and historical quarterly XML audits.

    What's Included

    • Dual-Regime Matrix: Clear operational rules separating 2023–2025 transitional logic from 2026+ definitive financial obligations.
    • 5-Step Pre-Calculation Exemption Gate: CN versioning, territorial exclusions, customs procedure rules, de minimis handling, electricity (MWh) special rules, and Annex II indirect emissions gating.
    • Complete Calculation Algorithms: Formulas for Simple Goods, Complex Goods (with precursors), Consignment Total Emissions, EU ETS Free Allocation Adjustment, Carbon Price Credit, and Net Certificates.
    • Core JSON Data Contract: Six normalized entities (Declarant, CustomsEntry, EmissionFactorRecord, PrecursorInput, CarbonPriceDeduction, AuditSnapshot) enforcing fixed-point decimal precision.
    • Worked Numerical Reference Case: End-to-end 2026 complex cold-rolled steel import calculation with precursor, ETS adjustment, and origin carbon price deduction.
    • Production Gotchas Checklist: Six high-impact engineering safeguards against rounding drift, CN code drift, over-billed indirect emissions, and negative certificate balances.

    Suggested Marketplace Tags

    eu-cbam · trade-compliance · customs · carbon-accounting · esg · supply-chain · eu-ets · logistics-erp · regulation-2023-956

    Requires external reference data supplied by your system (annual EU Combined Nomenclature tables, weekly EU ETS auction prices, and statutory CBAM benchmarks). Provides deterministic architecture and calculation logic only—does not bundle raw EU XSD/XML schema files, connect directly to the EU CBAM Registry API, or constitute formal legal or customs advice.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    Nothing to install. It runs in your AI agent.

    Pure domain specification and deterministic calculation logic. Requires no external APIs, credentials, or local dependencies—works immediately in any AI coding agent or chat interface out of the box.

    Permissions

    No special permissions declared or detected

    Listed13 days ago

    What's inside

    Frequently Asked Questions

    This skill provides the deterministic logic and algorithmic guardrails required for CBAM calculations, ensuring your agent follows Regulation (EU) 2023/956 without hallucinating phase-in dates or complex goods formulas.

    It follows the open SKILL.md standard and works out of the box with Claude Code, Cursor, Gemini CLI, Codex CLI, VS Code Copilot, and other compatible agents. Because the logic and JSON data contracts are stack-agnostic, your agent can implement them in TypeScript, Python, Go, Java, C#, or SQL for any ERP, TMS, or customs backend.

    You receive the architectural rules, data structures, and deterministic logic sets for both Transitional and Definitive regimes, including recursive precursor math and exemption gates.

    The architecture decouples calculation logic from statutory reference data—requiring year-versioned CN tables, configurable phase-in factors, and external ETS price inputs—so your implementation absorbs future EU Commission implementing acts without rewriting core logic.

    No, the skill focuses on the internal logic and math; you will need to provide external data sources for real-time EU ETS pricing and specific 8-digit CN code tables.

    The skill uses high-precision math (DECIMAL 18,6) to handle recursive emissions rollups, ensuring that 'complex goods' accurately include the carbon footprint of all regulated precursors as required by EU law.

    New in APIs & Backend

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.