Works with the AI Agents you already use

    Custom Tax Disbursements Architect

    by Xavier Pallares

    1

    * Multi-Jurisdiction by Design: Explicit branching between CIF_BORDER (EU-27, UK, APAC/LATAM) and FOB_ORIGIN (US, Canada) with full Incoterms® 2020 adjustment matrices.

    $49

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Custom Tax Disbursements Architect

    Custom Tax Disbursements Architect

    Example session with this skill installed

    Implement a multi-jurisdiction TypeScript customs tax and disbursement billing service for our freight ERP. It must handle both EU_UCC (CIF_BORDER, supporting CASH_AT_BORDER and DEFERRED_REVERSE_CHARGE VAT) and US_CBP (FOB_ORIGIN, whole-dollar Entered Value, clamped border user fee), separate Balance Sheet disbursements from taxable P&L brokerage/outlay fees, and emit a SHA-256 AuditSnapshot. Verify it against an illustrative FOB 18,000 USD shipment.

    • Read your context and instructions
    • Compiled the custom tax disbursements

    Architectural Overview

    This multi-jurisdiction service enforces four core accounting and customs guardrails:

    1. Profile-Driven Valuation (CIF_BORDER vs. FOB_ORIGIN):
      Under EU_UCC, international freight and insurance are added to FOB and converted via the statutory USD/EUR monthly customs rate (1 USD = X EUR). Under US_CBP, international freight and insurance are excluded and Entered Value is rounded to 0 decimals (whole dollar) while duties and user fees settle to 2 decimals.
    2. Cascading Import VAT & Settlement Branching:
      Under EU_UCC, Import VAT cascades over CV + Duty + Excise + First-Destination Incidentals. Under DEFERRED_REVERSE_CHARGE, Import VAT is logged for audit only and never billed as a cash disbursement.
    3. Strict Balance Sheet vs. P&L Separation:
      Official duties, border user fees, and cash-at-border Import VAT post to DISBURSEMENT_BALANCE_SHEET (0% local service tax). Brokerage fees and outlay fees post to REVENUE_PNL with local service tax applied—preserving true operating margin.
    4. Fixed-Point Decimal Math & Canonical Serialization:
      Uses decimal.js (DECIMAL(18,6) intermediates) and outputs canonical decimal strings ("4849.05") with an immutable SHA-256 AuditSnapshot.

    Illustrative Verification Matrix (FOB 18000.00 USD, 3.5% Duty)

    Line Item / MetricEU_UCC (CASH_AT_BORDER)EU_UCC (DEFERRED_REVERSE_CHARGE)US_CBP (FOB_ORIGIN)Accounting Ledger
    Customs Value (CV)18000.00 EUR18000.00 EUR18000 USDValuation Base
    Import Duty (3.5%)630.00 EUR630.00 EUR630.00 USDBalance Sheet (0% tax)
    Border User Fee0.00 EUR0.00 EUR63.00 USDBalance Sheet (0% tax)
    Import VAT (21%)3990.00 EUR0.00 EUR (memo only)0.00 USD (N/A)Balance Sheet / Memo
    Total Cash Disbursements4620.00 EUR630.00 EUR693.00 USDExcluded from P&L
    Brokerage + Outlay Fee189.30 EUR135.00 EUR135.00 USDP&L Operating Revenue
    Local Service Tax (21% / 0%)39.75 EUR28.35 EUR0.00 USDOutput Tax Liability
    Total Client Invoice Payable4849.05 EUR793.35 EUR828.00 USDExact cash payable

    TypeScript Implementation (customs-tax-service.ts)

    import { createHash, randomUUID } from 'node:crypto';
    import Decimal from 'decimal.js';
    
    Decimal.set({ precision: 24, rounding: Decimal.ROUND_HALF_UP });
    
    export type JurisdictionProfile = 'EU_UCC' | 'UK_GLOBAL' | 'US_CBP' | 'CA_CBSA' | 'GENERIC_CIF';
    export type VatSettlementMode = 'CASH_AT_BORDER' | 'DEFERRED_REVERSE_CHARGE' | 'NOT_APPLICABLE';
    
    export interface CustomsTaxInput {
      declarationRef: string;
      jurisdictionProfile: JurisdictionProfile;
      localCurrency: string;
      localCurrencyMinorUnits: number; // ISO 4217: 0, 2, or 3
      enteredValueScale: number;       // 0 for US_CBP whole-dollar; matches minorUnits otherwise
      statutoryCustomsFxRate: string;  // Strictly 1 invoice_currency = X local_currency
      vatSettlementMode: VatSettlementMode;
      invoiceAmountDoc: string;
      intlFreightDoc: string;
      insuranceDoc: string;
      adValoremRate: string;
      exciseAmountLocal: string;
      incidentalCostsFirstDestLocal: string;
      importTaxRate: string;
      borderUserFee?: { rate: string; min: string; max: string };
      brokerageFeeLocal: string;
      outlayFeeRate: string;
      outlayFeeMinLocal: string;
      localServiceTaxRate: string;
    }
    
    export interface LedgerEntry {
      classification: 'DISBURSEMENT_BALANCE_SHEET' | 'REVENUE_PNL';
      chargeCode: 'IMPORT_DUTY' | 'BORDER_USER_FEE' | 'IMPORT_VAT_GST' | 'BROKERAGE_FEE' | 'OUTLAY_FEE';
      netAmount: string;
      localServiceTaxAmount: string;
    }
    
    export interface CustomsAuditResult {
      snapshotId: string;
      calculatedAtUtc: string;
      customsValueLocal: string;
      totalCashDisbursements: string;
      totalOperatingRevenue: string;
      totalClientInvoicePayable: string;
      ledgerEntries: LedgerEntry[];
      inputPayloadHash: string;
    }
    
    export function calculateCustomsAndDisbursements(input: CustomsTaxInput): CustomsAuditResult {
      const scale = input.localCurrencyMinorUnits;
      const payloadHash = createHash('sha256').update(JSON.stringify(input)).digest('hex');
    
      // 1. Multi-Jurisdiction Valuation (CIF_BORDER vs. FOB_ORIGIN)
      const isFobOrigin = input.jurisdictionProfile === 'US_CBP' || input.jurisdictionProfile === 'CA_CBSA';
      const docBase = isFobOrigin
        ? new Decimal(input.invoiceAmountDoc)
        : new Decimal(input.invoiceAmountDoc).plus(input.intlFreightDoc).plus(input.insuranceDoc);
    
      const cv = docBase
        .times(input.statutoryCustomsFxRate)
        .toDecimalPlaces(input.enteredValueScale, Decimal.ROUND_HALF_UP);
    
      // 2. Duties & Clamped Border User Fees
      const duty = cv.times(input.adValoremRate).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP);
      const borderFee = input.borderUserFee
        ? Decimal.min(
            input.borderUserFee.max,
            Decimal.max(input.borderUserFee.min, cv.times(input.borderUserFee.rate)),
          ).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP)
        : new Decimal(0);
    
      // 3. Cascading Import VAT / GST
      const incidentals = input.jurisdictionProfile === 'CA_CBSA'
        ? new Decimal(0)
        : new Decimal(input.incidentalCostsFirstDestLocal);
    
      const importTax = input.vatSettlementMode === 'NOT_APPLICABLE'
        ? new Decimal(0)
        : cv.plus(duty).plus(input.exciseAmountLocal).plus(incidentals)
            .times(input.importTaxRate)
            .toDecimalPlaces(scale, Decimal.ROUND_HALF_UP);
    
      // 4. Separate Balance Sheet Disbursements (0% tax) from P&L Revenue
      const ledgerEntries: LedgerEntry[] = [];
      let cashDisbursements = new Decimal(0);
    
      if (duty.gt(0)) {
        ledgerEntries.push({ classification: 'DISBURSEMENT_BALANCE_SHEET', chargeCode: 'IMPORT_DUTY', netAmount: duty.toFixed(scale), localServiceTaxAmount: (0).toFixed(scale) });
        cashDisbursements = cashDisbursements.plus(duty);
      }
      if (borderFee.gt(0)) {
        ledgerEntries.push({ classification: 'DISBURSEMENT_BALANCE_SHEET', chargeCode: 'BORDER_USER_FEE', netAmount: borderFee.toFixed(scale), localServiceTaxAmount: (0).toFixed(scale) });
        cashDisbursements = cashDisbursements.plus(borderFee);
      }
      if (input.vatSettlementMode === 'CASH_AT_BORDER' && importTax.gt(0)) {
        ledgerEntries.push({ classification: 'DISBURSEMENT_BALANCE_SHEET', chargeCode: 'IMPORT_VAT_GST', netAmount: importTax.toFixed(scale), localServiceTaxAmount: (0).toFixed(scale) });
        cashDisbursements = cashDisbursements.plus(importTax);
      }
    
      // 5. Taxable P&L Brokerage & Outlay Fees
      const brokerageFee = new Decimal(input.brokerageFeeLocal).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP);
      const outlayFee = cashDisbursements.gt(0)
        ? Decimal.max(input.outlayFeeMinLocal, cashDisbursements.times(input.outlayFeeRate)).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP)
        : new Decimal(0);
    
      const operatingRevenue = brokerageFee.plus(outlayFee);
      const serviceTaxTotal = operatingRevenue.times(input.localServiceTaxRate).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP);
    
      ledgerEntries.push({ classification: 'REVENUE_PNL', chargeCode: 'BROKERAGE_FEE', netAmount: brokerageFee.toFixed(scale), localServiceTaxAmount: brokerageFee.times(input.localServiceTaxRate).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP).toFixed(scale) });
      if (outlayFee.gt(0)) {
        ledgerEntries.push({ classification: 'REVENUE_PNL', chargeCode: 'OUTLAY_FEE', netAmount: outlayFee.toFixed(scale), localServiceTaxAmount: serviceTaxTotal.minus(brokerageFee.times(input.localServiceTaxRate).toDecimalPlaces(scale, Decimal.ROUND_HALF_UP)).toFixed(scale) });
      }
    
      return {
        snapshotId: randomUUID(),
        calculatedAtUtc: new Date().toISOString(),
        customsValueLocal: cv.toFixed(input.enteredValueScale),
        totalCashDisbursements: cashDisbursements.toFixed(scale),
        totalOperatingRevenue: operatingRevenue.toFixed(scale),
        totalClientInvoicePayable: cashDisbursements.plus(operatingRevenue).plus(serviceTaxTotal).toFixed(scale),
        ledgerEntries,
        inputPayloadHash: payloadHash,
      };
    }
    

    Recommended Next Steps

    1. Connect Official Tariff & FX Feeds:
      Bind statutoryCustomsFxRate to official monthly customs tables (EU_UCC / UK_GLOBAL) or export-date FX feeds (US_CBP / CA_CBSA).
    2. Add NCTS T1 / In-Bond State Machine:
      Lock TransitGuaranteeHold on declaration issuance and unlock strictly upon confirmed customs discharge (IE045 or In-Bond acquittal).
    3. Add 1:N Largest Remainder Allocator:
      Attribute duties directly by tariff line and prorate shared clearance fees across HBL/HAWB records so line sums match the official invoice to the exact minor unit.

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

    About this skill

    Customs Tax & Disbursements Architect — Multi-Jurisdiction Valuation, Import Tax & Pass-Through Accounting

    Production-grade customs valuation, cascading import tax math, bonded transit guarantee state machines, and Balance Sheet disbursement accounting for AI coding agents.

    Value Proposition

    Generic LLMs routinely break customs and freight-forwarding ERP backends: they hardcode CIF valuation onto FOB-origin jurisdictions (like US CBP or Canada CBSA), apply daily commercial spot FX instead of statutory customs exchange rates, omit duties and THC from cascading Import VAT bases, bill deferred reverse-charge VAT as cash, and book pass-through customs disbursements (suplidos / débours) as operating revenue—destroying gross margin reporting.

    customs-tax-disbursements-architect equips your AI coding agent with deterministic, multi-jurisdiction domain rules covering EU UCC, UK Global, US CBP, Canada CBSA, and Rest-of-World CIF regimes—complete with ISO 4217 multi-currency rounding, NCTS T1 / In-Bond guarantee lifecycles, and an immutable general-ledger data contract.

    • Multi-Jurisdiction by Design: Explicit branching between CIF_BORDER (EU-27, UK, APAC/LATAM) and FOB_ORIGIN (US, Canada) with full Incoterms® 2020 adjustment matrices.
    • True Margin Protection: Strict 3-part pass-through test separating 0%-tax Balance Sheet disbursements (disbursements, suplidos, débours, durchlaufende Posten) from taxable P&L brokerage and outlay fees.
    • ISO 4217 & Statutory Precision: Fixed-point DECIMAL(18,6) intermediate math, canonical JSON serialization, ISO 4217 minor-unit rounding (0/2/3 decimals), and field-level whole-dollar Entered Value support for US CBP Form 7501.
    • Stack-Agnostic & Ready to Test: Pure domain logic and a side-by-side synthetic worked example (EU CASH_AT_BORDER, EU DEFERRED_REVERSE_CHARGE, and US FOB_ORIGIN) ready to convert directly into unit tests.

    Target Audience

    • Freight Forwarding & Logistics SaaS Teams building customs brokerage and billing modules.
    • ERP & Accounting Engineers separating pass-through trade tax disbursements from operating revenue and COGS.
    • Customs Brokerage & Trade Tech Architects implementing multi-country duty/VAT engines and NCTS T1 guarantee tracking.
    • Cross-Border E-Commerce & Supply Chain Teams automating landed-cost and import tax provisioning.

    What's Included

    • 5 Multi-Jurisdiction Profiles: EU_UCC (EUR & non-EUR EU-27), UK_GLOBAL (GBP + PVA), US_CBP (USD + whole-dollar Entered Value + clamped user fees), CA_CBSA (CAD + GST on Duty-Paid Value), and GENERIC_CIF.
    • Incoterms® 2020 Matrix: Exact valuation additions and deductions for EXW through DDP under both CIF_BORDER and FOB_ORIGIN.
    • Import Tax Settlement Branching: CASH_AT_BORDER, DEFERRED_REVERSE_CHARGE (EU reverse charge / UK PVA), and NOT_APPLICABLE.
    • Complete Calculation Algorithms: Customs Value, Ad Valorem / Specific / ADD-CVD Duties, Clamped Border User Fees, Cascading Import VAT/GST, Outlay Fee Floors, Transit Guarantee Locks, and 1:N Largest Remainder (Hamilton) Allocation.
    • 6-Entity Normalized JSON Data Contract: CustomsDeclaration, TariffLine, DisbursementLedgerEntry, TransitGuaranteeHold, AllocationLine, and AuditSnapshot.
    • 9 Production Gotchas: Engineering guardrails against FX quote inversion, spot FX misuse, margin distortion, premature T1 guarantee release, and duty proration errors.

    Requires external reference data supplied by your system (official tariff schedules such as EU TARIC, UKGT, USITC HTS, or CBSA; statutory customs exchange rate tables; and active VAT/GST or border user-fee bounds). Provides deterministic architecture, tax math, and accounting contracts only—does not connect directly to customs EDI/NCTS/ACE portals or constitute formal customs or tax 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.

    No permissions are required. This skill is a pure domain architecture, mathematical specification, and accounting data contract that runs entirely inside the AI agent's context with zero external access.

    Permissions

    No special permissions declared or detected

    Listed13 days ago

    What's inside

    Frequently Asked Questions

    It natively supports multi-jurisdiction profiles covering CIF-border regimes (EU UCC across EUR and non-EUR Member States, UK Global, and generic APAC/LATAM CIF) as well as FOB-origin regimes (US CBP with whole-dollar Entered Value and clamped border user fees, plus Canada CBSA GST on Duty-Paid Value).

    It enforces a strict 3-part pass-through test (issued in the importer's name, 0% markup, outside service tax base) that routes official duties, border user fees, and cash-at-border import VAT to a Balance Sheet clearing account (disbursements / suplidos / débours), while keeping brokerage fees and advancement/outlay fees on the P&L.

    New in Finance & Accounting

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