agentleFS
lyticslytics/agent-skills/integration-advisor/SKILL.md

integration-advisor

Skill4 starsChanged 7 months agoMITView on GitHub

Strategic guidance for setting up the right data integration -- workflow selection, field mapping, and configuration. Use when the user needs help choosing the right integration approach, wants advice on field mapping, or needs to plan a data integration.

  • Sends data out

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If valid auth exists for this provider, plan to reuse it

    line 62
  2. Distinctive:

    If a connection exists, check if it's suitable

    line 63
  3. Distinctive:

    If no auth exists, guide the user based on auth method:

    line 64
  4. Distinctive:

    If multiple workflows could apply, explain the tradeoffs:

    line 78
  5. Distinctive:

    If the user mentioned a segment, verify it exists:

    line 127
  6. Distinctive:

    If no segment specified for an export, suggest:

    line 133
  7. Distinctive:

    Create resources in dependency order:

    line 171
  8. Distinctive:

    After creation, check job status:

    line 190
  9. Distinctive:

    Connection scan fails: Check auth credentials, network access to external system

    line 233

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Integration Advisor

Purpose

Guides users from "I want to connect X" to a fully configured, running integration. Goes beyond basic CRUD to advise on which workflow to use, how to map fields intelligently, and how to configure the integration for their specific use case. Lytics has 110+ providers with different auth methods, config shapes, and field mapping patterns -- the advisor navigates this complexity.

Supports:

  • Exports: "Export my high-value audience to Facebook Custom Audiences"
  • Imports: "Import contacts from Salesforce"
  • Enrichment: "Enrich profiles with Clearbit data"

Environment

Requires authenticated API access. See ../references/auth.md for credential resolution.

Integration Architecture

Integrations follow a three-layer model:

Provider -- what platform
  → Auth -- how to authenticate
    → Connection -- optional, for data source integrations
      → Job -- what to do, runs a specific workflow

Flow

Step 1: Understand the Goal

Classify the user's intent:

  • Platform name (Facebook, Salesforce, Google, etc.)
  • Direction: import, export, or enrichment
  • Data type: audiences, events, profiles, conversions
  • Any specific segment references

Step 2: Discover Provider

curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/provider" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

Find the matching provider by name. If ambiguous, show matching providers and ask user to select. Note whether the provider shows is_connected: true (auth already exists).

Step 3: Check Existing Auth and Connections

# Check for existing auth credentials
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/auth" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

# Check for existing connections
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/connection" \
  -H "Authorization: ${LYTICS_API_TOKEN}"
  • If valid auth exists for this provider, plan to reuse it
  • If a connection exists, check if it's suitable
  • If no auth exists, guide the user based on auth method:
Auth MethodGuidance
OAuth2"You'll need to complete the OAuth flow in your browser. Go to Settings > Integrations > [Platform] in the Lytics UI to authorize. Once connected, I can set up the job."
API Key"You'll need your API key from [Platform]. I can create the auth once you have it."
Credentials"You'll need your username and password for [Platform]."

Important: OAuth flows cannot be completed in the CLI. Always direct users to the Lytics UI for OAuth authorization, then pick up the created auth_id via the API.

Step 4: Recommend Workflow

Each provider may have multiple workflows. Recommend the right one based on the user's goal:

If multiple workflows could apply, explain the tradeoffs:

"Facebook has two export options:

  1. Custom Audiences -- syncs a segment as a Facebook audience for ad targeting
  2. Conversion API -- sends conversion events for attribution

For your goal of retargeting lapsed users, Custom Audiences is the right choice."

Step 5: Analyze Field Mappings

For exports -- cross-reference Lytics schema against the target platform's accepted fields:

curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/schema/user/field" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

Suggest mappings based on field name similarity and type compatibility. Check field coverage in the target segment to predict match rates:

"I'll map these Lytics fields to Facebook:

  • email -> EMAIL (92% coverage -- good for match rates)
  • first_name -> FN (85% coverage)
  • last_name -> LN (85% coverage)
  • phone -> PHONE (45% coverage -- supplementary matches)"

For imports -- scan the external data source schema:

# List tables in the connection
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/connection/${CONNECTION_ID}/schema" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

# Get column schema for a specific table
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/connection/${CONNECTION_ID}/schema/${TABLE}" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

# Sample data to verify
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/connection/${CONNECTION_ID}/scan" \
  -H "Authorization: ${LYTICS_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"query": "SELECT * FROM table LIMIT 5", "primary_keys": ["user_id"]}'

Suggest field mappings from external columns to Lytics schema fields:

  • Auto-match by name similarity (e.g., email_address -> email)
  • Flag potential identity fields (email, user_id, phone)
  • Warn about unmapped fields and suggest whether to include them

Step 6: Check Segment (for exports)

If the user mentioned a segment, verify it exists:

curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment?table=user&sizes=true" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

If no segment specified for an export, suggest:

"You'll need a segment to export. Would you like me to help you build one? I can analyze your data and recommend the best audience for your goal." Then hand off to audience-advisor skill or audience-builder skill.

Step 7: Build Job Config and Confirm

Assemble the complete job configuration and present using the confirmation-gate pattern:

## Proposed Integration: Export High-Value Users to Facebook Custom Audiences

**Workflow**: facebook_custom_audiences
**Auth**: Facebook OAuth (connected as marketing@acme.com)
**Segment**: High Value Customers (12,400 users)

**Field Mappings**:
  email -> EMAIL
  first_name -> FN
  last_name -> LN

**Schedule**: Continuous sync

Then show the raw API payload:

{
  "name": "Export High Value to Facebook",
  "workflow": "facebook_custom_audiences",
  "config": {
    "segment_id": "abc123",
    "field_mappings": { ... }
  },
  "auth_ids": ["auth_456"]
}

Step 8: Execute on Approval

Create resources in dependency order:

# Create job
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/job/${WORKFLOW}" \
  -H "Authorization: ${LYTICS_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ ... approved config ... }'

For imports that need a new connection, create the connection first:

curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/connection" \
  -H "Authorization: ${LYTICS_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ ... connection config ... }'

Step 9: Verify

After creation, check job status:

curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/job/${JOB_ID}" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/job/${JOB_ID}/logs" \
  -H "Authorization: ${LYTICS_API_TOKEN}"

Report initial status and suggest monitoring:

"Job created and running. Initial status: active. Check back in a few minutes for first sync results, or ask me to check job status later."

Common Integration Patterns

GoalWorkflow TypeKey Config
Retarget audience in adsExport - Custom Audiencessegment_id, field mappings
Send conversion eventsExport - Conversion APIevent mappings, pixel/tag ID
Import CRM contactsImport - Contact syncobject type, field mappings, identity field
Import behavioral eventsImport - Event streamevent type, timestamp field
Sync to email platformExport - List syncsegment_id, list ID, field mappings
Warehouse exportExport - Table writedataset, table, write mode, partition

Field Mapping Heuristics

Common Lytics-to-platform field mappings:

Lytics FieldFacebookGoogle AdsSalesforceGeneral
emailEMAILhashedEmailEmailemail
first_nameFNfirstNameFirstNamefirst_name
last_nameLNlastNameLastNamelast_name
phonePHONEhashedPhonePhonephone
countryCOUNTRYcountryCodeMailingCountrycountry
cityCTcityMailingCitycity
zipZIPzipCodeMailingPostalCodepostal_code

Error Handling

  • Provider not found: List similar providers, ask user to clarify
  • No auth exists: Guide to Lytics UI for OAuth, or help create API key auth
  • Auth expired: Suggest re-authorizing in the Lytics UI
  • No matching workflow: List available workflows for the provider
  • Segment not found: Suggest creating one with audience-builder or audience-advisor
  • Connection scan fails: Check auth credentials, network access to external system
  • Job creation fails: Parse error, check required config fields

Dependencies

  • Composes: connection-manager skill, job-manager skill, schema-discovery skill, ../references/confirmation-gate.md
  • References: ../references/auth.md
  • Related: audience-advisor skill, audience-builder skill (for creating segments to export)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.