@salesforce/afv-skills 1.31.0 → 1.32.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 (98) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
  3. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
  4. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
  5. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
  6. package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
  7. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
  8. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
  9. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
  10. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
  11. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
  12. package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
  13. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
  14. package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
  15. package/skills/dx-org-manage/SKILL.md +8 -5
  16. package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
  17. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
  18. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
  19. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
  20. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
  21. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
  22. package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
  23. package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
  24. package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
  25. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
  26. package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
  27. package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
  28. package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
  29. package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
  30. package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
  31. package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
  32. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
  33. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
  34. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
  35. package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
  36. package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
  37. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
  38. package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
  39. package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
  40. package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
  41. package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
  42. package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
  43. package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
  44. package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
  45. package/skills/platform-widget-generate/SKILL.md +241 -0
  46. package/skills/platform-widget-generate/examples/conditional.json +73 -0
  47. package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
  48. package/skills/platform-widget-generate/examples/single-object.json +64 -0
  49. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
  50. package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
  51. package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
  52. package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
  53. package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
  54. package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
  55. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
  56. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
  57. package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
  58. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
  59. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
  60. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
  61. package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
  62. package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
  63. package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
  64. package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
  65. package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
  66. package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
  67. package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
  68. package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
  69. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
  70. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
  71. package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
  72. package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
  73. package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
  74. package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
  75. package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
  76. package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
  77. package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
  78. package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
  79. package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
  80. package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
  81. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
  82. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
  83. package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
  84. package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
  85. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
  86. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
  87. package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
  88. package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
  89. package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
  90. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
  91. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
  92. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
  93. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
  94. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
  95. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
  96. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
  97. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
  98. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
@@ -0,0 +1,116 @@
1
+ # SF CLI Bot Reference
2
+
3
+ Essential SF CLI command sequence for Mode A (org-backed retrieval) after inputs are finalized (`--org-alias`, `--bot`, `--bot-version`).
4
+
5
+ Do not use this reference in Mode B (offline metadata input). In offline mode, skip SF CLI retrieval and continue with extraction/mapping from local XML metadata files.
6
+
7
+ ## 1) Prerequisite checks
8
+
9
+ ```bash
10
+ sf --version
11
+ sf org display --json --target-org <org-alias>
12
+ ```
13
+
14
+ If no orgs are available (no authenticated orgs are found), branch on the effective `--interactive` value:
15
+
16
+ - **`--interactive=true`**: ask the customer to log in to an org using:
17
+
18
+ ```bash
19
+ sf org login web --instance-url <LOGIN_URL> --alias <ALIAS>
20
+ ```
21
+
22
+ When asking, inform the customer about the default values so they can accept them or override:
23
+ - `--instance-url` defaults to `https://login.salesforce.com` when omitted. Tell the customer to use the default for production and Developer Edition orgs, `https://test.salesforce.com` for sandboxes.
24
+
25
+ - **`--interactive=false`**: do NOT prompt. Halt with an explicit error: `No authenticated org found for the provided --org-alias; run sf org login web and retry.`
26
+
27
+ ## 2) Validate bot and version
28
+
29
+ `BotVersion.VersionNumber` is a numeric field, but `<bot-version>` is supplied in the `v1`/`v2`/`v3` format. Derive `<version-number>` by stripping the leading `v` from `<bot-version>` (e.g. `v1` -> `1`, `v12` -> `12`) and use that numeric value in the SOQL filter. Keep the original `<bot-version>` (`vN`) form for the metadata retrieval in section 3.
30
+
31
+ Listing bots:
32
+ ```bash
33
+ sf data query --json --target-org <org-alias> \
34
+ --query "SELECT BotDefinition.MasterLabel FROM BotDefinition WHERE Type = 'Bot'"
35
+ ```
36
+
37
+ Listing bot versions:
38
+ ```bash
39
+ sf data query --json --target-org <org-alias> \
40
+ --query "SELECT Id, VersionNumber, Status FROM BotVersion WHERE BotDefinition.Type = 'Bot'"
41
+ ```
42
+
43
+ ## 3) Retrieve bot metadata
44
+
45
+ Before retrieval, ensure an SF project directory exists:
46
+
47
+ 1. If no project exists for this migration run (`sfdx-project.json` doesn't exist), create one:
48
+ `sf project generate --name <bot-name>-<bot-version>-agent --template "empty" --output-dir "."`
49
+ 2. Change into that project directory.
50
+ 3. Run all remaining sf cli commands from that same project directory.
51
+
52
+ ```bash
53
+ sf project retrieve start --target-org <org-alias> \
54
+ --metadata "Bot:<bot-name>" "BotVersion:<bot-name>.<bot-version>"
55
+ ```
56
+
57
+ ## 4) Retrieve related ML domains (only if referenced)
58
+
59
+ After bot metadata retrieval, discover referenced ML domains from the retrieved bot XML metadata using the same pattern as the migration script (`relatedMlIntent` entries in `<Domain.Intent>` format), then retrieve each domain.
60
+
61
+ Bot XML exists at: `force-app/main/default/bots/<bot-name>/<bot-name>.bot-meta.xml` (relative to the generated SFDX project directory from section 3).
62
+
63
+ Use this sequence:
64
+
65
+ 1. Read the bot metadata XML file.
66
+ 2. Find all `relatedMlIntent` values.
67
+ 3. For each value, split on `.` and keep only the domain name prefix.
68
+ 4. De-duplicate the discovered domain names.
69
+ 5. For each discovered domain, run:
70
+ `sf project retrieve start --target-org <org-alias> --metadata "MlDomain:<domain_name>"`
71
+
72
+ If no `relatedMlIntent` entries are found, skip MLDomain retrieval.
73
+
74
+ ## 5) Retrieve invocation dependencies (Apex/Flow)
75
+
76
+ The pipeline extracts invocation names from bot metadata, then retrieves only those exact classes/flows.
77
+
78
+ ### Apex classes
79
+
80
+ ```bash
81
+ sf project retrieve start --target-org <org-alias> --manifest <apex-package.xml>
82
+ ```
83
+
84
+ `<apex-package.xml>` should contain only required classes:
85
+
86
+ ```xml
87
+ <?xml version="1.0" encoding="UTF-8"?>
88
+ <Package xmlns="http://soap.sforce.com/2006/04/metadata">
89
+ <types>
90
+ <members>ClassA</members>
91
+ <members>ClassB</members>
92
+ <name>ApexClass</name>
93
+ </types>
94
+ <version>67.0</version>
95
+ </Package>
96
+ ```
97
+
98
+ ### Flows
99
+
100
+ ```bash
101
+ sf project retrieve start --target-org <org-alias> --manifest <flow-package.xml>
102
+ ```
103
+
104
+ `<flow-package.xml>` should contain only required flows:
105
+
106
+ ```xml
107
+ <?xml version="1.0" encoding="UTF-8"?>
108
+ <Package xmlns="http://soap.sforce.com/2006/04/metadata">
109
+ <types>
110
+ <members>FlowA</members>
111
+ <members>FlowB</members>
112
+ <name>Flow</name>
113
+ </types>
114
+ <version>67.0</version>
115
+ </Package>
116
+ ```
@@ -0,0 +1,270 @@
1
+ ---
2
+ name: dx-devops-work-item-manage
3
+ description: "Use this skill to manage the full lifecycle of DevOps Center work items — list, create, update, commit changes, perform status transitions, and create pull requests. Update fields like subject, description, and status. Commit and push code changes to work item branches. Create pull requests for work item branches via DevOps Center API. Invoke when the user wants to track, find, create, or update a work item, commit changes to a work item branch, advance a work item's status through the pipeline, or create a pull request for code review. Consolidates sf devops work-item and review operations. DO NOT TRIGGER for promotion or deployment operations, or conflict detection."
4
+ metadata:
5
+ version: "1.0"
6
+ minApiVersion: "58.0"
7
+ cliTools:
8
+ - tool: ["sf"]
9
+ semver: ">=2.0.0"
10
+ - tool: ["git"]
11
+ semver: ">=2.0.0"
12
+ - tool: ["jq"]
13
+ semver: ">=1.6"
14
+ ---
15
+
16
+ # DevOps Center Work Item Management
17
+
18
+ Manages the complete work item lifecycle in DevOps Center — from creation through status transitions to promotion readiness. Provides headless CLI-driven operations for autonomous release workflows.
19
+
20
+ ## Scope
21
+
22
+ - **In scope**: List work items, create new work items, commit changes to work item branches, update work item fields (subject, description, status), transition work item status (New → In Progress → Ready to Promote), create pull requests for work item branches
23
+ - **Out of scope**: Promotion/deployment, conflict detection, pipeline or project management (separate skills)
24
+
25
+ ---
26
+
27
+ ## Required Inputs
28
+
29
+ Gather or infer before proceeding:
30
+
31
+ - **Operation type**: list, create, update, commit, or create-review
32
+ - **For list**: project ID (required) — obtain via `sf devops project list --json` if not provided
33
+ - **For create**: project ID (required), subject (required), description (optional)
34
+ - **For commit**: work item name or ID (required) to retrieve branch name, files to commit, commit message
35
+ - **For update**: work item name (e.g., WI-000001) or work item ID (required), fields to update (subject, description, status)
36
+ - **For create-review**: work item name (e.g., WI-000001) or work item ID (required)
37
+
38
+ Defaults unless specified:
39
+ - Output format: `--json` for headless consumption
40
+ - Work item identifier: prefer `--work-item-name` (WI-000001) over `--work-item-id` when both are available (names are human-readable)
41
+
42
+ If the user provides a clear request ("list work items for Project Alpha", "create work item to fix login bug", "move WI-12345 to In Progress", "create PR for WI-12345"), proceed immediately without unnecessary questions.
43
+
44
+ ---
45
+
46
+ ## Workflow
47
+
48
+ All operations use `sf devops work-item` CLI commands with `--json` output for structured consumption.
49
+
50
+ ### Phase 1 — Identify Operation
51
+
52
+ 1. **Determine the operation type** from user intent:
53
+ - Keywords like "list", "show", "find" → list operation
54
+ - Keywords like "create", "new", "add" → create operation
55
+ - Keywords like "commit", "push", "save changes", "git commit" → commit operation
56
+ - Keywords like "update", "change", "modify", "edit", "move", "transition", "advance", "mark as" → update operation
57
+ - Keywords like "create PR", "pull request", "code review", "review", "open PR" → create-review operation
58
+
59
+ ### Phase 2 — Execute Operation
60
+
61
+ 2. **Verify org authentication** before any operation:
62
+ ```bash
63
+ sf org display --json
64
+ ```
65
+ - If no default org is set or authentication has expired, instruct the user to run:
66
+ ```bash
67
+ sf org login web --set-default --alias <alias>
68
+ ```
69
+ - Verify the authenticated org has DevOps Center enabled by attempting to list projects
70
+ - If the user wants to target a specific org, use `--target-org <alias>` on all subsequent commands
71
+
72
+ 3. **List work items** — when the user wants to see existing work items:
73
+ ```bash
74
+ sf devops work-item list --project-id <project-id> --json
75
+ ```
76
+ - `--project-id` is required — if the user provides a project name instead of ID, first run `sf devops project list --json` to resolve the name to an ID
77
+ - Verify the command returns status 0 (success)
78
+ - Parse the JSON output: the work items are in the `.result[]` array
79
+ - Each work item has: `name` (e.g., WI-000001), `subject`, `branch`, `environment`, `status`, `description`
80
+ - Present in a readable format showing work item name, subject, status, branch, and environment
81
+ - If `.result[]` is an empty array, confirm "No work items found in project <project-name>."
82
+ - If the user requested filtering by status (e.g., "show work items in Ready to Promote status"), run:
83
+ ```bash
84
+ sf devops work-item list --project-id <id> --json | jq '.result[] | select(.status == "<requested-status>")'
85
+ ```
86
+ Then present the matching work items
87
+
88
+ 4. **Create a work item** — when the user wants to create a new work item:
89
+ ```bash
90
+ sf devops work-item create \
91
+ --project-id <project-id> \
92
+ --subject "<subject>" \
93
+ --description "<description>" \
94
+ --json
95
+ ```
96
+ - `--project-id` is required (obtain from user or via `sf devops project list --json`)
97
+ - `--subject` is required (user-facing title)
98
+ - `--description` is optional (defaults to blank if omitted)
99
+ - Capture the returned work item name (e.g., WI-000001), branch name, and environment from JSON output for future operations
100
+ - Idempotent: if the user attempts to create a duplicate (same subject + project), check via list first and return the existing work item
101
+
102
+ 5. **Execute commit operation** — when operation type is commit:
103
+ - DevOps Center creates a dedicated feature branch for each work item (returned in the create operation)
104
+ - The user must commit and push changes to this branch before transitioning status or creating a PR
105
+ - Standard git workflow:
106
+ ```bash
107
+ git checkout <branch-name>
108
+ git add <files>
109
+ git commit -m "<commit-message>"
110
+ git push origin <branch-name>
111
+ ```
112
+ - The branch name is available from the work item's `branch` field (retrieve via list or create operation)
113
+ - Changes must be committed before the work item can be marked "Ready to Promote" or before creating a PR
114
+
115
+ 6. **Update work item** — when the user wants to change subject, description, or status:
116
+ ```bash
117
+ sf devops work-item update \
118
+ --work-item-name <WI-name> \
119
+ --subject "<new-subject>" \
120
+ --description "<new-description>" \
121
+ --status "<In Progress|Ready to Promote>" \
122
+ --json
123
+ ```
124
+ - Work item identifier is required: use `--work-item-name <WI-000001>` (preferred) or `--work-item-id <id>`
125
+ - If the user provides a work item by subject instead of name, resolve it to a name first:
126
+ ```bash
127
+ sf devops work-item list --project-id <id> --json | jq -r '.result[] | select(.subject == "<user-provided-subject>") | .name'
128
+ ```
129
+ Then pass the returned name (e.g., WI-000001) to the update command
130
+ - At least one of `--subject`, `--description`, or `--status` must be provided
131
+ - Valid status values: "In Progress" or "Ready to Promote" (exact strings with spaces)
132
+ - Only include flags for fields being updated (omit unchanged fields)
133
+ - Verify the command returns status 0 (success)
134
+ - Parse the JSON response: `.result.name`, `.result.subject`, `.result.status` contain the updated values
135
+ - **For status transitions specifically**: after the command completes, explicitly confirm the new status by checking `.result.status` in the response. If the status field is absent from the update response, re-query the work item via list to verify the status persisted
136
+
137
+ 7. **Create pull request** — when the user wants to create a PR for code review:
138
+ ```bash
139
+ sf devops review create \
140
+ --work-item-name <WI-name> \
141
+ --json
142
+ ```
143
+ - Work item identifier is required: use `--work-item-name <WI-000001>` (preferred) or `--work-item-id <id>`
144
+ - If the user provides a work item by subject instead of name, resolve it to a name first:
145
+ ```bash
146
+ sf devops work-item list --project-id <id> --json | jq -r '.result[] | select(.subject == "<user-provided-subject>") | .name'
147
+ ```
148
+ Then pass the returned name (e.g., WI-000001) to the review create command
149
+ - Creates PR via DevOps Center API using VCS credentials stored in the org
150
+ - No local VCS authentication required — DevOps Center handles GitHub/Bitbucket auth
151
+ - Works with GitHub and Bitbucket
152
+ - Verify the command returns status 0 (success)
153
+ - Parse the JSON response: `.result.pullRequestUrl` contains the PR URL, `.result.status` contains the PR status (typically "open" for newly created PRs), `.result.number` contains the PR number
154
+ - If the command fails with a VCS credentials error, instruct the user to configure VCS credentials in the DevOps Center org (Setup → DevOps Center → VCS Credentials)
155
+ - If the command fails with "PR already exists" error, report that a PR already exists for this work item (idempotent operation)
156
+
157
+ ### Phase 3 — Verify and Report
158
+
159
+ 8. **Verify operation success**:
160
+ - **For list**: confirm the CLI returned status 0, parse the JSON `.result[]` array, and verify it contains work items (or is empty if no matches). If the user specified a project by name, confirm the resolved project ID matches.
161
+ - **For create**: verify the CLI returned status 0 and the JSON output contains `.result.name` (work item ID like WI-000001), `.result.branch` (branch name), and `.result.environment` fields.
162
+ - **For commit**: verify each git command returned exit code 0. If `git push` succeeds, the commit is saved to the work item branch.
163
+ - **For update (general fields)**: verify the CLI returned status 0 and compare the returned JSON fields against the user's requested changes. If updating subject, confirm `.result.subject` matches the new value.
164
+ - **For update (status transition)**: verify the CLI returned status 0, then **explicitly confirm the status transition** by checking `.result.status` in the JSON response matches the target status (e.g., "Ready to Promote"). If the response doesn't include the status field, re-run `sf devops work-item list` filtered to this work item and verify the status persisted.
165
+ - **For create-review**: verify the CLI returned status 0 and the JSON output contains `.result.pullRequestUrl` (the PR URL) and `.result.status` (should be "open" or equivalent). If VCS credentials are missing, the CLI returns an error — surface this to the user.
166
+
167
+ 9. **Report results**:
168
+ - **List**: present work items in a readable format showing work item name, subject, status, branch, and environment. If filtering by status was requested, show only matching work items.
169
+ - **Create**: return the work item name (e.g., WI-000001), branch name, environment, and confirm "Work item created successfully."
170
+ - **Commit**: confirm which files were staged, the commit SHA (from git output), and "Changes committed and pushed to branch <branch-name>."
171
+ - **Update (general)**: confirm which fields changed with before/after values (e.g., "Subject updated from 'X' to 'Y'").
172
+ - **Status transition**: explicitly state the transition with old → new status (e.g., "Status updated: In Progress → Ready to Promote").
173
+ - **Create-review**: return the PR URL and confirm "Pull request created successfully. Status: open. URL: <url>"
174
+
175
+ ---
176
+
177
+ ## Rules / Constraints
178
+
179
+ | Constraint | Rationale |
180
+ |-----------|-----------|
181
+ | All sf devops commands must use `--json` flag | Structured output is required for headless consumption; human-readable output is unreliable for parsing |
182
+ | Work item identifier required for commit, update, and create-review | Use `--work-item-name` (preferred) or `--work-item-id`; obtain from list or prior create |
183
+ | Project ID required for list and create | All work items belong to a project; use `sf devops project list --json` if not provided |
184
+ | At least one update field required | Update command fails if no `--subject`, `--description`, or `--status` flag is provided |
185
+ | Status values must be exact strings | "In Progress" and "Ready to Promote" (with spaces, proper capitalization); other values fail |
186
+ | Idempotent create operations | Check for existing work item with same subject + project before creating duplicates |
187
+ | Changes must be committed before status transition to Ready to Promote | DevOps Center validates that the work item branch has commits before allowing promotion readiness |
188
+ | PR creation requires VCS credentials in org | DevOps Center API uses stored VCS credentials; no local git auth needed |
189
+ | Never use interactive prompts | Skills run in headless environments; all inputs must be via CLI flags |
190
+
191
+ ---
192
+
193
+ ## Gotchas
194
+
195
+ | Issue | Resolution |
196
+ |-------|------------|
197
+ | **No default org set** | Run `sf org display --json` first; if it fails, instruct user to run `sf org login web --set-default` |
198
+ | **User provides work item by subject, not name** | Resolve via: `sf devops work-item list --project-id <id> --json \| jq -r '.result[] \| select(.subject == "<subject>") \| .name'`; then pass the returned name to the update/create-review command |
199
+ | **User provides project by name, not ID** | First run `sf devops project list --json` and filter `.result[]` by `.name` field to find the project ID, then use that ID in the list/create command |
200
+ | **Status update response missing status field** | The CLI doesn't always return the status field in the update response; re-run `sf devops work-item list` filtered to this work item and check `.result[0].status` to verify the transition persisted |
201
+ | **Work item not found** | User provided invalid work item name/ID; run list command to show available work items |
202
+ | **Invalid status value** | Only "In Progress" and "Ready to Promote" are valid (exact strings with spaces); check spelling and capitalization |
203
+ | **Project not found** | User provided invalid project ID; run `sf devops project list --json` to show available projects |
204
+ | **Duplicate work item subject** | Idempotent create check should catch this; return existing work item name instead of creating duplicate |
205
+ | **Git push fails - no commits or branch not found** | Verify files are staged with `git status` and branch name retrieved from work item via list command |
206
+ | **PR creation fails - VCS credentials** | VCS credentials not configured in DevOps Center UI; instruct user to configure in Setup → DevOps Center → VCS Credentials |
207
+
208
+ ---
209
+
210
+ ## Output Expectations
211
+
212
+ Deliverables vary by operation:
213
+
214
+ - **List**: JSON array of work items with work item name (WI-######), subject, branch, environment, repository details
215
+ - **Create**: Work item name (e.g., WI-000001), ID, branch name, and environment of the newly created work item
216
+ - **Commit**: Confirmation of git commit and push success, with commit SHA
217
+ - **Update**: Confirmation of updated fields (old value → new value for subject/description, or status change)
218
+ - **Create-review**: Pull request URL, PR number, and status
219
+
220
+ Outputs are derived from `sf devops work-item` CLI, `sf devops review create` CLI, and standard git commands.
221
+
222
+ ---
223
+
224
+ ## Verification Checklist
225
+
226
+ Before reporting results to the user:
227
+
228
+ ### Universal Checks
229
+ - [ ] Was org authentication verified with `sf org display --json`?
230
+ - [ ] Was the CLI command executed with `--json` flag?
231
+ - [ ] Did the CLI return a successful exit code (0)?
232
+ - [ ] Is the JSON output parseable and non-empty?
233
+ - [ ] If multi-org scenario, was `--target-org` specified on all commands?
234
+
235
+ ### List Operation Checks
236
+ - [ ] Was `--project-id` provided?
237
+ - [ ] Are work items displayed with work item name, subject, branch, environment?
238
+ - [ ] If the list is empty, was this communicated to the user?
239
+
240
+ ### Create Operation Checks
241
+ - [ ] Was a work item name (WI-######) and ID returned in the JSON output?
242
+ - [ ] Was the branch name returned in the JSON output?
243
+ - [ ] Was `--subject` provided and included in the command?
244
+ - [ ] Was `--project-id` provided (or obtained via project list)?
245
+
246
+ ### Commit Operation Checks
247
+ - [ ] Was the work item branch name retrieved successfully?
248
+ - [ ] Were files staged with `git add`?
249
+ - [ ] Did `git commit` succeed with exit code 0?
250
+ - [ ] Did `git push` succeed with exit code 0?
251
+
252
+ ### Update Operation Checks
253
+ - [ ] Was work item identifier provided (name or ID)?
254
+ - [ ] Was at least one update field provided (subject, description, or status)?
255
+ - [ ] If status was updated, was it a valid value ("In Progress" or "Ready to Promote")?
256
+ - [ ] Was the updated work item returned in JSON?
257
+
258
+ ### Create-Review Operation Checks
259
+ - [ ] Was work item identifier provided (name or ID)?
260
+ - [ ] Was a PR URL returned in JSON output?
261
+ - [ ] Was the PR creation confirmed?
262
+
263
+ ---
264
+
265
+ ## Reference File Index
266
+
267
+ | File | When to read |
268
+ |------|-------------|
269
+ | `references/cli-commands.md` | When you need detailed CLI flag documentation, JSON output schemas, or error handling patterns |
270
+ | `examples/common-workflows.md` | When the user's request matches a common pattern (bulk updates, reassignment, idempotent creation, sequential transitions) |