PluginBench
Skill
Fail
Audit score 45

sf-flow

jaganpro/sf-skills

Create and validate Salesforce Flows with 110-point scoring across 6 categories.

What is sf-flow?

sf-flow helps you design, build, and validate Salesforce Flows (record-triggered, screen, autolaunched, scheduled, and platform-event) with architectural guidance and bulk-safety checks. Use it when working with Flow Builder, .flow-meta.xml files, or Flow-specific automation decisions.

  • Choose the right Flow type (before-save, after-save, screen, autolaunched, scheduled, platform-event, AI Decision)
  • Generate Flow XML from templates for common patterns
  • Validate bulk safety (no DML/Get Records in loops, fault paths, trigger conditions)
  • Score Flows across 6 categories with 110-point scale (88+ production-ready)
  • Orchestrate subflows and parent-child Flow composition
  • Integrate with AI Decision elements for sentiment, intent, and tone routing

How to install sf-flow

npx skills add https://github.com/jaganpro/sf-skills --skill sf-flow
Prerequisites
  • Salesforce org with Flow Builder enabled
  • Target org alias configured (for deployment or validation)
  • Related objects and fields must exist before Flow creation
Claude Code
Cursor
Windsurf
Cline

How to use sf-flow

  1. 1.Gather context: flow type, trigger object, entry conditions, and business goal
  2. 2.Choose the right Flow type using the provided decision table (before-save, after-save, screen, autolaunched, scheduled, platform-event)
  3. 3.Start from a template in assets/ (record-triggered-before-save.xml, screen-flow-template.xml, etc.)
  4. 4.Build or edit the Flow in Flow Builder or XML, applying high-signal rules (no DML in loops, proper fault paths, safe subflow composition)
  5. 5.Validate against Flow guardrails and bulk-safety checklist
  6. 6.Run Flow tests using sf flow run test --target-org <alias> --json
  7. 7.Hand off deployment to sf-deploy and test data seeding to sf-data

Use cases

Good for
  • Build a before-save record-triggered Flow to update same-record fields on Account creation
  • Design an after-save Flow to send emails and create related records when an Opportunity closes
  • Create a screen Flow for guided data entry with conditional branching and validation
  • Architect an autolaunched subflow library for reusable business logic across multiple Flows
  • Validate a scheduled Flow for bulk record processing with proper error handling and fault paths
Who it's for
  • Salesforce developers building declarative automation
  • Admins designing record-triggered and screen Flows
  • Architects planning Flow orchestration and subflow composition
  • Teams migrating from Process Builder to Flows

sf-flow FAQ

When should I use Flow instead of Apex or a formula field?

Use Flow for declarative, reusable automation. Choose before-save for same-record updates, after-save for related records/emails/callouts, and screen Flows for guided UI. Delegate to Apex (sf-apex) for complex imperative logic and to formula fields for simple calculations.

What is the 110-point scoring system?

Flows are scored across 6 categories with a total of 110 points. Scores of 88+ indicate production-ready Flows, 75–87 are good with review items, 60–74 need stronger guardrails, and below 60 are unsafe for deployment.

How do I avoid bulk safety issues?

Never place DML or Get Records inside loops. Test with 251+ records when bulk behavior matters. Use Transform elements for data shaping instead of per-record branching. Always include fault paths for data-changing operations.

Can I use AI Decision elements in Flows?

Yes. Use autolaunched Flows with AI Decision elements for sentiment, intent, and tone evaluation. Do not place AI Decision elements inside loops (credit cost per iteration), and ensure prompts include merge field references for data context.

What should I do after building a Flow?

Deploy using sf-deploy for safe deployment sequencing, then use sf-data to create realistic bulk test data for post-deploy verification. Run sf flow run test to validate Flow behavior in the org.

Full instructions (SKILL.md)

Source of truth, from jaganpro/sf-skills.


name: sf-flow description: > Creates and validates Salesforce Flows with 110-point scoring. TRIGGER when: user builds or edits record-triggered, screen, autolaunched, or scheduled flows, or touches .flow-meta.xml files. DO NOT TRIGGER when: Apex automation (use sf-apex), process builder migration questions only, or non-Flow declarative config (use sf-metadata). license: MIT metadata: version: "2.1.0" author: "Jag Valaiyapathy" scoring: "110 points across 6 categories"

sf-flow: Salesforce Flow Creation and Validation

Use this skill when the user needs Flow design or Flow XML work: record-triggered, screen, autolaunched, scheduled, or platform-event Flows, including validation, architecture choices, and safe deployment sequencing.

When This Skill Owns the Task

Use sf-flow when the work involves:

  • .flow-meta.xml files
  • Flow Builder architecture and XML generation
  • record-triggered, screen, scheduled, autolaunched, or platform-event flows
  • Flow-specific bulk safety, fault paths, and subflow orchestration

Delegate elsewhere when the user is:

  • writing Apex-first automation → sf-apex
  • creating objects / fields first → sf-metadata
  • deploying metadata → sf-deploy
  • seeding post-deploy test data → sf-data

Required Context to Gather First

Ask for or infer:

  • flow type
  • trigger object / entry conditions
  • core business goal
  • whether this is new, refactor, or repair
  • target org alias if deployment or validation is needed
  • whether related objects / fields already exist

Recommended Workflow

1. Choose the right automation tool

Before building, confirm Flow is the right answer rather than:

  • formula field
  • validation rule
  • roll-up summary
  • Apex

2. Choose the right Flow type

NeedDefault flow type
same-record update before savebefore-save record-triggered
related-record work / emails / calloutsafter-save record-triggered
guided UIscreen flow
reusable background logicautolaunched / subflow
scheduled processingscheduled flow
event-driven declarative responseplatform-event flow
AI-evaluated routing (sentiment, intent, tone)autolaunched with AI Decision element

3. Start from a template

Prefer the provided assets:

  • assets/record-triggered-before-save.xml
  • assets/record-triggered-after-save.xml
  • assets/screen-flow-template.xml
  • assets/autolaunched-flow-template.xml
  • assets/scheduled-flow-template.xml
  • assets/platform-event-flow-template.xml
  • assets/ai-decision-template.xml
  • assets/subflows/

4. Validate against Flow guardrails

Focus on:

  • no DML in loops
  • no Get Records inside loops
  • proper fault paths
  • correct trigger conditions
  • safe subflow composition
  • AI Decision elements not placed inside loops (credit cost per iteration)
  • AI Decision prompts include merge field references for data context

5. Hand off deployment and testing

Use:

  • sf-deploy for deploy / dry-run
  • sf-data for high-volume test data

High-Signal Rules

Flow architecture

  • before-save for same-record field updates
  • after-save for related records, emails, and callouts
  • do not loop over $Record
  • use subflows when logic becomes wide or repetitive

Bulk safety

  • no DML in loops
  • no Get Records in loops
  • test with 251+ records when bulk behavior matters
  • prefer Transform when the job is shaping data, not per-record branching

Error handling

  • every data-changing path should have fault handling
  • avoid self-referencing fault connectors
  • deploy Flows as Draft first when activation risk is non-trivial

Output Format

When finishing, report in this order:

  1. Flow type and goal
  2. Files created or updated
  3. Architecture choices
  4. Bulk/error-handling notes
  5. Deploy/testing next steps

Suggested shape:

Flow: <name>
Type: <flow type>
Files: <paths>
Design: <trigger choice, subflows, key decisions>
Risks: <bulk safety, fault paths, dependencies>
Next step: <dry-run deploy, activate, or test>

Flow Testing (CLI)

Run Flow tests from the command line without VS Code:

# Run all flow tests
sf flow run test --target-org <alias> --json

# Run tests for a specific flow
sf flow run test --class-names MyFlow --target-org <alias> --json

# Get results for an asynchronous run
sf flow get test --test-run-id <id> --target-org <alias> --json

Flow tests execute in the org and can take 1-5 minutes. sf flow run test returns a test run ID for asynchronous runs; use sf flow get test to retrieve results later. Always run with --json and use background execution for longer runs.


Cross-Skill Integration

NeedDelegate toReason
create objects / fields firstsf-metadataschema readiness
deploy / activate flowsf-deploysafe deployment sequence
create realistic bulk test datasf-datapost-deploy verification
create Apex actions / invocablessf-apeximperative logic
embed LWC in a screen flowsf-lwccustom UI components
expose Flow to Agentforcesf-ai-agentscriptagent action orchestration

Reference Map

Start here

Design / orchestration

AI Decision

Screen / integration / troubleshooting


Score Guide

ScoreMeaning
88+production-ready Flow
75–87good Flow with some review items
60–74functional but needs stronger guardrails
< 60unsafe / incomplete for deployment