Skip to content
Skillv1.0.0

clari-upgrade-migration

Handle Clari API version changes and export schema migrations. Use when Clari updates their API, export format changes, or migrating from v3 to v4 API. Trigger with phrases like "upgrade clari", "clar

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (plugins/saas-packs/clari-pack/skills/clari-upgrade-migration/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill clari-upgrade-migration. Copyright stays with the author (MIT).

Clari Upgrade & Migration

Overview

Handle Clari API changes: version migrations, export schema updates, and Copilot API adoption.

Prerequisites

  • Current and target API/schema versions recorded in change control
  • Representative non-production exports and an approved compatibility baseline
  • Version-pinned client, warehouse migration, and rollback paths
  • Data-owner approval for any field, retention, or analytics semantic change

Instructions

Step 1: Check Current API Version

# v4 is the current version
curl -s -H "apikey: ${CLARI_API_KEY}" \
  https://api.clari.com/v4/export/forecast/list | jq .

# If using v3 (deprecated), migrate to v4

Step 2: Schema Change Detection

def detect_schema_changes(
    current_export: dict, expected_fields: set[str]
) -> dict:
    if not current_export.get("entries"):
        return {"status": "empty", "changes": []}

    actual_fields = set(current_export["entries"][0].keys())
    new_fields = actual_fields - expected_fields
    removed_fields = expected_fields - actual_fields

    return {
        "status": "changed" if new_fields or removed_fields else "compatible",
        "new_fields": list(new_fields),
        "removed_fields": list(removed_fields),
    }

# Track expected schema
EXPECTED_FIELDS = {
    "ownerName", "ownerEmail", "forecastAmount", "quotaAmount",
    "crmTotal", "crmClosed", "adjustmentAmount", "timePeriod"
}

Step 3: Database Schema Migration

-- Add new columns when Clari adds export fields
ALTER TABLE clari_forecasts ADD COLUMN IF NOT EXISTS new_field_name VARCHAR;

-- Backfill historical data
UPDATE clari_forecasts SET new_field_name = 'default' WHERE new_field_name IS NULL;

Rollback

Keep the previous client version alongside the new one until migration is verified:

# Pin client to specific behavior
client_v4 = ClariClient(ClariConfig(api_key=api_key, base_url="https://api.clari.com/v4"))

Error Handling

Condition Response
Source removes or renames a field Block promotion, update the compatibility contract, and revalidate transformations.
Backfill produces unexpected values Stop the migration, preserve the prior certified table, and investigate with redacted samples.
New client or endpoint fails Restore the pinned prior client and record the provider/job evidence.
Schema is empty or ambiguous Do not infer compatibility; obtain an approved source contract or defer the change.

Output

Create a migration receipt with source/target versions, detected fields, compatibility decision, tested transform, backfill counts, validation evidence, rollback result, and named approver. Keep live credentials and raw forecast values out of the receipt.

Examples

Detect a new export field in staging, add it behind a nullable warehouse migration, compare redacted records with the prior client, and verify the analytics contract before promotion. If a mandatory field disappears, retain the previous client and certified dataset while the data owner decides the new semantic mapping.

Resources

Next Steps

For CI integration, see clari-ci-integration.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clari-upgrade-f1ed8e/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-clari-upgrade-f1ed8e.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-clari-upgrade-f1ed8e",
  "kind": "skill",
  "name": "clari-upgrade-migration",
  "description": "Handle Clari API version changes and export schema migrations. Use when Clari updates their API, export format changes, or migrating from v3 to v4 API. Trigger with phrases like \"upgrade clari\", \"clari api migration\", \"clari schema change\", \"clari v4 migration\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "revenue-intelligence",
      "forecasting",
      "clari",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Handle Clari API version changes and export schema migrations. Use when Clari updates their API, export format changes, or migrating from v3 to v4 API. Trigger with phrases like \"upgrade clari\", \"clari api migration\", \"clari schema change\", \"clari v4 migration\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/clari-pack/skills/clari-upgrade-migration/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/clari-pack/skills/clari-upgrade-migration/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/clari-pack/skills/clari-upgrade-migration/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(curl:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Clari Upgrade & Migration\n\n## Overview\n\nHandle Clari API changes: version migrations, export schema updates, and Copilot API adoption.\n\n## Prerequisites\n\n- Current and target API/schema versions recorded in change control\n- Representative non-production exports and an approved compatibility baseline\n- Version-pinned client, warehouse migration, and rollback paths\n- Data-owner approval for any field, retention, or analytics semantic change\n\n## Instructions\n\n### Step 1: Check Current API Version\n\n```bash\n# v4 is the current version\ncurl -s -H \"apikey: ${CLARI_API_KEY}\" \\\n  https://api.clari.co",
  "cost": {
    "context_tokens": 823
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clari-upgrade-f1ed8e/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.