
Sf Data
Generate or import large Salesforce datasets for Bulk API testing, migration drills, and realistic report volumes without blowing Anonymous Apex limits.
Overview
sf-data is an agent skill most often used in Build (also Ship testing, Validate prototyping) that guides Salesforce bulk creation of 10,000+ records via CLI bulk, Data Loader, or Batch Apex.
Install
npx skills add https://github.com/jaganpro/sf-skills --skill sf-dataWhat is this skill?
- Documents bulk insert of 10,000+ records with explicit warning against Anonymous Apex for volume
- Three approaches: sf data import bulk with CSV (recommended), Data Loader, and chunked Batch Apex
- Batch Apex pattern BulkAccountCreator with Database.executeBatch and configurable batch size (example 200)
- Targets Bulk API 2.0, performance, migration validation, and dashboard testing scenarios
- Stateful batch counter and industry/name-prefix patterns for repeatable test corpora
- Designed for bulk insert of 10,000+ records
- Documents 3 bulk-creation approaches
- Example batch size 200 in executeBatch comment
Adoption & trust: 1.3k installs on skills.sh; 418 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need realistic Salesforce volume for Bulk API or dashboards but Anonymous Apex and small inserts cannot create 10,000+ rows safely.
Who is it for?
Builders testing Bulk API 2.0, migration cutovers, or report performance in full or partial sandboxes.
Skip if: Tiny sandboxes with strict storage caps, production loads without change control, or non-Salesforce databases.
When should I use this skill?
Bulk API testing, migration validation, performance testing, or generating large Salesforce datasets via CLI, Data Loader, or Batch Apex.
What do I get? / Deliverables
You choose a governor-safe path—CSV plus sf data import bulk, Data Loader, or batch Apex—and get patterns to create large test datasets reproducibly.
- Batch Apex bulk creator class pattern
- Bulk import workflow notes (CSV + sf data import bulk)
- Guidance on Data Loader for very large datasets
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Bulk data tooling is authored while integrating Salesforce and preparing orgs for features that depend on volume. Salesforce data load and Batch Apex are integration-layer tasks tied to the CRM backend, not frontend polish.
Where it fits
Scaffold BulkAccountCreator and sf bulk CSV import before wiring integrations against 10k Accounts.
Load realistic volume to validate report and dashboard performance before release.
Seed a sandbox quickly to demo pricing or pipeline flows with believable data density.
Refresh staging orgs after schema changes using repeatable bulk import playbooks.
How it compares
Use for scripted bulk Salesforce seeding instead of one-off SOQL loops in Anonymous Apex.
Common Questions / FAQ
Who is sf-data for?
Solo developers and small teams automating Salesforce sandboxes who need large record sets for API, migration, or analytics testing.
When should I use sf-data?
In Build integrations when seeding CRM data; in Ship when stress-testing reports and APIs; in Validate when proving flows against high record counts.
Is sf-data safe to install?
Bulk scripts can modify org data—review Security Audits on this page, run only in sandboxes first, and scope sf CLI credentials minimally.
SKILL.md
READMESKILL.md - Sf Data
/** * ═══════════════════════════════════════════════════════════════════════════════ * BULK INSERT 10,000+ RECORDS * For Bulk API and large data volume testing * ═══════════════════════════════════════════════════════════════════════════════ * * ⚠️ IMPORTANT: This script is designed to be run via sf CLI Bulk API * NOT via Anonymous Apex (which has governor limits) * * PURPOSE: * Generate large datasets for: * • Bulk API 2.0 testing * • Performance testing * • Data migration validation * • Report/Dashboard testing with realistic volumes * * APPROACHES: * 1. Use sf data import bulk with CSV files (recommended) * 2. Use Data Loader for very large datasets * 3. Use batch Apex to create in smaller chunks * * ═══════════════════════════════════════════════════════════════════════════════ */ // ═══════════════════════════════════════════════════════════════════════════════ // APPROACH 1: BATCH APEX FOR LARGE DATA CREATION // ═══════════════════════════════════════════════════════════════════════════════ /** * Batch class to create large number of Account records * Execute with: Database.executeBatch(new BulkAccountCreator(10000), 200); */ public class BulkAccountCreator implements Database.Batchable<Integer>, Database.Stateful { private Integer targetCount; private Integer createdCount = 0; private String namePrefix; private List<String> industries; private DateTime startTime; public BulkAccountCreator(Integer count) { this.targetCount = count; this.namePrefix = 'BulkData'; this.industries = new List<String>{ 'Technology', 'Healthcare', 'Finance', 'Manufacturing', 'Retail', 'Education', 'Energy', 'Media' }; this.startTime = DateTime.now(); } public Iterable<Integer> start(Database.BatchableContext bc) { // Create list of indices to process List<Integer> indices = new List<Integer>(); for (Integer i = 0; i < targetCount; i++) { indices.add(i); } return indices; } public void execute(Database.BatchableContext bc, List<Integer> indices) { List<Account> accounts = new List<Account>(); for (Integer i : indices) { accounts.add(new Account( Name = namePrefix + '_' + String.valueOf(i).leftPad(7, '0'), Industry = industries[Math.mod(i, industries.size())], Type = Math.mod(i, 3) == 0 ? 'Customer' : 'Prospect', AnnualRevenue = 50000 + (Math.mod(i, 1000) * 1000), NumberOfEmployees = 10 + Math.mod(i, 1000), BillingCity = 'San Francisco', BillingState = 'CA', BillingCountry = 'USA', Description = 'Bulk created record ' + i )); } insert accounts; createdCount += accounts.size(); } public void finish(Database.BatchableContext bc) { DateTime endTime = DateTime.now(); Long durationMs = endTime.getTime() - startTime.getTime(); System.debug('═══════════════════════════════════════════════════════════════'); System.debug('BULK CREATION COMPLETE'); System.debug('═══════════════════════════════════════════════════════════════'); System.debug('Records Created: ' + createdCount); System.debug('Duration: ' + durationMs + 'ms (' + (durationMs / 1000) + ' seconds)'); System.debug('Rate: ' + (createdCount * 1000 / durationMs) + ' records/second'); System.debug('═══════════════════════════════════════════════════════════════'); } } // Execute with: // Database.executeBatch(new BulkAccountCreator(10000), 200); // ═══════════════════════════════════════════════════════════════════════════════ // APPROACH 2: GENERATE CSV FOR BULK API IMPORT // Run this to generate CSV, then use sf data import bulk // ═══════════════════════════════════════════════════════════════════════════════ /**