Adds scripts/bdt_analyze.py — a generic, stdlib-only DAG parser and
query CLI for Salesforce Data Cloud BDT JSON. 1,379 lines.
Parser primitives:
- DataTransform.from_path / from_dict — accepts three input shapes:
editor export ({version, nodes, ui, ...}), Connect API
single-definition ({name, label, type, definition: {...}}), and
Connect API multi-definition ({name, definitions: [{name, label,
type, definition}, ...]}).
- Node dataclass with ui_label / ui_description fallback resolution.
- roots() / sinks() / topo_order() — Kahn's algorithm with
deterministic tie-break for reproducible output.
- upstream() / downstream() traversal resilient to broken refs and
cycles (does not infinite-loop on self-edges or cycles).
- broken_references(), fields_produced(), fields_consumed(),
_scrape_field_refs() heuristics for field-trace discovery.
CLI (argparse, 10 subcommands, each supports --json for machine
output):
- summary — node counts, source/sink counts, stage totals.
- sources — list source nodes (no upstream).
- outputs — list sink nodes (no downstream).
- stages — topologically ordered stages.
- nodes — flat node listing with labels.
- node <name> — per-node detail (action, inputs, outputs, fields,
UI label/description).
- lineage <node> — upstream + downstream chain from a node.
- field-trace <field> — which nodes produce/consume a given field.
- formula <node> — extract formulas/expressions from a node.
- definitions — lists definitions in multi-definition
payloads; every other subcommand accepts
--definition N (default 0) to route into a
specific definition within the payload.
Error contract:
- Exit 0 on success, 2 on unknown node/field, 3 on malformed input.
- BdtInputError (exit 3) and BdtNotFoundError (exit 2) classes
centralize error handling so the CLI shell stays thin.
- Field-trace narrowing refinements prevent false positives from
substring matches in formula bodies.
- Upstream/downstream walkers harden against broken refs discovered
during internal-BDT audit.
Design invariants:
- Python owns truth (parsing, DAG math, field discovery). LLM owns
narrative (explaining what the structure means to a user).
- No external dependencies — stdlib only: argparse, json, pathlib,
re, sys, collections, dataclasses, typing.
- Output size budgets: every subcommand caps its default-mode output
so summaries fit in a single LLM context window; --json dumps
everything for agents that need raw data.
@W-22196528@
|
||
|---|---|---|
| .github | ||
| samples | ||
| scripts | ||
| skills | ||
| .gitignore | ||
| .nvmrc | ||
| .template-versions.json | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| DOCS_ONLY.md | ||
| LICENSE.txt | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| SECURITY.md | ||
| sfdx-project.json | ||
Agentforce Vibes Library
This repository provides a curated collection of Salesforce agent skills for building applications. It includes skills for Agentforce agents, Lightning apps, Flow, Apex, SOQL, Lightning Web Components (LWC), UI bundles, objects and fields, permission sets, and related areas.
The skills are contributed by Salesforce and the broader community. It’s optimized for Agentforce Vibes and can be used with any AI tool that supports skills.
🗂️ Structure
afv-library/
├── skills/ # Directory-based executable workflows
│ ├── generating-apex/
│ ├── generating-custom-object/
│ ├── generating-flow/
│ └── ...
├── samples/ # Synced sample apps (e.g. from npm)
│ └── ui-bundle-template-app-react-sample-b2e/
│ └── ...
├── scripts/
│ └── ...
└── README.md
🚀 Usage
| Tool | Usage |
|---|---|
| Agentforce Vibes | Skills are auto-installed and auto-updated |
| OpenCode, Claude Code, Codex, Cursor, more | npx skills add forcedotcom/afv-library |
📦 Samples
The samples/ folder contains synced sample apps. For example, samples/ui-bundle-template-app-react-sample-b2e/ tracks the npm package @salesforce/ui-bundle-template-app-react-sample-b2e (nightly and on manual trigger via GitHub Actions).
To run the same sync locally from the repository root:
npm install
npm run sync-react-b2e-sample
The GitHub Action runs the same commands and opens a pull request when the npm package version changes. For more information, see samples/README.md.
🛠️ Agent Skills
Agent Skills package executable workflows, scripts, and reference material into self-contained directories. This repository follows the open Agent Skills specification and can be used with OpenCode, Claude Code, Codex, Cursor, and other tools that support skills.
Directory Structure
Each skill is a folder that can include:
SKILL.md(required): Instructions and YAML front matter.scripts/(optional): Executable scripts (For example, Python, Bash, or JavaScript).references/(optional): Extra reference documentation.assets/(optional): Templates, schemas, and lookup data
🤝 Contributing
See Contributing.
💬 Feedback
- Open an issue in this repository
- Open a pull request with suggested changes
- Use GitHub Discussions or the pull request thread for broader conversation