Skip to content

Commit 68dc625

Browse files
committed
chore: update claude skill to use unified method
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent d06f192 commit 68dc625

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

  • .claude/skills/scaffold-snowflake-connector

.claude/skills/scaffold-snowflake-connector/SKILL.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Ask the user:
9393
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.
9494

9595
If the path doesn't exist or they need to clone:
96-
> "Run: `git clone git@github.com:linuxfoundation/crowd.dev.git`
96+
> "Run: `git clone https://github.com/linuxfoundation/crowd.dev.git`
9797
> Then provide the path to the cloned directory."
9898
9999
Wait for a valid path before continuing.
@@ -307,12 +307,13 @@ Example format for an ambiguity:
307307
308308
### 3a. Identity Mapping
309309
310-
**Rule:** Every member record must produce at least one identity with `type: MemberIdentityType.USERNAME`. The fallback chain is (try in order):
311-
1. Platform-native username column from schema
312-
2. LFID column value (used as username on `PlatformType.LFID`)
313-
3. Email value used as the platform USERNAME (last resort)
310+
**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).
314311
315-
If Pre-Analysis resolved email, username, and LFID columns with HIGH confidence and the user confirmed them, skip to the summary step below.
312+
The unified method covers the standard fallback chain automatically:
313+
1. If `platformUsername` is non-null → EMAIL identity + USERNAME identity for the platform; if null → email value used as USERNAME fallback
314+
2. If `lfUsername` is non-null → additional USERNAME identity for `PlatformType.LFID`
315+
316+
If Pre-Analysis resolved email, platformUsername, and LFID columns with HIGH confidence and the user confirmed them, skip to the summary step below.
316317
317318
For any unresolved identity field, use this pattern:
318319
- **Multiple candidates found**: "I see columns `A` and `B` that could be the email — which one?" (present choices, not open-ended)
@@ -325,8 +326,10 @@ For each confirmed identity column also confirm:
325326
326327
**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.
327328
328-
After all identity fields are confirmed, summarize the full identity-building logic and ask:
329-
> "Here is how identities will be built: [summary]. Does this look correct?"
329+
After all identity fields are confirmed, summarize how `buildMemberIdentities()` will be called and ask:
330+
> "Here is how identities will be built:
331+
> `this.buildMemberIdentities({ email, sourceId, platformUsername: [col], lfUsername: [col] })`
332+
> Does this look correct?"
330333
331334
---
332335
@@ -578,11 +581,13 @@ File: `services/apps/snowflake_connectors/src/integrations/{platform}/{source}/t
578581
- All string comparisons must be case-insensitive: use `.toLowerCase()` on both sides of comparison only; preserve the original value in the output
579582
- No broad `else` statements — every branch must have an explicit condition
580583
- All column names referenced in code must exactly match the schema registry — never assumed
581-
- Identity fallback chain (always produces at least one USERNAME identity):
582-
1. If platform-native username column present and non-null → push EMAIL + USERNAME identities for platform
583-
2. Else if LFID present and non-null → push EMAIL for platform + LFID value as USERNAME for platform
584-
3. Else → push EMAIL value as USERNAME for platform (email-as-username)
585-
- After building platform identities, if LFID column is present and non-null → push separate LFID identity: `{ platform: PlatformType.LFID, value: lfid, type: MemberIdentityType.USERNAME, ... }`
584+
- **Identity building — always use `this.buildMemberIdentities()` first (preferred):**
585+
- Call `this.buildMemberIdentities({ email, sourceId?, platformUsername?, lfUsername? })` from `TransformerBase`
586+
- `platformUsername` = the platform-native username column (null if absent)
587+
- `lfUsername` = the LFID column value (null if absent)
588+
- The method handles the full fallback chain automatically: EMAIL+USERNAME when platformUsername present, email-as-USERNAME fallback otherwise, plus optional LFID identity
589+
- Do NOT import `IMemberData` or `MemberIdentityType` in the transformer — those are only needed if falling back to inline construction
590+
- **Only use inline identity construction if the user explicitly requests it and justifies why `buildMemberIdentities()` cannot be used** (e.g., non-standard identity shape not covered by the method). Document the justification in a comment.
586591
- `isIndividualNoAccount` must call `this.isIndividualNoAccount(displayName)` from `TransformerBase` — never reimplement
587592
- **Do not set member attributes** (e.g., `MemberAttributeName.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 exactly
588593
- Extends the platform base class if one was confirmed in Phase 3e; otherwise extends `TransformerBase` directly

0 commit comments

Comments
 (0)