/dx-app-analytics-query
ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the
$ npx -y skills add forcedotcom/sf-skills --skill dx-app-analytics-query --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/dx-app-analytics-query
Context preview
The summary Claude sees to decide when to auto-load this skill.
ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the
SKILL.md
dx-app-analytics-query.SKILL.mdname: dx-app-analytics-query
description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use platform-soql-query), or Data Cloud query/search (use data360-query)."
metadata:
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"
relatedSkills:
- "platform-soql-query"
version: "1.0"
minApiVersion: "56.0"App Analytics
When This Skill Owns the Task
Use `dx-app-analytics-query` when the work involves:
- Creating `AppAnalyticsQueryRequest` records via the REST/sObject API
- Configuring `AppAnalyticsSettings` via the Metadata API (simulation mode, opt-out)
- Understanding the query lifecycle: New → Pending → Complete → Expired → Failed
- Choosing between dataType values: PackageUsageSummary, PackageUsageLog, SubscriberSnapshot
- File format and compression options for analytics downloads
- Time-range filtering with startTime, endTime, availableSince
- Troubleshooting failed or expired analytics queries
Delegate elsewhere when the user is:
- Running standard CRM SOQL queries → platform-soql-query
- Working with Data Cloud SQL or DMOs → data360-query
- Building reports/dashboards on standard objects → reporting skills
- Deploying or retrieving generic metadata XML → platform-metadata-deploy / retrieving-metadata
---
Available Types
AppAnalyticsQueryRequest (REST/sObject API)
An asynchronous query request that ISV partners use to retrieve usage analytics data for their managed packages from the ISV Intelligence Data Lake. Records are created via `POST /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest` and polled via `GET /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest/<id>`. The system processes the query and provides a presigned download URL upon completion.
**Fields (14 properties):**
| Field | Type | Description | |-------|------|-------------| | DataType | string (filterable) | Type of analytics data. Values: `PackageUsageSummary`, `PackageUsageLog`, `SubscriberSnapshot` | | RequestState | string (filterable) | Processing status. Values: `New`, `Pending`, `Complete`, `Expired`, `Failed`, `NoData`, `Delivered` | | StartTime | string | Start of time range for requested data | | EndTime | string | End of time range. Should be set on an hour boundary | | AvailableSince | string | Limits query to data indexed after this time (inclusive). Use for incremental retrieval | | PackageIds | string | Comma-delimited list of managed package IDs (033-prefix) | | OrganizationIds | string | Comma-delimited list of subscriber org IDs to filter results | | DownloadUrl | string | Presigned URL for downloading results. Populated when RequestState is Complete | | DownloadSize | long | Size in bytes of the result data file | | DownloadExpirationTime | string | Time at which the download URL expires | | FileType | string (filterable) | Output format. Values: `csv`, `parquet` | | FileCompression | string (filterable) | Compression. Values: `none`, `gzip`, `snappy` | | QuerySubmittedTime | string | Time the query was submitted to the Data Lake | | ErrorMessage | string | Diagnostic message for failed queries |
AppAnalyticsSettings (Metadata API)
Configuration settings for ISV App Analytics that control simulation mode and opt-out behavior. Deployed via the Metadata API (`sf project deploy`) or Tooling API.
**Fields (2 properties):**
| Field | Type | Description | |-------|------|-------------| | enableSimulationMode | boolean (filterable) | When true, allows querying sample usage logs for integration testing without real subscriber data | | enableAppAnalyticsOptOut | boolean (filterable) | When true, opts this subscriber org out of AppExchange App Analytics data collection |
---
Request Lifecycle
New → Pending → Complete → (download within expiration window)
→ Expired (download URL no longer valid)
→ Delivered (download confirmed received)
→ Failed (check errorMessage)
→ NoData (no matching records for the criteria)---
Common Patterns
Query Package Usage Summary (last 7 days)
Create a record via the REST API:
POST /services/data/v60.0/sobjects/AppAnalyticsQueryRequest
Content-Type: application/json
{
"DataType": "PackageUsageSummary",
"StartTime": "<7-days-ago>T00:00:00Z",
"EndTime": "<today-on-hour-boundary>T00:00:00Z",
"PackageIds": "033XXXXXXXXXXXX",
"FileType": "csv",
"FileCompression": "gzip"
}Poll the record via GET until `RequestState` reaches `Complete`, then download from `DownloadUrl`.
Incremental Data Retrieval
Set `AvailableSince` to the timestamp of your last successful query completion to avoid re-downloading data you already have.
Enable Simulation Mode for Testing
Deploy `AppAnalyticsSettings` via Metadata API with `enableSimulationMode: true` to query sample data without real subscribers.
---
High-Signal Gotchas
- AppAnalyticsQueryRequest is an **sObject** — create and poll records via the REST Data API (`/sobjects/AppAnalyticsQueryRequest`), NOT via Metadata API XML deployment.
- AppAnalyticsQueryRequest does NOT have Apex triggers and does NOT flow through custom objects or Flows.
- Download URLs expire — always check `DownloadExpirationTime` before attempting download.
- `EndTime` should be set on an hour boundary for consistent results.
- `AvailableSince` is inclusive — data indexed at exactly that ti
Read more
name: dx-app-analytics-query
description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use platform-soql-query), or Data Cloud query/search (use data360-query)."
metadata:
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"
relatedSkills:
- "platform-soql-query"
version: "1.0"
minApiVersion: "56.0"App Analytics
When This Skill Owns the Task
Use `dx-app-analytics-query` when the work involves:
- Creating `AppAnalyticsQueryRequest` records via the REST/sObject API
- Configuring `AppAnalyticsSettings` via the Metadata API (simulation mode, opt-out)
- Understanding the query lifecycle: New → Pending → Complete → Expired → Failed
- Choosing between dataType values: PackageUsageSummary, PackageUsageLog, SubscriberSnapshot
- File format and compression options for analytics downloads
- Time-range filtering with startTime, endTime, availableSince
- Troubleshooting failed or expired analytics queries
Delegate elsewhere when the user is:
- Running standard CRM SOQL queries → platform-soql-query
- Working with Data Cloud SQL or DMOs → data360-query
- Building reports/dashboards on standard objects → reporting skills
- Deploying or retrieving generic metadata XML → platform-metadata-deploy / retrieving-metadata
---
Available Types
AppAnalyticsQueryRequest (REST/sObject API)
An asynchronous query request that ISV partners use to retrieve usage analytics data for their managed packages from the ISV Intelligence Data Lake. Records are created via `POST /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest` and polled via `GET /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest/<id>`. The system processes the query and provides a presigned download URL upon completion.
**Fields (14 properties):**
| Field | Type | Description | |-------|------|-------------| | DataType | string (filterable) | Type of analytics data. Values: `PackageUsageSummary`, `PackageUsageLog`, `SubscriberSnapshot` | | RequestState | string (filterable) | Processing status. Values: `New`, `Pending`, `Complete`, `Expired`, `Failed`, `NoData`, `Delivered` | | StartTime | string | Start of time range for requested data | | EndTime | string | End of time range. Should be set on an hour boundary | | AvailableSince | string | Limits query to data indexed after this time (inclusive). Use for incremental retrieval | | PackageIds | string | Comma-delimited list of managed package IDs (033-prefix) | | OrganizationIds | string | Comma-delimited list of subscriber org IDs to filter results | | DownloadUrl | string | Presigned URL for downloading results. Populated when RequestState is Complete | | DownloadSize | long | Size in bytes of the result data file | | DownloadExpirationTime | string | Time at which the download URL expires | | FileType | string (filterable) | Output format. Values: `csv`, `parquet` | | FileCompression | string (filterable) | Compression. Values: `none`, `gzip`, `snappy` | | QuerySubmittedTime | string | Time the query was submitted to the Data Lake | | ErrorMessage | string | Diagnostic message for failed queries |
AppAnalyticsSettings (Metadata API)
Configuration settings for ISV App Analytics that control simulation mode and opt-out behavior. Deployed via the Metadata API (`sf project deploy`) or Tooling API.
**Fields (2 properties):**
| Field | Type | Description | |-------|------|-------------| | enableSimulationMode | boolean (filterable) | When true, allows querying sample usage logs for integration testing without real subscriber data | | enableAppAnalyticsOptOut | boolean (filterable) | When true, opts this subscriber org out of AppExchange App Analytics data collection |
---
Request Lifecycle
New → Pending → Complete → (download within expiration window)
→ Expired (download URL no longer valid)
→ Delivered (download confirmed received)
→ Failed (check errorMessage)
→ NoData (no matching records for the criteria)---
Common Patterns
Query Package Usage Summary (last 7 days)
Create a record via the REST API:
POST /services/data/v60.0/sobjects/AppAnalyticsQueryRequest
Content-Type: application/json
{
"DataType": "PackageUsageSummary",
"StartTime": "<7-days-ago>T00:00:00Z",
"EndTime": "<today-on-hour-boundary>T00:00:00Z",
"PackageIds": "033XXXXXXXXXXXX",
"FileType": "csv",
"FileCompression": "gzip"
}Poll the record via GET until `RequestState` reaches `Complete`, then download from `DownloadUrl`.
Incremental Data Retrieval
Set `AvailableSince` to the timestamp of your last successful query completion to avoid re-downloading data you already have.
Enable Simulation Mode for Testing
Deploy `AppAnalyticsSettings` via Metadata API with `enableSimulationMode: true` to query sample data without real subscribers.
---
High-Signal Gotchas
- AppAnalyticsQueryRequest is an **sObject** — create and poll records via the REST Data API (`/sobjects/AppAnalyticsQueryRequest`), NOT via Metadata API XML deployment.
- AppAnalyticsQueryRequest does NOT have Apex triggers and does NOT flow through custom objects or Flows.
- Download URLs expire — always check `DownloadExpirationTime` before attempting download.
- `EndTime` should be set on an hour boundary for consistent results.
- `AvailableSince` is inclusive — data indexed at exactly that ti
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Other skills on sf-skills.
- /agentforce-generate
Build, modify, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, optimizes, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent actions, tools,
Open skill - /agentforce-observe
Analyze production Agentforce agent behavior using session traces and Data Cloud. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance issues; asks about session traces, conversation logs,
Open skill - /agentforce-test
Write, run, and analyze structured test suites for Agentforce agents — functional AND security. TRIGGER when: user writes or modifies test spec YAML (AiEvaluationDefinition); runs sf agent test create, run, run-eval, or results commands; asks about test coverage strategy, metric
Open skill - /automation-flow-generate
Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as \"when a record is
Open skill - /dx-code-analyzer-configure
Set up, configure, and troubleshoot Salesforce Code Analyzer for any project. Handles installation, prerequisite checks, diagnosing broken setups, creating and editing code-analyzer.yml overrides, engine-specific settings, ignore patterns, severity overrides, and CI/CD pipeline
Open skill - /dx-code-analyzer-custom-rule-create
Create custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the
Open skill

