Salesforce Data Operations Expert (handling-sf-data) Use this skill when the user needs Salesforce data work : record CRUD, bulk import/export, test data generation, cleanup scripts, or data factory patterns for validating Apex, Flow, or integration behavior. When This Skill Owns the Task Use when the work involves: - CLI commands - record creation, update, delete, upsert, export, or tree import/export - realistic test data generation - bulk data operations and cleanup - Apex anonymous scripts for data seeding / rollback Delegate elsewhere when the user is: - writing SOQL only → querying-soql…

, '', content, flags=re.MULTILINE)\n # Remove multi-line comments\n content = re.sub(r'/\\*[\\s\\S]*?\\*/', '', content)\n return content\n\n def _has_where_clause(self, content: str) -> bool:\n \"\"\"Check if query has a WHERE clause.\"\"\"\n return bool(re.search(r'\\bWHERE\\b', content, re.IGNORECASE))\n\n def _has_limit(self, content: str) -> bool:\n \"\"\"Check if query has a LIMIT clause.\"\"\"\n return bool(re.search(r'\\bLIMIT\\s+\\d+', content, re.IGNORECASE))\n\n def _has_hardcoded_ids(self, content: str) -> bool:\n \"\"\"Check for hardcoded Salesforce IDs.\"\"\"\n # Salesforce IDs are 15 or 18 character alphanumeric\n # Starting with specific prefixes: 001 (Account), 003 (Contact), etc.\n id_pattern = r\"'[a-zA-Z0-9]{15}'\" # 15-char ID\n id_pattern_18 = r\"'[a-zA-Z0-9]{18}'\" # 18-char ID\n\n return bool(re.search(id_pattern, content) or re.search(id_pattern_18, content))\n\n def _uses_indexed_fields(self, content: str) -> bool:\n \"\"\"Check if WHERE clause uses indexed fields.\"\"\"\n # Extract WHERE clause\n where_match = re.search(r'\\bWHERE\\b(.*?)(?:\\bORDER\\b|\\bGROUP\\b|\\bLIMIT\\b|$)',\n content, re.IGNORECASE | re.DOTALL)\n if not where_match:\n return False\n\n where_clause = where_match.group(1)\n\n # Check for indexed fields\n for field in self.INDEXED_FIELDS:\n if re.search(rf'\\b{field}\\b', where_clause, re.IGNORECASE):\n return True\n\n return False\n\n def _has_subquery(self, content: str) -> bool:\n \"\"\"Check if query has subqueries.\"\"\"\n # Look for nested SELECT in parentheses\n return bool(re.search(r'\\(\\s*SELECT\\b', content, re.IGNORECASE))\n\n def _has_relationship(self, content: str) -> bool:\n \"\"\"Check if query uses relationship queries.\"\"\"\n # Look for dot notation (child-to-parent) or __r suffix\n return bool(re.search(r'\\w+\\.\\w+|__r\\.', content))\n\n def _validate_syntax(self, content: str) -> List[Dict[str, Any]]:\n \"\"\"Validate SOQL syntax and return issues.\"\"\"\n issues = []\n\n # Check for SELECT without FROM\n if re.search(r'\\bSELECT\\b', content, re.IGNORECASE):\n if not re.search(r'\\bFROM\\b', content, re.IGNORECASE):\n issues.append({\n 'severity': 'error',\n 'message': 'SELECT statement missing FROM clause'\n })\n\n # Check for invalid operators\n if re.search(r'==', content):\n issues.append({\n 'severity': 'error',\n 'message': 'Invalid operator \"==\" - use \"=\" in SOQL'\n })\n\n if re.search(r'!=\\s*null', content, re.IGNORECASE):\n pass # Valid\n elif re.search(r'\u003c>', content):\n issues.append({\n 'severity': 'warning',\n 'message': 'Consider using \"!=\" instead of \"\u003c>\" for consistency'\n })\n\n # Check for SELECT *\n if re.search(r'\\bSELECT\\s+\\*', content, re.IGNORECASE):\n issues.append({\n 'severity': 'error',\n 'message': 'SELECT * is not valid in SOQL - specify field names'\n })\n\n # Check for proper string quoting\n if re.search(r\"=\\s*\\\"[^\\\"]*\\\"\", content):\n issues.append({\n 'severity': 'warning',\n 'message': 'Use single quotes for string literals in SOQL'\n })\n\n # Check for unbalanced parentheses\n open_parens = content.count('(')\n close_parens = content.count(')')\n if open_parens != close_parens:\n issues.append({\n 'severity': 'error',\n 'message': f'Unbalanced parentheses: {open_parens} open, {close_parens} close'\n })\n\n # Check for TYPEOF without END\n if re.search(r'\\bTYPEOF\\b', content, re.IGNORECASE):\n if not re.search(r'\\bEND\\b', content, re.IGNORECASE):\n issues.append({\n 'severity': 'error',\n 'message': 'TYPEOF expression missing END keyword'\n })\n\n # Check for reserved words as field names (common issues)\n reserved = ['SELECT', 'FROM', 'WHERE', 'ORDER', 'GROUP', 'LIMIT']\n for word in reserved:\n # Look for patterns like \"SELECT SELECT\" or \"field, SELECT\"\n if re.search(rf'\\b{word}\\s*,|\\,\\s*{word}\\b', content, re.IGNORECASE):\n issues.append({\n 'severity': 'warning',\n 'message': f'Possible misuse of reserved word \"{word}\"'\n })\n\n return issues\n\n def get_query_complexity(self, content: str) -> Dict[str, int]:\n \"\"\"Analyze query complexity metrics.\"\"\"\n clean = self._remove_comments(content)\n\n return {\n 'select_fields': len(re.findall(r'\\bSELECT\\b.*?\\bFROM\\b', clean, re.IGNORECASE | re.DOTALL)),\n 'where_conditions': len(re.findall(r'\\b(AND|OR)\\b', clean, re.IGNORECASE)) + 1 if self._has_where_clause(clean) else 0,\n 'subqueries': len(re.findall(r'\\(\\s*SELECT\\b', clean, re.IGNORECASE)),\n 'joins': len(re.findall(r'__r\\.|\\.Name|\\.Id', clean)),\n 'aggregates': len(re.findall(r'\\b(COUNT|SUM|AVG|MIN|MAX)\\s*\\(', clean, re.IGNORECASE))\n }\n\n def suggest_optimizations(self, content: str) -> List[str]:\n \"\"\"Suggest query optimizations.\"\"\"\n suggestions = []\n clean = self._remove_comments(content)\n\n # Check for missing indexed field in WHERE\n if self._has_where_clause(clean) and not self._uses_indexed_fields(clean):\n suggestions.append('Add an indexed field (Id, Name, CreatedDate) to WHERE for better performance')\n\n # Check for ORDER BY without LIMIT\n if re.search(r'\\bORDER\\s+BY\\b', clean, re.IGNORECASE):\n if not self._has_limit(clean):\n suggestions.append('Consider adding LIMIT when using ORDER BY')\n\n # Check for SELECT with many fields\n select_match = re.search(r'\\bSELECT\\b(.*?)\\bFROM\\b', clean, re.IGNORECASE | re.DOTALL)\n if select_match:\n fields = select_match.group(1)\n field_count = len([f.strip() for f in fields.split(',') if f.strip()])\n if field_count > 20:\n suggestions.append(f'Query selects {field_count} fields - consider selecting only needed fields')\n\n # Check for deeply nested subqueries\n subquery_depth = len(re.findall(r'\\(\\s*SELECT\\b', clean, re.IGNORECASE))\n if subquery_depth > 2:\n suggestions.append('Consider simplifying query - deeply nested subqueries may impact performance')\n\n return suggestions\n\n\n# Standalone execution for testing\nif __name__ == '__main__':\n import sys\n\n if len(sys.argv) \u003c 2:\n print('Usage: python soql_validator.py \u003csoql_file>')\n sys.exit(1)\n\n with open(sys.argv[1], 'r') as f:\n content = f.read()\n\n validator = SOQLValidator(content)\n result = validator.validate()\n\n print('SOQL Validation Results:')\n print('=' * 40)\n for key, value in result.items():\n if key not in ['issues', 'recommendations']:\n print(f'{key}: {value}')\n\n if result['issues']:\n print('\\nIssues:')\n for issue in result['issues']:\n print(f\" [{issue['severity']}] {issue['message']}\")\n\n if result['recommendations']:\n print('\\nRecommendations:')\n for rec in result['recommendations']:\n print(f' - {rec}')\n","content_type":"text/x-python; charset=utf-8","language":"python","size":11201,"content_sha256":"035e4a3620b8e127532b610ab09efb1e270b22539150aef0e5aa053d2c6db887"},{"filename":"scripts/validate_data_operation.py","content":"#!/usr/bin/env python3\n\"\"\"\nsf-data Validation Module\n=========================\n\nValidates data operation files against the 130-point scoring system:\n- Query Efficiency (25 points)\n- Bulk Safety (25 points)\n- Data Integrity (20 points)\n- Security & FLS (20 points)\n- Test Patterns (15 points)\n- Cleanup & Isolation (15 points)\n- Documentation (10 points)\n\"\"\"\n\nimport re\nfrom pathlib import Path\nfrom typing import Dict, List, Any, Optional\n\nclass DataOperationValidator:\n \"\"\"Validates data operation files.\"\"\"\n\n # Scoring categories\n CATEGORIES = {\n 'query_efficiency': {\n 'name': 'Query Efficiency',\n 'max': 25,\n 'score': 25,\n 'issues': []\n },\n 'bulk_safety': {\n 'name': 'Bulk Safety',\n 'max': 25,\n 'score': 25,\n 'issues': []\n },\n 'data_integrity': {\n 'name': 'Data Integrity',\n 'max': 20,\n 'score': 20,\n 'issues': []\n },\n 'security_fls': {\n 'name': 'Security & FLS',\n 'max': 20,\n 'score': 20,\n 'issues': []\n },\n 'test_patterns': {\n 'name': 'Test Patterns',\n 'max': 15,\n 'score': 15,\n 'issues': []\n },\n 'cleanup_isolation': {\n 'name': 'Cleanup & Isolation',\n 'max': 15,\n 'score': 15,\n 'issues': []\n },\n 'documentation': {\n 'name': 'Documentation',\n 'max': 10,\n 'score': 10,\n 'issues': []\n }\n }\n\n def __init__(self, file_path: str):\n self.file_path = Path(file_path)\n self.content = ''\n self.file_type = ''\n self.issues: List[Dict[str, Any]] = []\n self.recommendations: List[str] = []\n self.categories = self._init_categories()\n\n def _init_categories(self) -> Dict[str, Dict[str, Any]]:\n \"\"\"Initialize fresh category scores.\"\"\"\n import copy\n return copy.deepcopy(self.CATEGORIES)\n\n def validate(self) -> Optional[Dict[str, Any]]:\n \"\"\"Run validation and return results.\"\"\"\n if not self.file_path.exists():\n return None\n\n try:\n with open(self.file_path, 'r', encoding='utf-8') as f:\n self.content = f.read()\n except Exception:\n return None\n\n # Determine file type\n self.file_type = self.file_path.suffix.lower()\n\n # Run type-specific validation\n if self.file_type == '.apex':\n self._validate_apex()\n elif self.file_type == '.soql':\n self._validate_soql()\n elif self.file_type == '.csv':\n self._validate_csv()\n elif self.file_type == '.json':\n self._validate_json()\n else:\n return None\n\n # Calculate total score\n total_score = sum(cat['score'] for cat in self.categories.values())\n max_score = sum(cat['max'] for cat in self.categories.values())\n\n return {\n 'score': total_score,\n 'max_score': max_score,\n 'categories': {cat['name']: {'score': cat['score'], 'max': cat['max']}\n for cat in self.categories.values()},\n 'issues': self.issues,\n 'recommendations': self.recommendations\n }\n\n def _validate_apex(self):\n \"\"\"Validate Apex data operation file.\"\"\"\n content = self.content\n\n # Query Efficiency (25 points)\n self._check_query_efficiency(content)\n\n # Bulk Safety (25 points)\n self._check_bulk_safety(content)\n\n # Data Integrity (20 points)\n self._check_data_integrity(content)\n\n # Security & FLS (20 points)\n self._check_security(content)\n\n # Test Patterns (15 points)\n self._check_test_patterns(content)\n\n # Cleanup & Isolation (15 points)\n self._check_cleanup(content)\n\n # Documentation (10 points)\n self._check_documentation(content)\n\n def _validate_soql(self):\n \"\"\"Validate SOQL query file.\"\"\"\n content = self.content\n\n # Import SOQL validator\n try:\n from soql_validator import SOQLValidator\n soql_validator = SOQLValidator(content)\n soql_result = soql_validator.validate()\n\n # Apply SOQL-specific scoring\n if soql_result.get('has_where_clause', False):\n pass # Good\n else:\n self._deduct('query_efficiency', 5, 'Missing WHERE clause')\n\n if soql_result.get('has_limit', False):\n pass # Good\n else:\n self._deduct('query_efficiency', 3, 'Missing LIMIT clause')\n\n if soql_result.get('has_hardcoded_ids', False):\n self._deduct('query_efficiency', 5, 'Hardcoded record IDs found')\n\n except ImportError:\n # Basic SOQL validation\n if 'WHERE' not in content.upper():\n self._deduct('query_efficiency', 5, 'Missing WHERE clause')\n if 'LIMIT' not in content.upper():\n self._deduct('query_efficiency', 3, 'Missing LIMIT clause')\n\n # Documentation check for SOQL\n if not content.strip().startswith('--'):\n self._deduct('documentation', 5, 'Missing SOQL documentation/comments')\n\n def _validate_csv(self):\n \"\"\"Validate CSV import file.\"\"\"\n lines = self.content.strip().split('\\n')\n\n if len(lines) \u003c 2:\n self._deduct('data_integrity', 10, 'CSV file has no data rows')\n return\n\n # Check for header row\n header = lines[0]\n if not header or ',' not in header:\n self._deduct('data_integrity', 5, 'CSV missing proper header row')\n\n # Check for consistent column count\n expected_cols = len(header.split(','))\n for i, line in enumerate(lines[1:], 2):\n if line.strip() and len(line.split(',')) != expected_cols:\n self._deduct('data_integrity', 2, f'Inconsistent column count on line {i}')\n break\n\n # Check for potential PII patterns\n self._check_csv_security(self.content)\n\n def _validate_json(self):\n \"\"\"Validate JSON tree import file.\"\"\"\n import json as json_lib\n\n try:\n data = json_lib.loads(self.content)\n except json_lib.JSONDecodeError as e:\n self._deduct('data_integrity', 20, f'Invalid JSON: {str(e)}')\n return\n\n # Check for proper sObject tree format\n if 'records' not in data:\n self._deduct('data_integrity', 10, 'Missing \"records\" array')\n return\n\n records = data.get('records', [])\n\n for i, record in enumerate(records):\n if 'attributes' not in record:\n self._deduct('data_integrity', 5, f'Record {i+1} missing \"attributes\"')\n else:\n attrs = record['attributes']\n if 'type' not in attrs:\n self._deduct('data_integrity', 3, f'Record {i+1} missing object type')\n if 'referenceId' not in attrs:\n self._deduct('data_integrity', 2, f'Record {i+1} missing referenceId')\n\n def _check_query_efficiency(self, content: str):\n \"\"\"Check for query efficiency issues.\"\"\"\n # Check for queries in loops\n if re.search(r'for\\s*\\([^)]*\\)\\s*\\{[^}]*\\[SELECT', content, re.IGNORECASE | re.DOTALL):\n self._deduct('query_efficiency', 10, 'SOQL query inside for loop (N+1 pattern)')\n\n # Check for hardcoded IDs\n if re.search(r\"'[a-zA-Z0-9]{15,18}'\", content):\n self._deduct('query_efficiency', 5, 'Hardcoded Salesforce ID found')\n\n # Check for SELECT * equivalent (all fields)\n if re.search(r'SELECT\\s+\\*', content, re.IGNORECASE):\n self._deduct('query_efficiency', 5, 'SELECT * is not valid in SOQL')\n\n def _check_bulk_safety(self, content: str):\n \"\"\"Check for bulk safety issues.\"\"\"\n # Check for DML in loops\n dml_in_loop = re.search(\n r'for\\s*\\([^)]*\\)\\s*\\{[^}]*(insert|update|delete|upsert)\\s+',\n content, re.IGNORECASE | re.DOTALL\n )\n if dml_in_loop:\n self._deduct('bulk_safety', 10, 'DML operation inside for loop')\n\n # Check for single-record operations when bulk would be better\n single_record_pattern = re.search(\n r'(insert|update|delete)\\s+\\w+\\s*;(?!\\s*//\\s*single)',\n content, re.IGNORECASE\n )\n # This is a soft check - single records are sometimes intentional\n\n # Check for list-based DML (good pattern)\n if re.search(r'(insert|update|delete)\\s+\\w+List', content, re.IGNORECASE):\n pass # Good - using list-based DML\n elif re.search(r'(insert|update|delete)\\s+new\\s+List\u003c', content, re.IGNORECASE):\n pass # Good - using list\n\n def _check_data_integrity(self, content: str):\n \"\"\"Check for data integrity issues.\"\"\"\n # Check for required field handling\n if 'required' in content.lower() or 'mandatory' in content.lower():\n pass # Awareness of required fields\n\n # Check for null checks\n if re.search(r'!=\\s*null|!= null', content):\n pass # Good - null checking\n\n def _check_security(self, content: str):\n \"\"\"Check for security issues.\"\"\"\n # Check for PII patterns\n pii_patterns = [\n (r'\\b\\d{3}-\\d{2}-\\d{4}\\b', 'SSN pattern detected'),\n (r'\\b\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}\\b', 'Credit card pattern detected'),\n (r'\\b[A-Za-z0-9._%+-]+@(gmail|yahoo|hotmail|outlook)\\.(com|net|org)\\b',\n 'Personal email domain in test data')\n ]\n\n for pattern, message in pii_patterns:\n if re.search(pattern, content):\n self._deduct('security_fls', 10, message)\n\n # Check for WITH USER_MODE usage (good practice)\n if 'WITH USER_MODE' in content.upper():\n pass # Good - respecting FLS\n\n def _check_test_patterns(self, content: str):\n \"\"\"Check for good test data patterns.\"\"\"\n # Check for bulk record creation (200+)\n bulk_patterns = [\n r'(\\d{3,})\\s*[;,)]', # Numbers 100+\n r'count\\s*[=:]\\s*(\\d{3,})',\n r'recordCount\\s*[=:]\\s*(\\d{3,})'\n ]\n\n has_bulk = False\n for pattern in bulk_patterns:\n match = re.search(pattern, content)\n if match:\n try:\n num = int(match.group(1))\n if num >= 200:\n has_bulk = True\n except ValueError:\n pass\n\n # Check for edge case handling\n edge_cases = ['null', 'empty', 'boundary', 'special character', 'unicode']\n has_edge_cases = any(ec in content.lower() for ec in edge_cases)\n\n if not has_bulk and 'bulk' not in self.file_path.stem.lower():\n self._deduct('test_patterns', 5, 'Consider testing with 200+ records for bulkification')\n\n def _check_cleanup(self, content: str):\n \"\"\"Check for cleanup and isolation patterns.\"\"\"\n # Check for cleanup provisions\n cleanup_patterns = ['cleanup', 'delete', 'rollback', 'Savepoint', 'Database.rollback']\n has_cleanup = any(pattern.lower() in content.lower() for pattern in cleanup_patterns)\n\n if not has_cleanup:\n self._deduct('cleanup_isolation', 5, 'No cleanup mechanism found')\n self.recommendations.append('Add cleanup script or savepoint for test isolation')\n\n # Check for ID tracking\n if re.search(r'Set\u003cId>|List\u003cId>|createdIds|recordIds', content):\n pass # Good - tracking created IDs\n\n def _check_documentation(self, content: str):\n \"\"\"Check for documentation.\"\"\"\n # Check for file header comment\n if not (content.strip().startswith('/*') or\n content.strip().startswith('//') or\n content.strip().startswith('/**')):\n self._deduct('documentation', 3, 'Missing file header documentation')\n\n # Check for method documentation\n if re.search(r'/\\*\\*[\\s\\S]*?\\*/', content):\n pass # Has JSDoc-style comments\n elif re.search(r'//.*description|//.*purpose|//.*usage', content, re.IGNORECASE):\n pass # Has inline documentation\n else:\n self._deduct('documentation', 2, 'Consider adding method/section documentation')\n\n def _check_csv_security(self, content: str):\n \"\"\"Check CSV content for security issues.\"\"\"\n # Check for PII patterns in CSV\n lines = content.split('\\n')\n for i, line in enumerate(lines, 1):\n # SSN pattern\n if re.search(r'\\b\\d{3}-\\d{2}-\\d{4}\\b', line):\n self._deduct('security_fls', 10, f'SSN pattern on line {i}')\n break\n # Credit card pattern\n if re.search(r'\\b\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}\\b', line):\n self._deduct('security_fls', 10, f'Credit card pattern on line {i}')\n break\n\n def _deduct(self, category: str, points: int, message: str):\n \"\"\"Deduct points from a category and record the issue.\"\"\"\n if category in self.categories:\n current = self.categories[category]['score']\n self.categories[category]['score'] = max(0, current - points)\n self.categories[category]['issues'].append(message)\n\n self.issues.append({\n 'category': self.categories.get(category, {}).get('name', category),\n 'severity': 'error' if points >= 10 else 'warning',\n 'message': message,\n 'points': points\n })\n","content_type":"text/x-python; charset=utf-8","language":"python","size":13787,"content_sha256":"1a59af6c8d2753058432b00aa4c9f8349a067d243f472c3292b23235af5a63ac"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Salesforce Data Operations Expert (handling-sf-data)","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this skill when the user needs ","type":"text"},{"text":"Salesforce data work","type":"text","marks":[{"type":"strong"}]},{"text":": record CRUD, bulk import/export, test data generation, cleanup scripts, or data factory patterns for validating Apex, Flow, or integration behavior.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When This Skill Owns the Task","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"handling-sf-data","type":"text","marks":[{"type":"code_inline"}]},{"text":" when the work involves:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"sf data","type":"text","marks":[{"type":"code_inline"}]},{"text":" CLI commands","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"record creation, update, delete, upsert, export, or tree import/export","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"realistic test data generation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"bulk data operations and cleanup","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Apex anonymous scripts for data seeding / rollback","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Delegate elsewhere when the user is:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"writing SOQL only → ","type":"text"},{"text":"querying-soql","type":"text","marks":[{"type":"link","attrs":{"href":"../querying-soql/SKILL.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running or repairing Apex tests → ","type":"text"},{"text":"running-apex-tests","type":"text","marks":[{"type":"link","attrs":{"href":"../running-apex-tests/SKILL.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"deploying metadata first → ","type":"text"},{"text":"deploying-metadata","type":"text","marks":[{"type":"link","attrs":{"href":"../deploying-metadata/SKILL.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"creating or modifying custom objects / fields → ","type":"text"},{"text":"generating-custom-object","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-object/SKILL.md","title":null}}]},{"text":" or ","type":"text"},{"text":"generating-custom-field","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-field/SKILL.md","title":null}}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Important Mode Decision","type":"text"}]},{"type":"paragraph","content":[{"text":"Confirm which mode the user wants:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Mode","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use when","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Script generation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"they want reusable ","type":"text"},{"text":".apex","type":"text","marks":[{"type":"code_inline"}]},{"text":", CSV, or JSON assets without touching an org yet","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Remote execution","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"they want records created / changed in a real org now","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Do not assume remote execution if the user may only want scripts.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Required Context to Gather First","type":"text"}]},{"type":"paragraph","content":[{"text":"Ask for or infer:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"target object(s)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"org alias, if remote execution is required","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"operation type: query, create, update, delete, upsert, import, export, cleanup","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"expected volume","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"whether this is test data, migration data, or one-off troubleshooting data","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"any parent-child relationships that must exist first","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Operating Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"handling-sf-data","type":"text","marks":[{"type":"code_inline"}]},{"text":" acts on ","type":"text"},{"text":"remote org data","type":"text","marks":[{"type":"strong"}]},{"text":" unless the user explicitly wants local script generation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Objects and fields must already exist before data creation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For automation testing, prefer ","type":"text"},{"text":"251+ records","type":"text","marks":[{"type":"strong"}]},{"text":" when bulk behavior matters.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Plan cleanup before creating large or noisy datasets — untracked records accumulate across runs and pollute org state.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use synthetic, non-identifying data in test records — real PII creates compliance risk and cannot be safely removed after bulk import.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Prefer ","type":"text"},{"text":"CLI-first","type":"text","marks":[{"type":"strong"}]},{"text":" for straightforward CRUD; use anonymous Apex when the operation truly needs server-side orchestration.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If metadata is missing, stop and hand off to:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"generating-custom-object","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-object/SKILL.md","title":null}}]},{"text":" or ","type":"text"},{"text":"generating-custom-field","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-field/SKILL.md","title":null}}]},{"text":" to create the missing schema, then ","type":"text"},{"text":"deploying-metadata","type":"text","marks":[{"type":"link","attrs":{"href":"../deploying-metadata/SKILL.md","title":null}}]},{"text":" to deploy it before retrying the data operation","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Recommended Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. Verify prerequisites","type":"text"}]},{"type":"paragraph","content":[{"text":"Confirm object / field availability, org auth, and required parent records.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Run describe-first pre-flight validation when schema is uncertain","type":"text"}]},{"type":"paragraph","content":[{"text":"Before creating or updating records, use object describe data to validate:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"required fields","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"createable vs non-createable fields","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"picklist values","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"relationship fields and parent requirements","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"references/sf-cli-data-commands.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/sf-cli-data-commands.md","title":null}}]},{"text":" for the ","type":"text"},{"text":"sf sobject describe","type":"text","marks":[{"type":"code_inline"}]},{"text":" command and jq filter patterns for inspecting fields, picklist values, and createable constraints.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. Choose the smallest correct mechanism","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Need","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default approach","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"small one-off CRUD","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"sf data","type":"text","marks":[{"type":"code_inline"}]},{"text":" single-record commands","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"large import/export","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Bulk API 2.0 via ","type":"text"},{"text":"sf data ... bulk","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"parent-child seed set","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"tree import/export","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"reusable test dataset","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"factory / anonymous Apex script","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"reversible experiment","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"cleanup script or savepoint-based approach","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Execute or generate assets","type":"text"}]},{"type":"paragraph","content":[{"text":"Use the built-in templates under ","type":"text"},{"text":"assets/","type":"text","marks":[{"type":"code_inline"}]},{"text":" when they fit:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/factories/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/bulk/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/cleanup/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/soql/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/csv/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/json/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"5. Verify results","type":"text"}]},{"type":"paragraph","content":[{"text":"Check counts, relationships, and record IDs after creation or update.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6. Apply a bounded retry strategy","type":"text"}]},{"type":"paragraph","content":[{"text":"If creation fails:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"try the primary CLI shape once","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"retry once with corrected parameters","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"re-run describe / validate assumptions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"pivot to a different mechanism or provide a manual workaround","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Do ","type":"text"},{"text":"not","type":"text","marks":[{"type":"strong"}]},{"text":" repeat the same failing command indefinitely.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"7. Leave cleanup guidance","type":"text"}]},{"type":"paragraph","content":[{"text":"Provide exact cleanup commands or rollback assets whenever data was created.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"High-Signal Rules","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Bulk safety","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"use bulk operations for large volumes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test automation-sensitive behavior with 251+ records where appropriate","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"avoid one-record-at-a-time patterns for bulk scenarios","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Data integrity","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"include required fields","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"validate picklist values before creation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"verify parent IDs and relationship integrity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"account for validation rules and duplicate constraints","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"exclude non-createable fields from input payloads","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Cleanup discipline","type":"text"}]},{"type":"paragraph","content":[{"text":"Prefer one of:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"delete-by-ID","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"delete-by-pattern","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"delete-by-created-date window","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"rollback / savepoint patterns for script-based test runs","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Common Failure Patterns","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Error","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Likely cause","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default fix direction","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"INVALID_FIELD","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"wrong field API name or FLS issue","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"verify schema and access","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"REQUIRED_FIELD_MISSING","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"mandatory field omitted","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"include required values from describe data","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"INVALID_CROSS_REFERENCE_KEY","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"bad parent ID","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"create / verify parent first","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"FIELD_CUSTOM_VALIDATION_EXCEPTION","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"validation rule blocked the record","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"use valid test data or adjust setup","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"invalid picklist value","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"guessed value instead of describe-backed value","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"inspect picklist values first","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"non-writeable field error","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"field is not createable / updateable","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"remove it from the payload","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"bulk limits / timeouts","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"wrong tool for the volume","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"switch to bulk / staged import","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Format","type":"text"}]},{"type":"paragraph","content":[{"text":"When finishing, report in this order:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Operation performed","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Objects and counts","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Target org or local artifact path","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Record IDs / output files","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verification result","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cleanup instructions","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"paragraph","content":[{"text":"Suggested shape:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"text"},"content":[{"text":"Data operation: \u003ccreate / update / delete / export / seed>\nObjects: \u003cobject + counts>\nTarget: \u003corg alias or local path>\nArtifacts: \u003crecord ids / csv / apex / json files>\nVerification: \u003cpassed / partial / failed>\nCleanup: \u003cexact delete or rollback guidance>","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Cross-Skill Integration","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Need","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Delegate to","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Reason","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"create missing custom objects","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"generating-custom-object","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-object/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"schema must exist before data operations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"create missing custom fields","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"generating-custom-field","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-custom-field/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"field-level schema must exist before data creation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"run bulk-sensitive Apex validation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"running-apex-tests","type":"text","marks":[{"type":"link","attrs":{"href":"../running-apex-tests/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"test execution and coverage","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"deploy missing schema first","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"deploying-metadata","type":"text","marks":[{"type":"link","attrs":{"href":"../deploying-metadata/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"metadata readiness","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"implement production Apex logic consuming the data","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"generating-apex","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-apex/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Apex class / trigger authoring","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"implement Flow logic consuming the data","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"generating-flow","type":"text","marks":[{"type":"link","attrs":{"href":"../generating-flow/SKILL.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Flow authoring and automation","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Map","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Start here","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/sf-cli-data-commands.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/sf-cli-data-commands.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/test-data-best-practices.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/test-data-best-practices.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/orchestration.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/orchestration.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/test-data-patterns.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/test-data-patterns.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/test-data-factory-usage.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/test-data-factory-usage.md","title":null}}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Query / bulk / cleanup","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/soql-relationship-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/soql-relationship-guide.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/relationship-query-examples.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/relationship-query-examples.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/bulk-operations-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/bulk-operations-guide.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/cleanup-rollback-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/cleanup-rollback-guide.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/cleanup-rollback-example.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/cleanup-rollback-example.md","title":null}}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Examples / limits","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/crud-workflow-example.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/crud-workflow-example.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/bulk-testing-example.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/bulk-testing-example.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/anonymous-apex-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/anonymous-apex-guide.md","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/governor-limits-reference.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/governor-limits-reference.md","title":null}}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Validation scripts","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"scripts/soql_validator.py","type":"text","marks":[{"type":"link","attrs":{"href":"scripts/soql_validator.py","title":null}}]},{"text":" — validate SOQL queries before execution","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"scripts/validate_data_operation.py","type":"text","marks":[{"type":"link","attrs":{"href":"scripts/validate_data_operation.py","title":null}}]},{"text":" — pre-flight check for data operations (required fields, picklist values, createable fields)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Asset templates","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/factories/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Apex test data factory scripts (account, contact, opportunity, lead, user, etc.)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/bulk/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Bulk API 2.0 Apex templates (insert 200, 500, 10000 records; upsert by external ID)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/cleanup/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Cleanup and rollback scripts (delete by name, date, pattern; transaction rollback)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/soql/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — SOQL query templates (aggregate, subquery, parent-to-child, child-to-parent, polymorphic)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/csv/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — CSV import templates for Account, Contact, Opportunity, custom objects","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/json/","type":"text","marks":[{"type":"code_inline"}]},{"text":" — JSON tree import templates (account-contact, account-opportunity, full hierarchy)","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Score Guide","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Score","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Meaning","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"117+","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"strong production-safe data workflow","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"104–116","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"good operation with minor improvements possible","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"91–103","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"acceptable but review advised","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"78–90","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"partial / risky patterns present","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003c 78","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"blocked until corrected","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"handling-sf-data","author":"@skillopedia","source":{"stars":438,"repo_name":"sf-skills","origin_url":"https://github.com/forcedotcom/sf-skills/blob/HEAD/skills/handling-sf-data/SKILL.md","repo_owner":"forcedotcom","body_sha256":"3119a1266880cb6dc6c78c4c853d91933bf58dc2b08a948d19b569234ce67f5c","cluster_key":"f0000eaf40a9f56c7a5bc7247c6809d5bd8a31cc0ed86aab03d395d91f2e37e6","clean_bundle":{"format":"clean-skill-bundle-v1","source":"forcedotcom/sf-skills/skills/handling-sf-data/SKILL.md","attachments":[{"id":"7025579c-689d-5834-839d-c1ce81200bbf","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7025579c-689d-5834-839d-c1ce81200bbf/attachment.md","path":"CREDITS.md","size":159,"sha256":"30fab4c912c1b45c1329e4c936dc8d21eb3faa61e4fbc094f77d0cd2c0d0e0e6","contentType":"text/markdown; charset=utf-8"},{"id":"0d2a9ce2-29de-5f50-8d33-be07791f3d58","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0d2a9ce2-29de-5f50-8d33-be07791f3d58/attachment.md","path":"README.md","size":4501,"sha256":"f79bb54c5a8b08eb6dd9dc6e24f31d31a08a350b9773635ca9ed616ffa950fe8","contentType":"text/markdown; charset=utf-8"},{"id":"15542c94-82bf-59dc-bf99-26ce641d6a04","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/15542c94-82bf-59dc-bf99-26ce641d6a04/attachment.apex","path":"assets/bulk/bulk-insert-10000.apex","size":12598,"sha256":"e9c9152535cd185219ebcb6072c18b0568f6587a64c026ac88b2b54629fadc81","contentType":"application/vnd.apexlang"},{"id":"24c00fc1-cdbb-5893-bd9e-c8c0ac287b05","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/24c00fc1-cdbb-5893-bd9e-c8c0ac287b05/attachment.apex","path":"assets/bulk/bulk-insert-200.apex","size":12747,"sha256":"da54501d130f7fc00e9d85944f3f3cfc8ad5324f3b60338e554d72b1abde6f85","contentType":"application/vnd.apexlang"},{"id":"09b75710-efe5-5ce5-8dbf-63828bb230df","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/09b75710-efe5-5ce5-8dbf-63828bb230df/attachment.apex","path":"assets/bulk/bulk-insert-500.apex","size":13458,"sha256":"ca84998e2122134341c62854dc4c9fdff118c6af6626cfa8f82a53046c799b36","contentType":"application/vnd.apexlang"},{"id":"c3662b7b-95d1-529c-afc3-8f6146f06a99","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c3662b7b-95d1-529c-afc3-8f6146f06a99/attachment.apex","path":"assets/bulk/bulk-upsert-external-id.apex","size":13708,"sha256":"e17a7ab29bff204866e83126d5a9226c5bdabcf8aea23c8418b6fb9b9c26390f","contentType":"application/vnd.apexlang"},{"id":"dacca454-0f51-5177-a21d-3ea44962d5eb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/dacca454-0f51-5177-a21d-3ea44962d5eb/attachment.apex","path":"assets/cleanup/delete-by-created-date.apex","size":16241,"sha256":"6651bacdffeabb73093ff0c36b547a164e252d56efad7e8643aec50e9baa7549","contentType":"application/vnd.apexlang"},{"id":"c76a419e-bb49-5902-bfb7-67c546e673c6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c76a419e-bb49-5902-bfb7-67c546e673c6/attachment.apex","path":"assets/cleanup/delete-by-name.apex","size":13167,"sha256":"349006505e06911998759249fe94ba5949dc105c5d0bc716a4eea86d926d1b58","contentType":"application/vnd.apexlang"},{"id":"f2cf82fd-3678-5236-a52f-36fa5a4b8386","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f2cf82fd-3678-5236-a52f-36fa5a4b8386/attachment.apex","path":"assets/cleanup/delete-test-data.apex","size":17002,"sha256":"fa4eb3bd30ae95a47878817441303d413392715836cb4d04319acc56f412e6f4","contentType":"application/vnd.apexlang"},{"id":"5d101f96-ca9e-5da6-a7b9-9de78adee475","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5d101f96-ca9e-5da6-a7b9-9de78adee475/attachment.apex","path":"assets/cleanup/rollback-transaction.apex","size":12653,"sha256":"65ce39361c0a85b67656df21a6b57fde02a5a3dce242c8141bca28c47c5495d8","contentType":"application/vnd.apexlang"},{"id":"b3247b63-8059-5230-a4f6-0a71a0f228ac","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b3247b63-8059-5230-a4f6-0a71a0f228ac/attachment.csv","path":"assets/csv/account-import.csv","size":1821,"sha256":"c7cd4d0261651d9c425c9511346662fbf765274add3411a72164b569f8190462","contentType":"text/csv; charset=utf-8"},{"id":"0718b52f-71fc-5eeb-8675-b6833b7e9037","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0718b52f-71fc-5eeb-8675-b6833b7e9037/attachment.csv","path":"assets/csv/contact-import.csv","size":1961,"sha256":"94bdce52afe8fc87020ab8c3ae7b404d1bc28d1d17b7ce3bdcdca7e4a317b533","contentType":"text/csv; charset=utf-8"},{"id":"e73cd976-9650-599e-8936-a6f3b0ef6faa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e73cd976-9650-599e-8936-a6f3b0ef6faa/attachment.csv","path":"assets/csv/custom-object-import.csv","size":1177,"sha256":"1ea56560b419891d80651aad18a238fcd32a292a32c7e4694bbb94ed8a9ec610","contentType":"text/csv; charset=utf-8"},{"id":"9ab13417-28a3-518b-b604-c4fbf929b395","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9ab13417-28a3-518b-b604-c4fbf929b395/attachment.csv","path":"assets/csv/opportunity-import.csv","size":1667,"sha256":"497af22840078674af54d85a1c37913dbd89aa6645ac02392bfa587b92944676","contentType":"text/csv; charset=utf-8"},{"id":"9248da75-d8fa-534d-a9b4-61db94838821","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9248da75-d8fa-534d-a9b4-61db94838821/attachment.apex","path":"assets/factories/account-factory.apex","size":5770,"sha256":"090b09ac07233b159f9d0dc00624e7874da9a42f23f73c06aa01d222e648a996","contentType":"application/vnd.apexlang"},{"id":"3352543c-ca04-5520-973b-997c3454632f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3352543c-ca04-5520-973b-997c3454632f/attachment.apex","path":"assets/factories/case-factory.apex","size":8288,"sha256":"c63a344c4fe1e5c8a05e2029b298fa1aebc21273f35bcef65cf5df10c9d09a4e","contentType":"application/vnd.apexlang"},{"id":"ef3cbb58-f166-5a16-a8f2-1c5712f18af3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ef3cbb58-f166-5a16-a8f2-1c5712f18af3/attachment.apex","path":"assets/factories/contact-factory.apex","size":6024,"sha256":"23fa4ef0a73d18493b50d37df037da485264a920f497f3c9f60f4981fb83c182","contentType":"application/vnd.apexlang"},{"id":"9f466736-0969-5367-86ac-8589e87cf570","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9f466736-0969-5367-86ac-8589e87cf570/attachment.apex","path":"assets/factories/custom-object-factory.apex","size":11038,"sha256":"d03b3070849b432781ffd6892de58a347ec593f251e2c17c3c0fb52dd7f43ed5","contentType":"application/vnd.apexlang"},{"id":"c354824d-f13e-516d-983d-67b1e78b7931","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c354824d-f13e-516d-983d-67b1e78b7931/attachment.apex","path":"assets/factories/event-factory.apex","size":9839,"sha256":"d5f0cb2fd025943d244a3ad4bdc26d724b88524569cf8293a6541da6760f394f","contentType":"application/vnd.apexlang"},{"id":"39f7dd31-c8d8-5e71-86c3-325bf19fcd08","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/39f7dd31-c8d8-5e71-86c3-325bf19fcd08/attachment.apex","path":"assets/factories/hierarchy-factory.apex","size":16371,"sha256":"c6d57f41fdb24aa13842c56482270ff7d9a66bb8d0535c3e66c2e58734682092","contentType":"application/vnd.apexlang"},{"id":"c5f5390f-2f30-58ae-b092-02d2b984fc85","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c5f5390f-2f30-58ae-b092-02d2b984fc85/attachment.apex","path":"assets/factories/lead-factory.apex","size":6536,"sha256":"121f33443c5507ede3a11e7d97e14386620adf4875a0e6b863bac2455dd74f5a","contentType":"application/vnd.apexlang"},{"id":"d0cf31a4-b94a-53c5-9351-b9de5f92fbb5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d0cf31a4-b94a-53c5-9351-b9de5f92fbb5/attachment.apex","path":"assets/factories/opportunity-factory.apex","size":7484,"sha256":"cbf9db06c4ba44a51d251417d6ac4a86e214ebe99080faccd04dba723f1a250f","contentType":"application/vnd.apexlang"},{"id":"de7c43a2-f222-5b2f-88db-2d20df93ac24","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/de7c43a2-f222-5b2f-88db-2d20df93ac24/attachment.apex","path":"assets/factories/task-factory.apex","size":8344,"sha256":"75faefd08d75f2a3cd22165ca75b5b03d9bbc1fc5bda7634f4331cb94e5ef760","contentType":"application/vnd.apexlang"},{"id":"3298d382-1506-57e1-be80-301ac365d688","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3298d382-1506-57e1-be80-301ac365d688/attachment.apex","path":"assets/factories/user-factory.apex","size":9015,"sha256":"835f61c31a136ca46dbe749ad15ec756c311438067a5b7e1eee8b688c1747432","contentType":"application/vnd.apexlang"},{"id":"4ddfff38-5434-5788-a8fe-0bace033e695","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4ddfff38-5434-5788-a8fe-0bace033e695/attachment.json","path":"assets/json/account-contact-tree.json","size":3647,"sha256":"bd5cb6980be0a4bb2837312b67a192296fb7ab3bd56f062b9b5ba95de7c33b3d","contentType":"application/json; charset=utf-8"},{"id":"f1d88ae9-eae6-54b2-b12a-a3feaf056282","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f1d88ae9-eae6-54b2-b12a-a3feaf056282/attachment.json","path":"assets/json/account-opportunity-tree.json","size":3336,"sha256":"acdec854a14bb28bbdc79bc74faf76ce147b9f1eb7a63b1803a3c103c2616103","contentType":"application/json; charset=utf-8"},{"id":"30626ec4-439c-5033-8e95-b45891d9d345","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/30626ec4-439c-5033-8e95-b45891d9d345/attachment.json","path":"assets/json/full-hierarchy-tree.json","size":5935,"sha256":"931a0c1e039044964db42615d4660d7563f6ab5bdf85d7da946e1600ba6a2d0a","contentType":"application/json; charset=utf-8"},{"id":"39752632-252d-50c5-9bdc-d6e84a176f1d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/39752632-252d-50c5-9bdc-d6e84a176f1d/attachment.soql","path":"assets/soql/aggregate.soql","size":12579,"sha256":"ed2389aa8c26b5c3dcadb44ad8a8be3ab68fd05fc8e42f9613469e4e0f84a666","contentType":"application/octet-stream"},{"id":"9fb7eee5-b733-5c6e-8407-5784cb4d1846","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9fb7eee5-b733-5c6e-8407-5784cb4d1846/attachment.soql","path":"assets/soql/child-to-parent.soql","size":10007,"sha256":"da7aa78697a2aecf35a66d3c4fcc37c2b2a10cc20dbe9b6a6b51aa55980cc300","contentType":"text/plain; charset=utf-8"},{"id":"4f815e28-ba57-549a-b2b1-6333c8efcb77","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4f815e28-ba57-549a-b2b1-6333c8efcb77/attachment.soql","path":"assets/soql/parent-to-child.soql","size":8846,"sha256":"52a7af352c7695dc33d034470b1f96f2f0a80d521ef0bfa4d0275f02699fc07b","contentType":"application/octet-stream"},{"id":"9e908ddb-17ec-5d76-830d-93e245f851de","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9e908ddb-17ec-5d76-830d-93e245f851de/attachment.soql","path":"assets/soql/polymorphic.soql","size":11322,"sha256":"b545546848c1dd4af5238a5e1ec96ed32a813bf6034aae5cb0c6b6656fb0029c","contentType":"text/plain; charset=utf-8"},{"id":"25acef7a-0d23-5e1b-849f-ac6e6692c12f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/25acef7a-0d23-5e1b-849f-ac6e6692c12f/attachment.soql","path":"assets/soql/subquery.soql","size":16611,"sha256":"61be7f142155c771c9fa2e0f0d277021ecf535304f26938eb1f56caa8d5aef67","contentType":"text/plain; charset=utf-8"},{"id":"56daf3ac-fcfe-552d-a352-9cc36136e843","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/56daf3ac-fcfe-552d-a352-9cc36136e843/attachment.md","path":"references/anonymous-apex-guide.md","size":2010,"sha256":"9b589e1194759c38276a147a447ec03795cffd79cbb9db1c1cdb3b583e2b314e","contentType":"text/markdown; charset=utf-8"},{"id":"e6532545-3140-502d-af7a-ad2d7338b9b5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e6532545-3140-502d-af7a-ad2d7338b9b5/attachment.md","path":"references/bulk-operations-guide.md","size":1865,"sha256":"2c37c377b21cfde333c2ddadc8bd6a39bd05c3a42fd7ff0d90857b018133332e","contentType":"text/markdown; charset=utf-8"},{"id":"0d9014c9-a4ae-5288-bd9a-84fb06a3ab27","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0d9014c9-a4ae-5288-bd9a-84fb06a3ab27/attachment.md","path":"references/bulk-testing-example.md","size":5041,"sha256":"139d0408f66bf4234d65b159c66955ef3678955b5cbff4355647f8db3611fad7","contentType":"text/markdown; charset=utf-8"},{"id":"6b0093ff-1de0-5607-a657-d3e3b8087341","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6b0093ff-1de0-5607-a657-d3e3b8087341/attachment.md","path":"references/cleanup-rollback-example.md","size":8382,"sha256":"6e5eb8b344fbdfa14303f349418722a028055cc3cd4b3e53c37a2a2bc196b08c","contentType":"text/markdown; charset=utf-8"},{"id":"4619bfd4-5f30-5d38-a64c-f93440deda96","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4619bfd4-5f30-5d38-a64c-f93440deda96/attachment.md","path":"references/cleanup-rollback-guide.md","size":1767,"sha256":"01551686a5e1585360fef18b7f730eb66ba49b82b60df09e4b279c868cf97997","contentType":"text/markdown; charset=utf-8"},{"id":"98608641-4b0a-5905-a18a-a7facd1c553f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/98608641-4b0a-5905-a18a-a7facd1c553f/attachment.md","path":"references/crud-workflow-example.md","size":4061,"sha256":"1081dc9da653d92aa78bc12c70764c875b6db9b1bcce6f1c7ed7658c66d9a771","contentType":"text/markdown; charset=utf-8"},{"id":"3ceeb0ea-d50a-5ec3-a65c-0d21b4047381","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3ceeb0ea-d50a-5ec3-a65c-0d21b4047381/attachment.md","path":"references/governor-limits-reference.md","size":1874,"sha256":"9ff0719f8d53aaca14191086bcfc96359a83fad80bd6125555ead3869feb94a9","contentType":"text/markdown; charset=utf-8"},{"id":"cd47fc15-cfef-53df-8d45-5dbd3dee0d08","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cd47fc15-cfef-53df-8d45-5dbd3dee0d08/attachment.md","path":"references/orchestration.md","size":7013,"sha256":"c372b427c78a8752e28839ee4e30a3b37357662e6eb71f2c8b65eec14b1aa250","contentType":"text/markdown; charset=utf-8"},{"id":"5cc85e2b-c376-5352-ad38-2b6132a40748","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5cc85e2b-c376-5352-ad38-2b6132a40748/attachment.md","path":"references/relationship-query-examples.md","size":5847,"sha256":"677eb44ce525ef57217280642867b8266134afde684ea8d0ecc0f78d0a0028cb","contentType":"text/markdown; charset=utf-8"},{"id":"8a58c035-43ca-5239-84b7-6281657a0b35","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8a58c035-43ca-5239-84b7-6281657a0b35/attachment.md","path":"references/sf-cli-data-commands.md","size":2855,"sha256":"c7e10900c08fef6d63f0a3d281e7c17520743691f810da5a767baef5b8458acc","contentType":"text/markdown; charset=utf-8"},{"id":"85d755ec-bec1-5725-84d9-c36137caa904","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/85d755ec-bec1-5725-84d9-c36137caa904/attachment.md","path":"references/soql-relationship-guide.md","size":2013,"sha256":"fcac87a17e023080718ff58c0279c4329a83d73d3080dc69af5c6028b1eb4720","contentType":"text/markdown; charset=utf-8"},{"id":"0b4fe2a9-8b36-5e4a-a64c-471457aa0ded","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0b4fe2a9-8b36-5e4a-a64c-471457aa0ded/attachment.md","path":"references/test-data-best-practices.md","size":3272,"sha256":"1f884c8efe315e12038780046b95ec45c39737efba05b6b1e7c231ba21865610","contentType":"text/markdown; charset=utf-8"},{"id":"1a3140bd-988d-538c-86fc-bb44d088bdd0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1a3140bd-988d-538c-86fc-bb44d088bdd0/attachment.md","path":"references/test-data-factory-usage.md","size":7770,"sha256":"381d144bd66a02963ff30b0abc6a5ae5fc0b88701db47ca9f4f46ba4ab9d8688","contentType":"text/markdown; charset=utf-8"},{"id":"1f8cc9b3-67b2-55e8-9e5e-63350844af19","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1f8cc9b3-67b2-55e8-9e5e-63350844af19/attachment.md","path":"references/test-data-patterns.md","size":2494,"sha256":"f0b0d27414ede285a8119987a07cb1ab767a9b6b836768a9a7930505c92fd0bc","contentType":"text/markdown; charset=utf-8"},{"id":"8f46140d-bd6a-59d7-9be9-3cb566ed8d0e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8f46140d-bd6a-59d7-9be9-3cb566ed8d0e/attachment.py","path":"scripts/soql_validator.py","size":11201,"sha256":"035e4a3620b8e127532b610ab09efb1e270b22539150aef0e5aa053d2c6db887","contentType":"text/x-python; charset=utf-8"},{"id":"e29023a4-2cdd-5e16-a4a1-e024280cb5ff","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e29023a4-2cdd-5e16-a4a1-e024280cb5ff/attachment.py","path":"scripts/validate_data_operation.py","size":13787,"sha256":"1a59af6c8d2753058432b00aa4c9f8349a067d243f472c3292b23235af5a63ac","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"1ef4bbdeae5764e953240c1bb647cf99a6b2873280897903a145a7aadc9ef840","attachment_count":48,"text_attachments":25,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":23,"excluded_attachments":[]},"cluster_size":2,"skill_md_path":"skills/handling-sf-data/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":1},"license":"MIT","version":"v1","category":"testing-qa","metadata":{"version":"1.1"},"import_tag":"clean-skills-v1","description":"Salesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata)."}},"renderedAt":1782980604967}

Salesforce Data Operations Expert (handling-sf-data) Use this skill when the user needs Salesforce data work : record CRUD, bulk import/export, test data generation, cleanup scripts, or data factory patterns for validating Apex, Flow, or integration behavior. When This Skill Owns the Task Use when the work involves: - CLI commands - record creation, update, delete, upsert, export, or tree import/export - realistic test data generation - bulk data operations and cleanup - Apex anonymous scripts for data seeding / rollback Delegate elsewhere when the user is: - writing SOQL only → querying-soql…