Flow Scanner Integration - Auto-fix, SARIF output, configuration-driven validation
From opspal-salesforcenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-salesforceThis skill is limited to using the following tools:
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Use Flow Scanner Integration when:
| Pattern | Command | Time Savings |
|---|---|---|
| Hard-coded IDs | --auto-fix | 5-10 min/Flow |
| Unused variables | --auto-fix | 2-5 min/Flow |
| Missing descriptions | --auto-fix | 1-2 min/Flow |
| Outdated API versions | --auto-fix | 1 min/Flow |
| Missing fault paths | --auto-fix | 5-10 min/Flow |
| Copy naming | --auto-fix | 2-3 min/Flow |
| Unconnected elements | --auto-fix | 3-5 min/Flow |
| Trigger order | --auto-fix | 1 min/Flow |
Average time savings: 20-45 minutes per Flow (70-80% reduction)
# Auto-fix workflow
node scripts/lib/flow-validator.js MyFlow.xml --auto-fix --dry-run # Preview
node scripts/lib/flow-validator.js MyFlow.xml --auto-fix # Apply
# SARIF output
node scripts/lib/flow-validator.js MyFlow.xml --sarif --output report.sarif
# Configuration
# Create .flow-validator.yml (see templates/.flow-validator.yml)
node scripts/lib/flow-validator.js MyFlow.xml # Auto-loads config
| Capability | Supported | Complexity | Notes |
|---|---|---|---|
| Auto-fix hard-coded IDs | ✅ Yes | Low | Safe to apply |
| Auto-fix unused variables | ✅ Yes | Low | Safe to apply |
| Auto-fix missing fault paths | ✅ Yes | Medium | Review recommended |
| SARIF output | ✅ Yes | Low | Standard format |
| Configuration files | ✅ Yes | Medium | Org-specific rules |
| Exception management | ✅ Yes | Medium | Flow/global level |
# 1. Full validation
node scripts/lib/flow-validator.js MyFlow.xml --checks all --best-practices
# 2. Auto-fix
node scripts/lib/flow-validator.js MyFlow.xml --auto-fix
# 3. Final validation
node scripts/lib/flow-validator.js MyFlow.fixed.xml --checks all
- name: Validate Flows
run: node scripts/lib/flow-validator.js flows/*.xml --sarif --output report.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
# Preview fixes
node scripts/lib/flow-validator.js LegacyFlow.xml --auto-fix --dry-run
# Apply fixes
node scripts/lib/flow-validator.js LegacyFlow.xml --auto-fix
# Test in sandbox
# Fix multiple Flows
for flow in flows/*.xml; do
node scripts/lib/flow-validator.js "$flow" --auto-fix
done
# .flow-validator.yml
rules:
HardcodedId:
severity: warning
auto-fix: true
UnusedVariable:
severity: warning
auto-fix: true
exceptions:
flows:
Legacy_Account_Update:
- HardcodedId # Known business-critical ID
| Rule | Detection | Severity | Auto-Fix |
|---|---|---|---|
| UnusedVariable | Variable declared but never used | Warning | ✅ Remove |
| UnconnectedElement | Element not in Flow path (BFS check) | Error | ✅ Remove |
| CopyAPIName | API name starts with "Copy_of_" | Warning | ⚠️ Prompt |
| RecursiveAfterUpdate | After-update Flow updates same object | Error | ❌ No |
| TriggerOrder | Trigger order not optimal | Warning | ✅ Set to 1000 |
| AutoLayout | Auto-layout disabled | Note | ✅ Enable |
| InactiveFlow | Flow never activated (Draft/Obsolete) | Note | ❌ No |
| UnsafeRunningContext | "System Mode without Sharing" | Warning | ❌ No |
docs/FLOW_SCANNER_INTEGRATION.md (600+ lines)docs/FLOW_SCANNER_QUICK_REFERENCE.md (400+ lines)templates/.flow-validator.yml (173 lines)Agents that should use Flow Scanner Integration:
sfdc-automation-builder - Gate 5: Auto-fix before deploymentflow-diagnostician - Flow Scanner Integration sectionflow-test-orchestrator - Auto-fix before execution testingflow-batch-operator - Batch auto-fix operationsflow-template-specialist - Auto-fix template-generated Flowsflow-segmentation-specialist - Auto-fix after segment completion