# Agentforce Architecture Analyze

Declared architecture snapshot for one Agentforce agent: planner, topics, actions...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill agentforce-architecture-analyze -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill agentforce-architecture-analyze -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill agentforce-architecture-analyze -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill agentforce-architecture-analyze -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## 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).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 named an agent

Trigger condition: `$ARGUMENTS` names no agent (no `--agent` flag and no exact `BotDefinition` API name in the prose). Never invent an agent name. Instead, discover what the org actually contains, one read-only query, no pipeline yet. Use the `--org` alias if given, otherwise the default target org (omit `--target-org`):

```bash
sf data query --query "SELECT DeveloperName, MasterLabel FROM BotDefinition ORDER BY DeveloperName" \
  [--target-org <alias>] --json
```

If the user gave no org alias, the pipeline block defaults `--org` to the CLI default target org itself (`sf config get target-org --json` → `.result[0].value`), you don't need to resolve it.

Then branch on the rows returned:

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/agentforce-adlc/skills/agentforce-architecture-analyze/SKILL.md
