Second-generation package creation, versioning, ancestry, namespace management, and ISV distribution
From claude-sfdx-iqnpx claudepluginhub bhanu91221/claude-sfdx-iq --plugin claude-sfdx-iqThis skill uses the workspace's default tool permissions.
Ingests video/audio from files, URLs, RTSP, desktop; indexes/searches moments with timestamps/clips; transcodes/edits timelines (subtitles/overlays/dubbing); generates assets and live alerts.
Guides AI-assisted editing of real video footage: transcribe/plan cuts with Claude, execute via FFmpeg bash scripts, augment with Remotion/ElevenLabs/fal.ai, polish in Descript/CapCut.
Runs phased verification: build, types, lint, tests with coverage, security scans for secrets/console.log, and git diff review before PRs or after changes.
Second-generation packages (2GP) are the modern packaging model for Salesforce. They are source-driven, version-controlled, and built using the Salesforce CLI. 2GP supports both managed (with namespace for ISV distribution) and unmanaged (unlocked) packages. This skill covers the full lifecycle from project configuration through distribution and deprecation.
| Type | Namespace | IP Protection | Distribution | Upgradeable |
|---|---|---|---|---|
| Unlocked | Optional | None | Internal only | Yes |
| Managed 2GP | Required | Code hidden | AppExchange / ISV | Yes |
| Org-Dependent Unlocked | Optional | None | Internal only | Yes (org-specific) |
{
"packageDirectories": [
{
"path": "force-app/core",
"default": true,
"package": "MyApp-Core",
"versionName": "Spring 2026",
"versionNumber": "1.5.0.NEXT",
"versionDescription": "Core services and utilities"
},
{
"path": "force-app/billing",
"package": "MyApp-Billing",
"versionName": "Spring 2026",
"versionNumber": "2.0.0.NEXT",
"versionDescription": "Billing module",
"dependencies": [
{
"package": "MyApp-Core",
"versionNumber": "1.4.0.LATEST"
}
]
}
],
"namespace": "myns",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "62.0",
"packageAliases": {
"MyApp-Core": "0Ho1234567890AB",
"MyApp-Core@1.4.0-1": "04t1234567890AB",
"MyApp-Core@1.5.0-1": "04t1234567890CD",
"MyApp-Billing": "0Ho1234567890EF",
"MyApp-Billing@2.0.0-1": "04t1234567890GH"
}
}
| Field | Description |
|---|---|
package | Human-readable package name |
versionNumber | Format: MAJOR.MINOR.PATCH.BUILD |
NEXT | Auto-increments build number |
LATEST | Resolves to latest build of that version |
dependencies | Other packages this package requires |
namespace | Required for managed, optional for unlocked |
packageAliases | Maps names to Salesforce IDs (0Ho for package, 04t for version) |
# Create an unlocked package
sf package create --name "MyApp-Core" --package-type Unlocked \
--path force-app/core --target-dev-hub devhub
# Create a managed package
sf package create --name "MyApp-Core" --package-type Managed \
--path force-app/core --namespace myns --target-dev-hub devhub
# Create a beta version (not promoted)
sf package version create --package "MyApp-Core" \
--installation-key "secretkey123" \
--wait 30 --target-dev-hub devhub
# Create with code coverage requirement
sf package version create --package "MyApp-Core" \
--installation-key "secretkey123" \
--code-coverage --wait 30 --target-dev-hub devhub
# Create with specific definition file
sf package version create --package "MyApp-Core" \
--definition-file config/project-scratch-def.json \
--installation-key "secretkey123" \
--wait 30 --target-dev-hub devhub
# Install beta version in a scratch org or sandbox
sf package install --package "MyApp-Core@1.5.0-1" \
--installation-key "secretkey123" \
--target-org test-scratch --wait 20
# Run tests in the target org
sf apex run test --target-org test-scratch --test-level RunLocalTests --wait 10
# Promote (cannot be undone)
sf package version promote --package "MyApp-Core@1.5.0-1" --target-dev-hub devhub
Promotion rules:
sf package install --package "MyApp-Core@1.5.0-1" \
--installation-key "secretkey123" \
--target-org production --wait 20 \
--security-type AdminsOnly
Ancestry defines the upgrade path. Each new version must declare its ancestor so Salesforce can validate the upgrade is safe.
# Create version with explicit ancestor
sf package version create --package "MyApp-Core" \
--version-number 1.6.0.NEXT \
--ancestor 04tXXXXXXXXXXXXX \
--wait 30 --target-dev-hub devhub
# Skip ancestry validation (use carefully)
sf package version create --package "MyApp-Core" \
--skip-ancestor-check \
--wait 30 --target-dev-hub devhub
| Scenario | Ancestor Required |
|---|---|
| First version ever | No ancestor |
| Patch version (1.5.1) | Must descend from 1.5.0 |
| Minor version (1.6.0) | Must descend from latest promoted in 1.x |
| Major version (2.0.0) | Can skip ancestor or descend from 1.x |
| Breaking changes | New major version recommended |
{
"dependencies": [
{
"package": "MyApp-Core",
"versionNumber": "1.4.0.LATEST"
},
{
"package": "04t000000000000AAA",
"versionNumber": "3.2.0.LATEST"
}
]
}
Packages must be installed in dependency order. If Package C depends on B, and B depends on A, the install order is A, B, C.
# Install in order
sf package install --package "MyApp-Core@1.5.0-1" --target-org myorg --wait 20
sf package install --package "MyApp-Billing@2.0.0-1" --target-org myorg --wait 20
myns__CustomObject__c, myns.MyClass| Aspect | Beta | Released (Promoted) |
|---|---|---|
| Install in sandbox | Yes | Yes |
| Install in production | No | Yes |
| Delete version | Yes | No |
| Upgrade path | Testing only | Production upgrade |
| Code coverage check | Optional | Required (75%) |
# List all packages in Dev Hub
sf package list --target-dev-hub devhub
# List all versions of a package
sf package version list --package "MyApp-Core" --target-dev-hub devhub
# Get version details
sf package version report --package "MyApp-Core@1.5.0-1" --target-dev-hub devhub
# List installed packages in an org
sf package installed list --target-org myorg
# Uninstall a package
sf package uninstall --package 04t... --target-org myorg --wait 20
# Delete an unpromoted beta version
sf package version delete --package "MyApp-Core@1.5.0-3" --target-dev-hub devhub
--code-coverage before promoting