forcedotcom/sf-skills / plugins/builder/salesforce-development/skills/platform-soql-query
platform-soql-query
VerifiedUse when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 1.7 KB |
| SKILL.md | skill md | 6.3 KB |
| assets/aggregate-queries.soql | other | 9.4 KB |
| assets/basic-queries.soql | other | 7.4 KB |
| assets/bulkified-query-pattern.cls | other | 10.7 KB |
| assets/optimization-patterns.soql | other | 10.9 KB |
| assets/relationship-queries.soql | other | 7.5 KB |
| assets/selector-class.cls | other | 8.4 KB |
| references/anti-patterns.md | markdown | 8.7 KB |
| references/cli-commands.md | markdown | 7.2 KB |
| references/field-coverage-rules.md | markdown | 14.4 KB |
| references/query-optimization.md | markdown | 3.2 KB |
| references/selector-patterns.md | markdown | 13.7 KB |
| references/soql-reference.md | markdown | 6.4 KB |
| references/soql-syntax-reference.md | markdown | 4.5 KB |
| scripts/post-tool-validate.py | script | 11.9 KB |
README.md
View on GitHub# platform-soql-query
Salesforce SOQL query generation, optimization, and analysis skill with 100-point scoring. Convert natural language into performant SOQL and validate queries for security, selectivity, and governor-limit awareness.
## Features
- **Natural Language to SOQL**: Convert requests into executable queries
- **Query Optimization**: Improve selectivity, LIMIT usage, and field selection
- **Relationship Queries**: Parent-child, child-parent, and polymorphic patterns
- **Security Guidance**: `WITH USER_MODE`, `WITH SECURITY_ENFORCED`, and Apex-safe usage
- **100-Point Scoring**: Performance, correctness, security, and readability checks
## Quick Start
### 1. Invoke the skill
```yaml
Skill: platform-soql-query
Request: "Find Accounts with open Opportunities created this quarter"
```
### 2. Typical use cases
- Generate SOQL from plain-English requirements
- Optimize slow or non-selective queries
- Build aggregates and relationship queries
- Validate queries before using them in Apex or CLI workflows
## Documentation
- [SKILL.md](SKILL.md) - Core workflow and optimization guidance
- [references/query-optimization.md](references/query-optimization.md) - Selectivity and performance tuning
- [references/soql-syntax-reference.md](references/soql-syntax-reference.md) - Syntax, relationships, and aggregates
- [references/selector-patterns.md](references/selector-patterns.md) - Reusable Apex selector patterns
- [references/cli-commands.md](references/cli-commands.md) - sf CLI query execution examples
## Related Skills
- `platform-data-manage` - For data creation/import/export workflows
- `platform-apex-generate` - For inline SOQL inside Apex code
- `platform-apex-test-run` - For validating query behavior in tests
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |