Field service mobile branding configure

From forcedotcom/sf-skills · View interactive version

Field service mobile branding configure is an AI agent skill from the GitHub repository forcedotcom/sf-skills. Derive a Field Service mobile app color scheme from a brand source (URL, hex codes, brand-guide paste, or color description), validate WCAG AA contrast in both light and dark mode, and apply the 14-field scheme to the org-default FieldServiceMobileSettings record. Trigger phrases include 'brand the

How to use this skill

Skill file

Field Service Mobile Branding

This skill ingests a brand source and produces a 14-field color scheme that gets applied to the org-default FieldServiceMobileSettings record (DeveloperName='Field_Service_Mobile_Settings', IsDefault=true). Confirmation with the user happens between derivation and apply — never apply without approval.

Source: This skill was authored by Chad Barbour and is mirrored from an

upstream Field Service assets repository.

Methodology, color tables, and contrast checks are unchanged from upstream — refresh from upstream when content changes there.

Runtime contract: every org interaction in this skill is a single REST

call dispatched through the Codey runtime (dispatch locally / the hosted

Headless 360 MCP in shared surfaces). This skill has **no dependency on the

execution environment** — no sf CLI, no shell scripts, no local Python, no

temp files. Colors are derived and validated by the agent inline, then

written with one sObject PATCH. Do not shell out.

Input contract

One of:

See reference/derivation-methodology.md for the four ingestion cases (A–D) in detail.

Output

A 14-field color scheme written to the org-default FieldServiceMobileSettings record via a single sObject PATCH (PATCH /services/data/vXX.0/sobjects/FieldServiceMobileSettings/{id}). Color changes appear on devices after the metadata cache refreshes (default: 7 days, force-refreshable from app Settings).

Workflow

1. Confirm the target org

Before fetching the brand source, confirm the org is reachable with a cheap auth probe — dispatch SELECT Id FROM Organization LIMIT 1 (GET /services/data/vXX.0/query):

Then ask: "Which org should I apply this to?" and wait for explicit confirmation before proceeding. Do not assume a default — even if the user mentioned an org name in their request, confirm it explicitly so there are no surprises. (The Codey runtime resolves the connected org; this skill does not manage org aliases.)

2. Ingest the brand source

Follow the cases (A–D) in reference/derivation-methodology.md. At the end of this step you should have two anchors:

3. Derive the full 14-field scheme

Apply the derivation rules in reference/derivation-methodology.md and the field semantics in reference/color-fields.md.

Hold the scheme in memory as a flat object whose keys match the 14 FieldServiceMobileSettings color fields. Use examples/salesforce-default-scheme.json as a template. Before continuing, self-check that all 14 fields are present and every value matches ^#[0-9A-Fa-f]{6}$ (6-digit hex, # prefix — 3-digit shorthand and missing # are invalid); fix any that don't before proposing.

4. Validate contrast (light + dark mode)

Compute the WCAG AA contrast ratio for each pair in reference/contrast-validation.md inline — this is deterministic arithmetic on the hex values you already hold, not an external tool. For each #RRGGBB pair:

  1. Normalize each channel: r = R/255, g = G/255, b = B/255.
  2. Linearize each channel: c ≤ 0.03928 → c/12.92, else ((c+0.055)/1.055)^2.4.
  3. Relative luminance: L = 0.2126·r + 0.7152·g + 0.0722·b.
  4. Contrast ratio: (L_lighter + 0.05) / (L_darker + 0.05).

Evaluate all 5 light-mode pairs and all 5 dark-mode pairs from reference/contrast-validation.md; a pair PASSES at ≥ 4.5:1 (WCAG AA, normal text). Surface any FAIL pairs to the user with a suggested fix in step 5. Note that brand colors are fixed across both modes, so a passing light-mode scheme can still fail dark-mode pairs.

5. Present proposal & confirm

Show the user:

Ask the user to confirm before applying. Use the suggested fixes in reference/contrast-validation.md when proposing alternatives for failing pairs.

6. Apply to org

Apply only after the user has approved the proposal in step 5. Three REST calls:

  1. Confirm FLS (optional but recommended). GET /services/data/vXX.0/sobjects/FieldServiceMobileSettings/describe and confirm each of the 14 color fields has updateable: true. A field with updateable: false (or a filtered describe) is the earliest signal the running user lacks edit access — surface that before attempting the PATCH.
  1. Resolve the org-default record. GET /services/data/vXX.0/query with SELECT Id FROM FieldServiceMobileSettings WHERE DeveloperName = 'Field_Service_Mobile_Settings' AND IsDefault = true LIMIT 1. totalSize = 0 means Field Service Mobile is not provisioned — surface the error and stop (see step 7). Otherwise take records[0].Id.
  1. Write the scheme. PATCH /services/data/vXX.0/sobjects/FieldServiceMobileSettings/{id} with a flat JSON body of the 14 color fields. Merge semantics — only fields in the body are written. Do not send IsDefault (not updateable). A 204 (no body) is success; then GET the record back to confirm the values landed.

7. Report back

On success, print:

If the apply fails because no Field_Service_Mobile_Settings record exists, surface the error and stop — Field Service Mobile may not be set up in the org. Direct the user to Setup → Field Service Mobile Settings to bootstrap the default record, then retry.

Scope

Generated automatically:

Out of scope:

Files in this skill

Contrast validation and scheme derivation are performed by the agent inline (see steps 3–4); there are no executable scripts in this skill. Org writes are single REST calls dispatched through the Codey runtime.

Related skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.