跳到主内容
智客 ZICQ

技能库 智客分类:文档办公 agentforce-architecture-analyze

Agentforce Architecture Analyze

宣布了一个 AgentForce 代理的架构快照: 规划器,主题,动作,流量,Apex,即时模板,以及NGA插件. 从设计时间元数据(不是运行时间审计行)中渲染出人可读的架构文件和人鱼引用图. TRIGGER 当用户要求描述,图,目录,审计,文档,或diff(例如v3 vs v5)架构/动作树/专题结构/工具盘点特定代理人时,使用特定对象的代理API名称. 对运行时间的会话跟踪、谈话记录、生成时间或网关审计链不使用TRIGGER——这种技能只读取设计时间元数据(使用代理force-d360-分析来分析会话跟踪).

5493 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

宣布了一个 AgentForce 代理的架构快照: 规划器,主题,动作,流量,Apex,即时模板,以及NGA插件. 从设计时间元数据(不是运行时间审计行)中渲染出人可读的架构文件和人鱼引用图. TRIGGER 当用户要求描述,图,目录,审计,文档,或diff(例如v3 vs v5)架构/动作树/专题结构/工具盘点特定代理人时,使用特定对象的代理API名称. 对运行时间的会话跟踪、谈话记录、生成时间或网关审计链不使用TRIGGER——这种技能只读取设计时间元数据(使用代理force-d360-分析来分析会话跟踪).

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:agentforce-architecture-analyze — declared architecture snapshot、If the user hasn't given enough to proceed、Pipeline invocation、zsh arrays are 1-indexed by default; bash arrays are 0-indexed.、This block uses 0-indexed semantics throughout (_args[$i] starting at i=0),、so under zsh + `set -u` the very first read of `_args[0]` would trip。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/_shared/fs_guard.py、scripts/main.py、scripts/emit_result.py、references/soql_fields.md、references/contract.json、references/architecture_sections.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).

agentforce-architecture-analyze — declared architecture snapshotIf the user hasn't given enough to proceedPipeline invocationzsh arrays are 1-indexed by default; bash arrays are 0-indexed.This block uses 0-indexed semantics throughout (_args[$i] starting at i=0),so under zsh + `set -u` the very first read of `_args[0]` would trip`parameter not set`. KSH_ARRAYS makes zsh treat arrays as 0-indexed,matching the bash shebang's expectation. No-op under bash.Argument parser. Accepts both `--org foo` and `--org=foo`.`$ARGUMENTS` is the raw user input Claude Code substitutes.shellcheck disable=SC2206Usage block if required flags missing. Agent reads stderr,

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
agentforce-architecture-analyze
description
Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 6
  • scripts/_shared/fs_guard.py
  • scripts/main.py
  • scripts/emit_result.py
  • references/soql_fields.md
  • references/contract.json
  • references/architecture_sections.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「agentforce-architecture-analyze」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-38ac06633513132c-Agentforce-%E6%9E%B6%E6%9E%84%E5%88%86%E6%9E%90.html
请存为 .cursor/skills/agentforce-architecture-analyze/SKILL.md 或 .claude/skills/agentforce-architecture-analyze/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/forcedotcom/sf-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/forcedotcom/sf-skills' --list

npx skills add 'https://github.com/forcedotcom/sf-skills' --skill 'agentforce-architecture-analyze'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: agentforce-architecture-analyze description: "Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces)." metadata: version: "1.0" domains: ["Agentforce"] minApiVersion: "64.0" relatedSkills: - "agentforce-d360-analyze" cliTools: - tool: ["sf"] semver: ">=2.136.8" - tool: ["python3"] semver: ">=3.10.0" --- # agentforce-architecture-analyze — declared architecture snapshot Design-time metadata tree for one Agentforce agent: planner → topics → actions → flows → Apex → prompts → NGA plugins. Reads declared metadata only — `BotDefinition`, `GenAiPlanner*`, `GenAiPlugin*`, `GenAiFunction*`, `Flow`, `ApexClass`, `GenAiPromptTemplate`. Does **not** read runtime audit rows. **Runtime budget: 30–45s typical, ≤60s hard cap** on reference fixtures. Sequential baseline would be 90–220s; parallel Tooling SOQL fan-out delivers a 3–5× speedup. Large bots with many flows scale approximately linearly — each flow metadata retrieve is one round-trip. Runs **inline** — no subagent. Every phase is deterministic file processing. ## If the user hasn't given enough to proceed When invoked with no `agent_api_name` AND no org alias, print the following block **verbatim** — do not paraphrase, do not pre-run any script. Trigger condition: `$ARGUMENTS` is empty OR names no agent (no `--agent` flag and no known agent API name in the prose) OR names no org (no `--org` flag and no known alias). > Which agent should I document, and in which org? > > I need: > - **Agent API name** — the `DeveloperName` of the `BotDefinition` (e.g. `MyAgent`, `MySalesAgent`). Not the label. > - **Org alias** — for `sf` CLI auth (the alias you configured with `sf org login`) > > Optional: > - **Version** — an `agent_version_api_name` like `v5`. If omitted, I'll resolve the active `BotVersion`. > - **`--force`** — ignore cached tree; re-fetch everything. > - **`--reprobe`** — re-run the 7-day channel-probe cache (only needed after a Salesforce release). > > I'll run the metadata pipeline inline. Artifacts land under `~/.vibe/data/agentforce-architecture-analyze//__/` (overridable with `--data-dir`). ## Pipeline invocation When the user has supplied `--org ` + `--agent ` (plus any optional flags), run this block. One `python3` invocation drives the full pipeline. `main.py` writes `.emit_ctx.json`; `emit_result.py` reads it and prints the final `=== RESULT ===` block last to stdout. ```bash set -euo pipefail # zsh arrays are 1-indexed by default; bash arrays are 0-indexed. # This block uses 0-indexed semantics throughout (_args[$i] starting at i=0), # so under zsh + `set -u` the very first read of `_args[0]` would trip # `parameter not set`. KSH_ARRAYS makes zsh treat arrays as 0-indexed, # matching the bash shebang's expectation. No-op under bash. [ -n "${ZSH_VERSION:-}" ] && setopt KSH_ARRAYS SKILL_ROOT="${SKILL_ROOT:-${PLUGIN_ROOT:-$HOME/.vibe/skills}/agentforce-architecture-analyze}" # Argument parser. Accepts both `--org foo` and `--org=foo`. # `$ARGUMENTS` is the raw user input Claude Code substitutes. ARG_ORG="" ARG_AGENT="" ARG_VERSION="" ARG_FORCE="" ARG_REPROBE="" ARG_PARALLELISM="" ARG_MAX_MERMAID="" # shellcheck disable=SC2206 _args=($ARGUMENTS) i=0 while [ $i -lt ${#_args[@]} ]; do tok="${_args[$i]}" case "$tok" in --org=*) ARG_ORG="${tok#--org=}" ;; --org) i=$((i+1)); ARG_ORG="${_args[$i]:-}" ;; --agent=*) ARG_AGENT="${tok#--agent=}" ;; --agent) i=$((i+1)); ARG_AGENT="${_args[$i]:-}" ;; --version=*) ARG_VERSION="${tok#--version=}" ;; --version) i=$((i+1)); ARG_VERSION="${_args[$i]:-}" ;; --parallelism=*) ARG_PARALLELISM="${tok#--parallelism=}" ;; --parallelism) i=$((i+1)); ARG_PARALLELISM="${_args[$i]:-}" ;; --max-mermaid-nodes=*) ARG_MAX_MERMAID="${tok#--max-mermaid-nodes=}" ;; --max-mermaid-nodes) i=$((i+1)); ARG_MAX_MERMAID="${_args[$i]:-}" ;; --force) ARG_FORCE="1" ;; --reprobe) ARG_REPROBE="1" ;; esac i=$((i+1)) done # Usage block if required flags missing. Agent reads stderr, # prints verbatim, and stops — does NOT pre-run main.py. if [ -z "$ARG_ORG" ] || [ -z "$ARG_AGENT" ]; then cat >&2 <<'USAGE' > Which agent should I document, and in which org? > > I need: > - **Agent API name** — the BotDefinition.DeveloperName (e.g. `MyAgent`) > - **Org alias** — for `sf` CLI auth (the alias you configured with `sf org login`) > > Optional flags: > - `--version v5` — pin a specific BotVersion (default: Active+highest) > - `--force` — bypass cache > - `--reprobe` — force channel-probe refresh > - `--parallelism N` — ThreadPoolExecutor size (default 5) > - `--max-mermaid-nodes N` — cap Mermaid node count (default 80) USAGE exit 2 fi # Fresh work dir per invocation. Epoch + random suffix avoids collisions # between concurrent runs on the same host. WORK_DIR="/tmp/agentforce-architecture-analyze-$(date +%s)-$RANDOM" mkdir -p "$WORK_DIR" # Input validation at the boundary, BEFORE any python3 call. # fs_guard exits 1 and prints an INVALID_INPUT RESULT block on failure; # `|| exit 1` is mandatory — bare calls silently continue past failures. python3 "$SKILL_ROOT/scripts/_shared/fs_guard.py" "$ARG_AGENT" agent_api_name api_name || exit 1 python3 "$SKILL_ROOT/scripts/_shared/fs_guard.py" "$ARG_ORG" org_alias not_empty || exit 1 python3 "$SKILL_ROOT/scripts/_shared/fs_guard.py" "$WORK_DIR" WORK_DIR symlink || exit 1 python3 "$SKILL_ROOT/scripts/_shared/fs_guard.py" "$WORK_DIR" WORK_DIR owned || exit 1 if [ -n "$ARG_VERSION" ]; then python3 "$SKILL_ROOT/scripts/_shared/fs_guard.py" "$ARG_VERSION" agent_version api_name || exit 1 fi # Single python3 call drives all pipeline phases. main.py writes # `.emit_ctx.json` into $WORK_DIR — emit_result.py then renders the # RESULT block from that ctx. No subprocess-per-phase. _main_args=(--org-alias "$ARG_ORG" --agent "$ARG_AGENT" --work-dir "$WORK_DIR") [ -n "$ARG_VERSION" ] && _main_args+=(--version "$ARG_VERSION") [ -n "$ARG_FORCE" ] && _main_args+=(--force) [ -n "$ARG_REPROBE" ] && _main_args+=(--reprobe) [ -n "$ARG_PARALLELISM" ] && _main_args+=(--parallelism "$ARG_PARALLELISM") [ -n "$ARG_MAX_MERMAID" ] && _main_args+=(--max-mermaid-nodes "$ARG_MAX_MERMAID") # main.py returns nonzero on terminal failures; we DON'T short-circuit — # emit_result still publishes the failure RESULT block. `set -e` is # temporarily relaxed around this single call. set +e python3 "$SKILL_ROOT/scripts/main.py" "${_main_args[@]}" _rc=$? set -e # Final RESULT block is emit_result.py's stdout — MUST be the last thing # stdout sees. emit_result exits 0 on render success; the bash harness # propagates main.py's rc for the agent's exit status. WORK_DIR="$WORK_DIR" python3 "$SKILL_ROOT/scripts/emit_result.py" exit "$_rc" ``` ## Inputs | Input | Flag | Required | Default | |---|---|---|---| | `org_alias` | `--org` | yes | — | | `agent_api_name` | `--agent` | yes | — | | `agent_version_api_name` | `--version` | no | active BotVersion | | `force_refresh` | `--force` | no | false (honor cache) | | `reprobe` | `--reprobe` | no | false (honor 7-day channel-probe cache) | | `parallelism` | `--parallelism` | no | 5 | | `max_mermaid_nodes` | `--max-mermaid-nodes` | no | 80 | | `data_dir` | `--data-dir` | no | `~/.vibe/data/agentforce-architecture-analyze` | | `cache_dir` | `--cache-dir` | no | `~/.vibe/cache/agentforce-architecture-analyze` | ## Outputs All artifacts under `~/.vibe/data/agentforce-architecture-analyze//__/` (default; override with `--data-dir `): ```xml __metadata_tree.json primary artifact — normalized planner/topic/action/flow/apex/prompt/plugin tree __architecture.md human-readable section-by-section rendering (H1 + 7 numbered sections, plus a conditional Dependency graph appendix). Mermaid diagrams are embedded inside the relevant sections (Action tree, Data flow, and Dependency graph) ``` ## Pipeline — inline, no subagent ```text resolve_bot.py → BotDefinition + BotVersion + planner name lookup retrieve_planner.py → Metadata API zip retrieve for GenAiPlannerBundle (+ NGA plugins if present) parallel_retrieve.py → 6 parallel Tooling SOQL channels fan out from the planner id (resolved by the `planner_definition_by_agent_chain` seed query): - plugins_by_planner (GenAiPluginDefinition) - planner_bundle_functions (GenAiPlannerFunctionDef join) - functions_by_plugins (GenAiFunctionDefinition) - planner_attrs_by_parent_ids (GenAiPlannerAttrDefinition) - plugin_functions_by_plugin_ids (GenAiPluginFunctionDef join) - plugin_instructions_by_plugin_ids (GenAiPluginInstructionDef) parse_bundle.py → parse retrieved XML into normalized node shapes parse_wave.py → BFS expansion: flow/apex/prompt refs discovered in nodes → SOQL for Flow/Apex bodies (batched by id list) → Metadata retrieve ONLY for GenAiPromptTemplate (+ NGA external plugins conditionally) finalize.py → merge waves into metadata_tree.json render_architecture.py → __architecture.md + Mermaid invocation graph (capped at --max-mermaid-nodes) ``` **Channel strategy — SOQL-first.** - **Tooling SOQL** for every normalized tree node (planner, plugins, functions, plugin-functions, plugin-instructions, planner-functions, planner-attrs) — 6 parallel channels keyed on planner id, plus the `planner_definition_by_agent_chain` seed query that resolves the planner id from the agent chain. - **Data API SOQL** for Flow (by id) and Apex (by id or name) bodies — batched. - **Metadata retrieve** only for two cases: (a) `GenAiPromptTemplate` (prompt bodies aren't cleanly exposed via Tooling SOQL), and (b) NGA **external plugins** when the planner is Native Generative Agent shape (skipped for classic ReAct). This is where the 3–5× speedup comes from. A naive implementation would retrieve everything via Metadata API zips sequentially; parallel Tooling SOQL covers ~80% of the tree in a single fan-out. ## Planner shapes — classic ReAct vs NGA The skill normalizes two planner families into a single tree shape: | Shape | `GenAiPlannerDefinition.PlannerType` | InvocationTarget style | NGA plugins? | |---|---|---|---| | **Classic ReAct** | `ReactAiPlannerV1` / `SequentialPlannerIntentClassifier` / etc. | DeveloperName strings | no | | **NGA** | `ConcurrentMultiAgentOrchestration` / `AnthropicCompatibleV1` / etc. | Sometimes 15/18-char Ids (ID-prefix routed) | yes (external plugins via Metadata retrieve) | The ID-prefix router in `resolve_invocation_target.py` distinguishes the two: NGA InvocationTargets that look like ids (`01p…` = ApexClass, `301…` = Flow, etc.) get resolved via id-scoped SOQL; DeveloperName targets go through name-scoped SOQL. Unknown prefixes surface as `_unresolved[]` with `reason="unknown-id-prefix:"` — never silently dropped. ## Caching - **Tree cache**: `metadata_tree.json` is reused unless `--force` is passed. Cache key includes the asset-hash of every `.soql` / `.yaml` / `.mmd` template bundled with the skill — bump a template, the cache busts automatically. - **Channel probe cache**: 7-day TTL on the per-org `sf sobject describe` results that validate every field name the SOQL assets reference. A Salesforce quarterly release that renames / removes a field triggers `status: PROBE_FAILED`; `--reprobe` forces a refresh. ## Prerequisites | Tool | Required | |---|---| | `sf` CLI (authenticated against the target org) | yes — `sf org login web --alias ` | | Python 3.10+ | yes | ## Reference docs to load when needed Do NOT load eagerly. Load when the user's question requires it: - `references/soql_fields.md` — per-sObject field reference for the 13 sObjects this skill touches (2 Data API + 11 Tooling), with `[mandatory]` vs `[optional]` tags. Load when the user asks about a specific field, or when debugging an `INVALID_FIELD` SOQL error. - `references/contract.json` — machine-readable schema for `metadata_tree.json`. Load when writing downstream tooling that consumes the tree. - `references/architecture_sections.md` — section-by-section structure of the rendered `__architecture.md`. ## Invariants worth knowing upfront - **Pipeline is deterministic.** Same `(org, agent, version)` + static org metadata → byte-identical `__metadata_tree.json` and `__architecture.md`. Only manifest timestamps drift across re-runs. - **Forward-only traversal.** Every discovered ref goes forward from planner → children. No backward lookups. - **Partial results are surfaced, not silenced.** Any unresolved reference lands in `_unresolved[]` with `reason=...`. `STATUS=PARTIAL_OK` if any channel failed; `STATUS=OK` only on a clean run. - **Cycle detection is per-branch.** Same flow visited along its own ancestor chain emits `_cycle_back_to:` instead of recursing. A defensive `MAX_BFS_DEPTH=20` guard backs the per-branch ancestor set; real-world agents bottom out well before either limit fires. (Earlier docs claimed a hard cap of 5; that was the historical limit and was abandoned because shared utility flows like `handleFlowFault` tripped it on every nested tree — see `config.MAX_BFS_DEPTH` for the rationale.) - **Child ordering is alphabetical by `api_name` (case-insensitive).** Topics come before non-topic plannerActions at the root level. Flow-actionCall order is NOT sorted — that's the flow author's execution sequence.

相关技能

文档办公

Ontology

为结构化的代理内存和可堆肥技能所打入的知识图. 在创建/征服实体(Person, project, Task, Evention, Document)时使用,链接相关对象,强制约束,规划多步动作作为图变,或技能需要共享状态时使用. 触发到"记住","我知道什么","链接X到Y",…

文档办公

Nano Pdf

使用纳米-pdf CLI编辑带有自然语言指令的PDF.

文档办公

Word / DOCX

创建,检查,并编辑有可靠样式的Microsoft Word文档和DOCX文件,编号,跟踪更改,表格,章节,并进行相容性检查. 当 (1) 任务涉及 Word 或 ".docx " 时使用; (2) 文件包括跟踪的更改,评论,字段,表格,模板,或页面布局限制; (3) 文档必须在不…

文档办公

Api Gateway

通过 Maton 网关调用第三方 API, 它为用户已经连接的应用程序注入证书 。 当用户命名一个连接的应用程序和其中的具体行动时使用此技能——读取一个邮箱,查询一个CMM,归档一个问题,更新一个电子表格,通过一个连接的搜索或刮取提供者运行一个查询. 每一次通话都到用户连接的应用…