@salesforce/afv-skills 1.24.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/package.json +1 -1
  2. package/skills/commerce-b2b-open-code-components-replace/SKILL.md +244 -0
  3. package/skills/commerce-b2b-open-code-components-replace/assets/ootb-to-open-code-mapping.json +66 -0
  4. package/skills/dx-devops-test-failures-analyze/SKILL.md +89 -0
  5. package/skills/dx-devops-test-failures-analyze/references/code-analyzer-violations.md +26 -0
  6. package/skills/dx-devops-test-failures-analyze/references/failure-categories.md +85 -0
  7. package/skills/{checking-devops-prerequisites/SKILL.md → dx-devops-test-failures-analyze/references/prerequisite-checks.md} +8 -37
  8. package/skills/{creating-fix-work-item/SKILL.md → dx-devops-test-failures-analyze/references/work-item-creation.md} +8 -12
  9. package/skills/dx-devops-test-pipeline-configure/SKILL.md +72 -0
  10. package/skills/dx-devops-test-pipeline-configure/references/configuring-quality-gate.md +133 -0
  11. package/skills/dx-devops-test-pipeline-configure/references/configuring-test-provider.md +80 -0
  12. package/skills/dx-devops-test-pipeline-configure/references/error-handling.md +39 -0
  13. package/skills/dx-devops-test-pipeline-configure/references/gotchas.md +37 -0
  14. package/skills/dx-devops-test-pipeline-configure/references/prerequisite-checks.md +112 -0
  15. package/skills/dx-devops-test-pipeline-configure/references/syncing-test-providers.md +69 -0
  16. package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +74 -0
  17. package/skills/dx-devops-test-suite-assignments-configure/references/api-endpoint.md +30 -0
  18. package/skills/dx-devops-test-suite-assignments-configure/references/error-handling.md +14 -0
  19. package/skills/dx-devops-test-suite-assignments-configure/references/prerequisite-checks.md +112 -0
  20. package/skills/{recommending-devops-tests/SKILL.md → dx-devops-test-suite-assignments-configure/references/recommendation-logic.md} +10 -26
  21. package/skills/dx-devops-test-suite-assignments-configure/references/suite-assignment-modes.md +99 -0
  22. package/skills/dx-devops-test-suite-run/SKILL.md +111 -0
  23. package/skills/dx-devops-test-suite-run/references/error-handling.md +31 -0
  24. package/skills/dx-devops-test-suite-run/references/polling-configuration.md +78 -0
  25. package/skills/dx-devops-test-suite-run/references/prerequisite-checks.md +112 -0
  26. package/skills/dx-devops-test-suite-run/references/retrigger-mode.md +51 -0
  27. package/skills/dx-org-manage/SKILL.md +192 -0
  28. package/skills/dx-org-manage/examples/README.md +45 -0
  29. package/skills/dx-org-manage/examples/scratch-orgs/error_no_devhub.json +9 -0
  30. package/skills/dx-org-manage/examples/scratch-orgs/error_timeout.json +13 -0
  31. package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +28 -0
  32. package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +26 -0
  33. package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +27 -0
  34. package/skills/dx-org-manage/examples/snapshots/error_output.json +9 -0
  35. package/skills/dx-org-manage/examples/snapshots/success_output.json +15 -0
  36. package/skills/dx-org-manage/references/cli_flags.md +67 -0
  37. package/skills/dx-org-manage/references/creating-scratch-org.md +164 -0
  38. package/skills/dx-org-manage/references/creating-snapshot.md +103 -0
  39. package/skills/dx-org-manage/references/definition_file_options.md +224 -0
  40. package/skills/dx-org-manage/references/edition_types.md +78 -0
  41. package/skills/dx-org-manage/references/opening-org.md +160 -0
  42. package/skills/dx-org-manage/references/snapshot_usage.md +74 -0
  43. package/skills/dx-org-permission-set-assign/SKILL.md +98 -0
  44. package/skills/dx-org-permission-set-assign/examples/error_output.json +19 -0
  45. package/skills/dx-org-permission-set-assign/examples/success_output.json +16 -0
  46. package/skills/dx-org-permission-set-assign/references/cli_flags.md +68 -0
  47. package/skills/experience-cms-brand-apply/SKILL.md +1 -1
  48. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +31 -19
  49. package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +1 -1
  50. package/skills/experience-ui-bundle-frontend-generate/implementation/header-footer.md +1 -1
  51. package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +336 -581
  52. package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +172 -0
  53. package/skills/experience-ui-bundle-salesforce-data-access/references/graphiti-cli.md +373 -0
  54. package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +376 -0
  55. package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +119 -0
  56. package/skills/experience-ui-bundle-salesforce-data-access/references/rest-and-integration.md +152 -0
  57. package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +217 -0
  58. package/skills/experience-ui-bundle-salesforce-data-access/scripts/graphql-search.sh +36 -9
  59. package/skills/platform-agentsetup-categories-fetch/SKILL.md +109 -0
  60. package/skills/platform-agentsetup-categories-fetch/references/api-response-schema.md +121 -0
  61. package/skills/platform-custom-object-generate/SKILL.md +62 -7
  62. package/skills/platform-custom-object-generate/references/description-enrichment.md +125 -0
  63. package/skills/platform-metadata-retrieve/SKILL.md +121 -0
  64. package/skills/platform-metadata-retrieve/examples/error_output.json +10 -0
  65. package/skills/platform-metadata-retrieve/examples/success_output.json +27 -0
  66. package/skills/platform-metadata-retrieve/references/cli_flags.md +138 -0
  67. package/skills/platform-metadata-retrieve/references/retrieval_modes.md +181 -0
  68. package/skills/platform-sharing-rules-generate/SKILL.md +165 -0
  69. package/skills/platform-sharing-rules-generate/references/rule-types.md +199 -0
  70. package/skills/platform-tracing-agentforce-configure/SKILL.md +118 -0
  71. package/skills/platform-tracing-agentforce-configure/assets/AgentforcePlatformTracing-template.xml +4 -0
  72. package/skills/platform-tracing-configure/SKILL.md +118 -0
  73. package/skills/platform-tracing-configure/assets/EventSettings-template.xml +4 -0
  74. package/skills/platform-trust-archive-manage/SKILL.md +25 -11
  75. package/skills/platform-trust-archive-manage/examples/monitor-failed-jobs.md +2 -2
  76. package/skills/platform-trust-archive-manage/references/archive-activity-entity.md +1 -1
  77. package/skills/platform-trust-archive-manage/references/connect-api-operations.md +51 -12
  78. package/skills/analyzing-test-failures/SKILL.md +0 -159
  79. package/skills/configuring-quality-gate/SKILL.md +0 -120
  80. package/skills/configuring-test-provider/SKILL.md +0 -113
  81. package/skills/managing-suite-assignments/SKILL.md +0 -161
  82. package/skills/polling-test-results/SKILL.md +0 -72
  83. package/skills/running-devops-test-suite/SKILL.md +0 -144
  84. package/skills/syncing-test-providers/SKILL.md +0 -108
@@ -0,0 +1,125 @@
1
+ <!-- Parent: platform-custom-object-generate/SKILL.md -->
2
+
3
+ # Object Description Enrichment
4
+
5
+ The `<description>` on a Custom Object must read like human-written documentation.
6
+
7
+ ---
8
+
9
+ ## When & How — always compose, confirm the text, write
10
+
11
+ A `<description>` is **mandatory** — always compose one. Do it when **creating** the object and again on **any** change: adding, updating, or deleting a field **or a validation rule** (keeps it from going stale). Validation-rule changes count exactly like field changes — the change isn't done until the description is refreshed. Never ask *whether* to add a description; the only thing to confirm is the **wording**.
12
+
13
+ **Confirm per change.** Propose and confirm on **each** change separately. A prior "keep current" applies to that one change only — it is never standing permission to skip the proposal on a later change.
14
+
15
+ Why confirm the wording: an existing description may be hand-authored by an admin (carrying context the schema can't reveal) or generated earlier — you can't tell which from the file, so don't overwrite it silently.
16
+
17
+ **Compose** the description (Steps 1–2 below). If one already exists, use it as a **strong signal** — preserve its business context and fold the new field/rule in; don't discard good prose. Then branch:
18
+
19
+ - **No existing description (brand-new object):** nothing to overwrite — just write the composed description. **Do not prompt.**
20
+ - **An existing description (update / delete / any re-enrichment):** never overwrite it silently. Show the proposal, ask, and **STOP — wait for the user's reply before writing:**
21
+ ```text
22
+ Proposed description for <Object>:
23
+ <enriched description>
24
+ Current: <existing description>
25
+ Use this? (yes / keep current / edit)
26
+ ```
27
+ **Do NOT write the `<description>` until the user replies** — showing the diff is not approval, even when the change looks obvious. Then act: *yes* → write proposed · *keep current* → leave untouched · *edit* → use the user's wording.
28
+
29
+ Always end with a `<description>` written.
30
+
31
+ ---
32
+
33
+ ## Step 1 — Classify Description Signals
34
+
35
+ Each field is classified by how it should appear in the enriched description:
36
+
37
+ | Classification | Criteria | Enriched output |
38
+ |---------------|----------|--------------------|
39
+ | **Constrained** | required, unique, externalId, restricted picklist | Selective parenthetical: `VIN (required, external ID)`, `Color (Red/Green only)` |
40
+ | **Behavioral** | formula / calculated, roll-up summary | Dedicated clause describing behavior: "the Age Years field auto-calculates vehicle age", "Total Service Cost summarizes related service records" — never formula syntax |
41
+ | **Relationship** | master-detail, lookup | Woven context: "as a child of Account", "links to User" — never "(Master-Detail to Account)" |
42
+ | **Standard** | everything else | Label only, no annotation |
43
+
44
+ When selecting which fields to surface, prioritize **constrained > behavioral > relationship > standard**.
45
+
46
+ Plus two non-field signals:
47
+ - **Business purpose** — from the user's words ("track projects", "manage inventory") or inferred from object name + key fields. Becomes the opening.
48
+ - **Common use cases** — infer 2-3 practical uses from purpose, fields, and relationships ("fleet management", "service scheduling"); `helpText` and conversation context are hints.
49
+
50
+ ---
51
+
52
+ ## Step 2 — Compose the Description
53
+
54
+ Compose in this order:
55
+
56
+ ```text
57
+ 1 (Purpose): "The {Object_Label} object {verb_phrase}."
58
+ 2 (Key fields): "It captures {labels with selective context}."
59
+ 3 (Computed): "The {Label} field auto-calculates {what}, while {Label} summarizes {what}."
60
+ 4 (Rules): "Validation rules enforce {human-readable constraints}."
61
+ 5 (Use cases): "Commonly used for {use_case_1}, {use_case_2}, and {use_case_3}."
62
+ ```
63
+
64
+ Sentences 1 and 2 are always included. Apply these conditions to 3–5:
65
+ - **Sentence 3 (Computed):** include only if the object has formula or roll-up fields; omit if it has none.
66
+ - **Sentence 4 (Rules):** include only if the object has validation rules; omit if it has none.
67
+ - **Sentence 5 (Use cases):** always include — unless the description would exceed 50 words, in which case drop it first (it is the lowest-priority element).
68
+
69
+ **Writing rules:**
70
+ - Field **labels**, never API names (`Year`, not `Year__c`)
71
+ - Selective annotations only — annotate non-obvious attributes (required, external ID, restricted values); standard fields get label only
72
+ - Formulas/rollups → behavior, not syntax ("auto-calculates vehicle age", not `YEAR(TODAY()) - Year__c`)
73
+ - Validations → business rules ("require VIN"), not `ISBLANK(...)`
74
+ - Relationships → context ("as a child of Account"), not metadata notation
75
+ - Open in third person ("The X object..."), never "Tracks X" or "Object used to..."
76
+ - No "Contains N fields including"
77
+ - Clear professional prose; no markdown/backticks/special characters
78
+ - **Hard ceiling: under 50 words.** If over, tighten wording first; if still over, drop in priority order: sentence 5 (use cases) first, then sentence 4 (rules), then sentence 3 (computed); never drop sentences 1–2.
79
+ - The result must read like human-written documentation, comprehensible without the schema.
80
+
81
+ ---
82
+
83
+ ## Field & Validation Prioritization
84
+
85
+ **Large field lists:** surface only the top 5-6 most notable by label + "along with additional tracking fields". Tier order when deciding what carries the most signal:
86
+ - **Tier 1 — Structure & Logic:** relationships, master-detail, roll-up summaries, formulas, picklists
87
+ - **Tier 2 — Contextual:** helpText, PII flag, externalId, trackHistory
88
+ - **Tier 3 — Standard:** everything else
89
+
90
+ **Many validation rules:** reference only active rules. If >20, prioritize complex/business-logic rules (compound conditions, cross-field comparisons) over trivial single-field null checks; summarize the 1-3 most important as business rules — never enumerate all.
91
+
92
+ ---
93
+
94
+ ## Junction & Child Objects
95
+
96
+ - **Junction:** mention both parents in the opening — "The {Label} object connects {ParentA} and {ParentB}, enabling many-to-many tracking between them."
97
+ - **Child:** weave the parent into the purpose sentence — "The {Label} object tracks {purpose} as a child of {Parent}."
98
+
99
+ ---
100
+
101
+ ## Examples
102
+
103
+ **❌ Generic template** — `Object used to track and manage Projects within the organization.` (no specifics)
104
+
105
+ **❌ Mechanical metadata dump** — `Tracks customer projects. Contains 2 fields including Status__c (Picklist: Planning, Active, Complete), Account__c (Master-Detail to Account)...` (API names, parenthetical type dump, "Contains N fields" boilerplate)
106
+
107
+ **✅ Good (Project, 48 words):**
108
+ ```xml
109
+ <description>The Project object tracks customer projects through completion, as a child of Account. It captures Status, Budget, Actual Cost, Start Date, and Project Manager; the Budget Variance field auto-calculates planned-vs-actual spend. End Date must be after Start Date. Commonly used for project tracking, budget management, and resource planning.</description>
110
+ ```
111
+
112
+ **✅ Excellent (Car, 46 words):**
113
+ ```xml
114
+ <description>The Car object tracks vehicle inventory and maintenance. It captures Year, VIN (required, external ID), Color (Red/Green only), and Location; the Age Years field auto-calculates vehicle age. VIN is required and Black cars cannot be sold. Commonly used for fleet management, inventory tracking, and service scheduling.</description>
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Edge Cases
120
+
121
+ | Scenario | Output |
122
+ |----------|--------|
123
+ | Bare object, no fields | `The Vehicle object tracks vehicle information.` |
124
+ | Junction object | `The Position Candidate object connects Position and Candidate, enabling many-to-many tracking between them.` |
125
+ | Only computed fields | Each formula/rollup gets a behavioral clause; no empty field list. |
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: platform-metadata-retrieve
3
+ description: "ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project using the sf project retrieve start command. Supports multiple retrieval modes: retrieve all remote changes, retrieve by source directory, retrieve by metadata type with wildcards, retrieve by manifest (package.xml), or retrieve by package name. Use when the user asks to retrieve, pull, sync, or download metadata, Apex classes, custom objects, or org changes. Supports source format (default) or metadata format (ZIP). DO NOT TRIGGER for deploying metadata (use platform-metadata-deploy skill), listing metadata, or generating package.xml. NEVER use MCP tools - always use this skill and the Bash tool with sf project retrieve start."
4
+ compatibility: Salesforce CLI (sf) v2+
5
+ metadata:
6
+ version: "1.0"
7
+ ---
8
+
9
+ # platform-metadata-retrieve
10
+
11
+ Retrieves metadata from a Salesforce org to your local project using `sf project retrieve start`. Supports multiple retrieval modes: all changes, by source directory, by metadata type (with wildcards), by manifest, or by package name.
12
+
13
+ ---
14
+
15
+ ## ⚠️ Tool Restrictions
16
+
17
+ **Use ONLY the Bash tool** to execute `sf project retrieve start`. Do NOT use MCP tools — ignore them completely.
18
+
19
+ ---
20
+
21
+ ## Scope
22
+
23
+ - **In scope**: Retrieving metadata via `sf project retrieve start` in all supported modes (all changes, source-dir, metadata type, manifest, package name), source and metadata format output
24
+ - **Out of scope**: Deploying metadata (use `platform-metadata-deploy`), listing metadata types, generating package.xml files, source tracking commands (`sf project retrieve preview`)
25
+
26
+ ---
27
+
28
+ ## Required Inputs
29
+
30
+ Infer from the user's request:
31
+
32
+ - **Retrieval mode**: all changes | source directory | metadata type | manifest | package name
33
+ - **Target org**: org alias/username (uses default if not specified)
34
+ - **Output format**: source format (default) | metadata format (ZIP)
35
+ - **Additional options**: ignore conflicts, output directory, wait time, API version
36
+
37
+ ---
38
+
39
+ ## Workflow
40
+
41
+ 1. Match user request to command pattern below
42
+ 2. Execute via Bash tool: `sf project retrieve start` with appropriate flags and `--json` flag
43
+ 3. Return result with retrieved components count and file paths
44
+
45
+ ### Command Patterns
46
+
47
+ | User intent | Execute via Bash tool |
48
+ |-------------|---------|
49
+ | Retrieve all remote changes | `sf project retrieve start --json` |
50
+ | Retrieve by source directory | `sf project retrieve start --source-dir <path> --target-org <alias> --json` |
51
+ | Retrieve by metadata type | `sf project retrieve start --metadata <MetadataType:Name> --target-org <alias> --json` |
52
+ | Retrieve by metadata type with wildcard | `sf project retrieve start --metadata '<MetadataType:Pattern*>' --target-org <alias> --json` |
53
+ | Retrieve multiple metadata types | `sf project retrieve start --metadata <Type1> --metadata <Type2> --target-org <alias> --json` |
54
+ | Retrieve by manifest | `sf project retrieve start --manifest <path/to/package.xml> --target-org <alias> --json` |
55
+ | Retrieve by package name | `sf project retrieve start --package-name <PackageName> --target-org <alias> --json` |
56
+ | Retrieve to metadata format (ZIP) | `sf project retrieve start --source-dir <path> --target-metadata-dir <output> --unzip --target-org <alias> --json` |
57
+ | Ignore conflicts | `sf project retrieve start --source-dir <path> --ignore-conflicts --target-org <alias> --json` |
58
+
59
+ ---
60
+
61
+ ## Rules / Constraints
62
+
63
+ | Constraint | Rationale |
64
+ |-----------|-----------|
65
+ | Always use `--json` flag | Provides structured output for reliable parsing and error handling |
66
+ | Must run from within Salesforce project | Command requires `sfdx-project.json` at repo root |
67
+ | Wildcard patterns must be quoted | Shell expansion breaks unquoted wildcards like `ApexClass:My*` |
68
+ | Cannot mix --manifest with --metadata or --source-dir | Mutually exclusive flags — command will error |
69
+ | Retrieve all changes requires source tracking | Production orgs don't support source tracking — must use other retrieval modes |
70
+ | --ignore-conflicts only works on trackable orgs | No effect on production orgs; applies to scratch/sandbox only |
71
+ | --output-dir must be inside project directory | Command validates output path is within project boundary |
72
+ | --output-dir cannot match package directory | Command fails if target matches `sfdx-project.json` packageDirectories |
73
+ | Default wait time is 33 minutes | Use --wait flag to override for large retrievals |
74
+ | Package retrieval is for reference only | Retrieved package metadata should not be added to source control for development |
75
+ | CustomField retrieval auto-includes CustomObject | When retrieving CustomField, CLI automatically adds CustomObject to get full context |
76
+
77
+ ---
78
+
79
+ ## Troubleshooting
80
+
81
+ | Issue | Resolution |
82
+ |-------|------------|
83
+ | "This command is required to run from within an SFDX project" | Not in Salesforce project directory — cd to project root with `sfdx-project.json` |
84
+ | "No org found for <alias>" error | Org alias doesn't exist or isn't authenticated — verify with `sf org list` |
85
+ | "This org does not support source tracking" | Production org doesn't allow "retrieve all changes" mode — use --source-dir, --metadata, or --manifest instead |
86
+ | "ERROR running project retrieve start: Cannot mix --manifest with --metadata or --source-dir" | Remove conflicting flags — use one retrieval mode only |
87
+ | Wildcard pattern retrieves nothing | Pattern not quoted — wrap in single quotes: `'ApexClass:My*'` |
88
+ | "The package directory path in sfdx-project.json does not exist" | Output directory conflicts with package directory — use different path |
89
+ | "Output directory must be inside the project" | --output-dir path is outside project boundary — use relative path inside project |
90
+ | Retrieve times out | Increase wait time with `--wait 60` for large metadata volumes |
91
+ | Retrieved files overwrite local changes | Use `--output-dir` to retrieve to separate location, or commit local changes first |
92
+ | SourceConflictError with conflict table | Conflicts detected between local and remote on trackable org (scratch/sandbox) — resolve conflicts manually or use --ignore-conflicts to force overwrite |
93
+
94
+ ---
95
+
96
+ ## Output Expectations
97
+
98
+ The command returns JSON output with retrieved components details.
99
+
100
+ See `examples/success_output.json` and `examples/error_output.json` for response structures.
101
+
102
+ ---
103
+
104
+ ## Cross-Skill Integration
105
+
106
+ | Need | Delegate to |
107
+ |------|-------------|
108
+ | Deploy metadata to org | `platform-metadata-deploy` skill |
109
+ | Preview retrieve without executing | Execute `sf project retrieve preview --target-org <alias> --json` |
110
+ | List available metadata types | Execute `sf org list metadata-types --target-org <alias> --json` |
111
+
112
+ ---
113
+
114
+ ## Reference File Index
115
+
116
+ | File | When to read |
117
+ |------|-------------|
118
+ | `examples/success_output.json` | To understand successful retrieve response structure |
119
+ | `examples/error_output.json` | To handle common error scenarios |
120
+ | `references/retrieval_modes.md` | For detailed explanation of all retrieval modes and when to use each |
121
+ | `references/cli_flags.md` | For complete flag reference with usage patterns |
@@ -0,0 +1,10 @@
1
+ {
2
+ "status": 1,
3
+ "name": "projectNotFoundError",
4
+ "message": "This command is required to run from within an SFDX project.",
5
+ "exitCode": 1,
6
+ "commandName": "project retrieve start",
7
+ "stack": "projectNotFoundError: This command is required to run from within an SFDX project.",
8
+ "warnings": [],
9
+ "data": {}
10
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "status": 0,
3
+ "result": {
4
+ "inboundFiles": [
5
+ {
6
+ "state": "Created",
7
+ "fullName": "AccountService",
8
+ "type": "ApexClass",
9
+ "filePath": "force-app/main/default/classes/AccountService.cls"
10
+ },
11
+ {
12
+ "state": "Created",
13
+ "fullName": "AccountService",
14
+ "type": "ApexClass",
15
+ "filePath": "force-app/main/default/classes/AccountService.cls-meta.xml"
16
+ },
17
+ {
18
+ "state": "Changed",
19
+ "fullName": "Account",
20
+ "type": "CustomObject",
21
+ "filePath": "force-app/main/default/objects/Account/Account.object-meta.xml"
22
+ }
23
+ ],
24
+ "packages": [],
25
+ "warnings": []
26
+ }
27
+ }
@@ -0,0 +1,138 @@
1
+ # CLI Flags Reference
2
+
3
+ Complete reference for `sf project retrieve start` command flags.
4
+
5
+ ## Target Org Flag (Optional When Default Is Set)
6
+
7
+ **Note:** `--target-org` is omitted when a default org is set via `sf config set target-org`. Only include this flag when the user specifies a non-default org or no default is configured.
8
+
9
+ | Flag | Alias | Description | Example |
10
+ |------|-------|-------------|---------|
11
+ | `--target-org` | `-o` | Username or alias of target org (omit if using default) | `--target-org my-org` |
12
+
13
+ ## Retrieval Mode Flags (Mutually Exclusive Groups)
14
+
15
+ | Flag | Alias | Description | Example |
16
+ |------|-------|-------------|---------|
17
+ | `--source-dir` | `-d` | File paths to retrieve from org | `--source-dir force-app` |
18
+ | `--metadata` | `-m` | Metadata component names (wildcards supported) | `--metadata ApexClass:MyClass*` |
19
+ | `--manifest` | `-x` | Path to manifest (package.xml) file | `--manifest config/package.xml` |
20
+ | `--package-name` | `-n` | Package names to retrieve (reference only) | `--package-name MyPackage` |
21
+
22
+ **Note:** Cannot combine `--manifest` with `--metadata` or `--source-dir`. Choose one retrieval mode.
23
+
24
+ ## Optional Flags
25
+
26
+ | Flag | Alias | Description | Example |
27
+ |------|-------|-------------|---------|
28
+ | `--api-version` | `-a` | Target API version for retrieve | `--api-version 66.0` |
29
+ | `--ignore-conflicts` | `-c` | Ignore conflicts and overwrite local files | `--ignore-conflicts` |
30
+ | `--output-dir` | `-r` | Directory root for retrieved source files | `--output-dir retrieved` |
31
+ | `--wait` | `-w` | Minutes to wait for completion (default: 33) | `--wait 60` |
32
+
33
+ ## Metadata API Format Flags
34
+
35
+ | Flag | Description | Example |
36
+ |------|-------------|---------|
37
+ | `--target-metadata-dir` | Directory for metadata format files or ZIP | `--target-metadata-dir output` |
38
+ | `--unzip` | Extract files from retrieved ZIP | `--unzip` |
39
+ | `--single-package` | ZIP points to single package directory | `--single-package` |
40
+ | `--zip-file-name` | Filename for retrieved ZIP | `--zip-file-name metadata.zip` |
41
+
42
+ ## Usage Patterns
43
+
44
+ ### Basic Retrieve All Changes
45
+
46
+ ```bash
47
+ sf project retrieve start --json
48
+ ```
49
+
50
+ ### Retrieve by Source Directory
51
+
52
+ ```bash
53
+ sf project retrieve start --source-dir force-app --target-org my-org --json
54
+ ```
55
+
56
+ ### Retrieve Multiple Directories
57
+
58
+ ```bash
59
+ sf project retrieve start --source-dir force-app/main/default/classes --source-dir force-app/main/default/objects --json
60
+ ```
61
+
62
+ ### Retrieve by Metadata Type
63
+
64
+ ```bash
65
+ sf project retrieve start --metadata ApexClass --target-org my-org --json
66
+ ```
67
+
68
+ ### Retrieve Specific Component
69
+
70
+ ```bash
71
+ sf project retrieve start --metadata ApexClass:AccountService --target-org my-org --json
72
+ ```
73
+
74
+ ### Retrieve with Wildcard
75
+
76
+ ```bash
77
+ sf project retrieve start --metadata 'ApexClass:Account*' --target-org my-org --json
78
+ ```
79
+
80
+ ### Retrieve Multiple Metadata Types
81
+
82
+ ```bash
83
+ sf project retrieve start --metadata CustomObject --metadata ApexClass --target-org my-org --json
84
+ ```
85
+
86
+ ### Retrieve by Manifest
87
+
88
+ ```bash
89
+ sf project retrieve start --manifest config/package.xml --target-org my-org --json
90
+ ```
91
+
92
+ ### Retrieve by Package Name
93
+
94
+ ```bash
95
+ sf project retrieve start --package-name MyPackage --target-org my-org --json
96
+ ```
97
+
98
+ ### Retrieve Multiple Packages
99
+
100
+ ```bash
101
+ sf project retrieve start --package-name Package1 --package-name "Package With Spaces" --target-org my-org --json
102
+ ```
103
+
104
+ ### Retrieve to Metadata Format
105
+
106
+ ```bash
107
+ sf project retrieve start --source-dir force-app --target-metadata-dir output --target-org my-org --json
108
+ ```
109
+
110
+ ### Retrieve and Extract ZIP
111
+
112
+ ```bash
113
+ sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip --target-org my-org --json
114
+ ```
115
+
116
+ ### Ignore Conflicts
117
+
118
+ ```bash
119
+ sf project retrieve start --source-dir force-app --ignore-conflicts --target-org my-org --json
120
+ ```
121
+
122
+ ### Custom Output Directory
123
+
124
+ ```bash
125
+ sf project retrieve start --source-dir force-app --output-dir retrieved --target-org my-org --json
126
+ ```
127
+
128
+ ### Override Wait Time
129
+
130
+ ```bash
131
+ sf project retrieve start --manifest config/package.xml --wait 60 --target-org my-org --json
132
+ ```
133
+
134
+ ### Override API Version
135
+
136
+ ```bash
137
+ sf project retrieve start --source-dir force-app --api-version 66.0 --target-org my-org --json
138
+ ```
@@ -0,0 +1,181 @@
1
+ # Retrieval Modes
2
+
3
+ Complete guide to the five retrieval modes supported by `sf project retrieve start`.
4
+
5
+ ## Mode 1: Retrieve All Remote Changes
6
+
7
+ **When to use:** Sync all org changes to local project (most common workflow)
8
+
9
+ ```bash
10
+ sf project retrieve start --json
11
+ ```
12
+
13
+ - Retrieves all metadata that changed in the org since last sync
14
+ - Only works with orgs that allow source tracking (scratch/sandbox)
15
+ - Does not work with production orgs
16
+ - Most common command for daily development workflow
17
+
18
+ ## Mode 2: Retrieve by Source Directory
19
+
20
+ **When to use:** Pull specific directory/file from org
21
+
22
+ ```bash
23
+ sf project retrieve start --source-dir force-app --target-org my-org --json
24
+ sf project retrieve start --source-dir force-app/main/default/classes --target-org my-org --json
25
+ sf project retrieve start --source-dir force-app/main/default/classes/AccountService.cls --target-org my-org --json
26
+ ```
27
+
28
+ - Can target entire directory or single file
29
+ - Retrieves directory contents recursively
30
+ - Multiple `--source-dir` flags supported
31
+ - Works with all org types (scratch, sandbox, production)
32
+
33
+ **Multiple directories:**
34
+
35
+ ```bash
36
+ sf project retrieve start --source-dir force-app/main/default/classes --source-dir force-app/main/default/objects --json
37
+ ```
38
+
39
+ ## Mode 3: Retrieve by Metadata Type
40
+
41
+ **When to use:** Pull specific metadata types or components
42
+
43
+ ```bash
44
+ sf project retrieve start --metadata ApexClass --json
45
+ sf project retrieve start --metadata ApexClass:AccountService --json
46
+ sf project retrieve start --metadata 'ApexClass:Account*' --json
47
+ ```
48
+
49
+ - Retrieve all components of a type: `--metadata ApexClass`
50
+ - Retrieve specific component: `--metadata ApexClass:AccountService`
51
+ - Retrieve with wildcard pattern: `--metadata 'ApexClass:Account*'` (requires quotes)
52
+ - Multiple `--metadata` flags supported
53
+ - Works with all org types
54
+
55
+ **Wildcards:**
56
+
57
+ ```bash
58
+ sf project retrieve start --metadata 'CustomObject:SBQQ__*' --json
59
+ sf project retrieve start --metadata 'ListView:Case*' --json
60
+ ```
61
+
62
+ **Multiple types:**
63
+
64
+ ```bash
65
+ sf project retrieve start --metadata CustomObject --metadata ApexClass --json
66
+ ```
67
+
68
+ ## Mode 4: Retrieve by Manifest (package.xml)
69
+
70
+ **When to use:** Pull metadata listed in package.xml
71
+
72
+ ```bash
73
+ sf project retrieve start --manifest path/to/package.xml --json
74
+ ```
75
+
76
+ - Retrieves all components specified in the manifest file
77
+ - Cannot be combined with `--metadata` or `--source-dir`
78
+ - Works with all org types
79
+ - Useful for CI/CD pipelines and release management
80
+
81
+ ## Mode 5: Retrieve by Package Name
82
+
83
+ **When to use:** Extract package metadata for reference only
84
+
85
+ ```bash
86
+ sf project retrieve start --package-name MyPackageName --json
87
+ sf project retrieve start --package-name "Package With Spaces" --json
88
+ ```
89
+
90
+ - Retrieves metadata into child directory matching package name
91
+ - Cannot be used with the `--output-dir` flag
92
+ - Retrieved metadata is **for reference only** — not for development/deployment
93
+ - Do not add to source control
94
+ - For package development, use manifest or source-dir modes instead
95
+ - Works with all org types
96
+
97
+ **Multiple packages:**
98
+
99
+ ```bash
100
+ sf project retrieve start --package-name Package1 --package-name "Package With Spaces" --package-name Package3 --json
101
+ ```
102
+
103
+ ## Output Format Options
104
+
105
+ ### Source Format (Default)
106
+
107
+ ```bash
108
+ sf project retrieve start --source-dir force-app --json
109
+ ```
110
+
111
+ - Retrieves in Salesforce DX source format
112
+ - Files written to package directories defined in `sfdx-project.json`
113
+ - Default behavior
114
+
115
+ ### Metadata Format (ZIP)
116
+
117
+ ```bash
118
+ sf project retrieve start --source-dir force-app --target-metadata-dir output --json
119
+ ```
120
+
121
+ - Retrieves as ZIP file in metadata format
122
+ - Use `--unzip` to automatically extract contents
123
+ - Use `--zip-file-name` to specify ZIP filename
124
+ - Use `--single-package` for single package directory structure
125
+
126
+ **Extract automatically:**
127
+
128
+ ```bash
129
+ sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip --json
130
+ ```
131
+
132
+ ## Conflict Handling
133
+
134
+ ### Ignore Conflicts (Scratch/Sandbox Only)
135
+
136
+ **⚠️ Warning:** Do not use `--ignore-conflicts` flag without confirming with the user first. This flag overwrites local changes and may result in lost work.
137
+
138
+ ```bash
139
+ sf project retrieve start --source-dir force-app --ignore-conflicts --json
140
+ ```
141
+
142
+ - Overwrites local files even if they have uncommitted changes
143
+ - Only works on orgs that allow source tracking (scratch/sandbox)
144
+ - No effect on production orgs
145
+
146
+ ### Retrieve to Separate Directory
147
+
148
+ ```bash
149
+ sf project retrieve start --source-dir force-app --output-dir retrieved-backup --json
150
+ ```
151
+
152
+ - Retrieves to custom directory instead of default package directory
153
+ - Cannot use directory that matches `sfdx-project.json` packageDirectories
154
+ - Useful for comparing org state with local state
155
+ - Running multiple times adds/overwrites files in target directory
156
+
157
+ ## Common Patterns
158
+
159
+ ### Retrieve Specific Apex Class
160
+
161
+ ```bash
162
+ sf project retrieve start --metadata ApexClass:MyApexClass --ignore-conflicts --json
163
+ ```
164
+
165
+ ### Retrieve All Custom Objects with Namespace
166
+
167
+ ```bash
168
+ sf project retrieve start --metadata 'CustomObject:SBQQ__*' --json
169
+ ```
170
+
171
+ ### Retrieve All List Views for Standard Object
172
+
173
+ ```bash
174
+ sf project retrieve start --metadata 'ListView:Case*' --json
175
+ ```
176
+
177
+ ### Retrieve to Metadata Format and Extract
178
+
179
+ ```bash
180
+ sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip --json
181
+ ```