Chapter 7
Your first flights
Example prompts for each built-in guide, what a good answer looks like, and what to check before you trust it.
How to judge any answer
The Copilot works from built-in guides (we call them recipes). Each one fixes the steps, the questions it may ask your system, and the shape of the answer. You do not name a recipe: you describe the job, and the Copilot uses the one that fits. Every recipe in this chapter is read-only: it reads and explains, and never offers to change anything.
Judging an answer checklist
- Open the Brain panel's Activity tab. Do the tool lines match what the answer claims it read?
- Is every number or name in the answer one you can find in the system itself, in a place you can open?
- Does the answer say what it could not read ("not readable with your access") instead of guessing?
- Did it state a limit of what it knows (for example that sharing was not evaluated)?
- Is there any record Id, email or token repeated that it should have called "a record id"?
- If something looks wrong, ask "Which query or tool call gave you that number?" A good answer can name it.
ADVISORY
A new Developer Edition org has little in it. A correct answer on a nearly empty org is often "nothing found" or "fewer than three". That is the Copilot being honest, not failing. The guides are told never to invent a class, a user, a date or a number.
ADVISORY · If a guide seems missing
The guides are switched on per environment. The Salesforce guides and the GitHub guides are on; the Org Discovery Report is switched on only where the owner has enabled it. If the Copilot answers as though a guide does not exist, say so to support@cockpitai.io.
7.1 The first question
Before the guides, prove the connection returns real data.
Ask the Copilot
How close is this org to its API limits?
A good answer reports real numbers from the org's limits and says which are nearly used. In a new org, nothing will be close. The API meter above the message box then shows your calls this run.
Then one question per connected system. Note each result on your checklist:
| System | Prompt | A real answer looks like |
|---|---|---|
| Salesforce | Which Apex classes touch the Account object? | A list, or "none" in a new org, said plainly. |
| MuleSoft | List my Anypoint environments. | Your trial's environments, for example Sandbox and Production. |
| GitHub | What repositories can you see, and what is in cockpit-practice? | The practice repository and its README. |
| Postman | List my Postman workspaces and collections. | Cockpit practice and Orders API. |
| Slack | Which Slack channels can you see? | Including cockpit-practice. |
7.2 Explain a debug log
Needs: nothing connected. It reads only what you paste. It touches no system.
Ask the Copilot
Here is an Apex debug log from a failed save. What went wrong, and what is the usual fix? (paste the log)
To try it without a real log, paste these made-up lines:
Sample to paste (made up for the test)
12:00:01.1 (1100)|EXCEPTION_THROWN|[14]|System.LimitException: Too many SOQL queries: 101 12:00:01.1 (1200)|FATAL_ERROR|System.LimitException: Too many SOQL queries: 101 Number of SOQL queries: 101 out of 100
- A good answer, in this order: one plain sentence with the cause; a table of limit, used and allowed (only limits in your paste; any at 80 percent or more flagged); the top three suspects, each with a log line number or a class and line; the usual fix. It says which part is your paste and which part is its reasoning.
- For a SOQL limit, the usual cause is a query inside a loop, and the usual fix is to query once into a Map.
- If the error is not one it recognises, it says "not recognised", says what it can read, and asks for the missing part.
CAUTION
Real logs hold customer data, record ids and sometimes session ids. The Copilot is told not to repeat them and to tell you to rotate anything that looks like a token. Even so, paste only logs from throwaway orgs during the test drive.
Check: every suspect cites a line you can see in your paste. It does not name a class the paste does not show. It does not offer to fetch the log itself.
7.3 Org tour
Needs: a connected Salesforce org. A guided walk through an org you have just inherited, in about ten minutes of reading.
Ask the Copilot
I just inherited this Salesforce org. Give me a tour.
- A good answer goes in seven steps and stops after each with one line asking whether to go on: org summary and licences; data model; automation; integration surface (installed packages, named credentials); limits; security risks; and what changed in the last 30 days. It uses the same sections as the Org Discovery Report (7.10).
- Each step is two or three plain sentences, a small table if it helps, and what it means for someone taking over.
- It ends with Five things to read first and Three things that look risky, naming only things it read. On a small org it gives fewer and says the tour cannot show business rules that are not written down.
- A part it cannot read is listed as "not readable with your access" in its step and again at the end.
Check: pick one named object or flow and find it in Setup. It should be there. It should not call anything a bug.
7.4 Async job doctor
Needs: a connected Salesforce org. Finds background work that has quietly failed.
Ask the Copilot
Is anything quietly failing in the background in this org?
- A good answer starts with one sentence (for example "3 classes failed in the last 7 days and 1 schedule looks stuck", or "nothing failed in the last 7 days"), then a table of job, failures, last error and last success, then any stuck schedules. A schedule is flagged when it should have run and did not, or is in an error or blocked state.
- It counts what it can see and says so. It always lists what it did not check: failed Flow interviews, fault emails, platform event delivery and email send errors, which need Event Monitoring or admin settings. It never says the org is healthy about those.
- It never offers to abort, reschedule, retry or change a job.
Check: in Setup, open Apex Jobs and compare the failures it names. A new Developer org will normally answer "nothing failed", which is correct.
7.5 Licence, storage and idle-user review
Needs: a connected Salesforce org.
Ask the Copilot
Review our Salesforce licences, storage and idle users.
- A good answer gives a table of licence, used, total and free, largest free first (rows with a total of 0 left out); idle users who have not logged in for 90 days, oldest first, up to 20, with the total, and users who never logged in; and storage as used = Max minus Remaining, with the percent used, from the org's limits.
- It calls idle users "candidates to ask about", because they may be integration or seasonal users. It does not tell you to remove anyone.
- For storage per object it can only count records on a few objects and says its space figure is an estimate (Salesforce counts most records as about 2 KB).
- It does not state or guess what a licence or a gigabyte costs, unless you give it a price.
Check: compare the licence table with Setup, Company Information. Compare the storage figures with Setup, Storage Usage.
7.6 Who can edit a field
Needs: a connected Salesforce org and a user in it. In a new Developer org, use your own admin user or a user you create.
Ask the Copilot
Can Priya Rao edit Opportunity.Amount? If not, why not?
- A good answer gives the deciding reason first in one line, then the chain: who the user is (profile, role, active or not), each profile, permission set or permission set group that grants something, and what is missing if the answer is no. Editing a field needs Edit on the object and Edit on the field.
- If more than one user matches the name, it lists them and asks which. If the user is inactive, it says so and stops.
- For a grant that arrives through a permission set group, it says "granted through the group X unless the group mutes it", because muting is not evaluated.
- It always says "Record-level sharing was not evaluated". Object and field access say whether the user can edit the field at all, not which records they can see.
CAUTION
If a query is refused (the connected Salesforce user may lack View Setup and Configuration), the Copilot names the table it could not read and stops. A missing table is not an answer of "no access". Do not treat it as one.
Check: open the user in Setup, then the permission sets and the field's field-level security, and confirm the chain.
7.7 Sandbox refresh checklist
Needs: a connected Salesforce sandbox. It lists what to note before a sandbox refresh and checks what is left after it. A person does the refresh in Setup; the Copilot cannot start or schedule one.
CAUTION · Not on a Developer Edition org
This guide first checks whether the org is a sandbox. A Developer Edition org is not a sandbox, so the Copilot will say that this chat is connected to a production-type org, and stop. That is correct behaviour. To try it you need a real sandbox.
Ask the Copilot
I am about to refresh this sandbox. What should I note down before I do?
- Before: one table per area (named credentials, external data sources, remote site settings, outbound messages, scheduled jobs, connected apps, custom settings) with what, name, the value to note and what to do. Then a manual list of things the API cannot give, each with where to look in Setup. Anything it could not read is on the manual list, not guessed.
- After: the same reads again. It asks which production hosts your integrations point at, then flags any endpoint whose host equals a production host as pointing at production, and lists same-domain hosts as "check". If you decline to name hosts, it lists every host and says nothing was compared.
- Nothing is stored beyond the chat: copy the "before" table somewhere safe, and paste it back in the "after" chat.
Check: the "after" run flags nothing for an integration you know still points at its sandbox endpoint.
7.8 Pull request review
Needs: GitHub connected, and a pull request in a repository the connected user can see. It reviews the Apex and Flow files of one pull request against a fixed checklist of ten rules.
Make a pull request to test with
In your cockpit-practice repository, create a branch and add the file
force-app/main/default/classes/AccountUpdater.clscontaining the made-up class below. Open a pull request into the main branch.You should see A pull request page with one added file.
Made-up Apex for the test
public class AccountUpdater { public static void touch(List<Account> accts) { for (Account a : accts) { Contact c = [SELECT Id FROM Contact WHERE AccountId = :a.Id LIMIT 1]; update a; } } }
Ask the Copilot
Review pull request 1 in yourname-cockpit-test/cockpit-practice.
- A good answer lists findings, high severity first. Each has the rule (R1 to R10), the severity, the repository, the file path, the short head sha, the line range, the line quoted exactly, why it matters in one sentence and the fix. For the class above, expect R1 (a query inside a loop) and R2 (a data change inside a loop), and probably R5 (no sharing keyword).
- It reviews only Apex, trigger and Flow files and names the other changed files as not reviewed. It says how many pages of files it did not read.
- No findings is a valid answer: "No findings from the ten rules in the files I read", with the files listed.
- It never posts a comment, approves, or requests changes, and never calls the pull request safe: it read a diff, it did not run it.
Check: open the file at the sha it names and compare the quoted line and its number. If the line number matters and it was unsure, it should have confirmed with a file read before citing it.
7.9 Pull request description and release notes
Needs: GitHub connected. It writes text in the chat for you to paste. It cannot put it into the pull request.
Ask the Copilot
Write the pull request description for pull request 1 in yourname-cockpit-test/cockpit-practice, and what to tell QA.
Ask the Copilot
Write release notes for the commits between tag v1.0 and v1.1 in yourname-cockpit-test/cockpit-practice.
- A good answer uses the repository's pull request template if it has one, keeping its headings in order, and leaves every checkbox unticked with "to be ticked by the author". Without a template: Summary, Components changed (each changed file in exactly one section, such as Apex classes, Flows or Tests), Risk (low, medium or high, with the reason, stated as its judgement), Test plan and Deploy notes.
- It never says a test ran or passed unless a tool result says so. It names a ticket only if the key is in the title, description or a commit message.
- Deploy notes contain only what the file types support. A file named destructiveChanges removes components and is called out first.
- It says in one line what the text cannot know: it describes the diff and messages, not what was run or what is in the org.
Check: count the changed files on GitHub against the files listed in the answer. The guide tells the Copilot to make them match.
7.10 The Org Discovery Report
Needs: a connected Salesforce org, and the report switched on for your environment. It reads the org once, within a fixed call limit, and writes a report into a chat. It changes nothing in Salesforce.
Type
/discoveryin the message box and press Enter, or open Connectors and press Run discovery report on the org's card.You should see A progress line such as "Reading limits (5 of 7)..." and then a message that starts with "# Org discovery report".
Read the report. Its sections follow the tour: org summary, data model, automation, integration surface, limits, security risks and tech debt hints.
Download it as Markdown, or its tables as CSV, with the buttons under the report.
- The report states its date. A part the connected user cannot read is marked not readable with your access; a part skipped because the report reached its call limit, or to protect your API allowance, says so.
- Afterwards, ask follow-up questions in the same chat. The Copilot quotes the report's numbers and does not recompute them. For anything newer, it uses its tools and says the report may be out of date.
Check: compare the date and two numbers (for example the count of custom objects) with Setup.
7.11 More guides
These work the same way: read-only, honest about what they could not read, and never offering to change anything. Try them after the nine above.
| Guide | Prompt to try | Needs |
|---|---|---|
| Flow documentation | Document the active flows on Account. | Salesforce |
| Where is this used | Where is the field Region__c used? | Salesforce (GitHub adds a code search) |
| Dead metadata finder | Which metadata looks unused, and what is the evidence? | Salesforce |
| SOQL assistant | Write a SOQL query for open opportunities over 10,000 and tell me if the filter is selective. | Salesforce. Selectivity is labelled an estimate. |
| Data dictionary | Give me a data dictionary for the Account object. | Salesforce. One object at a time; CSV as text in the chat. |
| Org health score | Give me a health score for this org. | Salesforce. A count of ok, watch and act with thresholds, never a percentage. |
| Out-of-band changes | What changed in setup in the last 30 days that is not in our repository? | Salesforce and GitHub. A lead to check, not proof. |
| Mule project review | Review the Mule project in owner/repo. | GitHub (MuleSoft adds deployment facts) |
| API spec review | Review the OpenAPI file in owner/repo against our API policies. | GitHub (MuleSoft or Postman adds more) |
| Postman collection from a spec | Make a Postman collection from the OpenAPI file in owner/repo. | GitHub. Writes JSON in the chat; nothing is created in Postman. |