/lfx-skills:lfx-cdp-snowflake-connectorsfrom lfx-skills
Scaffolds a new Snowflake connector data source for crowd.dev, generating buildSourceQuery, transformer, activity types, migration, and type registrations across up to 11 touch points.
Ships in lfx-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill scaffolds all code required to add a new snowflake-connector data source to crowd.dev. It covers up to 11 touch points, enforces zero-assumption practices, and requires explicit user validation for every piece of business logic before writing any file to disk.
One platform, one source per run. Multiple sources within a platform are done one run at a time.
digraph scaffold {
"Phase 1: Initial Questions" [shape=box];
"Phase 2: Schema Collection" [shape=box];
"Pre-Analysis: Auto-Derive Mappings" [shape=box];
"Phase 3: Confirm / Correct Mappings" [shape=box];
"All mappings confirmed?" [shape=diamond];
"Phase 4: Generate & Review Files" [shape=box];
"User approves each file?" [shape=diamond];
"Phase 5: Testing" [shape=box];
"Done" [shape=doublecircle];
"Phase 1: Initial Questions" -> "Phase 2: Schema Collection";
"Phase 2: Schema Collection" -> "Pre-Analysis: Auto-Derive Mappings";
"Pre-Analysis: Auto-Derive Mappings" -> "Phase 3: Confirm / Correct Mappings";
"Phase 3: Confirm / Correct Mappings" -> "All mappings confirmed?";
"All mappings confirmed?" -> "Phase 3: Confirm / Correct Mappings" [label="no, revise"];
"All mappings confirmed?" -> "Phase 4: Generate & Review Files" [label="yes"];
"Phase 4: Generate & Review Files" -> "User approves each file?";
"User approves each file?" -> "Phase 4: Generate & Review Files" [label="no, revise"];
"User approves each file?" -> "Phase 5: Testing" [label="yes"];
"Phase 5: Testing" -> "Done";
}
Read the current state of each file before modifying. Never modify without reading first.
| # | File | Change |
|---|---|---|
| 0 | services/libs/types/src/enums/platforms.ts | Add PlatformType.{PLATFORM} enum value |
| # | File | Change |
|---|---|---|
| 1 | services/libs/types/src/enums/organizations.ts | Add to OrganizationSource + OrganizationAttributeSource enums |
| 2 | services/libs/integrations/src/integrations/{platform}/types.ts | NEW: activity type enum + GRID |
| 3 | services/libs/integrations/src/integrations/index.ts | Add export * from './{platform}/types' |
| 4 | services/libs/data-access-layer/src/organizations/attributesConfig.ts | Add to ORG_DB_ATTRIBUTE_SOURCE_PRIORITY |
| 5 | backend/src/database/migrations/V{epoch}__add{Platform}ActivityTypes.sql | NEW: INSERT into activityTypes |
| 6 | services/apps/snowflake_connectors/src/integrations/types.ts | Add DataSourceName.{PLATFORM}_{SOURCE} |
| 7 | services/apps/snowflake_connectors/src/integrations/index.ts | Import + register in supported |
| # | File | Change |
|---|---|---|
| 8 | services/apps/snowflake_connectors/src/integrations/{platform}/{source}/buildSourceQuery.ts | NEW |
| 9 | services/apps/snowflake_connectors/src/integrations/{platform}/{source}/transformer.ts | NEW |
| 10 | services/apps/snowflake_connectors/src/integrations/{platform}/{platform}TransformerBase.ts | NEW (optional) |
Run this once at skill start, before any other step.
Check whether the skill is running inside the crowd.dev repository by testing for the presence of the snowflake connectors integration index:
services/apps/snowflake_connectors/src/integrations/index.ts
Use Glob or Read to check for this file relative to the current working directory.
Set CROWD_DEV_ROOT = "." (current directory). All file paths in this skill are relative to CWD. Proceed to Phase 1 immediately.
Ask the user:
"This skill needs access to the crowd.dev repository to read and modify files. Do you have a local clone?
- If yes: provide the absolute path (e.g.,
/Users/you/work/crowd.dev)- If no: I'll give you the clone command first."
If the user provides a path: verify it by checking {path}/services/apps/snowflake_connectors/src/integrations/index.ts exists. If confirmed, set CROWD_DEV_ROOT = {path}. Proceed to Phase 1.
If the path doesn't exist or they need to clone:
"Run:
git clone https://github.com/linuxfoundation/crowd.dev.gitThen provide the path to the cloned directory."
Wait for a valid path before continuing.
For all subsequent file operations, prefix every path in this skill with CROWD_DEV_ROOT. Example: services/libs/types/src/enums/platforms.ts becomes {CROWD_DEV_ROOT}/services/libs/types/src/enums/platforms.ts.
Ask one question at a time. Do not bundle questions.
Read services/libs/types/src/enums/platforms.ts and list all current PlatformType values.
Ask:
"What is the platform name for this data source? It must match a
PlatformTypeenum value. Current values are: [list them]. If your platform isn't listed, provide the name and I'll add it."
"⚠️
{name}is not in thePlatformTypeenum. I'll need to add it toservices/libs/types/src/enums/platforms.ts. Please confirm this is a new platform and confirm the exact string value (e.g.,my-platform)." Wait for confirmation before proceeding.
Read services/apps/snowflake_connectors/src/integrations/index.ts.
Ask:
"What is the name for this data source? This becomes the directory name and
DataSourceNameenum suffix (e.g.,enrollments,event-registrations)."
Ask for the main table first, then any additional tables:
"What is the main Snowflake table for this source?"
Then:
"Are there any additional tables needed (e.g., for user data, org data, segment matching)? For each one, provide the table name and its purpose — what data it holds and how it relates to the main table."
Do not assume a direct JOIN between tables. The relation type (JOIN, subquery, CTE, lookup) must come from the user's description of each table's purpose.
Once all table names are known, collect column schemas using the LFX BI Layer MCP tools. Only fall back to the manual query when BI Layer lookup fails for a specific table.
⚠️ Data Privacy — real user data ahead. This phase asks the user to paste Snowflake results (or provide a path to an exported CSV/JSON/TSV, see the fallback in Step 3, Option B below) that will contain real emails, usernames, LFIDs, and org data. Read
../lfx/references/data-privacy.mdbefore proceeding. The rules for this skill:
- Use pasted or file-imported PII only to derive column mappings and validate transformer logic. Do not embed pasted values as example rows, comments, test fixtures, or docs into any file written to disk.
- Every column-mapping example, code comment, and generated fixture MUST use the safe alternatives from the reference (
[email protected],testuser01, reserved UUIDs). Never hard-code a real user's email or LFID intotransformer.tsorbuildSourceQuery.ts.- When the user provides a file path (Step 3, Option B): prefer a sanitized/minimized export (e.g., only the columns needed for mapping,
LIMIT 20, no full customer datasets). Read only what you need; do not copy the file into the repo or reference its path in generated code or docs; and remind the user to delete the export from disk once mapping is confirmed. Nevergit adda Snowflake export file.- If the generated code introduces logging (via
console.log, an existing logger, or athrow new Error(...)message), it MUST NOT include the user's email, LFID, name, or platform username. Note: in this skill, thesourceIdargument tobuildMemberIdentities()is the user ID column (see the transformer rules below at Touch Point 9), sosourceId— and any source column that is mapped tosourceIdin Phase 3's confirmed mapping, such asREGISTRATION_IDin the sample prompt below — is a linked pseudonym and is NOT a safe log fallback either. Log only correlators that do not locate an individual activity record: the CDPproject_slug, the batch or pipelinerun_id/ invocation identifier that groups many rows, or the source table name plus a coarse (day-level) time bucket that deliberately aggregates across many rows. Do NOT log row-level activity timestamps (e.g.,UPDATED_TS), source-row primary keys, or any "source-scoped resource ID" that pinpoints a single row — those join back to a person via the row's user-ID column and are linked pseudonyms per the canonical taxonomy (same rule asskills/lfx-data-engineer/SKILL.md§PII Hard Rules, macro-logging bullet). When a user-linked correlator is truly needed for a specific log line, emit a service-specific keyed-HMAC pseudonym per../lfx/references/data-privacy.md("Logging exception"), not a raw hash.- When in doubt (e.g., a column looks synthetic but might be a real handle), stop and ask the user before writing the file.
Use ToolSearch with query "LFX BI Layer get_all_sources" to check whether the BI Layer tools are available in the current session.
Tools found: proceed directly to Step 1.
Tools not found: prompt the user to authenticate:
"The LFX BI Layer MCP is not connected. To enable automatic schema lookup, run
/mcpand select 'claude.ai LFX BI Layer' to authenticate. Once done, say 'continue' and I'll proceed. Or say 'skip' to use the manual query approach instead."
Wait for the user's response. If they authenticate: re-check with ToolSearch and proceed to Step 1. If they skip or authentication still fails: proceed directly to Step 2 for all tables.
mcp__claude_ai_LFX_BI_Layer__get_all_sources. This returns all registered dbt sources.name field).mcp__claude_ai_LFX_BI_Layer__get_source_details using the uniqueId from Step 1. Extract the column registry from catalog.columns: each entry has name, type, and index (ordinal position).Generate the ACCOUNT_USAGE query for the missing tables and ask the user to run it:
SELECT DISTINCT
table_catalog,
table_schema,
table_name,
column_name,
data_type,
is_nullable,
ordinal_position
FROM SNOWFLAKE.ACCOUNT_USAGE.COLUMNS
WHERE (table_catalog, table_schema, table_name) IN (
('DB1', 'SCHEMA1', 'TABLE1')
-- one row per missing table
)
AND DELETED IS NULL
ORDER BY table_name, ordinal_position;
Ask the user to paste the output or provide a path to an exported file (CSV, JSON, or TSV). If a file path is given, read the file.
After Step 1 and/or Step 2, build a column registry per table:
Store this as the canonical column reference. Every column name used in generated code must appear in this registry. Never assume or invent a column name.
Flag non-VARCHAR column types (e.g., DATE, TIME, TIMESTAMP_TZ, BOOLEAN, NUMBER) — these arrive as native JS types from the Parquet reader, not strings (see touch point 9 rules).
For each JOIN table, check whether any existing transformer in services/apps/snowflake_connectors/src/integrations/ queries from the same table. If yes, inherit its column mappings; if no, treat every column as unknown and derive it from sample data in the Pre-Analysis step below.
Attempt to retrieve sample data via the LFX BI Layer before asking the user to run a manual query.
mcp__claude_ai_LFX_BI_Layer__list_metrics. Search the results for metrics whose name or description relates to the platform/source (e.g., total_committees, total_committee_members, total_enrollments).mcp__claude_ai_LFX_BI_Layer__get_dimensions to list available dimensions.mcp__claude_ai_LFX_BI_Layer__query_metrics with those dimensions and limit: 20.Important caveat: query_metrics queries semantic/transformed dbt models, not raw source tables. Column names in the result come from the semantic model and may differ from raw schema column names. Use the data to infer field roles and value patterns; map back to raw column names using the schema registry from Step 1–2.
If no relevant metrics are found, or the returned dimensions don't cover the fields needed for mapping, fall through to Option B.
Generate a sample data query using only explicit column names from the registry (never *), and per the Phase 2 data-privacy callout above, narrow the SELECT to the columns needed for mapping — do not request every column from every table. Use the Step 2 heuristics (below) to pick candidates: identity columns (EMAIL, USER_NAME, LOGIN, HANDLE, LF_USERNAME, LFID), org columns (ACCOUNT_NAME, COMPANY, ORGANIZATION), activity/timestamp columns (UPDATED*, MODIFIED*, CREATED*), and any _ID columns that are candidates for sourceId. Exclude free-text payloads (raw email bodies, comments, notes), base64/binary blob columns, huge JSON columns, and any column whose registry description does not suggest identity/org/activity/timestamp — these expand the PII exposure without helping mapping derivation. If a column's role is genuinely ambiguous from the registry alone (name and description don't disambiguate), add just that column to the SELECT and note the ambiguity to the user — one column at a time, not the entire row:
SELECT
-- Identity/org/activity candidates from the main table registry:
main.EMAIL, main.USER_NAME, main.LF_USERNAME,
main.ACCOUNT_NAME, main.UPDATED_TS, main.<candidate_id_col>,
-- Identity/org candidates from each JOIN table:
j1.<identity_or_org_cols_only>,
-- Omit: raw email bodies, notes, blob payloads, base64 fields, large JSON
FROM DB.SCHEMA.MAIN_TABLE main
LEFT JOIN DB.SCHEMA.JOIN_TABLE1 j1 ON main.join_key = j1.pk
-- ... joins limited to tables whose columns actually contribute to mapping
LIMIT 20;
Ask the user:
"Please run this query in Snowflake and paste the result or provide a path to the exported file (CSV, JSON, or TSV). I've limited the SELECT to identity/org/activity/timestamp candidates per the Phase 2 minimization rule; if a role is ambiguous and you want me to include another column, tell me and I'll widen the SELECT with your confirmation. I'll use the actual data values to auto-derive column mappings before asking for your confirmation."
Before asking the user any Phase 3 questions, perform this analysis using the schema registry, the pasted sample data, and existing implementations that query the same tables.
For each JOIN table, check if any existing transformer imports or queries from it. If found, inherit those column mappings directly — they are already validated.
Read the relevant transformer files from services/apps/snowflake_connectors/src/integrations/ and extract: which column maps to email, username, LFID, org name, org website, domain aliases, timestamp, sourceId.
For columns not covered by an existing implementation, apply these heuristics:
| Role | High-confidence signals |
|---|---|
Name contains EMAIL; values match [email protected] pattern | |
| Platform username | Name is USER_NAME, USERNAME, LOGIN, HANDLE; values are non-email strings |
| LFID | Name contains LF_USERNAME, LFID, LF_ID |
| Timestamp (incremental) | Type is TIMESTAMP; name contains UPDATED, MODIFIED; nullable=NO |
| sourceId | Name ends in _ID; values appear unique in sample |
| Org name | Name contains ACCOUNT_NAME, ORGANIZATION_NAME, COMPANY |
| Org website | Name contains WEBSITE, DOMAIN, URL; values start with http |
| Domain aliases | Name contains DOMAIN_ALIASES, ALIASES; values are comma-separated or array |
Assign each role a confidence level:
Present all HIGH-confidence mappings at once (exception to the one-question-per-message rule — batching is intentional here for efficiency). For MEDIUM, offer choices. For LOW/UNKNOWN, ask open-ended:
"Based on the schema and sample data, here's what I identified:
- Email:
USER_EMAIL(contains email values like[email protected]) ✅- Username:
USER_NAME✅- LFID:
LF_USERNAME✅- Timestamp:
UPDATED_TS(TIMESTAMP_NTZ, not nullable) ✅- sourceId:
REGISTRATION_ID(appears unique in sample) ✅- Org website:
ORG_WEBSITE✅- Org name:
ACCOUNT_NAMEorCOMPANY_NAME? (both present)- Domain aliases format: couldn't determine — comma-separated string or array?
Please confirm the ✅ items and resolve the open questions."
After the user responds, record all confirmed mappings. Skip any Phase 3 sub-step whose mappings are fully resolved here. Only enter a sub-step for fields that remain MEDIUM, LOW, or flagged by the user.
Rule: Skip sub-sections where Pre-Analysis fully resolved the mapping. For remaining sub-sections, use the propose-then-confirm pattern — never ask open-ended questions when a proposal can be made. Present choices when multiple candidates exist. Ask open-ended only when no inference is possible.
When raising any ambiguity, always include:
services/apps/snowflake_connectors/src/integrations/ and show the pattern. If an existing source skips or doesn't implement the feature, say so explicitly (e.g., "TNC doesn't use a logo field — it's left undefined").When raising any ambiguity that can be resolved by inspecting data, first try mcp__claude_ai_LFX_BI_Layer__query_metrics with the relevant dimensions and a where filter to narrow results. Only ask the user to run a manual Snowflake query if the semantic layer doesn't have dimensions covering the ambiguous columns.
Example format for an ambiguity:
"I see two timestamp columns:
CREATED_AT(nullable) andUPDATED_AT(not nullable).
- Existing sources (TNC, CVENT) all use a non-nullable
updated_ts-style column for incremental exports.- To check null rates, run:
SELECT COUNT(*) total, COUNT(CREATED_AT) created_not_null, COUNT(UPDATED_AT) updated_not_null FROM DB.SCHEMA.TABLE LIMIT 10000;Which column should be used as the incremental timestamp?"
Rule: Every member record must produce at least one identity with type: MemberIdentityType.USERNAME. The standard approach is to use the unified buildMemberIdentities() method on TransformerBase (added in the identity deduplication refactor). Only fall back to inline identity construction if the user explicitly requests it and can justify why the unified method cannot be used (e.g., fundamentally different identity shape not covered by the method's logic).
The unified method covers the standard fallback chain automatically. Full behavior by case:
platformUsername | lfUsername | Identities produced |
|---|---|---|
| null | null | EMAIL(platform) + USERNAME(platform, email) |
| set | null | EMAIL(platform) + USERNAME(platform, platformUsername) |
| null | set | EMAIL(platform) + USERNAME(LFID, lfUsername) + USERNAME(platform, lfUsername) |
| set | set | EMAIL(platform) + USERNAME(platform, platformUsername) + USERNAME(LFID, lfUsername) |
Critical: Never pass lfUsername as platformUsername. When a source only has an LFID column (no platform-native username), pass platformUsername: null — the lfUsername-only path (row 3 above) already produces the correct USERNAME identity for the platform using the lfUsername value.
If Pre-Analysis resolved email, platformUsername, and LFID columns with HIGH confidence and the user confirmed them, skip to the summary step below.
For any unresolved identity field, use this pattern:
A and B that could be the email — which one?" (present choices, not open-ended)USER_EMAIL is the email column based on its values. Confirm?" (one-tap confirmation)For each confirmed identity column also confirm:
verified: true? (default yes — ask only if the data suggests otherwise)verifiedBy value (default: platform type — propose it, don't ask open-ended)Critical: If a JOIN table for users is NOT the same table used by an existing implementation, validate every column explicitly regardless of Pre-Analysis confidence. Column name heuristics alone are not sufficient for unknown tables.
After all identity fields are confirmed, summarize how buildMemberIdentities() will be called and ask:
"Here is how identities will be built:
this.buildMemberIdentities({ email, sourceId: [col or null], platformUsername: [col or null], lfUsername: [col or null] })Does this look correct?"
If Pre-Analysis determined there is no org data (no org-related columns found in any table): before asking the user, first read existing transformers in services/apps/snowflake_connectors/src/integrations/ to check whether any of them join an org table using a key that also exists in the user's tables. If a match is found, prompt the user:
"I don't see org columns in the tables you provided, but [EXISTING_PLATFORM] sources org data from
{ORG_TABLE}via{join_key}— which also appears in your table. Did you mean to include this? (Recommended)"
If no existing pattern is joinable, ask: "I don't see any org columns. Does this source have org/company data?" — if yes, ask for the table; if no, skip to 3c.
If Pre-Analysis identified org columns:
buildOrganizations method and show the user exactly which columns will be used. Ask: "The org mapping follows the existing [PLATFORM] implementation — does this look correct?"ACCOUNT_NAME (values like Acme Corp). Confirm, or specify another column."ORG_WEBSITE (values start with http). Confirm?"DOMAIN_ALIASES — are these comma-separated strings or an array?"LOGO_URL. Confirm, or is there no logo column?"ORGANIZATION_INDUSTRY. Confirm?"ORGANIZATION_SIZE. Confirm?"Critical — isIndividualNoAccount:
Read services/apps/snowflake_connectors/src/core/transformerBase.ts to find isIndividualNoAccount. The generated code MUST call this method rather than reimplementing it. Show the user the method signature and confirm it will be used identically to existing sources.
After all org columns are confirmed, summarize and ask for confirmation before proceeding.
Rule: Activity type names and scores come entirely from the user. Do not suggest them.
Ask:
"Please list all activity types this source can produce. For each, provide:
- A short name (e.g.,
enrolled-certification)- A score from 1–10
I'll suggest the enum key, label, description, and flags for each one."
For each activity type the user provides, suggest the following one at a time, waiting for approval before moving to the next:
| Field | Suggestion rule |
|---|---|
| Enum key | SCREAMING_SNAKE_CASE version of the name (e.g., ENROLLED_CERTIFICATION) |
| String value | The name the user provided (kebab-case) |
| Label | Human-readable (e.g., Enrolled in certification) |
| Description | One sentence describing the event (follow the style in backend/src/database/migrations/V1771497876__addCventActivityTypes.sql and V1772556158__addTncActivityTypes.sql) |
isCodeContribution | false unless it involves code (check existing platforms — almost always false for non-GitHub sources) |
isCollaboration | false unless it is a collaborative activity |
Ask: "Does this look correct for {type_name}? Any changes?" before moving to the next type.
If Pre-Analysis already proposed these with HIGH confidence, present them with this explanation before asking for confirmation (never skip the explanation — it ensures the user understands the criticality):
"The timestamp column drives all incremental exports — records updated after the last export run are re-fetched using this column. It must never be null. The sourceId is the deduplication key — two records with the same sourceId produce only one activity. It must uniquely identify each logical event."
Then confirm the Pre-Analysis proposals:
Timestamp: "I identified UPDATED_TS (TIMESTAMP_NTZ, not nullable) as the incremental timestamp. Confirm?"
UPDATED_TS is marked nullable in the schema. Can it actually be null in practice? If yes, we need an alternative or a WHERE col IS NOT NULL guard." Wait for resolution.updated_ts, enrolled_at, created_at."sourceId: "I identified REGISTRATION_ID as the sourceId (appears unique in sample). Confirm, and is this guaranteed unique per logical event (not just per user)?"
sourceId."If this is the first and only source for this platform: no base class — transformer.ts extends TransformerBase directly and contains all logic inline (CVENT pattern). Do not propose a base class.
If the platform will have multiple sources (user confirmed more sources are planned or already exist):
services/apps/snowflake_connectors/src/integrations/{platform}/{platform}TransformerBase.ts exists.tncTransformerBase.ts). Ask for confirmation before creating.Ask:
"Please provide a
project_slugfrom CDP_MATCHED_SEGMENTS that has data in this Snowflake table. It should have a moderate number of records (ideally under a few thousand) and ideally cover all the activity types we're implementing. This slug will be used to restrict the test query and for the staging non-prod guard inbuildSourceQuery."
Before generating any files, ask the user:
"How would you like me to proceed with the implementation?
- A — Review mode: I show each file before writing it, you approve or request changes.
- B — Auto mode: I implement all files directly, then show a summary of everything written for a final review."
Proceed based on the user's choice. Read each target file before modifying it in both modes.
These are template-filled from confirmed inputs. No business logic reasoning required.
Touch point 0 — platforms.ts (only if new platform)
Add {PLATFORM} = '{platform-string}', to the PlatformType enum in alphabetical order among the non-standard entries.
Touch point 1 — organizations.ts
File: services/libs/types/src/enums/organizations.ts
Add to both enums:
OrganizationSource.{PLATFORM} = '{platform-string}'OrganizationAttributeSource.{PLATFORM} = '{platform-string}'Touch point 2 — {platform}/types.ts (new file)
File: services/libs/integrations/src/integrations/{platform}/types.ts
Template (fill with confirmed activity types and scores):
import { IActivityScoringGrid } from '@crowd/types'
export enum {Platform}ActivityType {
{ENUM_KEY} = '{string-value}',
// ... one entry per confirmed activity type
}
export const {PLATFORM}_GRID: Record<{Platform}ActivityType, IActivityScoringGrid> = {
[{Platform}ActivityType.{ENUM_KEY}]: { score: {score} },
// ... one entry per confirmed activity type
}
Touch point 3 — integrations/index.ts
File: services/libs/integrations/src/integrations/index.ts
Add before export * from './activityDisplayService':
export * from './{platform}/types'
Touch point 4 — attributesConfig.ts
File: services/libs/data-access-layer/src/organizations/attributesConfig.ts
Add OrganizationAttributeSource.{PLATFORM}, to the ORG_DB_ATTRIBUTE_SOURCE_PRIORITY array, positioned after the most recently added snowflake platform (currently after OrganizationAttributeSource.TNC).
Touch point 5 — Flyway migration (two new files)
Use a 10-digit second-epoch for the timestamp — run date +%s in terminal.
File A: backend/src/database/migrations/V{epoch_seconds}__add{Platform}ActivityTypes.sql
INSERT INTO "activityTypes" ("activityType", platform, "isCodeContribution", "isCollaboration", description, "label") VALUES
('{string-value}', '{platform-string}', {false|true}, {false|true}, '{description}', '{label}'),
-- ... one row per confirmed activity type, last row without trailing comma
('{string-value}', '{platform-string}', {false|true}, {false|true}, '{description}', '{label}');
File B: backend/src/database/migrations/U{epoch_seconds}__add{Platform}ActivityTypes.sql
Empty file — same timestamp and name as File A, prefix U instead of V. Matches the pattern used by existing migrations (e.g., U1771497876__addCventActivityTypes.sql).
Touch point 6 — snowflake_connectors/types.ts
File: services/apps/snowflake_connectors/src/integrations/types.ts
Add to DataSourceName enum:
{PLATFORM}_{SOURCE} = '{source-name}',
Touch point 7 — snowflake_connectors/index.ts
File: services/apps/snowflake_connectors/src/integrations/index.ts
Add import at top:
import { buildSourceQuery as {platform}{Source}BuildQuery } from './{platform}/{source}/buildSourceQuery'
import { {Platform}{Source}Transformer } from './{platform}/{source}/transformer'
Add to supported object under the platform key (create the key if new platform):
[PlatformType.{PLATFORM}]: {
sources: [
{
name: DataSourceName.{PLATFORM}_{SOURCE},
buildSourceQuery: {platform}{Source}BuildQuery,
transformer: new {Platform}{Source}Transformer(),
},
],
},
If the platform already exists, append to its sources array instead of creating a new key.
These are AI-generated from the confirmed column mappings. Apply all rules strictly.
Touch point 8 — buildSourceQuery.ts (new file)
File: services/apps/snowflake_connectors/src/integrations/{platform}/{source}/buildSourceQuery.ts
Rules (enforced — do not deviate):
table.* or table.* EXCLUDE (...) in new implementations — existing sources (TNC, CVENT) use these patterns but new sources should list columns explicitly to avoid parquet encoding/decoding issuesorg_accounts CTE (if org data present)CDP_MATCHED_SEGMENTS CTE (always)new_cdp_segments CTE (inside the sinceTimestamp branch only)sinceTimestamp is provided, UNION two queries:
> sinceTimestampnew_cdp_segments)QUALIFY ROW_NUMBER() OVER (PARTITION BY {sourceId_column} ORDER BY {dedup_key} DESC) = 1if (!IS_PROD_ENV) { select += \ AND {table}.{project_slug_column} = '{confirmed_project_slug}'` }`Show the full generated file and ask for confirmation before writing.
Touch point 9 — transformer.ts (new file)
File: services/apps/snowflake_connectors/src/integrations/{platform}/{source}/transformer.ts
Rules (enforced — do not deviate):
row.COLUMN as string. Snowflake types may arrive as native JS types after Parquet decoding (e.g., DATE → Date object, TIME → number in ms, BOOLEAN → boolean). Always check the Snowflake column type from the schema registry and handle the actual JS type the Parquet reader delivers — do not assume every column is a string..toLowerCase() on both sides of comparison only; preserve the original value in the outputelse statements — every branch must have an explicit conditionthis.buildMemberIdentities() first (preferred):
this.buildMemberIdentities({ email, sourceId, platformUsername, lfUsername }) from TransformerBasenull or undefined — never omit an argumentsourceId = the user ID column from the source table (undefined if the table has no user ID column)platformUsername = the platform-native username column (null if absent — do NOT substitute lfUsername here)lfUsername = the LFID column value (null if absent)lfUsername as platformUsername — when a source only has an LFID column, pass platformUsername: null; the method's lfUsername-only path already produces the correct platform USERNAME from the lfUsername valueIMemberData or MemberIdentityType in the transformer — those are only needed if falling back to inline constructionbuildMemberIdentities() cannot be used (e.g., non-standard identity shape not covered by the method). Document the justification in a comment.isIndividualNoAccount must call this.isIndividualNoAccount(displayName) from TransformerBase — never reimplementMemberAttributeName.JOB_TITLE, AVATAR_URL, COUNTRY) unless: (a) the user explicitly requested them, or (b) the same table and column are already used for that attribute in an existing implementation — in which case follow the existing pattern exactlyTransformerBase directlyShow the full generated file and ask for confirmation before writing.
Touch point 10 — {platform}TransformerBase.ts (new file, only if platform has multiple sources AND shared org logic — confirmed in Phase 3e)
File: services/apps/snowflake_connectors/src/integrations/{platform}/{platform}TransformerBase.ts
Model on tncTransformerBase.ts. Contains only the shared buildOrganizations logic. Abstract class that extends TransformerBase and sets readonly platform = PlatformType.{PLATFORM}.
If the platform has a single source, skip this file entirely — keep all logic in transformer.ts (CVENT pattern).
Show the full generated file and ask for confirmation before writing.
After all files are written, provide the user with a test query:
Take the buildSourceQuery output (without sinceTimestamp, so the full-load variant), substitute the non-prod project_slug guard with the confirmed project_slug, and add LIMIT 100:
-- Example shape (exact SQL comes from the generated buildSourceQuery):
WITH org_accounts AS (...),
cdp_matched_segments AS (...)
SELECT
-- all explicit columns
FROM {table} t
INNER JOIN cdp_matched_segments cms ON ...
WHERE t.{project_slug_column} = '{confirmed_project_slug}'
QUALIFY ROW_NUMBER() OVER (...) = 1
LIMIT 100;
Instruct the user:
"Please run this query directly in Snowflake and paste the result (JSON or CSV). I'll walk through each row and verify the transformer logic produces the expected
IActivityDatabefore we consider this done."
Note: the LFX BI Layer MCP does not support arbitrary SQL execution — the test query must be run manually in the Snowflake UI.
When the user pastes results, for each row:
IActivityData — replace real emails, LFIDs, platform usernames, GitHub/Discord/Slack handles, names, phone numbers, and any other PII from the canonical taxonomy (see ../lfx/references/data-privacy.md) with per-row tokens (<email:row1>, <username:row1>, <lfid:row1>) or reserved placeholders ([email protected], testuser01); never paste raw rows or pre-redaction IActivityData into chat, review artifacts, or files on diskIActivityData + segment slug (redacted per above)After all files are written, run format then lint from services/apps/snowflake_connectors:
cd services/apps/snowflake_connectors
pnpm run format
pnpm run lint
Fix any errors or warnings and re-run pnpm run lint until it reports no complaints. Do not proceed to the completion checklist until lint is clean.
Before declaring the implementation complete, verify every item:
table.* or table.* EXCLUDE (...) in any generated queryelse in any transformer.toLowerCase() on both sides of comparison)sourceId confirmed unique in test dataisIndividualNoAccount behavior verified matches existing sourcesThese apply throughout the entire skill execution. They are non-negotiable.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub linuxfoundation/lfx-skills --plugin lfx-skills20 skills in this plugin
/lfxLFX cross-repo topology and ownership router. Use when the task spans more than one LFX repo, asks "which repo owns X", "where does Y live", "what repos does this touch", "what consumes Z", or needs a peer-repo file path from inside a single repo. Loads per-repo configs when invoked from the LFX workspace root with a full task prompt; gives targeted cross-repo guidance when invoked from inside a single repo. Also answers LFX glossary and topology questions, and performs read-only discovery when the user asks whether a contract, API, event, field, workflow, or repo capability exists. Do not fire for single-repo implementation tasks where the active repo's own CLAUDE.md already governs (those belong to the repo's local skills). Do not fire for V2 platform composition, service classes, or cross-service handoffs (use `/lfx-skills:lfx-platform-architecture`), ITX wrapper plumbing (`/lfx-skills:lfx-itx-integration`), or Intercom app/Fin workflows (`/lfx-skills:lfx-intercom`).
/lfx-data-engineerGuide non-dbt developers through building PR-ready data models, tests, and transformations in the lf-dbt repo. Encodes the medallion architecture (bronze/silver/gold/platinum), Snowflake SQL conventions, sqlfluff formatting, dbt testing patterns, key macros, and data governance rules. Use this skill any time someone asks about writing dbt models, adding data tests, creating SQL transformations, fixing pipeline failures, or contributing to the lf-dbt repository.
/lfx-general-code-reviewThe general code-review method for LFX local reviews — correctness, security, data privacy, error handling, simplicity, naming, DRY, testing, performance and style, plus the target repo's own written conventions, rules and checklists — over the one explicit pinned range the caller supplies. Reads the repo's rules from the repo; carries none of its own. Loaded by the `general` background reviewer that `/lfx-skills:lfx-pre-pr-review` launches. Returns an ordinary Markdown review./lfx-git-setupInteractive setup guide for LFX contributors to configure Git for DCO signoff and GPG-signed commits. Use this skill whenever someone asks about setting up Git signing, DCO signoff, GPG keys for commits, configuring `~/.gitconfig` for signing, adding a GPG key to GitHub, or any variation of "how do I sign my commits?". Also trigger it when a user says their commits aren't showing as "Verified" on GitHub, when they're onboarding to an LFX project and need to meet contribution requirements, or when they ask about `git commit -s`, `--signoff`, `Signed-off-by`, or `commit.gpgSign`. This skill works for technical and non-technical users alike.
/lfx-intercomEverything Intercom for LFX — Angular app integration (code) and Fin AI optimization (support/CX). Use this skill for: adding or fixing Intercom in an LFX Angular app, auditing integrations against the LFX canonical pattern, correcting missing JWT pre-set, broken shutdown, missing Auth0 claim, wrong app IDs, or absent CSP entries — AND for Fin Guidance writing, Help Center optimization, resolution rate improvement, Fin escalation patterns, Copilot tips, Topics Explorer, Fin Attributes, daily review rituals, Fin best practices, and writing or reviewing support content (Intercom articles or LFX in-app docs pages). Routes to the right section based on context. Trigger on: any Intercom question, "Fin tips", "improve Fin", "Fin guidance", "Fin resolution rate", "Help Center optimization", "Copilot tips", "Angular Intercom", "IntercomService", "JWT Intercom", "Fin re-engagement", "Fin handoff", "write a Help Center article", "rewrite this article", "review this article", "article standards", "write a docs page", "update the docs", "in-app docs", or any Intercom-related support or development question.
/lfx-itx-integrationCentral explainer for how LFX V2 wrapper services integrate with ITX (the Linux Foundation IT backend) and with the legacy v1 system. Covers OAuth2 M2M to ITX via private key JWT assertion, v2 UUID to v1 Salesforce ID mapping via the NATS request/reply subject `lfx.lookup_v1_mapping`, v1 to v2 event sync via NATS JetStream KV bucket watchers, and the canonical `ITX_*` environment variable contract. Fires on prompts like "ITX", "OAuth2 M2M to ITX", "ID mapping v1 v2", "Salesforce SFID mapping", "v1 KV event sync", "lfx.lookup_v1_mapping", "ITX_CLIENT_ID", "ITX_CLIENT_PRIVATE_KEY", "ITX_AUDIENCE", "ITX_BASE_URL", "JetStream KV watcher", "v1 to v2 sync", "wrapper service ITX", "private key JWT assertion", "id mapper", "v1-objects bucket", "EVENT_STREAM_NAME", "EVENT_CONSUMER_NAME". Read-only; routes implementation work to the owning wrapper repo.
Other plugins' skills for the same job