@copado/agentia-cli 1.0.0 → 1.2.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 (226) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +2252 -1529
  3. package/dist/commands/ai/agent/ask.js +4 -4
  4. package/dist/commands/ai/agent/chat.js +4 -4
  5. package/dist/commands/cicd/cloud/commit.js +7 -2
  6. package/dist/commands/cicd/credential/auth/status.js +38 -0
  7. package/dist/commands/cicd/credential/auth/web/login.js +54 -0
  8. package/dist/commands/cicd/credential/list.js +13 -17
  9. package/dist/commands/cicd/credential/open.js +30 -0
  10. package/dist/commands/cicd/credential/update.js +9 -12
  11. package/dist/commands/cicd/environment/auth/status.js +34 -13
  12. package/dist/commands/cicd/environment/auth/web/login.js +20 -4
  13. package/dist/commands/cicd/environment/open.js +6 -22
  14. package/dist/commands/cicd/extension/create.js +53 -0
  15. package/dist/commands/cicd/extension/install.js +127 -0
  16. package/dist/commands/cicd/extension/package.js +35 -0
  17. package/dist/commands/cicd/extension/publish.js +61 -0
  18. package/dist/commands/cicd/extension/uninstall.js +99 -0
  19. package/dist/commands/cicd/extension/validate.js +47 -0
  20. package/dist/commands/cicd/extension-configuration/get.js +24 -0
  21. package/dist/commands/cicd/extension-configuration/list.js +49 -0
  22. package/dist/commands/cicd/extension-configuration/open.js +38 -0
  23. package/dist/commands/cicd/metadata/content/get.js +1 -1
  24. package/dist/commands/cicd/metadata/dependency/list.js +2 -2
  25. package/dist/commands/cicd/metadata/explore.js +81 -0
  26. package/dist/commands/cicd/metadata/list.js +3 -3
  27. package/dist/commands/cicd/metadata/refresh/deleted.js +1 -1
  28. package/dist/commands/cicd/metadata/refresh/run.js +2 -2
  29. package/dist/commands/cicd/metadata/refresh/status.js +2 -2
  30. package/dist/commands/cicd/pipeline/automation/activate.js +39 -0
  31. package/dist/commands/cicd/pipeline/automation/create.js +33 -0
  32. package/dist/commands/cicd/pipeline/automation/deactivate.js +39 -0
  33. package/dist/commands/cicd/pipeline/automation/delete.js +45 -0
  34. package/dist/commands/cicd/pipeline/automation/get.js +32 -0
  35. package/dist/commands/cicd/pipeline/automation/list.js +38 -0
  36. package/dist/commands/cicd/pipeline/automation/open.js +38 -0
  37. package/dist/commands/cicd/pipeline/automation/update.js +38 -0
  38. package/dist/commands/cicd/pipeline/quality-gate/activate.js +39 -0
  39. package/dist/commands/cicd/pipeline/quality-gate/create.js +34 -0
  40. package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +39 -0
  41. package/dist/commands/cicd/pipeline/quality-gate/delete.js +45 -0
  42. package/dist/commands/cicd/pipeline/quality-gate/get.js +32 -0
  43. package/dist/commands/cicd/pipeline/quality-gate/list.js +34 -0
  44. package/dist/commands/cicd/pipeline/quality-gate/open.js +38 -0
  45. package/dist/commands/cicd/pipeline/quality-gate/update.js +38 -0
  46. package/dist/commands/cicd/work/create.js +1 -0
  47. package/dist/commands/cicd/work/environment-sync.js +8 -7
  48. package/dist/commands/cicd/work/get.js +18 -2
  49. package/dist/commands/cicd/work/set.js +6 -4
  50. package/dist/commands/cicd/work/submit.js +3 -2
  51. package/dist/commands/cicd/work/update.js +1 -0
  52. package/dist/commands/plugins/install.js +2 -5
  53. package/dist/commands/setup/skills/create.js +29 -3
  54. package/dist/commands/setup/skills/list.js +55 -0
  55. package/dist/commands/setup/skills/update.js +37 -4
  56. package/dist/commands/setup.js +3 -3
  57. package/dist/commands/testing/data-table/create.js +1 -2
  58. package/dist/commands/testing/data-table/delete.js +1 -2
  59. package/dist/commands/testing/data-table/export.js +2 -6
  60. package/dist/commands/testing/data-table/get.js +2 -4
  61. package/dist/commands/testing/data-table/list.js +1 -2
  62. package/dist/commands/testing/data-table/update.js +3 -4
  63. package/dist/commands/testing/job/create.js +26 -22
  64. package/dist/commands/testing/job/delete.js +2 -2
  65. package/dist/commands/testing/job/files/download.js +73 -0
  66. package/dist/commands/testing/job/files/list.js +43 -0
  67. package/dist/commands/testing/job/{upload.js → files/upload.js} +13 -9
  68. package/dist/commands/testing/job/get.js +2 -2
  69. package/dist/commands/testing/job/list.js +1 -1
  70. package/dist/commands/testing/job/refs.js +4 -4
  71. package/dist/commands/testing/job/run.js +134 -1
  72. package/dist/commands/testing/{build → job/runs}/abort.js +10 -8
  73. package/dist/commands/testing/job/runs/get.js +42 -0
  74. package/dist/commands/testing/{build → job/runs}/list.js +19 -10
  75. package/dist/commands/testing/{logs.js → job/runs/logs.js} +9 -6
  76. package/dist/commands/testing/{build → job/runs}/search.js +9 -7
  77. package/dist/commands/testing/job/schedule/get.js +5 -11
  78. package/dist/commands/testing/job/schedule/remove.js +3 -3
  79. package/dist/commands/testing/job/schedule/set.js +3 -3
  80. package/dist/commands/testing/job/update.js +22 -65
  81. package/dist/commands/testing/live/continue.js +5 -10
  82. package/dist/commands/testing/live/execute.js +3 -3
  83. package/dist/commands/testing/live/history.js +7 -2
  84. package/dist/commands/testing/live/inspect.js +5 -4
  85. package/dist/commands/testing/live/interrupt.js +5 -10
  86. package/dist/commands/testing/live/recorder.js +23 -115
  87. package/dist/commands/testing/live/reports.js +3 -3
  88. package/dist/commands/testing/live/screenshot.js +3 -3
  89. package/dist/commands/testing/live/set-options.js +11 -4
  90. package/dist/commands/testing/live/start.js +9 -4
  91. package/dist/commands/testing/live/status.js +2 -5
  92. package/dist/commands/testing/live/stop.js +3 -5
  93. package/dist/commands/testing/live/view.js +2 -2
  94. package/dist/commands/testing/project/create.js +1 -17
  95. package/dist/commands/testing/project/get.js +0 -1
  96. package/dist/commands/testing/project/list.js +2 -2
  97. package/dist/commands/testing/project/permission/set.js +3 -7
  98. package/dist/commands/testing/project/permission/update.js +2 -2
  99. package/dist/commands/testing/robot/create.js +22 -25
  100. package/dist/commands/testing/robot/get.js +1 -1
  101. package/dist/commands/testing/robot/list.js +3 -3
  102. package/dist/commands/testing/robot/update.js +3 -3
  103. package/dist/commands/testing/user-parameter/create.js +3 -9
  104. package/dist/commands/testing/user-parameter/update.js +1 -7
  105. package/dist/commands/testing/variable/create.js +4 -9
  106. package/dist/commands/testing/variable/list.js +3 -3
  107. package/dist/commands/testing/variable/update.js +5 -12
  108. package/dist/help.js +17 -0
  109. package/dist/lib/ai-types.js +2 -1
  110. package/dist/lib/claude-mcp-config.js +15 -0
  111. package/dist/lib/credential-sync.js +1 -2
  112. package/dist/lib/defaults-store.js +4 -1
  113. package/dist/lib/environment-auth-status.js +2 -1
  114. package/dist/lib/environment-auth.js +2 -1
  115. package/dist/lib/environment-credential-flags.js +3 -1
  116. package/dist/lib/environment-credential-operations.js +8 -2
  117. package/dist/lib/environment-types.js +3 -1
  118. package/dist/lib/extension/assets.js +4 -0
  119. package/dist/lib/extension/create.js +3 -0
  120. package/dist/lib/extension/git.js +17 -0
  121. package/dist/lib/extension/index.js +27 -0
  122. package/dist/lib/extension/install.js +4 -0
  123. package/dist/lib/extension/manifest.js +21 -0
  124. package/dist/lib/extension/package.js +3 -0
  125. package/dist/lib/extension/paths.js +5 -0
  126. package/dist/lib/extension/publish.js +3 -0
  127. package/dist/lib/extension/sf-deploy.js +8 -0
  128. package/dist/lib/extension/source.js +7 -0
  129. package/dist/lib/extension/uninstall.js +3 -0
  130. package/dist/lib/extension-configuration-ops.js +4 -0
  131. package/dist/lib/extension-configuration-sanitize.js +7 -0
  132. package/dist/lib/extension-configuration-types.js +8 -0
  133. package/dist/lib/function-types.js +3 -1
  134. package/dist/lib/http-proxy.js +13 -0
  135. package/dist/lib/mcp/ai-tools.js +3 -3
  136. package/dist/lib/mcp/command-id.js +2 -0
  137. package/dist/lib/mcp/pipeline-automation-quality-tools.js +452 -0
  138. package/dist/lib/mcp/server.js +70 -1
  139. package/dist/lib/mcp/testing-live-tools.js +24 -13
  140. package/dist/lib/mcp/testing-tools.js +239 -550
  141. package/dist/lib/mcp/tool-annotations.js +27 -18
  142. package/dist/lib/mcp/tools.js +117 -32
  143. package/dist/lib/mcp/work-tools.js +37 -10
  144. package/dist/lib/metadata-explore.js +8 -0
  145. package/dist/lib/network-error.js +8 -0
  146. package/dist/lib/pipeline-automation-flags.js +12 -0
  147. package/dist/lib/pipeline-automation-ops.js +9 -0
  148. package/dist/lib/pipeline-automation-types.js +18 -0
  149. package/dist/lib/pipeline-lifecycle-id.js +3 -0
  150. package/dist/lib/pipeline-quality-gate-flags.js +12 -0
  151. package/dist/lib/pipeline-quality-gate-ops.js +9 -0
  152. package/dist/lib/pipeline-quality-gate-types.js +17 -0
  153. package/dist/lib/plugin-host/ai.js +2 -1
  154. package/dist/lib/plugin-skills.js +22 -0
  155. package/dist/lib/plugin-trust/gate.js +1 -2
  156. package/dist/lib/project-root.js +3 -1
  157. package/dist/lib/project-setup.js +5 -4
  158. package/dist/lib/runtime.js +1 -1
  159. package/dist/lib/salesforce-tooling-check.js +6 -0
  160. package/dist/lib/setup-skills.js +4 -1
  161. package/dist/lib/setup-templates.js +1 -4
  162. package/dist/lib/skill-packs.js +7 -0
  163. package/dist/lib/template-types.js +3 -1
  164. package/dist/lib/testing-archive.js +9 -0
  165. package/dist/lib/testing-data-table.js +39 -0
  166. package/dist/lib/testing-execution.js +22 -0
  167. package/dist/lib/testing-flags.js +6 -2
  168. package/dist/lib/testing-gateway.js +4 -1
  169. package/dist/lib/testing-live-command.js +3 -1
  170. package/dist/lib/testing-live-operations.js +7 -1
  171. package/dist/lib/testing-live-recorder.js +3 -1
  172. package/dist/lib/testing-live-state.js +8 -1
  173. package/dist/lib/testing-operations.js +6 -21
  174. package/dist/lib/testing-sanitization.js +2 -1
  175. package/dist/lib/testing-secret-input.js +2 -1
  176. package/dist/lib/testing-types.js +24 -3
  177. package/dist/lib/work-committed-metadata.js +4 -0
  178. package/dist/lib/work-environment-sync.js +3 -1
  179. package/dist/lib/work-flags.js +6 -1
  180. package/dist/lib/work-get.js +2 -1
  181. package/dist/lib/work-local-development-flow.js +4 -0
  182. package/dist/lib/work-submit-wait.js +3 -1
  183. package/oclif.manifest.json +9771 -9650
  184. package/package.json +35 -2
  185. package/templates/rules/cursor/agentia.mdc +29 -0
  186. package/templates/skills/agentia/SKILL.md +29 -0
  187. package/templates/skills/agentia-ai/SKILL.md +3 -4
  188. package/templates/skills/agentia-ai/references/ai-agents.md +2 -2
  189. package/templates/skills/agentia-cicd/SKILL.md +9 -4
  190. package/templates/skills/agentia-cicd/references/environments-and-credentials.md +19 -13
  191. package/templates/skills/agentia-cicd/references/extensions.md +52 -0
  192. package/templates/skills/agentia-cicd/references/pipelines.md +36 -2
  193. package/templates/skills/agentia-cicd/references/work.md +25 -8
  194. package/templates/skills/agentia-metadata/SKILL.md +140 -0
  195. package/templates/skills/agentia-metadata/references/metadata-explore.md +142 -0
  196. package/templates/skills/agentia-testing/SKILL.md +3 -3
  197. package/templates/skills/agentia-testing/references/tests.md +14 -14
  198. package/dist/commands/testing/build/get.js +0 -38
  199. package/dist/commands/testing/build/latest.js +0 -40
  200. package/dist/commands/testing/build/logs.js +0 -47
  201. package/dist/commands/testing/build/run.js +0 -26
  202. package/dist/commands/testing/create.js +0 -2
  203. package/dist/commands/testing/job/download.js +0 -54
  204. package/dist/commands/testing/job/files.js +0 -34
  205. package/dist/commands/testing/run.js +0 -26
  206. package/dist/commands/testing/status.js +0 -45
  207. package/dist/commands/testing/test/create.js +0 -2
  208. package/dist/commands/testing/test/logs.js +0 -2
  209. package/dist/commands/testing/test/run.js +0 -26
  210. package/dist/commands/testing/test/status.js +0 -2
  211. package/dist/commands/testing/test/update.js +0 -2
  212. package/dist/commands/testing/update.js +0 -65
  213. package/dist/lib/testing-data-command.js +0 -8
  214. package/dist/lib/testing-data-core.js +0 -20
  215. package/dist/lib/testing-data-export.js +0 -6
  216. package/dist/lib/testing-data-import.js +0 -6
  217. package/dist/lib/testing-data-io.js +0 -12
  218. package/dist/lib/testing-data-operations.js +0 -10
  219. package/dist/lib/testing-data-types.js +0 -4
  220. package/dist/lib/testing-live-endpoints.js +0 -6
  221. package/dist/lib/testing-live-history.js +0 -7
  222. package/dist/lib/testing-run-command.js +0 -3
  223. package/dist/lib/testing-schedule.js +0 -5
  224. package/dist/lib/testing-session.js +0 -5
  225. package/dist/lib/testing-watch.js +0 -4
  226. package/templates/AGENTS.md +0 -24
package/package.json CHANGED
@@ -12,6 +12,8 @@
12
12
  "@oclif/plugin-plugins": "^5",
13
13
  "@xmldom/xmldom": "^0.9.12",
14
14
  "exceljs": "^4.4.0",
15
+ "proxy-agent": "^8.0.2",
16
+ "proxy-from-env": "^2.1.0",
15
17
  "semver": "^7.8.5",
16
18
  "tty-table": "^7.0.1",
17
19
  "uuid": "^14.0.1",
@@ -59,6 +61,7 @@
59
61
  "bin": "agentia",
60
62
  "dirname": "agentia-cli",
61
63
  "commands": "./dist/commands",
64
+ "helpClass": "./dist/help.js",
62
65
  "hooks": {
63
66
  "finally": [
64
67
  "./dist/hooks/finally/ide-command-event"
@@ -227,15 +230,45 @@
227
230
  "description": "Create and update Agentia Agent Skills"
228
231
  },
229
232
  "testing": {
230
- "description": "Manage Copado Robotic Testing projects, tests, runs, logs, and variables"
233
+ "description": "Manage Copado Robotic Testing projects, jobs, runs, logs, and variables"
234
+ },
235
+ "testing:data-table": {
236
+ "description": "Manage Copado Robotic Testing data tables"
237
+ },
238
+ "testing:job": {
239
+ "description": "Manage Copado Robotic Testing jobs and their runs"
240
+ },
241
+ "testing:job:files": {
242
+ "description": "Manage files stored in a Copado Robotic Testing job"
243
+ },
244
+ "testing:job:runs": {
245
+ "description": "Inspect and control Copado Robotic Testing job runs"
246
+ },
247
+ "testing:job:schedule": {
248
+ "description": "Manage the schedule for a Copado Robotic Testing job"
231
249
  },
232
250
  "testing:live": {
233
251
  "description": "Manage Copado Robotic Testing live sessions"
252
+ },
253
+ "testing:project": {
254
+ "description": "Manage Copado Robotic Testing projects"
255
+ },
256
+ "testing:project:permission": {
257
+ "description": "Manage Copado Robotic Testing project permissions"
258
+ },
259
+ "testing:robot": {
260
+ "description": "Manage Copado Robotic Testing robots"
261
+ },
262
+ "testing:user-parameter": {
263
+ "description": "Manage account-scoped Copado Robotic Testing user parameters"
264
+ },
265
+ "testing:variable": {
266
+ "description": "Manage Copado Robotic Testing variables and secrets"
234
267
  }
235
268
  }
236
269
  },
237
270
  "type": "module",
238
- "version": "1.0.0",
271
+ "version": "1.2.0",
239
272
  "x-agentia-protected-build": true,
240
273
  "x-agentia-protected-files": [
241
274
  "dist/lib/runtime.js"
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Use Agentia for Copado CICD, Testing, AI, and advanced pipeline workflows
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- Agentia managed rules: agentia setup skills -->
7
+
8
+ # Agentia CLI
9
+
10
+ Use Agentia to manage Copado work items. Prefer registered Agentia MCP tools; otherwise use the CLI with `--json`.
11
+
12
+ Authentication must be configured before operational commands. Never print credentials, tokens, or unmasked environment variables.
13
+
14
+ ## Copado workflow
15
+
16
+ `list → get → set → (implement & git commit) → test → publish → submit [--done|--deploy]`
17
+
18
+ Read records before changing them and use IDs returned by Copado. Do not skip `work set` before coding; use one story per feature branch. Keep the working tree clean for lifecycle commands, and confirm promotion/deployment intent before `done`.
19
+
20
+ ## Agent Skills
21
+
22
+ Load exactly one copy of each applicable installed Agentia skill:
23
+
24
+ - `agentia-cicd`: Copado stories, commits, publish, submit, done, promotions, jobs, Functions, Job Templates, environments, pipelines, Slack notification configure, and data.
25
+ - `agentia-testing`: Copado Robotic Testing operations.
26
+ - `agentia-ai`: Copado AI operations.
27
+ - `agentia-adv`: advanced pipeline workflows.
28
+
29
+ Project-specific instructions take precedence over managed Agentia skills. Refresh managed skills with `agentia setup skills update`; do not hand-edit managed files.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: agentia
3
+ description: Use when working with Agentia or Copado CICD, Robotic Testing, AI, pipelines, user stories, commits, promotions, deployments, jobs, environments, credentials, or data templates.
4
+ ---
5
+
6
+ <!-- Agentia managed skill file: agentia setup skills -->
7
+
8
+ # Agentia CLI
9
+
10
+ Use Agentia to manage Copado work items. Prefer registered Agentia MCP tools; otherwise use the CLI with `--json`.
11
+
12
+ Authentication must be configured before operational commands. Never print credentials, tokens, or unmasked environment variables.
13
+
14
+ ## Copado workflow
15
+
16
+ `list → get → set → (implement & git commit) → test → publish → submit [--done|--deploy]`
17
+
18
+ Read records before changing them and use IDs returned by Copado. Do not skip `work set` before coding; use one story per feature branch. Keep the working tree clean for lifecycle commands, and confirm promotion/deployment intent before `done`.
19
+
20
+ ## Agent Skills
21
+
22
+ Use the applicable installed domain skill for detailed instructions:
23
+
24
+ - `agentia-cicd`: Copado stories, commits, publish, submit, done, promotions, jobs, Functions, Job Templates, environments, pipelines, Slack notification configure, and data.
25
+ - `agentia-testing`: Copado Robotic Testing operations.
26
+ - `agentia-ai`: Copado AI operations.
27
+ - `agentia-adv`: advanced pipeline workflows.
28
+
29
+ Project-specific instructions take precedence over managed Agentia skills. Refresh managed skills with `agentia setup skills update`; do not hand-edit managed files.
@@ -14,10 +14,9 @@ Prefer the `agentia_ai_ask` MCP tool when it is available for single-turn prompt
14
14
  ## Start Here
15
15
 
16
16
  1. Confirm AI auth with `agentia auth get --ai --json`. Configure missing credentials with `agentia auth set --ai ...` or the supported `AGENTIA_AI_*` environment variables.
17
- 2. Choose exactly one required `--agent` option for `ask`: `plan`, `build`, `test`, `release`, `operate`, or `knowledge`. `orchestrate` is not valid for `ask`.
18
- 3. Choose exactly one required `--agent` option for `chat`: `plan`, `build`, `test`, `release`, `operate`, `knowledge`, or `orchestrate`.
19
- 4. Add useful context flags when available: `--workspace`, `--dialogue`, `--user-story`, `--sf-org`, and `--component`.
20
- 5. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
17
+ 2. Omit `--agent` by default: `ask` and `chat` use `orchestrate`, which routes work to the right specialist. Pass `--agent plan`, `build`, `test`, `release`, `operate`, or `knowledge` only to target a specialist explicitly.
18
+ 3. Add useful context flags when available: `--workspace`, `--dialogue`, `--user-story`, `--sf-org`, and `--component`.
19
+ 4. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
21
20
 
22
21
  ## Reference
23
22
 
@@ -25,9 +25,9 @@ Operational options include `--workspace` and `--timeout`; authentication is res
25
25
  | `release` | Release, promotion, packaging, and deployment questions. |
26
26
  | `operate` | Operational diagnostics, monitoring, and runbook style questions. |
27
27
  | `knowledge` | Copado AI Knowledge grounding, product documentation, personas, and troubleshooting. |
28
- | `orchestrate` | Chat-only orchestration mode for interactive sessions. |
28
+ | `orchestrate` | Default. Routes the request to the right specialist automatically. |
29
29
 
30
- Pass the selected value with the required `--agent` option. `ask` accepts `plan`, `build`, `test`, `release`, `operate`, or `knowledge`; `chat` also accepts `orchestrate`. `ask` requires a prompt with `-p` or `--prompt`; `chat` is TTY-only and prompts interactively.
30
+ `--agent` is optional and defaults to `orchestrate` for `ask`, `chat`, and the `agentia_ai_ask` MCP tool. Pass a specialist only to target it explicitly. `ask` requires a prompt with `-p` or `--prompt`; `chat` is TTY-only and prompts interactively.
31
31
 
32
32
  ## Single-Turn Ask
33
33
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agentia-cicd
3
- description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools: user stories (including current/active story context), cloud commit/promote, work publish/submit/done, promotion runs and conflicts, job executions, Copado Functions, Job Templates, environments, credentials, pipelines, stages, Slack pipeline notification subscriptions, and release data templates. Use it whenever the user asks an agent to operate Copado CICD from a terminal, IDE, or headless workflow.
3
+ description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools, including user stories (including current/active story context), cloud commit/promote, work publish/submit/done, promotion runs and conflicts, job executions, Copado Functions, Job Templates, git-hosted CICD extensions, environments, credentials, pipelines, stages, Slack pipeline notification subscriptions, and release data templates. Use it whenever the user asks an agent to operate Copado CICD from a terminal, IDE, or headless workflow.
4
4
  ---
5
5
 
6
6
  <!-- Agentia managed skill file: agentia setup skills -->
@@ -24,22 +24,27 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
24
24
  - Promotion lookup, run, resume, merge conflicts, and story-centric promotion: [references/promotions.md](references/promotions.md)
25
25
  - Copado JobExecution lookup, actions, logs, and monitoring: [references/jobs.md](references/jobs.md)
26
26
  - Copado Functions lifecycle, remote run/results, and local Docker run: [references/functions.md](references/functions.md)
27
+ - Git-hosted Copado CICD extensions (`cicd extension`, experimental): [references/extensions.md](references/extensions.md)
27
28
  - Copado Job Templates (`cicd template`, not data templates): [references/templates.md](references/templates.md)
28
29
  - Copado environments, environment credentials, and browser authentication: [references/environments-and-credentials.md](references/environments-and-credentials.md)
29
- - Pipelines, environment connections, stages, and stage connections: [references/pipelines.md](references/pipelines.md)
30
+ - Pipelines, automations, quality gates, extension configurations, environment connections, stages, and stage connections: [references/pipelines.md](references/pipelines.md)
30
31
  - Slack notification subscriptions on a pipeline (`agentia_notification_configure` / CLI): [references/notifications.md](references/notifications.md)
31
32
  - Release data templates, records, matching, sync, dataset files, and data commits: [references/data.md](references/data.md)
32
33
 
34
+ For **Org Intelligence** (read Salesforce metadata against a sandbox/developer org credential; prefer local files first, then the org; metadata only—not data, not edits), use the separate skill `agentia-metadata/SKILL.md` (`cicd metadata explore` / MCP `agentia_metadata_explore`).
35
+
33
36
  ## General Rules
34
37
 
35
- - When the user means the **current story**, **current user story**, **active story**, **story context**, or similar without giving an ID, resolve context first with `agentia cicd work get --json` (no positional story ID). Use the returned user story (`result`) for follow-up work—any fields the task needs (for example `id`, `name`, `title`, `status`, specs, pipeline or environment IDs), not only identifiers. If the command fails (for example no active work item from `work set`), report the CLI error to the user and stop; do not guess, list stories, or pick a substitute unless the user asks you to.
38
+ - When the user means the **current story**, **current user story**, **active story**, **story context**, or similar without giving an ID, resolve context first with `agentia cicd work get --json` (no positional story ID). Use the returned user story (`result`) for follow-up work—any fields the task needs (for example `id`, `name`, `title`, `status`, specs, pipeline or environment IDs, subscriber `customFields`), not only identifiers. If the command fails (for example no active work item from `work set`), report the CLI error to the user and stop; do not guess, list stories, or pick a substitute unless the user asks you to.
39
+ - User Story subscriber custom fields: read `result.customFields` from `work get` / MCP `agentia_work_get`. Write with CLI `--custom-field ApiName=value` (repeatable) or MCP `customFields: [{ apiName, value }]` on create/update. See [references/work.md](references/work.md#subscriber-custom-fields).
36
40
  - Use Salesforce record IDs or generated names read from Copado. Do not invent story names, promotion IDs, job IDs, credential IDs, or pipeline IDs.
37
41
  - Keep human output off stdout in JSON workflows. Prefer `--json`, then parse the result object.
38
42
  - For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work publish`, and `work submit`. If `work set` returns `status: "warning"`, show the message and do not assume a feature branch was created; branch keys are cleared and the work item id/name/title are still recorded in config.user.json.
39
43
  - Treat `cicd job` as Copado CICD JobExecution. It is different from CRT `testing job`.
40
44
  - Treat `cicd function` as Copado Function definitions and runs. It is different from JobExecution (`cicd job`) and Job Templates (`cicd template`).
45
+ - Treat `cicd extension` as experimental git-hosted packaging of Functions/Templates (plus optional `force-app`). It is different from per-asset `cicd function` / `cicd template` upserts.
41
46
  - Treat `cicd template` as Copado Job Templates via `/release/jobs/templates`. It is different from Release Data Templates (`cicd data template`).
42
- - Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing test run`.
47
+ - Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing job run`.
43
48
  - Treat `cicd work test apex` as the Apex test runner that local quality gates (`.agentia_quality_gates.*`) usually call. An empty `--apex-test-classes` list skips Salesforce CLI. It can also be invoked directly. It is different from CRT.
44
49
  - Treat `auth` credentials as keychain/API credentials and `cicd credential` records as Copado environment credentials.
45
50
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Use this reference for `agentia cicd environment ...`, `agentia cicd environment auth ...`, and `agentia cicd credential ...`.
6
6
 
7
- `auth set --cicd` stores the API key used by the CLI. `cicd credential` lists, creates, or updates Copado environment credential records. They are different credential types.
7
+ `auth set --cicd` stores the API key used by the CLI. `cicd credential` lists, creates, updates, opens, or authenticates Copado environment credential records. They are different credential types.
8
8
 
9
9
  ## Environment Commands
10
10
 
@@ -14,9 +14,9 @@ Use this reference for `agentia cicd environment ...`, `agentia cicd environment
14
14
  | `environment get ID` | Inspect one environment | Read before updates, credential changes, or auth checks. |
15
15
  | `environment create NAME` | Create an environment | Set `--type`; platform defaults to SFDX. |
16
16
  | `environment update ID` | Sparse environment changes | Use only the fields the user wants changed. |
17
- | `environment open [ID]` | Open environment or credential | `--credentialid` opens a credential. CLI-only navigation helper. |
18
- | `environment auth status ID` | Validate org credential auth | Use `--credentialid` when multiple credentials need disambiguation. |
19
- | `environment auth web login ID` | Complete browser OAuth login | CLI-only, interactive browser flow. Supports bounded port and timeout flags. |
17
+ | `environment open [ID]` | Open an environment | Uses the project default environment when ID is omitted. CLI-only navigation helper. |
18
+ | `environment auth status ID` | Validate auth for an environment credential | Auto-selects when possible; use `--credentialid` to disambiguate. |
19
+ | `environment auth web login ID` | Complete browser OAuth for an environment credential | CLI-only interactive browser flow. Supports bounded port and timeout flags. |
20
20
 
21
21
  Examples:
22
22
 
@@ -26,33 +26,39 @@ agentia cicd environment get <environment-id> --json
26
26
  agentia cicd environment auth status <environment-id> --credentialid <credential-id> --json
27
27
  ```
28
28
 
29
- ## Environment Credential Commands
29
+ ## Credential Commands
30
30
 
31
31
  | Command | Use For | Notes |
32
32
  | --- | --- | --- |
33
- | `credential list` | Find credentials in one environment | Requires `--environmentid`; returns the environment's embedded credentials. OAuth signatures are never returned. |
33
+ | `credential list` | Find credentials across environments | Optional `--name`, `--page-size`, and `--cursor`. OAuth signatures are never returned. |
34
34
  | `credential create` | Create a Copado environment credential | Requires `--environmentid` and `--name`; `--default` marks it default. |
35
- | `credential update ID` | Update a Copado environment credential | Requires `--environmentid`; use `--default` or `--no-default`. |
35
+ | `credential update ID` | Update a Copado credential by ID | No environment flag; resolves environment/orgType from the credential. |
36
+ | `credential open ID` | Open a credential in the browser | CLI-only navigation helper. |
37
+ | `credential auth status ID` | Validate a specific credential | Derives the environment from GET `/corpus/credentials/{id}`. |
38
+ | `credential auth web login ID` | Browser OAuth for a specific credential | CLI-only; derives the environment from the credential. |
36
39
 
37
40
  Examples:
38
41
 
39
42
  ```sh
40
- agentia cicd credential list --environmentid <environment-id> --json
43
+ agentia cicd credential list --name CI --json
41
44
  agentia cicd credential create --environmentid <environment-id> --name "CI User" --default --json
42
- agentia cicd credential update <credential-id> --environmentid <environment-id> --no-default --json
45
+ agentia cicd credential update <credential-id> --no-default --json
46
+ agentia cicd credential open <credential-id>
47
+ agentia cicd credential auth status <credential-id> --json
48
+ agentia cicd credential auth web login <credential-id>
43
49
  ```
44
50
 
45
51
  ## When To Use Which Credential
46
52
 
47
53
  - Use `agentia auth set --cicd` when the CLI cannot authenticate to the Copado CICD API.
48
- - Use `agentia cicd credential list` to inspect an environment's credential records before changing authentication or defaults.
54
+ - Use `agentia cicd credential list` to discover credentials without first knowing an environment ID.
49
55
  - Use `agentia cicd credential create/update` when a Copado environment needs a Salesforce org credential record.
50
- - Use `agentia cicd environment auth web login` when a credential exists but needs browser-based OAuth authentication.
56
+ - Use `agentia cicd credential auth web login` when you already know the credential ID; use `agentia cicd environment auth web login` when you want automatic/default selection within an environment.
51
57
  - Use `agentia auth get --cicd --json` to inspect local CLI auth status without exposing the raw API key.
52
58
 
53
59
  ## Gotchas
54
60
 
55
61
  - Custom Domain environments are not supported by the credential create/update helpers.
56
- - The credential helper reads the environment first and copies its org type into the credential payload.
62
+ - Create still reads the environment first and copies its org type into the credential payload; update and credential-targeted auth derive environment/orgType from the global credential record.
57
63
  - Environment authentication can auto-select only when there is a single obvious credential. Pass `--credentialid` if multiple credentials exist.
58
- - Browser login is intentionally CLI-only; there is no equivalent MCP flow.
64
+ - Browser login and open are intentionally CLI-only; MCP exposes `agentia_credential_auth_status` for non-interactive validation.
@@ -0,0 +1,52 @@
1
+
2
+ <!-- Agentia managed skill file: agentia setup skills -->
3
+
4
+ # Copado CICD Extensions
5
+
6
+ Use this reference for experimental git-hosted extension commands under `agentia cicd extension ...`.
7
+
8
+ ## Scope
9
+
10
+ `cicd extension` packages Copado Functions and Job Templates (plus optional `force-app`) as a git repository with a semver tag. It is not the same as individual `cicd function` / `cicd template` upserts, Salesforce unlocked packages, or MCP tools (none in v1).
11
+
12
+ Layout:
13
+
14
+ - `copado/extension_manifest.json` (includes additive semver `version`)
15
+ - `copado/functions/`
16
+ - `copado/templates/`
17
+ - optional `force-app/`
18
+
19
+ ## Author workflow
20
+
21
+ ```sh
22
+ agentia cicd extension create --name my-extension --version 1.0.0
23
+ agentia cicd extension validate --require-version
24
+ agentia cicd extension package --json
25
+ # commit the manifest version before publish
26
+ agentia cicd extension publish --remote origin
27
+ agentia cicd extension publish --local --force # offline tag only
28
+ ```
29
+
30
+ `publish --version` fails if the bump is still uncommitted. Prefer committing the version, then publishing without rewriting it.
31
+
32
+ ## Install and uninstall
33
+
34
+ ```sh
35
+ agentia cicd extension install https://gitlab.com/org/my-ext.git --version 1.0.0 --dry-run
36
+ agentia cicd extension install https://gitlab.com/org/my-ext.git --version 1.0.0 --yes --sf-alias destOrg
37
+ agentia cicd extension install ./my-extension --version 1.0.0 --exclude-sf-deploy --yes --json
38
+ agentia cicd extension uninstall ./my-extension --version 1.0.0 --yes --json
39
+ ```
40
+
41
+ Rules:
42
+
43
+ - Install and uninstall need `--yes` (or a prompt) except `--dry-run`.
44
+ - `force-app` needs `--sf-alias` or `--exclude-sf-deploy`.
45
+ - Symlinks and paths outside the extension root are rejected.
46
+ - Uninstall deletes listed Functions/Templates only (404 = already gone); it does not undeploy `force-app`.
47
+
48
+ ## Related
49
+
50
+ - Individual Functions: [functions.md](functions.md)
51
+ - Individual Job Templates: [templates.md](templates.md)
52
+ - Customer enablement: `docs/enablement/features/agentia-cli-cicd-extensions.md`
@@ -2,9 +2,9 @@
2
2
 
3
3
  # CICD Pipelines Reference
4
4
 
5
- Use this reference for `agentia cicd pipeline ...`, `agentia cicd pipeline connection ...`, `agentia cicd pipeline stage-connection ...`, and `agentia cicd stage ...`.
5
+ Use this reference for `agentia cicd pipeline ...`, `agentia cicd pipeline automation ...`, `agentia cicd pipeline quality-gate ...`, `agentia cicd pipeline connection ...`, `agentia cicd pipeline stage-connection ...`, `agentia cicd stage ...`, and `agentia cicd extension-configuration ...`.
6
6
 
7
- Pipeline connections, stage connections, and stages are related but distinct. Read the target object before mutating it.
7
+ Pipeline connections, stage connections, stages, automation rules, quality gates, and extension configurations are related but distinct. Read the target object before mutating it. These pipeline quality gates are not local `cicd work test` quality gates.
8
8
 
9
9
  ## Pipeline Commands
10
10
 
@@ -23,6 +23,38 @@ agentia cicd pipeline list --platform SFDX --active --json
23
23
  agentia cicd pipeline get <pipeline-id> --json
24
24
  ```
25
25
 
26
+ ## Automation Rules
27
+
28
+ | Command | Use For | Notes |
29
+ | --- | --- | --- |
30
+ | `pipeline automation list --pipeline-id <id>` | List automation rules | Filters: `--active`, `--name`, `--source-action`, `--execution-time`, `--include-system-generated`. |
31
+ | `pipeline automation get ID --pipeline-id <id>` | Inspect one rule | Accepts Id or name. |
32
+ | `pipeline automation create --pipeline-id <id> ...` | Create an inactive rule | Scopes: `promotion`, `backPromotion`, `environmentSyncBackPromotion`, `advanced`. Requires stage/environment targets; Scheduled needs `--cron-expression`. Optional `--filter-criteria` is a user-story filter: builder `{mode,logic,conditions[]}` or custom `{mode:"custom",whereCondition}`. |
33
+ | `pipeline automation update ID --pipeline-id <id> ...` | Sparse update | Scope is immutable after create. |
34
+ | `pipeline automation activate\|deactivate ID --pipeline-id <id>` | Lifecycle | Salesforce Id only (not name). Requires Copado Deployer ≥ 27.46. |
35
+ | `pipeline automation delete ID --pipeline-id <id> --yes` | Delete | Confirmation required for headless/JSON. |
36
+ | `pipeline automation open ID` | Open in browser | Salesforce Id only. |
37
+
38
+ ## Quality Gates
39
+
40
+ | Command | Use For | Notes |
41
+ | --- | --- | --- |
42
+ | `pipeline quality-gate list --pipeline-id <id>` | List quality gates | Filters: `--name`, `--tool`. |
43
+ | `pipeline quality-gate get ID --pipeline-id <id>` | Inspect one gate | Aggregate may include multiple conditions. |
44
+ | `pipeline quality-gate create --pipeline-id <id> ...` | Create inactive gates | Requires an active `--extension-configuration-id` and targeting (`--entire-pipeline` or stage/environment Ids). Optional `--filter-criteria` is a metadata-change filter (`Name`/`Type`/`Directory` conditions + numbered `logic`). Create may return an array. |
45
+ | `pipeline quality-gate update ID --pipeline-id <id> ...` | Sparse update | Gate must be inactive; update uses singular `--stage-id` / `--environment-id`. |
46
+ | `pipeline quality-gate activate\|deactivate ID --pipeline-id <id>` | Lifecycle | Salesforce Id only. |
47
+ | `pipeline quality-gate delete ID --pipeline-id <id> --yes` | Delete inactive gate | Confirmation required for headless/JSON. |
48
+ | `pipeline quality-gate open ID` | Open in browser | Salesforce Id only. |
49
+
50
+ ## Extension Configurations
51
+
52
+ | Command | Use For | Notes |
53
+ | --- | --- | --- |
54
+ | `extension-configuration list` | Discover configs | Filters: `--name`, `--tool`, `--test-type`, `--active`. |
55
+ | `extension-configuration get ID` | Inspect one config | Accepts Id or name. |
56
+ | `extension-configuration open ID` | Open in browser | Salesforce Id only. Create/update/activate are not exposed (gateway lifecycle currently unavailable). |
57
+
26
58
  ## Environment Connections
27
59
 
28
60
  Pipeline connections define source-to-destination environment promotion edges.
@@ -59,5 +91,7 @@ Stages are reusable stage records. Stage connections order those stages inside a
59
91
  - `pipeline connection` is an environment promotion edge.
60
92
  - `pipeline stage-connection` is the ordered stage chain inside a pipeline.
61
93
  - `cicd stage` manages stage records that can be referenced by stage connections.
94
+ - Pipeline `quality-gate` commands manage Copado pipeline quality gates. Local script gates remain under `cicd work test`.
95
+ - Activate/deactivate and open require Salesforce Ids, not names.
62
96
  - Delete commands prompt in interactive mode. Use `--yes` only when the user already confirmed the destructive action.
63
97
  - Repository setup is a neighboring domain: pipelines can reference `--git-repository-id`, but repository lifecycle commands are under `agentia cicd repository`.
@@ -1,5 +1,7 @@
1
1
 
2
2
 
3
+ <!-- Agentia managed skill file: agentia setup skills -->
4
+
3
5
  # CICD Work Reference
4
6
 
5
7
  Use this reference for `agentia cicd work ...`, `agentia cicd cloud ...`, and matching MCP tools such as `agentia_work_get`, `agentia_cloud_commit`, `agentia_work_publish`, and `agentia_work_submit`.
@@ -19,7 +21,7 @@ agentia cicd work get --json
19
21
 
20
22
  Omit the positional story ID only; keep `--json` so agents parse the `result` object. With MCP, call `agentia_work_get` without an `id` when available.
21
23
 
22
- **On success:** treat the JSON `result` user story as the story context for the rest of the task. Reuse any returned fields later commands or flags need (identifiers, names, status, acceptance criteria, functional or technical specs, pipeline or environment references, and similar)—not only `id` and `name`.
24
+ **On success:** treat the JSON `result` user story as the story context for the rest of the task. Reuse any returned fields later commands or flags need (identifiers, names, status, acceptance criteria, functional or technical specs, pipeline or environment references, subscriber `customFields`, and similar)—not only `id` and `name`.
23
25
 
24
26
  **On failure:** the CLI exits when no active work item is recorded (typical message: no active work item; suggestion to run `agentia cicd work set <id>`). Tell the user that no current story is set, include the sanitized error text, and stop. Do not invent an ID, run `work list` to pick one, or continue the original request until the user sets context or provides an explicit story ID.
25
27
 
@@ -47,7 +49,7 @@ Use this path when the change exists in the local repository:
47
49
  Use this path when Copado should retrieve metadata from a configured source environment instead of using local Git changes:
48
50
 
49
51
  1. Inspect the Story and pass its Salesforce ID explicitly when possible. An active Story from `work set` is optional, not a prerequisite for the cloud operation.
50
- 2. Start a cloud commit with `agentia cicd cloud commit <story-id> ... --json`. Use the simple metadata flags for one change, or `--file`/`--stdin` for a multi-change request. Salesforce metadata requires `--metadata-category SFDX`.
52
+ 2. Start a cloud commit with `agentia cicd cloud commit <story-id> ... --json`. Use the simple metadata flags for one change, or `--file`/`--stdin` for a multi-change request. Always pass `--metadata-category` (use `SFDX` for Salesforce metadata). With `--file`/`--stdin`, each change requires `c` (or `category`).
51
53
  3. Let the command wait for its Job Execution by default. After a timeout, use the returned execution ID with `agentia cicd job get` and `agentia cicd job log get`; do not immediately submit a duplicate commit.
52
54
  4. When explicitly approved to promote an existing Promotion, use `agentia cicd cloud promote <story-id> --json`; add `--deploy` only for promote-and-deploy. This is independent of local `work submit`.
53
55
 
@@ -59,18 +61,18 @@ Cloud commit checks Story readiness and source credentials before submission. Av
59
61
  | Command | Use For | Notes |
60
62
  | ------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
63
  | `work list` | Find candidate stories | Use `--assigned-to-me`, `--status`, `--project-name`, `--name`, pagination flags. |
62
- | `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields. |
63
- | `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment. |
64
- | `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. `--source-credential` sends `sourceEnvironment` as null. |
64
+ | `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields including subscriber `customFields` (`apiName`, `label`, `type`, `value`, `displayValue`, `updateable`, optional `options`). `--committed-metadata` also includes the Story committed metadata list as `committedMetadata` in the result. |
65
+ | `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. Write subscriber fields with repeatable `--custom-field ApiName=value` (MCP: `customFields: [{ apiName, value }]`). `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment. |
66
+ | `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. Same `--custom-field` / MCP `customFields` write shape as create; update-only custom fields is allowed. `--source-credential` sends `sourceEnvironment` as null. |
65
67
  | `work set ID` | Mark active and prepare branch | Fetches the base branch and, when present, the remote feature branch; creates/checks out `feature/<story-name>` from `origin/feature` when that ref exists, otherwise from the base; stores local context. A gateway warning prints the message, skips git, clears branch keys, and records work-item id/name/title. Warns without PATCHing when the Story credential differs from the project default; use `work update --source-credential` to change it. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
66
- | `cloud commit` | Copado cloud metadata commit | For local Git work, use `git commit` then `work publish`. `work commit` is a hidden compatibility alias. |
68
+ | `cloud commit` | Copado cloud metadata commit | Prefer `agentia cicd cloud commit`. Requires `--metadata-category` (or `c`/`category` per `--file` change); use `SFDX` for Salesforce metadata. For local Git work, use `git commit` then `work publish`. `cicd work commit` remains a hidden compatibility alias. |
67
69
  | `work publish` | Publish local commits and register with Copado | Requires active story context and clean tree. Accepts `--permissions` and `--full-metadata` when nested detection is not enough. `work push` is a compatibility alias. |
68
70
  | `work test` | Run local quality gate scripts | `--local` is default. Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. If missing, warns and runs the stock setup sample from a temp file. `--cloud` is not implemented yet. |
69
71
  | `work test apex` | Run named Apex test classes | Optional `--apex-test-classes`. Omit or pass empty to log a skip and exit 0 without calling Salesforce CLI. `--rerun-failed-apex-tests` reruns classes from `.agentia/apex.tests.<user-story>.json`. Optional `--wait` minutes (default 60). Usually invoked from `.agentia_quality_gates.*`. |
70
72
  | `work submit` | Submit for review/validation or promote | Runs local gates unless `--skip-local-tests`; can push ahead commits. Waits up to 5 minutes when the last pending related job template contains `Commit`. `--skip-pull-request` skips opening the MR URL. `--done` and `--deploy` match Copado UI Submit when promoting. |
71
73
  | `work done` | Compatibility alias | Prefer `work submit --done`; both promote and deploy rather than validate-only. |
72
74
  | `work promote` | Experimental local promotion | Skips Quality Gates. Requires `enableLocalPromote: true` in `.agentia/config.json`. Merges `feature/<name>` into `promotion/<promotionName>`. Use `--backpromote --destination-branch` for back promotions; `--continue` after conflict resolution. |
73
- | `work environment-sync` | Sync next-env commits onto dest/dev | Back-promotes every story behind the destination environment. Use `--destination-environment` or `--dev-org-branch`; `--continue --promotion` after pathspec conflicts. |
75
+ | `work environment-sync` | Sync next-env commits onto dest/dev | Back-promotes every story behind the destination environment. Use `--destination-environment` or `--dev-org-branch`. On conflict, stores `lastEnvironmentSyncName` so `--continue` / `--abort` can omit `--promotion` (cleared on success, abort, and `work set`). |
74
76
  | `cloud promote` | Story-centric cloud promotion run | Use `--deploy` for merge and deploy. Prefer this over local `work promote` unless you explicitly enabled local promote. |
75
77
  | `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
76
78
  | `work open [ID]` | Open story in browser | CLI-only browser helper. |
@@ -105,7 +107,7 @@ agentia cicd cloud commit <story-id> --message "Commit AccountService" --metadat
105
107
  agentia cicd cloud commit <story-id> --file commit-request.json --json
106
108
  ```
107
109
 
108
- For Salesforce metadata, include `--metadata-category SFDX`. Without the SFDX category, Copado deploy logs can report "Salesforce changes not found."
110
+ `--metadata-category` is required on simple flag input. Each `--file`/`--stdin` change requires `c` (or `category`). For Salesforce metadata, use `SFDX`. Without `c:SFDX`, Copado deploy logs can report "Salesforce changes not found."
109
111
 
110
112
  For a cloud promotion, the Story must already belong to a Promotion:
111
113
 
@@ -116,6 +118,21 @@ agentia cicd cloud promote <story-id> --deploy --json
116
118
 
117
119
  Cloud commit and promotion wait for Job Executions by default and return nonzero on failed or timed-out jobs while preserving diagnostic IDs. If a Promotion reaches Merge Conflict, resolve it and resume the original execution; do not start a replacement run.
118
120
 
121
+ ## Subscriber Custom Fields
122
+
123
+ Org-defined User Story fields (API names ending in `__c`, excluding packaged `copado__*`) are exposed as `customFields` on `work get` / create / update responses.
124
+
125
+ - **Read:** prefer `agentia cicd work get [id] --json` (or MCP `agentia_work_get`) and use `result.customFields`. Prefer `displayValue` when presenting values; use `apiName` when writing. Human output lists them under `Custom Fields:` after `Components:`.
126
+ - **Write (CLI):** repeatable `--custom-field ApiName=value` (string values; first `=` splits key/value). Duplicate `apiName` values are rejected.
127
+ - **Write (MCP):** `customFields: [{ "apiName": "JIRA_Key__c", "value": "CICD-1" }]` on `agentia_work_create` / `agentia_work_update` (values may be string, number, boolean, or null).
128
+ - Omit custom-field flags/args for packaged-only mutations. Unknown or non-updateable names fail with gateway `PLA-US-009`.
129
+
130
+ ```sh
131
+ agentia cicd work create --title "Story" --custom-field JIRA_Key__c=CICD-1 --json
132
+ agentia cicd work update --custom-field Priority_Pick__c=P1 --json
133
+ agentia cicd work get --json
134
+ ```
135
+
119
136
  ## Deployment Steps
120
137
 
121
138
  Deployment steps are attached to a user story and run during promotion.
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: agentia-metadata
3
+ description: Org Intelligence — read Salesforce metadata in a sandbox or developer org through Agentia `cicd metadata explore` (and MCP `agentia_metadata_explore`). Use when listing or searching metadata names, reading items by API name, finding where a class/field/etc is referenced, describing types, reading type documentation, or running specified Apex tests. Prefer local project files first, then the org. Reads metadata only (not org data); does not edit or deploy metadata.
4
+ ---
5
+
6
+ <!-- Agentia managed skill file: agentia setup skills -->
7
+
8
+ # Org Intelligence (Agentia Metadata Exploration)
9
+
10
+ **Org Intelligence** lets you inspect Salesforce **metadata** in the user's
11
+ connected sandbox / developer org via `cicd metadata explore` (MCP
12
+ `agentia_metadata_explore`). Prefer MCP when available; otherwise use the CLI
13
+ with `--json` when results will be parsed.
14
+
15
+ Covers Apex classes, triggers, objects, fields, Flows, and other Metadata API
16
+ types. First release is **read-oriented** only—do not invent validate, deploy,
17
+ create, update, or `check_async_id`.
18
+
19
+ ## Capabilities And Limits
20
+
21
+ | Can | Cannot |
22
+ | --- | --- |
23
+ | Read / list / search / describe **metadata** | Read or query **org data** (records, SOQL results, reports as data) |
24
+ | Find metadata references (`find_references`) | **Edit**, create, update, validate, or deploy metadata |
25
+ | Run specified Apex test classes (when asked) | Mass-scan or compare entire orgs |
26
+
27
+ If the user asks to change metadata or fetch record data, say Org Intelligence
28
+ cannot do that and point them at the appropriate Copado/Agentia workflow or
29
+ local editing instead.
30
+
31
+ ## Source Priority
32
+
33
+ 1. **Local project files first** (workspace / git / force-app / retrieved source)
34
+ when they exist and answer the question.
35
+ 2. **Then the connected org** via Org Intelligence (`cicd metadata explore`)
36
+ for names, bodies, docs, and references that are missing or unclear locally.
37
+
38
+ Do not call the org when local files already provide a clear answer. Prefer
39
+ local when reconciling differences unless the user asks for the org version.
40
+
41
+ ## What You Can Do
42
+
43
+ | Goal | Action |
44
+ | --- | --- |
45
+ | List metadata names that match a pattern | `list` |
46
+ | Search source (Apex Page/Class/Trigger/Component only) | `search` |
47
+ | Retrieve one item by API name | `read` |
48
+ | Find where a class/field/etc is used or called | `find_references` |
49
+ | Describe a metadata type shape | `describe_type` |
50
+ | Get type documentation from the tool | `read_documentation` |
51
+ | Run specific Apex test classes | `run_apex_tests` |
52
+
53
+ Use `list` / `search` to discover exact names before `read` or
54
+ `find_references`. Pass type + name for references. Confirm with the user
55
+ before `run_apex_tests`.
56
+
57
+ ## Org And Scope
58
+
59
+ - Target is the CICD project default credential when `--credential-id` /
60
+ `credentialId` is omitted. Pass `--credential-id` only to override. Do not
61
+ mix credential auth with `--session-id` + `--endpoint`.
62
+ - The user may call this **Org Intelligence**, or the connected org **Org**,
63
+ **Sandbox**, **Integration**, **Dev Org**, or similar—treat those as the
64
+ same target unless they ask for a different credential.
65
+ - You can access selected metadata. You **cannot** compare orgs or run mass
66
+ analysis / full-org scans—that hits limits and takes too long. If a list is
67
+ truncated or incomplete, say you cannot finish that breadth of scan and ask
68
+ the user to narrow the request.
69
+
70
+ ## Pattern And Type Rules
71
+
72
+ - **Always quote CLI wildcards** (`--pattern 'Account*'`). Unquoted `*` is
73
+ expanded by the shell. MCP `pattern` does not need shell quotes.
74
+ - **`search`** only covers `ApexPage`, `ApexClass`, `ApexTrigger`, and
75
+ `ApexComponent`. Pattern ≥ 2 characters, at most one `*`.
76
+ - **`list` for CustomField / FieldSet / DuplicateRule / ListView** — pattern
77
+ must start with the SObject name and a dot (e.g. `Account.Name`,
78
+ `Account.namespace__Name__c`). You cannot list every item of every object.
79
+ - **`list` for Flow** — `--pattern` matches API name, Flow label, and
80
+ triggering object API name.
81
+ - **Profiles** — reading Profile details is not supported. Tell the user you
82
+ cannot answer questions about Profile contents. Listing Profile names may
83
+ still be attempted if useful, but do not claim you can read their body.
84
+ - **Reports, Dashboards, and Folders** — listing is not supported; say so.
85
+
86
+ ## Apex Tests
87
+
88
+ - You cannot run all tests or local tests.
89
+ - Ask the user which test class names to run, then pass them via
90
+ `--apex-unit-tests` / `apexUnitTests` (comma-separated).
91
+
92
+ ## How To Call
93
+
94
+ ```sh
95
+ agentia cicd metadata explore --action describe_type --object-type ApexClass --json
96
+ agentia cicd metadata explore --action list --object-type ApexClass --pattern 'Account*' --json
97
+ agentia cicd metadata explore --action search --pattern 'Cont*' --json
98
+ agentia cicd metadata explore --action read --object-type ApexClass --full-name MyClass --json
99
+ agentia cicd metadata explore --action find_references --object-type ApexClass --full-name MyClass --json
100
+ agentia cicd metadata explore --action run_apex_tests --apex-unit-tests MyClassTest --json
101
+ ```
102
+
103
+ | Surface | Name |
104
+ | --- | --- |
105
+ | CLI | `agentia cicd metadata explore` |
106
+ | MCP | `agentia_metadata_explore` |
107
+
108
+ Tool/CLI output is YAML inside `output` (human mode prints YAML; `--json` /
109
+ MCP return `{ output, credentialId? }`). **When talking to the user, respond in
110
+ XML—not YAML.** Summarize findings; do not dump full tool YAML unless asked.
111
+ Never echo session Ids, API keys, or other secrets.
112
+
113
+ ## Gathering Context For Generated Code
114
+
115
+ When helping the user design or draft Salesforce metadata (local edits only):
116
+
117
+ - Prefer **local files**, then Org Intelligence `list` / `search` / `read` /
118
+ `describe_type` / `find_references` for accurate names and patterns.
119
+ - When drafting new Apex tests, search local code or ask about existing
120
+ conventions (data factories, test setup) before querying the org.
121
+ - Present draft code with the client's normal artifact / code-block features.
122
+ Org Intelligence does not write metadata to the org.
123
+
124
+ ## Safety
125
+
126
+ - Stay on the supported read actions above—no metadata edits, no org data.
127
+ - Prefer sandbox/dev credentials; treat production as explicit and high-risk.
128
+ - Narrow `--pattern` when lists are large or truncated.
129
+ - Experimental command: expect a warning in human/JSON output.
130
+
131
+ ## Reference
132
+
133
+ Flags, MCP args, examples, and gotchas:
134
+ [references/metadata-explore.md](references/metadata-explore.md)
135
+
136
+ ## Report Back
137
+
138
+ Report actions run, object type / fullName / pattern, credential Id (never
139
+ session Id), and outcome (names found, test result summary, or error). Do not
140
+ include secrets. Use XML in the user-facing reply.