/dx-org-trial-expiration-check
Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org
$ npx -y skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/dx-org-trial-expiration-check
Context preview
The summary Claude sees to decide when to auto-load this skill.
Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org
SKILL.md
dx-org-trial-expiration-check.SKILL.mdname: dx-org-trial-expiration-check
description: "Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org still active\", \"how many days are left\", \"which orgs are expiring soon\", wants to filter orgs expiring within N days, needs machine-readable (JSON/CSV) output for cron or alerting, wants to back up an at-risk org before it lapses, or asks how to extend or renew an expiring trial or Developer Edition org. Covers trial editions, Developer Edition orgs (anything with a TrialExpirationDate), and scratch orgs (via sf org list). DO NOT TRIGGER for sandbox refresh timing, for creating, deleting, or switching the active org, or for non-Salesforce trials such as AWS, Netflix, or other vendors — this skill reads expiration and prints guidance, it does not modify orgs."
allowed-tools: Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date)
metadata:
version: "2.0"
cliTools:
- tool: ["jq"]
semver: ">=1.6.0"
- tool: ["sf"]
semver: ">=2.0.0"Org Expiration Check
Determine when a Salesforce org expires, how many days remain, and whether it has already expired — for one org, the default org, or every authenticated org. Results are **prioritized** (already-expired and soonest-expiring first) with a one-line summary. The skill can also emit machine-readable output for alerting, print **backup** commands for an at-risk org, and explain how to **renew** an expiring trial or Developer Edition org.
When to use
Trigger on requests like:
- "When does my trial org expire?" / "Is it still active or has it expired?"
- "How many days are left on my trial?"
- "Which of my orgs are expiring soon?" / "expiring within 30 days?"
- "Alert me / set up a cron job for expiring orgs" (use `--json` + `--fail-if-expiring`).
- "Back up my org before it expires" (use `--preserve`).
- "How do I extend / renew my trial (or Developer Edition) org?" (use `--renew`).
This skill covers **trial editions, Developer Edition orgs** (anything with a `TrialExpirationDate`), and **scratch orgs** (via the `expirationDate` from `sf org list`).
When NOT to use
Do **not** trigger this skill for:
- **Sandbox refresh timing** — that is not an expiration date.
- **Creating, deleting, or switching orgs** — this skill only *reads*
expiration and *prints* guidance; it never creates, deletes, refreshes, or changes the active/default org. (To switch the default org, use `dx-org-switch`.)
- **Non-Salesforce trials** — e.g. AWS free tier, Netflix, or any other
vendor's trial. This skill is Salesforce-only.
How expiration is determined
- **Trial / Developer Edition orgs:** the authoritative source is the org's
`Organization.TrialExpirationDate` field, read via SOQL (`sf data query`). This field is `null` for paid/production orgs, which therefore report **no trial expiration** — that is expected, not an error.
- **Scratch orgs:** the `expirationDate` reported by `sf org list` (no SOQL
query is issued for scratch orgs).
Steps
1. **CRITICAL:** Run the bundled helper script, which handles date math (days remaining, expired, expiring-soon warnings), prioritized sorting, and structured output, and works on macOS and Linux. Always invoke it by **absolute path** from the skill directory — never `./scripts/`, which resolves against the user's current directory and will either run the wrong script or fail.
**Before executing, verify:**
- [ ] `<skill_dir>` is an absolute path (starts with `/`), not a relative path
- [ ] The path points at this skill's own directory (the one containing this SKILL.md)
bash "<skill_dir>/scripts/check_expiration.sh" <alias-or-username> # one org
bash "<skill_dir>/scripts/check_expiration.sh" # default org (target-org config)
bash "<skill_dir>/scripts/check_expiration.sh" --all # every authenticated org
bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30 # only orgs expiring within 30 days
`<skill_dir>` is the absolute path to the directory containing this SKILL.md.
2. Relay the script output to the user. When an org could not be queried, surface the `sf org login web` command the script prints so the user can authenticate. Pick optional flags based on what the user asked for (see below): `--preserve` when they want to save their work, `--renew` when they ask how to extend, `--json`/`--csv` for automation, `--fail-if-expiring` for a cron/CI gate.
Options
| Flag | Purpose | |------|---------| | `--all`, `-a` | Check every authenticated org. | | `--within <days>`, `-w` | Show only orgs expiring within N days (includes already-expired; omits paid/production). `--within=30` also works. | | `--json` | Emit a JSON array of org records (data only). | | `--csv` | Emit CSV rows (data only). | | `--preserve` | Print backup commands for expiring/expired orgs. | | `--renew` | Print trial/DE extension & reactivation guidance. | | `--fail-if-expiring[=N]` | Exit 3 if any org expires within N days (default 7). | | `--no-scratch` | Exclude scratch orgs (trial/DE only). | | `--help`, `-h` | Show usage. |
Flag order is flexible and flags combine (e.g. `--all --within 30 --json`).
Prioritized output
Human output is grouped by urgency — **Expired** first, then **Expiring soon** (within 7 days, flagged `Warning`), then **Active**, then **No trial expiration**, then any orgs that could not be queried — and ends with a one-line summary:
Org expiration status for all authenticated orgs:
Expired:
old-trial trial/DE edition expired 2026-06-20 (EXPIRED 19 day(s) ago)
Expiring soon (within 7 day(s)):
almost-up trial/DE edi
Read more
name: dx-org-trial-expiration-check
description: "Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org still active\", \"how many days are left\", \"which orgs are expiring soon\", wants to filter orgs expiring within N days, needs machine-readable (JSON/CSV) output for cron or alerting, wants to back up an at-risk org before it lapses, or asks how to extend or renew an expiring trial or Developer Edition org. Covers trial editions, Developer Edition orgs (anything with a TrialExpirationDate), and scratch orgs (via sf org list). DO NOT TRIGGER for sandbox refresh timing, for creating, deleting, or switching the active org, or for non-Salesforce trials such as AWS, Netflix, or other vendors — this skill reads expiration and prints guidance, it does not modify orgs."
allowed-tools: Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date)
metadata:
version: "2.0"
cliTools:
- tool: ["jq"]
semver: ">=1.6.0"
- tool: ["sf"]
semver: ">=2.0.0"Org Expiration Check
Determine when a Salesforce org expires, how many days remain, and whether it has already expired — for one org, the default org, or every authenticated org. Results are **prioritized** (already-expired and soonest-expiring first) with a one-line summary. The skill can also emit machine-readable output for alerting, print **backup** commands for an at-risk org, and explain how to **renew** an expiring trial or Developer Edition org.
When to use
Trigger on requests like:
- "When does my trial org expire?" / "Is it still active or has it expired?"
- "How many days are left on my trial?"
- "Which of my orgs are expiring soon?" / "expiring within 30 days?"
- "Alert me / set up a cron job for expiring orgs" (use `--json` + `--fail-if-expiring`).
- "Back up my org before it expires" (use `--preserve`).
- "How do I extend / renew my trial (or Developer Edition) org?" (use `--renew`).
This skill covers **trial editions, Developer Edition orgs** (anything with a `TrialExpirationDate`), and **scratch orgs** (via the `expirationDate` from `sf org list`).
When NOT to use
Do **not** trigger this skill for:
- **Sandbox refresh timing** — that is not an expiration date.
- **Creating, deleting, or switching orgs** — this skill only *reads*
expiration and *prints* guidance; it never creates, deletes, refreshes, or changes the active/default org. (To switch the default org, use `dx-org-switch`.)
- **Non-Salesforce trials** — e.g. AWS free tier, Netflix, or any other
vendor's trial. This skill is Salesforce-only.
How expiration is determined
- **Trial / Developer Edition orgs:** the authoritative source is the org's
`Organization.TrialExpirationDate` field, read via SOQL (`sf data query`). This field is `null` for paid/production orgs, which therefore report **no trial expiration** — that is expected, not an error.
- **Scratch orgs:** the `expirationDate` reported by `sf org list` (no SOQL
query is issued for scratch orgs).
Steps
1. **CRITICAL:** Run the bundled helper script, which handles date math (days remaining, expired, expiring-soon warnings), prioritized sorting, and structured output, and works on macOS and Linux. Always invoke it by **absolute path** from the skill directory — never `./scripts/`, which resolves against the user's current directory and will either run the wrong script or fail.
**Before executing, verify:**
- [ ] `<skill_dir>` is an absolute path (starts with `/`), not a relative path
- [ ] The path points at this skill's own directory (the one containing this SKILL.md)
bash "<skill_dir>/scripts/check_expiration.sh" <alias-or-username> # one org bash "<skill_dir>/scripts/check_expiration.sh" # default org (target-org config) bash "<skill_dir>/scripts/check_expiration.sh" --all # every authenticated org bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30 # only orgs expiring within 30 days
`<skill_dir>` is the absolute path to the directory containing this SKILL.md.
2. Relay the script output to the user. When an org could not be queried, surface the `sf org login web` command the script prints so the user can authenticate. Pick optional flags based on what the user asked for (see below): `--preserve` when they want to save their work, `--renew` when they ask how to extend, `--json`/`--csv` for automation, `--fail-if-expiring` for a cron/CI gate.
Options
| Flag | Purpose | |------|---------| | `--all`, `-a` | Check every authenticated org. | | `--within <days>`, `-w` | Show only orgs expiring within N days (includes already-expired; omits paid/production). `--within=30` also works. | | `--json` | Emit a JSON array of org records (data only). | | `--csv` | Emit CSV rows (data only). | | `--preserve` | Print backup commands for expiring/expired orgs. | | `--renew` | Print trial/DE extension & reactivation guidance. | | `--fail-if-expiring[=N]` | Exit 3 if any org expires within N days (default 7). | | `--no-scratch` | Exclude scratch orgs (trial/DE only). | | `--help`, `-h` | Show usage. |
Flag order is flexible and flags combine (e.g. `--all --within 30 --json`).
Prioritized output
Human output is grouped by urgency — **Expired** first, then **Expiring soon** (within 7 days, flagged `Warning`), then **Active**, then **No trial expiration**, then any orgs that could not be queried — and ends with a one-line summary:
Org expiration status for all authenticated orgs: Expired: old-trial trial/DE edition expired 2026-06-20 (EXPIRED 19 day(s) ago) Expiring soon (within 7 day(s)): almost-up trial/DE edi
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Other skills on sf-skills.
- /agentforce-generate
Build, modify, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, optimizes, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent actions, tools,
Open skill - /agentforce-observe
Analyze production Agentforce agent behavior using session traces and Data Cloud. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance issues; asks about session traces, conversation logs,
Open skill - /agentforce-test
Write, run, and analyze structured test suites for Agentforce agents — functional AND security. TRIGGER when: user writes or modifies test spec YAML (AiEvaluationDefinition); runs sf agent test create, run, run-eval, or results commands; asks about test coverage strategy, metric
Open skill - /automation-flow-generate
Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as \"when a record is
Open skill - /dx-code-analyzer-configure
Set up, configure, and troubleshoot Salesforce Code Analyzer for any project. Handles installation, prerequisite checks, diagnosing broken setups, creating and editing code-analyzer.yml overrides, engine-specific settings, ignore patterns, severity overrides, and CI/CD pipeline
Open skill - /dx-code-analyzer-custom-rule-create
Create custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the
Open skill

