flow-audit
Skill1 starsChanged 7 months agoMITView on GitHub
Inventory active Flows in the target org, classify them by trigger type and purpose, flag overlaps with Apex triggers in source, and surface flows that lack source-control coverage. Useful before recommending new automation (Flow vs. Trigger decision) and during automation audits.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- gabrielh-silvestre/hexlogtheir own version, first seen Nov 8, 2026
- Aboudjem/ui-ux-suitetheir own version, first seen Nov 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Aboudjem/ui-ux-suite★ 8same name
- gabrielh-silvestre/hexlog★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- adrSkill
- agent-deploySkill
- agent-discoverSkill
- agent-eval-trendSkill
- agent-exchange-listSkill
- agent-specSkill
- agent-testSkill
- agent-vs-flow-vs-apexSkill
- before-vs-after-triggerSkill
- code-reviewSkill
- complexitySkill
- coverage-trendSkill
- dead-codeSkill
- dependency-graphSkill
- deploySkill
- destructive-changesSkill
- diff-deploySkill
- erdSkill
- field-impactSkill
- flaky-test-finderSkill
- flow-vs-apexSkill
- fls-auditSkill
- gateway-configSkill
- generate-docsSkill
- limit-usageSkill
- lwc-vs-reactSkill
- mcp-tool-vs-restSkill
- notifySkill
- onboardSkill
- org-diffSkill
- org-exploreSkill
- package-versionSkill
- pattern-packSkill
- perf-reviewSkill
- permset-auditSkill
- pr-prepareSkill
- queueable-vs-batchSkill
- quick-deploySkill
- react-initSkill
- release-notesSkill
- scratch-orgSkill
- security-scanSkill
- sequence-diagramSkill
- sf-initSkill
- sharing-reviewSkill
- slack-agentSkill
- soql-analyzerSkill
- test-coverageSkill
- test-dataSkill
- test-planSkill
- trust-evalSkill
- trust-layer-auditSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
If <object> was provided, add AND TriggerObjectOrEvent.QualifiedApiName = '<object>'.
- Distinctive: line 137
No row counts in the report unless you queried for them: Run-history queries are expensive and not always available.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are auditing record-triggered, screen, scheduled, and platform-event Flows in the target org. Output a structured report so the user — or @architect — can decide how to consolidate, replace, or leave them alone.
Read Project Config First
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/sf-cli.sh"
sf_cli_check || exit 2
ORG="$(sf_config_get '.platform.defaultTargetOrg' "$ENV")"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"Input
$ARGUMENTS:
- (empty) — full audit of active Flows
<object>— limit to flows that target a specific sObject (e.g.,Account)--include-inactive— include inactive flow versions in the inventory--target-org <alias>/--env <name>— standard overrides--ci/--format json|sarif/--out <path>— see CI output contract
Steps
1. Inventory active Flows
sf_cli_query "
SELECT DeveloperName, Label, ProcessType, TriggerType, TriggerObjectOrEvent.QualifiedApiName,
ActiveVersion.VersionNumber, ActiveVersion.Status,
LastModifiedBy.Name, LastModifiedDate, ManageableState
FROM FlowDefinitionView
WHERE IsActive = TRUE
ORDER BY TriggerType, TriggerObjectOrEvent.QualifiedApiName, DeveloperName
" "$ORG"If <object> was provided, add AND TriggerObjectOrEvent.QualifiedApiName = '<object>'.
2. Classify by ProcessType + TriggerType
| ProcessType | Meaning | Notes |
AutoLaunchedFlow + RecordBeforeSave | Before-save record-triggered flow | Pre-DML field set; same-record updates only, no callouts |
AutoLaunchedFlow + RecordAfterSave | After-save record-triggered flow | Cross-object DML, async; high concurrency risk |
AutoLaunchedFlow + Scheduled | Scheduled flow | Runs on a schedule; check frequency |
Flow | Screen flow | User-facing, requires visibility into the app/page |
AutoLaunchedFlow + PlatformEvent | Platform-event-triggered flow | Subscriber to a Platform Event |
Workflow | Legacy Workflow Rule (auto-migrated) | Retire in favor of Flow |
ProcessBuilder | Process Builder (deprecated) | Retire — Salesforce has end-of-life dates |
3. Detect Apex-trigger / Flow overlaps
For each record-triggered Flow on object O:
grep -l "trigger .* on $O " "$APEX_SRC"/*.trigger 2>/dev/nullIf overlap, flag:
- Both Flow and Apex Trigger run on the same object → unpredictable order, governor-limit risk
- Recommend: consolidate (use one or the other), or document the order if both must coexist
4. Detect orphan flows (no source coverage)
Cross-reference flow DeveloperName against force-app/**/flows/*.flow-meta.xml:
- Active in org AND present in source — ✅ tracked
- Active in org AND NOT in source — ⚠️ untracked (will not deploy elsewhere; missing from CI/CD)
- In source AND NOT active — ✅ deactivated; possibly intentional
5. Output
Default Markdown report:
# Flow Audit: <ORG>
Run at: 2026-04-28T10:40:00Z
Active flows: 12
## Active record-triggered flows
| DeveloperName | Object | TriggerType | Modified by | In source? | Apex overlap? |
|---------------|--------|-------------|-------------|------------|---------------|
| Acct_Set_Region_AfterSave | Account | RecordAfterSave | jdoe@... | ✅ | ⚠️ AccountTrigger |
| Case_Auto_Assign | Case | RecordBeforeSave | gov-user | ❌ untracked | — |
## Active screen flows
| DeveloperName | Label | Modified by | In source? |
|---------------|-------|-------------|------------|
| ...
## Active scheduled flows
| DeveloperName | Frequency | Last modified | In source? |
|---------------|-----------|---------------|------------|
## Active platform-event flows
...
## Findings
### ⚠️ Untracked active flows (3)
These run in production but aren't in source control:
- `Case_Auto_Assign` — last modified 2026-04-15 by gov-user
- ...
### ⚠️ Apex/Flow overlaps (1)
Same-object automation in two technologies:
- Account: `Acct_Set_Region_AfterSave` (Flow) + `AccountTrigger` (Apex)
### ⚠️ Deprecated automation in use (2)
- `Old_Process_Builder_X` (ProcessBuilder) — Salesforce end-of-life
- `Workflow_Auto_Email` (Workflow) — migrate to FlowCI mode emits findings in the internal shape (see docs/ci-output-contract.md):
FLOW-UNTRACKED—warningper untracked active flowFLOW-APEX-OVERLAP—warningper same-object overlapFLOW-DEPRECATED—errorfor ProcessBuilder/Workflow
6. Exit codes
- 0 — no findings
- 1 — any
FLOW-*findings - 2 — query/setup error
Rules
- Don't try to read flow contents. Flow XML parsing is heavy; this skill is metadata-only. Use
/argo:field-impactif you need to know which fields a Flow touches - Don't audit inactive flows by default. They're harmless and noisy
- Honor managed packages. Flows from a managed package (
ManageableState != 'unmanaged') are not the user's concern; report them in a separate "From Managed Packages" section - No row counts in the report unless you queried for them. Run-history queries are expensive and not always available; don't fake metrics
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

