Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Salesforce Query

ASecurity

Helps construct and execute SOQL queries against AFLS orgs. Use when user needs to query data, check configurations, or explore the AFLS data model in their Salesforce org.

2 stars
0 votes
0 copies
0 views
Added 9/19/2026
ai-agentsapidocumentation

Works with

cliapi

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add SalesforceLabs/afls-for-claude --skill salesforce-query --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Salesforce Query?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Salesforce Query
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/salesforcelabs-salesforce-query/badge)](https://www.skillsdirectory.com/skills/salesforcelabs-salesforce-query)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: salesforce-query
description: Helps construct and execute SOQL queries against AFLS orgs. Use when user needs to query data, check configurations, or explore the AFLS data model in their Salesforce org.
---

For AFLS-specific query guidance, call `search_afls_knowledge({ query: "<topic>" })` to get sourced documentation about the relevant objects and fields.


# Salesforce Query Assistant for AFLS

You help users query and explore their AFLS Salesforce orgs.

## Before Querying

1. **Check setup status** with `check_afls_setup` to ensure:
   - Salesforce CLI is installed
   - User is authenticated to an org
   - Target org is set

2. **If not set up**, guide through:
   - Installing SF CLI with `install_sf_cli`
   - Authenticating: `sf org login web --alias my-afls-org`
   - Setting target with `set_target_org`

## Important: Discover Object Names First

AFLS object API names vary by implementation and package version. **Always use `describe_sobject` to verify object and field names** before writing queries.

Common objects to explore:
- `Account` - HCPs and HCOs (often PersonAccount)
- `Visit` or similar - Visit records
- `Product2` - Products
- Territory-related objects

## Query Workflow

1. **Ask user what data they need**
2. **Use `describe_sobject`** to find the correct object and field names
3. **Build the query** using discovered field names
4. **Execute with `run_soql`**
5. **Iterate** if needed

## Example Workflow

User: "Show me recent visits"

1. First, discover the Visit object:
   ```
   describe_sobject for likely visit objects
   ```

2. Then query with actual field names from the describe result

## Objects That Cannot Be Queried via SOQL

Some Salesforce metadata is **not accessible via SOQL** — these require the **Tooling API** or **Metadata API** instead:

| Object / Feature | Correct API |
|-----------------|-------------|
| `CompactLayout` / Compact Layouts | Tooling API or Metadata API |
| `LifeSciConfigRecord` / Admin Console settings | Tooling API (`list_admin_settings`) |
| `LifeSciConfigFieldValue` / DB Schema records | Tooling API (`list_db_schema`) |
| Quick Actions / Custom Actions | Tooling API (`list_afls_actions`) |
| Page Layouts | Metadata API (`retrieve_metadata`) |

**NEVER use `run_soql` for compact layouts.** Use `retrieve_metadata` to fetch compact layout metadata, or use the Tooling API with a query like:
```
SELECT Id, Name, Label FROM CompactLayout WHERE EntityDefinitionId = '<ObjectId>'
```
via `sf data query --use-tooling-api`.

## Tips

- Start with small LIMIT values to test queries
- Use `describe_sobject` liberally - don't assume field names
- AFLS uses Health Cloud/Industry Cloud objects, not custom `__c` objects for core functionality
- Check the Admin Console documentation for feature-specific object relationships

Attribution

SalesforceLabsSalesforceLabs
View sourceMore from SalesforceLabs →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

693161 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →