sf-deploy by jaganpro/sf-skills
npx skills add https://github.com/jaganpro/sf-skills --skill sf-deploy当用户需要部署编排时使用此技能:包括试运行验证、基于目标或清单的部署、CI/CD 工作流建议、临时组织管理、故障排查或 Salesforce 元数据的安全推出排序。
当工作涉及以下内容时,使用 sf-deploy:
sf project deploy start、quick、report 或检索工作流当用户进行以下操作时,请委托给其他技能:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
sf CLI v2。--source-dir、--metadata 或 --manifest。--dry-run。sf-data。| 阶段 | 元数据 |
|---|---|
| 1 | 自定义对象 / 字段 |
| 2 | 权限集 |
| 3 | Apex |
| 4 | Flow 作为草稿 |
| 5 | Flow 激活 / 后验证 |
此顺序可防止许多依赖项和 FLS 失败。
询问或推断:
起飞前检查:
sf --version
sf org list
sf org display --target-org <alias> --json
test -f sfdx-project.json
确认身份验证、仓库结构、包目录和目标范围。
sf project deploy start --dry-run --source-dir force-app --target-org <alias> --wait 30 --json
当变更集是目标性的时,使用基于清单或元数据范围的验证。
验证成功后,引导用户执行正确的下一步操作:
# source-dir 部署
sf project deploy start --source-dir force-app --target-org <alias> --wait 30 --json
# 清单部署
sf project deploy start --manifest manifest/package.xml --target-org <alias> --test-level RunLocalTests --wait 30 --json
# 成功验证后的快速部署
sf project deploy quick --job-id <validation-job-id> --target-org <alias> --json
sf project deploy report --job-id <job-id> --target-org <alias> --json
然后验证测试、Flow 状态、权限分配和冒烟测试行为。
总结部署了什么、什么失败了、什么被跳过了以及下一个安全操作是什么。
| 错误 / 症状 | 可能原因 | 默认修复方向 |
|---|---|---|
FIELD_CUSTOM_VALIDATION_EXCEPTION | 验证规则或错误的测试数据 | 调整数据或规则时机 |
INVALID_CROSS_REFERENCE_KEY | 缺少依赖项 | 首先包含引用的元数据 |
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY | 触发器 / Flow / 验证副作用 | 检查自动化堆栈和失败逻辑 |
| 部署期间测试失败 | 代码损坏或测试脆弱 | 运行针对性测试,修复根本原因,重新验证 |
| 权限集中找不到字段/对象 | 顺序错误 | 在权限集之前部署对象/字段 |
| Flow 无效 / 版本冲突 | 依赖项或激活问题 | 作为草稿部署,验证,然后激活 |
默认流水线结构:
静态分析现在使用 Code Analyzer v5 (sf code-analyzer),而不是已弃用的 sf scanner。
使用此技能来编排围绕代理的部署/发布排序,但使用特定于代理的技能来进行编写决策:
.agent 编写和验证有关完整的代理 DevOps 详细信息,包括 Agent: 伪元数据、发布/激活以及组织间同步,请参阅:
| 需求 | 委托给 | 原因 |
|---|---|---|
| 自定义对象 / 字段创建 | sf-metadata | 在部署前定义元数据 |
| Apex 编译 / 审查 / 修复 | sf-apex | 代码编写和修复 |
| Flow 创建 / 修复 | sf-flow | Flow 编写和激活指导 |
| 测试数据或种子记录 | sf-data | 描述优先的数据设置和清理 |
| Agent Script 构建/发布准备 | sf-ai-agentscript | 特定于代理的正确性 |
| 分数 | 含义 |
|---|---|
| 90+ | 强大的部署计划和执行指导 |
| 75–89 | 良好的部署指导,有少量审查项 |
| 60–74 | 部分覆盖部署风险 |
| < 60 | 信心不足;在推出前完善计划 |
Deployment goal: <validate / deploy / retrieve / pipeline>
Target org: <alias>
Scope: <source-dir / metadata / manifest>
Result: <passed / failed / partial>
Key findings: <errors, ordering, tests, skipped items>
Next step: <safe follow-up action>
每周安装次数
288
仓库
GitHub 星标数
223
首次出现
Jan 22, 2026
安全审计
安装于
codex278
cursor277
opencode274
gemini-cli274
github-copilot271
amp268
Use this skill when the user needs deployment orchestration : dry-run validation, targeted or manifest-based deploys, CI/CD workflow advice, scratch-org management, failure triage, or safe rollout sequencing for Salesforce metadata.
Use sf-deploy when the work involves:
sf project deploy start, quick, report, or retrieval workflowsDelegate elsewhere when the user is:
sf CLI v2 only.--source-dir, --metadata, or --manifest.--dry-run first before real deploys.sf-data after metadata is validated or deployed.| Phase | Metadata |
|---|---|
| 1 | Custom objects / fields |
| 2 | Permission sets |
| 3 | Apex |
| 4 | Flows as Draft |
| 5 | Flow activation / post-verify |
This ordering prevents many dependency and FLS failures.
Ask for or infer:
Preflight checks:
sf --version
sf org list
sf org display --target-org <alias> --json
test -f sfdx-project.json
Confirm auth, repo shape, package directories, and target scope.
sf project deploy start --dry-run --source-dir force-app --target-org <alias> --wait 30 --json
Use manifest- or metadata-scoped validation when the change set is targeted.
After a successful validation, guide the user to the correct next action:
# source-dir deploy
sf project deploy start --source-dir force-app --target-org <alias> --wait 30 --json
# manifest deploy
sf project deploy start --manifest manifest/package.xml --target-org <alias> --test-level RunLocalTests --wait 30 --json
# quick deploy after successful validation
sf project deploy quick --job-id <validation-job-id> --target-org <alias> --json
sf project deploy report --job-id <job-id> --target-org <alias> --json
Then verify tests, Flow state, permission assignments, and smoke-test behavior.
Summarize what deployed, what failed, what was skipped, and what the next safe action is.
Output template: references/deployment-report-template.md
| Error / symptom | Likely cause | Default fix direction |
|---|---|---|
FIELD_CUSTOM_VALIDATION_EXCEPTION | validation rule or bad test data | adjust data or rule timing |
INVALID_CROSS_REFERENCE_KEY | missing dependency | include referenced metadata first |
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY | trigger / Flow / validation side effect | inspect automation stack and failing logic |
| tests fail during deploy | broken code or fragile tests | run targeted tests, fix root cause, revalidate |
| field/object not found in permset | wrong order | deploy objects/fields before permission sets |
| Flow invalid / version conflict |
Full workflows: references/orchestration.md, references/trigger-deployment-safety.md
Default pipeline shape:
Static analysis now uses Code Analyzer v5 (sf code-analyzer), not retired sf scanner.
Deep reference: references/deployment-workflows.md
Use this skill to orchestrate deployment/publish sequencing around agents, but use the agent-specific skills for authoring decisions:
.agent authoring and validationFor full agent DevOps details, including Agent: pseudo metadata, publish/activate, and sync-between-orgs, see:
| Need | Delegate to | Reason |
|---|---|---|
| custom object / field creation | sf-metadata | define metadata before deploy |
| Apex compile / review / fixes | sf-apex | code authoring and repair |
| Flow creation / repair | sf-flow | Flow authoring and activation guidance |
| test data or seed records | sf-data | describe-first data setup and cleanup |
| Agent Script build/publish readiness | sf-ai-agentscript | agent-specific correctness |
| Score | Meaning |
|---|---|
| 90+ | strong deployment plan and execution guidance |
| 75–89 | good deploy guidance with minor review items |
| 60–74 | partial coverage of deployment risk |
| < 60 | insufficient confidence; tighten plan before rollout |
Deployment goal: <validate / deploy / retrieve / pipeline>
Target org: <alias>
Scope: <source-dir / metadata / manifest>
Result: <passed / failed / partial>
Key findings: <errors, ordering, tests, skipped items>
Next step: <safe follow-up action>
Weekly Installs
288
Repository
GitHub Stars
223
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex278
cursor277
opencode274
gemini-cli274
github-copilot271
amp268
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
102,600 周安装
| dependency or activation problem |
| deploy as Draft, verify, then activate |