$npx -y skills add forcedotcom/sf-skills --skill omnistudio-dependencies-analyzeCross-cutting OmniStudio analysis skill for namespace detection, dependency visualization, and impact analysis across OmniScripts, FlexCards, Integration Procedures, and Data Mappers. TRIGGER when: user asks about OmniStudio dependencies, wants namespace detection (Core vs vlocit
| 1 | # omnistudio-dependencies-analyze: OmniStudio Cross-Component Analysis |
| 2 | |
| 3 | Expert OmniStudio analyst specializing in namespace detection, dependency mapping, and impact analysis across the full OmniStudio component suite. Performs org-wide inventory of OmniScripts, FlexCards, Integration Procedures, and Data Mappers with automated dependency graph construction and Mermaid visualization. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Scope |
| 8 | |
| 9 | - **In scope**: Namespace detection (Core / vlocity_cmt / vlocity_ins), org-wide component inventory, dependency graph construction, impact analysis, Mermaid diagram generation |
| 10 | - **Out of scope**: Authoring or modifying OmniScripts (use `omnistudio-omniscript-generate`), building FlexCards (use `omnistudio-flexcard-generate`), creating Integration Procedures (use `omnistudio-integration-procedure-generate`), configuring Data Mappers (use `omnistudio-datamapper-generate`) |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## Required Inputs |
| 15 | |
| 16 | Ask for or infer before starting: |
| 17 | |
| 18 | | Input | Default if not provided | |
| 19 | |-------|------------------------| |
| 20 | | Target org alias | Ask the user | |
| 21 | | Analysis scope | Full org (all OmniStudio component types) | |
| 22 | | Specific component to impact-analyze | None (produce full inventory first) | |
| 23 | | Output format preference | All three: Mermaid diagram + JSON summary + human-readable report | |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | ## Output Expectations |
| 28 | |
| 29 | Each analysis run produces one or more of: |
| 30 | |
| 31 | 1. **Namespace detection result** — which namespace is active (Core / vlocity_cmt / vlocity_ins / not installed) |
| 32 | 2. **Component inventory** — counts of OmniScripts, Integration Procedures, FlexCards, Data Mappers (active vs draft) |
| 33 | 3. **Dependency graph** — directed edges between all OmniStudio components with edge type labels |
| 34 | 4. **Mermaid diagram** — copy-pasteable Mermaid `graph LR` block for documentation |
| 35 | 5. **JSON summary** — machine-readable namespace + components + dependencies + impact analysis |
| 36 | 6. **Human-readable report** — plain-text summary with component counts, edge count, circular references, and most-depended components |
| 37 | 7. **Circular reference warnings** — cycle path and risk statement for each detected cycle |
| 38 | |
| 39 | --- |
| 40 | |
| 41 | ## Core Responsibilities |
| 42 | |
| 43 | 1. **Namespace Detection**: Identify whether an org uses Core (Industries), vlocity_cmt (Communications, Media & Energy), or vlocity_ins (Insurance & Health) namespace |
| 44 | 2. **Dependency Analysis**: Build directed graphs of cross-component dependencies using BFS traversal with circular reference detection |
| 45 | 3. **Impact Analysis**: Determine which components are affected when a given OmniScript, IP, FlexCard, or Data Mapper changes |
| 46 | 4. **Mermaid Visualization**: Generate dependency diagrams in Mermaid syntax for documentation and review |
| 47 | 5. **Org-Wide Inventory**: Catalog all OmniStudio components by type, status, language, and version |
| 48 | |
| 49 | --- |
| 50 | |
| 51 | > **CRITICAL: Orchestration Order** |
| 52 | > |
| 53 | > When multiple OmniStudio skills are involved, follow this dependency chain: |
| 54 | > |
| 55 | > `omnistudio-dependencies-analyze` → `omnistudio-datamapper-generate` → `omnistudio-integration-procedure-generate` → `omnistudio-omniscript-generate` → `omnistudio-flexcard-generate` |
| 56 | > |
| 57 | > This skill runs first to establish namespace context and dependency maps that downstream skills consume. |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Key Insights |
| 62 | |
| 63 | | Insight | Detail | |
| 64 | |---------|--------| |
| 65 | | Three namespaces coexist | Core (OmniProcess), vlocity_cmt (vlocity_cmt__OmniScript__c), vlocity_ins (vlocity_ins__OmniScript__c) | |
| 66 | | Dependencies are stored in JSON | PropertySetConfig (elements), Definition (FlexCards), InputObjectName/OutputObjectName (Data Mappers) | |
| 67 | | Circular references are possible | OmniScript A → IP B → OmniScript A via embedded call | |
| 68 | | FlexCard data sources are typed | `dataSource.type === 'IntegrationProcedures'` (plural) in DataSourceConfig JSON | |
| 69 | | Active vs Draft matters | Only active components participate in runtime dependency chains | |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Workflow (4-Phase Pattern) |
| 74 | |
| 75 | ### Phase 1: Namespace Detection |
| 76 | |
| 77 | **Purpose**: Determine which OmniStudio namespace the org uses before querying any component metadata. |
| 78 | |
| 79 | **Detection Algorithm** — Probe objects in order until a successful COUNT() returns: |
| 80 | |
| 81 | 1. **Core (Industries namespace)**: |
| 82 | ```soql |
| 83 | SELECT COUNT() FROM OmniProcess |
| 84 | ``` |
| 85 | If this succeeds, the org use |