Agent skill

Experience UI Bundle File Upload Generate

by forcedotcom in forcedotcom/sf-skills

MUST activate when the project contains a uiBundles//src/ directory and the task involves uploading, attaching, or dropping files.

Apache-2.0Auto-check passedBackend & APIs

Install Experience UI Bundle File Upload Generate

skills CLI
$ npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-file-upload-generate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills experience-ui-bundle-file-upload-generate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/experience-ui-bundle-file-upload-generate .claude/skills/experience-ui-bundle-file-upload-generate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
experience-ui-bundle-file-upload-generate
GitHub stars
1.1k
Token cost
~3k tokens
SKILL.md length
849 words
Files
1
Skills in repo
251
Repo updated
First seen
Licence
Apache-2.0

At a glance

MUST activate when the project contains a uiBundles//src/ directory and the task involves uploading, attaching, or dropping files.

  • Works in 6 steps: Install the package → Understand the three upload patterns → Build your custom UI → …
  • Adding file upload functionality to a UI bundle app
  • SKILL.md covers CRITICAL: This is an API-only…, 1. Install the package, 2. Understand the three upload… and 3. Build your custom UI, plus 9 more sections
  • Calls npm

What it does

Experience UI Bundle File Upload Generate is an agent skill from forcedotcom/sf-skills. MUST activate when the project contains a uiBundles//src/ directory and the task involves uploading, attaching, or dropping files. Use this skill when adding file upload functionality to a UI bundle app. Provides progress tracking and Salesforce ContentVersion integration. This feature provides programmatic APIs ONLY — build custom UI using the upload() API. ALWAYS use this instead of building file upload from scratch with FormData or XHR.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering File uploads and storage and CRM management. It works with Salesforce. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • Adding file upload functionality to a UI bundle app
  • Tasks that involve File uploads and storage
  • Tasks that involve CRM management

Example prompts

  • “/experience-ui-bundle-file-upload-generate”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Install the package
  2. Understand the three upload patterns
  3. Build your custom UI
  4. Track upload progress
  5. Cancel uploads (optional)
  6. Link to current user (special case)

What it can do on your machine

Read from SKILL.md and the folder at commit e5164d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Experience UI Bundle File Upload Generate loads about 3k tokens when it runs. Until then it costs about 122 tokens; SKILL.md has 849 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~122
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit e5164d9, republished under its Apache-2.0 licence (© forcedotcom). 849 words, ~3,034 tokens.

Download SKILL.mdSave it as .claude/skills/experience-ui-bundle-file-upload-generate/SKILL.md (or your agent's skills folder).
name
experience-ui-bundle-file-upload-generate
description
MUST activate when the project contains a uiBundles/*/src/ directory and the task involves uploading, attaching, or dropping files. Use this skill when adding file upload functionality to a UI bundle app. Provides progress tracking and Salesforce ContentVersion integration. This feature provides programmatic APIs ONLY — build custom UI using the upload() API. ALWAYS use this instead of building file upload from scratch with FormData or XHR.
metadata.version
1.0
metadata.domains
Experience
metadata.relatedSkills
experience-ui-bundle-salesforce-data-access

File Upload API (workflow)

When the user wants file upload functionality in a React UI bundle, follow this workflow. This feature provides APIs only — you must build the UI components yourself using the provided APIs.

CRITICAL: This is an API-only package

The package exports programmatic APIs, not React components or hooks. You will:

  • Use the upload() function to handle file uploads with progress tracking
  • Build your own custom UI (file input, dropzone, progress bars, etc.)
  • Track upload progress through the onProgress callback

Do NOT:

  • Expect pre-built components like <FileUpload /> — they are not exported
  • Try to import React hooks like useFileUpload — they are not exported
  • Look for dropzone components — they are not exported

The source code contains reference components for demonstration, but they are not available as imports. Use them as examples to build your own UI.

1. Install the package

bash
npm install @salesforce/ui-bundle-template-feature-react-file-upload

Dependencies are automatically installed:

  • @salesforce/ui-bundle (API client)
  • @salesforce/platform-sdk (data SDK; the old @salesforce/sdk-data name is dead — see the experience-ui-bundle-salesforce-data-access skill)

2. Understand the three upload patterns

Pattern A: Basic upload (no record linking)

Upload files to Salesforce and get back contentBodyId for each file. No ContentVersion record is created.

When to use:

  • User wants to upload files first, then create/link them to a record later
  • Building a multi-step form where the record doesn't exist yet
  • Deferred record linking scenarios
tsx
import { upload } from "@salesforce/ui-bundle-template-feature-react-file-upload";

const results = await upload({
  files: [file1, file2],
  onProgress: (progress) => {
    console.log(`${progress.fileName}: ${progress.status} - ${progress.progress}%`);
  },
});

// results[0].contentBodyId: "069..." (always available)
// results[0].contentVersionId: undefined (no record linked)
Pattern B: Upload with immediate record linking

Upload files and immediately link them to an existing Salesforce record by creating ContentVersion records.

When to use:

  • Record already exists (Account, Opportunity, Case, etc.)
  • User wants files immediately attached to the record
  • Direct upload-and-attach scenarios
tsx
import { upload } from "@salesforce/ui-bundle-template-feature-react-file-upload";

const results = await upload({
  files: [file1, file2],
  recordId: "001xx000000yyyy", // Existing record ID
  onProgress: (progress) => {
    console.log(`${progress.fileName}: ${progress.status} - ${progress.progress}%`);
  },
});

// results[0].contentBodyId: "069..." (always available)
// results[0].contentVersionId: "068..." (linked to record)
Pattern C: Deferred record linking (record creation flow)

Upload files without a record, then link them after the record is created.

When to use:

  • Building a "create record with attachments" form
  • Record doesn't exist until form submission
  • Need to upload files before knowing the final record ID
tsx
import {
  upload,
  createContentVersion,
} from "@salesforce/ui-bundle-template-feature-react-file-upload";

// Step 1: Upload files (no recordId)
const uploadResults = await upload({
  files: [file1, file2],
  onProgress: (progress) => console.log(progress),
});

// Step 2: Create the record
const newRecordId = await createRecord(formData);

// Step 3: Link uploaded files to the new record
for (const file of uploadResults) {
  const contentVersionId = await createContentVersion(
    new File([""], file.fileName),
    file.contentBodyId,
    newRecordId,
  );
}

3. Build your custom UI

The package provides the backend — you build the frontend. Here's a minimal example:

tsx
import {
  upload,
  type FileUploadProgress,
} from "@salesforce/ui-bundle-template-feature-react-file-upload";
import { useState } from "react";

function CustomFileUpload({ recordId }: { recordId?: string }) {
  const [progress, setProgress] = useState<Map<string, FileUploadProgress>>(new Map());

  const handleFileSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {
    const files = Array.from(event.target.files || []);

    await upload({
      files,
      recordId,
      onProgress: (fileProgress) => {
        setProgress((prev) => new Map(prev).set(fileProgress.fileName, fileProgress));
      },
    });
  };

  return (
    <div>
      <input type="file" multiple onChange={handleFileSelect} />

      {Array.from(progress.entries()).map(([fileName, fileProgress]) => (
        <div key={fileName}>
          {fileName}: {fileProgress.status} - {fileProgress.progress}%
          {fileProgress.error && <span>Error: {fileProgress.error}</span>}
        </div>
      ))}
    </div>
  );
}

4. Track upload progress

The onProgress callback fires multiple times for each file as it moves through stages:

StatusWhenProgress Value
"pending"File queued for upload0
"uploading"Upload in progress (XHR)0-100 (percentage)
"processing"Creating ContentVersion (if recordId provided)0
"success"Upload complete100
"error"Upload failed0

Always provide visual feedback:

  • Show file name
  • Display current status
  • Render progress bar for "uploading" status
  • Show error message if status is "error"

5. Cancel uploads (optional)

Use an AbortController to allow users to cancel uploads:

tsx
const abortController = new AbortController();

const handleUpload = async (files: File[]) => {
  try {
    await upload({
      files,
      signal: abortController.signal,
      onProgress: (progress) => console.log(progress),
    });
  } catch (error) {
    console.error("Upload cancelled or failed:", error);
  }
};

const cancelUpload = () => {
  abortController.abort();
};

If the user wants to upload files to their own profile or personal library:

tsx
import {
  upload,
  getCurrentUserId,
} from "@salesforce/ui-bundle-template-feature-react-file-upload";

const userId = await getCurrentUserId();
await upload({ files, recordId: userId });

API Reference

upload(options)

Main upload API that handles complete flow with progress tracking.

typescript
interface UploadOptions {
  files: File[];
  recordId?: string | null; // If provided, creates ContentVersion
  onProgress?: (progress: FileUploadProgress) => void;
  signal?: AbortSignal; // Optional cancellation
}

interface FileUploadProgress {
  fileName: string;
  status: "pending" | "uploading" | "processing" | "success" | "error";
  progress: number; // 0-100 for uploading, 0 for other states
  error?: string;
}

interface FileUploadResult {
  fileName: string;
  size: number;
  contentBodyId: string; // Always available
  contentVersionId?: string; // Only if recordId was provided
}

Returns: Promise<FileUploadResult[]>

createContentVersion(file, contentBodyId, recordId)

Manually create a ContentVersion record from a previously uploaded file.

typescript
async function createContentVersion(
  file: File,
  contentBodyId: string,
  recordId: string,
): Promise<string | undefined>;

Parameters:

  • file — File object (used for metadata like name)
  • contentBodyId — ContentBody ID from previous upload
  • recordId — Record ID for FirstPublishLocationId

Returns: ContentVersion ID if successful

getCurrentUserId()

Get the current user's Salesforce ID.

typescript
async function getCurrentUserId(): Promise<string>;

Returns: Current user ID

Common UI patterns

File input with button
tsx
<input type="file" multiple accept=".pdf,.doc,.docx,.jpg,.png" onChange={handleFileSelect} />
Show full SKILL.md (344 more words)Show less
Drag-and-drop zone

Build your own dropzone using native events:

tsx
function DropZone({ onDrop }: { onDrop: (files: File[]) => void }) {
  const handleDrop = (e: React.DragEvent) => {
    e.preventDefault();
    const files = Array.from(e.dataTransfer.files);
    onDrop(files);
  };

  return (
    <div
      onDrop={handleDrop}
      onDragOver={(e) => e.preventDefault()}
      style={{ border: "2px dashed #ccc", padding: "2rem" }}
    >
      Drop files here
    </div>
  );
}
Progress bar
tsx
{
  progress.status === "uploading" && (
    <div style={{ width: "100%", background: "#eee" }}>
      <div
        style={{
          width: `${progress.progress}%`,
          background: "#0176d3",
          height: "8px",
        }}
      />
    </div>
  );
}

Decision tree for agents

User asks for file upload functionality:

  1. Ask about record context:

    • "Do you want to link uploaded files to a specific record, or upload them first and link later?"
  2. Based on response:

    • Link to existing record → Use Pattern B with recordId
    • Upload first, link later → Use Pattern A (no recordId), then Pattern C for linking
    • Link to current user → Use Pattern B with getCurrentUserId()
  3. Build the UI:

    • Create file input or dropzone (not provided by package)
    • Add progress display for each file (status + progress bar)
    • Handle errors in the UI
  4. Test the implementation:

    • Verify progress callbacks fire correctly
    • Check that contentBodyId is returned
    • If recordId was provided, verify contentVersionId is returned

Reference implementation

The package includes a reference implementation in src/features/fileupload/ with:

  • FileUpload.tsx — Complete component with dropzone and dialog
  • FileUploadDialog.tsx — Progress tracking dialog
  • FileUploadDropZone.tsx — Drag-and-drop zone
  • useFileUpload.ts — React hook for state management

These are NOT exported but can be viewed as examples. Read the source files to understand patterns for building your own UI.

Troubleshooting

Upload fails with CORS error:

  • Ensure the UI bundle is properly deployed to Salesforce or running on localhost
  • Check that the org allows the origin in CORS settings

No progress updates:

  • Verify onProgress callback is provided
  • Check that the callback function updates React state correctly

ContentVersion not created:

  • Verify recordId is provided to upload() function
  • Check that the record ID is valid and exists in the org
  • Ensure user has permissions to create ContentVersion records

Files upload but don't appear in record:

  • Verify recordId is correct
  • Check that ContentVersion was created (look for contentVersionId in results)
  • Confirm user has access to view files on the record

DO NOT do these things

  • Build XHR/fetch upload logic from scratch — use the upload() API
  • Try to import <FileUpload /> component — it's not exported
  • Try to import useFileUpload hook — it's not exported
  • Use third-party file upload libraries when this feature exists
  • Skip progress tracking — always provide user feedback
  • Ignore errors — always handle and display error messages

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/experience-ui-bundle-file-upload-generate of forcedotcom/sf-skills.

Open the folder on GitHubat commit e5164d9

Compare with similar skills

Experience UI Bundle File Upload Generate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Experience UI Bundle File Upload Generate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Experience UI Bundle File Upload Generate this skillforcedotcom/sf-skills1.1k—~3kAutomated safety check: PassApache-2.0
Sf IntegrationJaganpro/sf-skills424—~1.5kAutomated safety check: PassMIT
Implementing Zero Trust For SaaS Applicationsmukul975/Anthropic-Cybersecurity-Skills34k—~2.9kAutomated safety check: PassApache-2.0
Salesforce Webhooks Eventsjeremylongshore/tons-of-skills-marketplace2.8k—~1.1kAutomated safety check: PassMIT
Sf Connected AppsJaganpro/sf-skills424—~1.9kAutomated safety check: NotesMIT
Databricks Lakeflow Connectdatabricks/databricks-agent-skills345—~3.8kAutomated safety check: PassCustom licence

Similar skills

  • Sf Integration

    Jaganpro/sf-skills

    Salesforce integration architecture with 120-point scoring. An agent skill from Jaganpro/sf-skills.

    424 GitHub stars~1.5k tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • Implementing Zero Trust For SaaS Applications

    mukul975/Anthropic-Cybersecurity-Skills

    Secures SaaS apps (Microsoft 365, Google Workspace, Salesforce, Slack) via CASB/SSPM deployment, conditional access policies, OAuth app governance, and session-level DLP controls enforcing identity…

    34k GitHub stars~2.9k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Salesforce Webhooks Events

    jeremylongshore/tons-of-skills-marketplace

    Select and govern Salesforce change delivery across Pub/Sub API, Change Data Capture, Platform Events, event relay, Streaming API, Outbound Messages, or polling.

    2.8k GitHub stars~1.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Sf Connected Apps

    Jaganpro/sf-skills

    Salesforce Connected Apps and OAuth configuration with 120-point scoring.

    424 GitHub stars~1.9k tokensUpdated 5 mo ago
    Backend & APIsAuto-check: notes
  • Databricks Lakeflow Connect

    databricks/databricks-agent-skills

    Official

    Build managed ingestion pipelines into Databricks using Lakeflow Connect.

    345 GitHub stars~3.8k tokensUpdated today
    Sales & SupportAuto-check passed
  • Agentforce Generate

    SalesforceAIResearch/agentforce-adlc

    Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script.

    114 GitHub starsUsed in 1 repo~7.4k tokens
    Agent WorkflowsAuto-check passed

More from forcedotcom/sf-skills

All 251 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated yesterday
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Experience UI Bundle File Upload Generate

What does Experience UI Bundle File Upload Generate do?

MUST activate when the project contains a uiBundles//src/ directory and the task involves uploading, attaching, or dropping files. Experience UI Bundle File Upload Generate is an agent skill from forcedotcom/sf-skills. MUST activate when the project contains a uiBundles//src/ directory and the task involves uploading, attaching, or dropping files.

When should I use Experience UI Bundle File Upload Generate?

Experience UI Bundle File Upload Generate fits situations like: adding file upload functionality to a UI bundle app; tasks that involve File uploads and storage; tasks that involve CRM management.

How do I install Experience UI Bundle File Upload Generate in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-file-upload-generate -a claude-code`. Or copy the skill folder (skills/experience-ui-bundle-file-upload-generate in forcedotcom/sf-skills) into .claude/skills/experience-ui-bundle-file-upload-generate in your project. Claude Code loads it when a task matches its description.

How do I install Experience UI Bundle File Upload Generate in Codex?

Run `npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-file-upload-generate -a codex`. Or copy the skill folder (skills/experience-ui-bundle-file-upload-generate in forcedotcom/sf-skills) into .agents/skills/experience-ui-bundle-file-upload-generate in your project. Codex loads it when a task matches its description.

Can I use Experience UI Bundle File Upload Generate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill experience-ui-bundle-file-upload-generate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/experience-ui-bundle-file-upload-generate, .gemini/skills/experience-ui-bundle-file-upload-generate, .github/skills/experience-ui-bundle-file-upload-generate and .opencode/skills/experience-ui-bundle-file-upload-generate in your project.

What does Experience UI Bundle File Upload Generate need to run?

Going by SKILL.md and its folder, Experience UI Bundle File Upload Generate needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Experience UI Bundle File Upload Generate access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Experience UI Bundle File Upload Generate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Experience UI Bundle File Upload Generate use?

Experience UI Bundle File Upload Generate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Experience UI Bundle File Upload Generate use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Experience UI Bundle File Upload Generate?

Skills that share tags, products or a category with Experience UI Bundle File Upload Generate: Sf Integration (Jaganpro/sf-skills, 424 stars), Implementing Zero Trust For SaaS Applications (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Salesforce Webhooks Events (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Sf Connected Apps (Jaganpro/sf-skills, 424 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Experience UI Bundle File Upload Generate?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,060 GitHub stars. The repository holds 251 skills in this directory. The repository was last updated on October 7, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.