Building a Salesforce Reporting Skill with Claude
23 March 2026 · Shumon Choudhury
In the first post in this series, we explained why we started using Claude to amplify our Salesforce delivery. In this post, we get practical.
We are going to walk through how we built a Claude Code skill that connects to a Salesforce org, runs complex SOQL queries, analyses the results, and produces structured reports — the kind that would normally take a consultant hours of manual work.
What is a Claude Code skill?
A skill is a markdown file that teaches Claude how to perform a specific type of work. Think of it as a reusable instruction set — it defines the context, the steps, the tools available, and the expected output format.
When you invoke a skill, Claude reads the instructions and executes them using the tools at its disposal: running shell commands, reading files, querying APIs, and writing structured output.
For Salesforce work, the key tool is the Salesforce CLI (sf). If you can do it from the command line, Claude can do it too — but faster, and without the context-switching that slows human operators down.
The architecture
Our Salesforce reporting skill has four components:
1. Authentication. The skill assumes the consultant has already authenticated with sf org login to the target org. It verifies the connection before proceeding — no hardcoded credentials, no stored tokens.
2. Discovery. Before running any reports, the skill queries the org metadata to understand what it is working with: objects, fields, record types, automation rules, and custom settings. This is equivalent to a consultant spending their first hour navigating Setup.
3. Analysis queries. The skill runs a sequence of SOQL queries tailored to the type of report being generated. For a Sales Cloud health check, this might include:
- Record counts and creation dates across key objects
- Field completion rates (how many records have each field populated)
- User login frequency and last login dates
- Automation rules and their evaluation counts
- Duplicate detection across Account, Contact, and Lead
- Opportunity stage distribution and pipeline velocity
Each query is designed to surface the kind of insight that a senior consultant would look for — but executed in seconds rather than hours.
4. Report generation. The results are compiled into a structured markdown report with sections, tables, findings, and recommendations. The format is consistent every time, making it easy to share with clients and incorporate into deliverables.
What we learned building it
SOQL has limits — and Claude respects them. Salesforce governor limits apply to API queries just as they do to Apex. The skill is designed to batch queries, use selective filters, and avoid full table scans. Claude understands these constraints because the skill instructions explain them explicitly.
Context matters more than queries. The hardest part was not writing the SOQL. It was teaching Claude what the results mean. A field completion rate of 30% on Account.Industry is concerning. A field completion rate of 30% on Account.Fax is expected. The skill includes interpretive guidance so that findings come with appropriate context.
The consultant still drives. The skill generates data and preliminary analysis. It does not make strategic recommendations. That is still the consultant's job — understanding the client's business, interpreting findings in context, and advising on priorities. The skill handles the mechanics so the consultant can focus on the thinking.
Iteration is fast. Because skills are just markdown files, refining them is trivial. If a query is not surfacing useful data, you adjust the skill and re-run. The feedback loop is minutes, not days.
A real example
Here is what the output looks like for a simplified Sales Cloud health check:
The skill runs approximately fifteen queries across the org, analyses the results, and produces a report covering:
- Object health: record volumes, growth trends, and data distribution
- Field usage: completion rates across standard and custom fields, identifying unused customisation
- User adoption: login frequency, feature usage, and inactive users
- Automation inventory: flows, process builders, validation rules, and triggers with execution counts
- Data quality: duplicate rates, orphaned records, and referential integrity
Each section includes specific findings and a severity rating. The consultant then reviews, adds business context from stakeholder interviews, and incorporates the analysis into the final deliverable.
Why this matters for clients
This is not about replacing consultants with AI. It is about changing the ratio of time spent on mechanics versus time spent on expertise.
In a traditional Sales Cloud health check, roughly two days are spent on data gathering and initial analysis. With the skill handling that work, those two days become available for deeper investigation, additional stakeholder conversations, or faster delivery.
The client gets the same senior expertise — applied more effectively.
What comes next
In the final post of this series, we look at where this approach is heading: from reporting skills to automation audits, data quality monitoring, and AI-assisted architecture reviews. The Salesforce ecosystem is about to change — and the consultancies that adapt will be the ones that thrive.