mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 03:09:50 +08:00
Compare commits
9 Commits
06006be8ac
...
d9186b17e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9186b17e0 | ||
|
|
a0b7442d8f | ||
|
|
ae560c9719 | ||
|
|
587641d564 | ||
|
|
ae792239f2 | ||
|
|
abe0d620a4 | ||
|
|
054ac205b5 | ||
|
|
0feab6c2ae | ||
|
|
5a08db79de |
18
CHANGELOG.md
18
CHANGELOG.md
@ -1,3 +1,21 @@
|
||||
# [1.31.0](https://github.com/forcedotcom/sf-skills/compare/1.30.0...1.31.0) (2026-07-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Release 4 new skills + 6 skill updates (weekly batch 2026-07-16) @W-23461225@ ([ae560c9](https://github.com/forcedotcom/sf-skills/commit/ae560c9719cd051d58b72b82b7965fd899df241b))
|
||||
|
||||
|
||||
|
||||
# [1.30.0](https://github.com/forcedotcom/sf-skills/compare/1.29.0...1.30.0) (2026-07-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Release 2 new skills: platform-models-api-configure, platform-policy-rule-generate @W-23396600@ ([ae79223](https://github.com/forcedotcom/sf-skills/commit/ae792239f2e798654c77348e0ee4593d3d3110e8))
|
||||
|
||||
|
||||
|
||||
# [1.29.0](https://github.com/forcedotcom/sf-skills/compare/1.28.0...1.29.0) (2026-07-03)
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ This repository provides a curated collection of Salesforce agent skills for bui
|
||||
|
||||
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.
|
||||
|
||||
> ⚠️ **Expect frequent changes.** The Salesforce skills library is evolving rapidly as we refine patterns and incorporate feedback. Skills may be renamed, restructured, or removed between releases — they do not follow the same stability guarantees as GA platform APIs. If you’ve forked or synced the repository, be prepared for upstream changes that may conflict with local modifications. This repository is always the source of truth.
|
||||
|
||||
## 🗂️ Structure
|
||||
|
||||
```
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@salesforce/afv-skills",
|
||||
"version": "1.29.0",
|
||||
"version": "1.31.0",
|
||||
"description": "Salesforce skills for Agentforce Vibes",
|
||||
"license": "CC-BY-NC-4.0",
|
||||
"files": [
|
||||
|
||||
@ -44,7 +44,7 @@ See `SKILL.md` for the full flag table and sample prompts.
|
||||
|
||||
## Directory layout
|
||||
|
||||
```
|
||||
```text
|
||||
agentforce-architecture-analyze/
|
||||
├── SKILL.md Skill contract (inputs, outputs, pipeline, invariants)
|
||||
├── README.md This file
|
||||
@ -86,7 +86,7 @@ agentforce-architecture-analyze/
|
||||
|
||||
### Channel strategy — SOQL-first
|
||||
|
||||
```
|
||||
```text
|
||||
Seed query: planner_definition_by_agent_chain (chain-LIKE lookup → planner id)
|
||||
|
||||
6 parallel Tooling SOQL channels (keyed on the resolved planner id):
|
||||
@ -147,9 +147,3 @@ Per-branch ancestor-path cycle detection is the primary termination primitive: t
|
||||
| `INVALID_FIELD` from a SOQL asset | Salesforce renamed / removed the field in a quarterly release. Run with `--reprobe` to refresh the 7-day channel cache and pick up the new schema |
|
||||
| `STATUS=PROBE_FAILED` on first run | Channel probe saw a mandatory field missing. Check `channels.json` under the probe cache dir for which sObject / field — may require org-side feature enablement |
|
||||
| Tree for classic ReAct agent shows `_unresolved` entries for NGA plugins | Expected — the NGA external-plugin retrieve is skipped when the planner shape is classic. Those entries can be ignored |
|
||||
|
||||
---
|
||||
|
||||
## Author
|
||||
|
||||
Raghul Jayagopal (RJ), Salesforce ANZ FDE.
|
||||
|
||||
@ -157,14 +157,14 @@ exit "$_rc"
|
||||
|
||||
All artifacts under `~/.vibe/data/agentforce-architecture-analyze/<org_id15>/<agent_api_name>__<agent_version>/` (default; override with `--data-dir <path>`):
|
||||
|
||||
```
|
||||
```xml
|
||||
<agent>_<ver>_metadata_tree.json primary artifact — normalized planner/topic/action/flow/apex/prompt/plugin tree
|
||||
<agent>_<ver>_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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"_doc": "retired-name references replaced with plugin-scoped layout. Machine-readable I/O contract for investigating-agentforce-architecture. Orchestrator code reads this file (not SKILL.md prose) to discover the input schema, output keys, STATUS enum, and error-contract rules. The architecture skill runs inline (no subagent).",
|
||||
"_doc": "retired-name references replaced with plugin-scoped layout. Machine-readable I/O contract for agentforce-architecture-analyze. Orchestrator code reads this file (not SKILL.md prose) to discover the input schema, output keys, STATUS enum, and error-contract rules. The architecture skill runs inline (no subagent).",
|
||||
"_schema_version": "3.1",
|
||||
"_schema_notes": "3.1 (2026-05-05) canonicalizes `invocation_type` on STANDARD_ACTION / UNKNOWN nodes in the metadata tree. Prior versions split this across `raw_invocation_type` (bundle-sourced nodes) and `raw_action_type` (flow-actionCall-sourced nodes). Both legacy keys are still tolerated by readers for one release.",
|
||||
"input": {
|
||||
@ -35,15 +35,15 @@
|
||||
},
|
||||
"work_dir": {
|
||||
"type": "absolute_path",
|
||||
"description": "Ephemeral scratch. Default: /tmp/investigating-agentforce-architecture-<epoch>-<rand>."
|
||||
"description": "Ephemeral scratch. Default: /tmp/agentforce-architecture-analyze-<epoch>-<rand>."
|
||||
},
|
||||
"cache_root": {
|
||||
"type": "absolute_path",
|
||||
"description": "Internal rebuildable cache root. Default: ~/.vibe/cache/investigating-agentforce-architecture. Override with --cache-dir <path>."
|
||||
"description": "Internal rebuildable cache root. Default: ~/.vibe/cache/agentforce-architecture-analyze. Override with --cache-dir <path>."
|
||||
},
|
||||
"data_root": {
|
||||
"type": "absolute_path",
|
||||
"description": "Durable user-facing output root. Default: ~/.vibe/data/investigating-agentforce-architecture. Override with --data-dir <path>."
|
||||
"description": "Durable user-facing output root. Default: ~/.vibe/data/agentforce-architecture-analyze. Override with --data-dir <path>."
|
||||
},
|
||||
"force_refresh": {
|
||||
"type": "boolean",
|
||||
|
||||
@ -64,7 +64,7 @@ Every edge is strictly **forward** from the entry query
|
||||
(`GenAiPlannerDefinition WHERE DeveloperName = :planner_name`). No
|
||||
backward lookups.
|
||||
|
||||
```
|
||||
```text
|
||||
BotDefinition (Data API, PK Id, matched by DeveloperName)
|
||||
└── BotVersion (Data API, FK BotDefinitionId)
|
||||
│ [resolved to planner name via Bot metadata retrieve]
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill is part of the `*-datacloud` family. Shared attribution, upstream source mapping, and maintenance notes live in:
|
||||
- [../data360-orchestrate/CREDITS.md](../data360-orchestrate/CREDITS.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
@ -36,4 +36,3 @@ sf data360 data-action-target list -o myorg 2>/dev/null
|
||||
- [../data360-orchestrate/assets/definitions/data-action-target.template.json](../data360-orchestrate/assets/definitions/data-action-target.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/data-action.template.json](../data360-orchestrate/assets/definitions/data-action.template.json)
|
||||
- [../data360-orchestrate/references/plugin-setup.md](../data360-orchestrate/references/plugin-setup.md)
|
||||
- [CREDITS.md](CREDITS.md)
|
||||
|
||||
@ -107,11 +107,9 @@ Next step: <destination validation or downstream testing>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [../data360-orchestrate/assets/definitions/activation-target.template.json](../data360-orchestrate/assets/definitions/activation-target.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/activation.template.json](../data360-orchestrate/assets/definitions/activation.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/data-action-target.template.json](../data360-orchestrate/assets/definitions/data-action-target.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/data-action.template.json](../data360-orchestrate/assets/definitions/data-action.template.json)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
- [../data360-orchestrate/references/plugin-setup.md](../data360-orchestrate/references/plugin-setup.md)
|
||||
- [../data360-orchestrate/references/feature-readiness.md](../data360-orchestrate/references/feature-readiness.md)
|
||||
|
||||
@ -3,6 +3,19 @@ name: data360-code-extension-generate
|
||||
description: "Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
relatedSkills:
|
||||
- "data360-schema-get"
|
||||
cliTools:
|
||||
- tool: ["sf"]
|
||||
semver: ">=2.0.0"
|
||||
- tool: ["pip"]
|
||||
semver: ">=21.0.0"
|
||||
- tool: ["python3"]
|
||||
semver: ">=3.11.0"
|
||||
- tool: ["docker"]
|
||||
semver: ">=20.0.0"
|
||||
- tool: ["git"]
|
||||
semver: ">=2.0.0"
|
||||
---
|
||||
|
||||
# data360-code-extension-generate Skill
|
||||
@ -30,7 +43,7 @@ Before executing any code extension commands, verify prerequisites:
|
||||
```
|
||||
If not installed:
|
||||
```bash
|
||||
sf plugins install @salesforce/plugin-data-codeextension
|
||||
sf plugins install @salesforce/plugin-data-code-extension
|
||||
```
|
||||
|
||||
2. **Python 3.11**
|
||||
@ -254,7 +267,7 @@ sf data-code-extension script deploy --target-org <org_alias> --name <name> --pa
|
||||
|
||||
| Error | Solution |
|
||||
|-------|----------|
|
||||
| `command data-code-extension not found` | `sf plugins install @salesforce/plugin-data-codeextension` |
|
||||
| `command data-code-extension not found` | `sf plugins install @salesforce/plugin-data-code-extension` |
|
||||
| `datacustomcode CLI not found` | `pip install salesforce-data-customcode` |
|
||||
| `Python version mismatch` | Use pyenv: `pyenv install 3.11.0 && pyenv local 3.11.0` |
|
||||
| `Cannot connect to Docker daemon` | Start Docker Desktop |
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill is part of the `*-datacloud` family of skills covering the full Data Cloud workflow lifecycle. Shared upstream source mapping and maintenance notes live in:
|
||||
- [../data360-orchestrate/CREDITS.md](../data360-orchestrate/CREDITS.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
@ -55,5 +55,3 @@ sf data360 connection schema-upsert -o myorg --name <connector-id> -f examples/c
|
||||
|
||||
- [SKILL.md](SKILL.md)
|
||||
- [../data360-orchestrate/references/plugin-setup.md](../data360-orchestrate/references/plugin-setup.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
- [CREDITS.md](CREDITS.md)
|
||||
|
||||
@ -142,7 +142,6 @@ Next step: <prepare phase or connector follow-up>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [examples/connections/heroku-postgres.json](examples/connections/heroku-postgres.json)
|
||||
- [examples/connections/redshift.json](examples/connections/redshift.json)
|
||||
- [examples/connections/sharepoint-unstructured.json](examples/connections/sharepoint-unstructured.json)
|
||||
@ -151,4 +150,3 @@ Next step: <prepare phase or connector follow-up>
|
||||
- [examples/connections/ingest-api-schema.json](examples/connections/ingest-api-schema.json)
|
||||
- [../data360-orchestrate/references/plugin-setup.md](../data360-orchestrate/references/plugin-setup.md)
|
||||
- [../data360-orchestrate/references/feature-readiness.md](../data360-orchestrate/references/feature-readiness.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill is part of the `*-datacloud` family of skills covering the Data Cloud lifecycle: ingestion, harmonization, segmentation, and retrieval.
|
||||
@ -107,7 +107,6 @@ Next step: <segment / retrieve / follow-up>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [../data360-orchestrate/assets/definitions/dmo.template.json](../data360-orchestrate/assets/definitions/dmo.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/mapping.template.json](../data360-orchestrate/assets/definitions/mapping.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/relationship.template.json](../data360-orchestrate/assets/definitions/relationship.template.json)
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill family distills publicly shared Data Cloud implementation knowledge into sf-skills house style. Attribution is intentionally explicit because contributor credit is a core sf-skills principle.
|
||||
|
||||
---
|
||||
|
||||
This family intentionally:
|
||||
- keeps sf-skills naming consistency (`*-datacloud`)
|
||||
- keeps the external CLI plugin outside this repo
|
||||
- favors deterministic helper scripts and reusable JSON templates
|
||||
- rewrites examples into generic sf-skills-style guidance rather than copying workshop-specific payloads
|
||||
|
||||
See [UPSTREAM.md](UPSTREAM.md) for the maintenance contract.
|
||||
|
||||
---
|
||||
@ -47,7 +47,6 @@ See [references/plugin-setup.md](references/plugin-setup.md).
|
||||
| [scripts/diagnose-org.mjs](scripts/diagnose-org.mjs) | Classify org readiness by phase before mutating Data Cloud assets |
|
||||
| [references/feature-readiness.md](references/feature-readiness.md) | Map high-signal errors and feature gates to concrete next steps |
|
||||
| [assets/definitions/](assets/definitions/) | Generic JSON templates for repeatable Data Cloud definition files |
|
||||
| [UPSTREAM.md](UPSTREAM.md) | Upstream mapping for future distillation and maintenance |
|
||||
|
||||
## Generic templates
|
||||
|
||||
@ -119,9 +118,3 @@ sf data360 activation platforms -o myorg 2>/dev/null
|
||||
- [SKILL.md](SKILL.md) - Orchestrator guidance
|
||||
- [references/plugin-setup.md](references/plugin-setup.md) - Plugin install and verification
|
||||
- [references/feature-readiness.md](references/feature-readiness.md) - Readiness classification and setup guidance
|
||||
- [UPSTREAM.md](UPSTREAM.md) - Upstream tracking and distillation policy
|
||||
- [CREDITS.md](CREDITS.md) - Contributor and source attribution
|
||||
|
||||
## Primary contributor
|
||||
|
||||
**Gnanasekaran Thoppae** — primary contributor for the data360-orchestrate family.
|
||||
|
||||
@ -215,10 +215,8 @@ Next step: <next phase, setup guidance, or cross-skill handoff>
|
||||
## Reference Map
|
||||
|
||||
### Start here
|
||||
- [README.md](README.md)
|
||||
- [references/plugin-setup.md](references/plugin-setup.md)
|
||||
- [references/feature-readiness.md](references/feature-readiness.md)
|
||||
- [UPSTREAM.md](UPSTREAM.md)
|
||||
|
||||
### Phase skills
|
||||
- [data360-connect](../data360-connect/SKILL.md)
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
# Upstream Distillation Map for data360-orchestrate
|
||||
|
||||
This file exists to make downstream maintenance easy without sacrificing sf-skills consistency.
|
||||
|
||||
## Maintenance contract
|
||||
|
||||
When upstream changes, do **not** copy blindly.
|
||||
|
||||
Instead:
|
||||
1. review new upstream commits
|
||||
2. identify changed command behaviors, install patterns, or gotchas
|
||||
3. update sf-skills prompts and templates in a distilled form
|
||||
4. keep naming, attribution, and cross-skill boundaries consistent with sf-skills
|
||||
5. update this file with the new reviewed commit SHAs
|
||||
|
||||
## High-priority upstream areas to re-check
|
||||
|
||||
- installation / linking workflow for the community plugin
|
||||
- command counts and topic coverage
|
||||
- API-version guidance
|
||||
- known issues and bug-fix notes
|
||||
- live-tested command set
|
||||
- any new commands affecting Connect / Prepare / Harmonize / Segment / Act / Retrieve boundaries
|
||||
- connector-specific payload examples worth distilling into generic repo-safe examples
|
||||
- search-index / hybrid-search guidance and any command-surface changes around hybrid scoring or prefilter behavior
|
||||
- Ingestion API schema-upload flow, send-data examples, and problem-record guidance
|
||||
- unstructured-source setup differences between connection-level reruns, stream refreshes, and initial UI seeding
|
||||
- UI-only gaps where upstream introduces browser automation; validate before importing
|
||||
|
||||
## Cross-skill boundary reminders
|
||||
|
||||
Keep Data Cloud product work in `*-datacloud`, but do not blur into:
|
||||
- `agentforce-observe` for STDM/session tracing/parquet workflows
|
||||
- `platform-soql-query` for CRM SOQL-only tasks
|
||||
- `platform-data-manage` for CRM record seeding/cleanup
|
||||
- `platform-*-generate` skills for CRM schema creation (custom objects, fields, validation rules, etc.)
|
||||
|
||||
## Local helper files in this family
|
||||
|
||||
- `references/plugin-setup.md`
|
||||
- `scripts/bootstrap-plugin.sh`
|
||||
- `scripts/verify-plugin.sh`
|
||||
- `assets/definitions/`
|
||||
|
||||
These are sf-skills-owned conveniences and should evolve independently from upstream when that improves user experience.
|
||||
@ -1,7 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
Primary contributor: **Gnanasekaran Thoppae**
|
||||
|
||||
This skill is part of the `*-datacloud` family. Shared attribution, upstream source mapping, and maintenance notes live in:
|
||||
- [../data360-orchestrate/CREDITS.md](../data360-orchestrate/CREDITS.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
@ -48,4 +48,3 @@ sf data360 connection run-existing -o myorg --name <connection-id> 2>/dev/null
|
||||
- [SKILL.md](SKILL.md)
|
||||
- [examples/ingestion-api/README.md](examples/ingestion-api/README.md)
|
||||
- [../data360-orchestrate/assets/definitions/data-stream.template.json](../data360-orchestrate/assets/definitions/data-stream.template.json)
|
||||
- [CREDITS.md](CREDITS.md)
|
||||
|
||||
@ -183,7 +183,6 @@ Next step: <harmonize or retrieve>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [examples/ingestion-api/README.md](examples/ingestion-api/README.md)
|
||||
- [../data360-orchestrate/assets/definitions/data-stream.template.json](../data360-orchestrate/assets/definitions/data-stream.template.json)
|
||||
- [../data360-orchestrate/references/plugin-setup.md](../data360-orchestrate/references/plugin-setup.md)
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
Primary contributor: **Gnanasekaran Thoppae**
|
||||
|
||||
This skill is part of the `*-datacloud` family. Shared attribution, upstream source mapping, and maintenance notes live in:
|
||||
- [../data360-orchestrate/CREDITS.md](../data360-orchestrate/CREDITS.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
@ -41,4 +41,3 @@ sf data360 query hybrid -o myorg --index Knowledge_Index --query "reset password
|
||||
|
||||
- [SKILL.md](SKILL.md)
|
||||
- [../data360-orchestrate/assets/definitions/search-index.template.json](../data360-orchestrate/assets/definitions/search-index.template.json)
|
||||
- [CREDITS.md](CREDITS.md)
|
||||
|
||||
@ -111,7 +111,6 @@ Next step: <segment / harmonize / follow-up>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [examples/search-indexes/vector-knowledge.json](examples/search-indexes/vector-knowledge.json)
|
||||
- [examples/search-indexes/hybrid-structured.json](examples/search-indexes/hybrid-structured.json)
|
||||
- [../data360-orchestrate/assets/definitions/search-index.template.json](../data360-orchestrate/assets/definitions/search-index.template.json)
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill is part of the `*-datacloud` family of skills covering the Salesforce Data Cloud workflow phases. Shared definitions, templates, and readiness scripts for this family live in the `data360-orchestrate` skill directory.
|
||||
@ -33,4 +33,3 @@ sf data360 calculated-insight list -o myorg 2>/dev/null
|
||||
- [SKILL.md](SKILL.md)
|
||||
- [../data360-orchestrate/assets/definitions/calculated-insight.template.json](../data360-orchestrate/assets/definitions/calculated-insight.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/segment.template.json](../data360-orchestrate/assets/definitions/segment.template.json)
|
||||
- [CREDITS.md](CREDITS.md)
|
||||
|
||||
@ -107,8 +107,6 @@ Next step: <act / retrieve / follow-up>
|
||||
|
||||
## References
|
||||
|
||||
- [README.md](README.md)
|
||||
- [../data360-orchestrate/assets/definitions/calculated-insight.template.json](../data360-orchestrate/assets/definitions/calculated-insight.template.json)
|
||||
- [../data360-orchestrate/assets/definitions/segment.template.json](../data360-orchestrate/assets/definitions/segment.template.json)
|
||||
- [../data360-orchestrate/references/feature-readiness.md](../data360-orchestrate/references/feature-readiness.md)
|
||||
- [../data360-orchestrate/UPSTREAM.md](../data360-orchestrate/UPSTREAM.md)
|
||||
|
||||
184
skills/dx-pkg-post-install-configure/SKILL.md
Normal file
184
skills/dx-pkg-post-install-configure/SKILL.md
Normal file
@ -0,0 +1,184 @@
|
||||
---
|
||||
name: dx-pkg-post-install-configure
|
||||
description: "Use this skill to automate managed package post-install configuration. Package-agnostic — works with any managed package (LMA, FMA, work.com, Certinia, etc.). TRIGGER when: user installs a managed package and needs post-install configuration, mentions LMA/FMA/work.com post-install setup, asks to configure permission sets/FLS/page layouts for an installed package, says 'post-install', 'package setup', 'configure LMA', 'set up FMA', 'post-install steps'. DO NOT TRIGGER for: standalone permission set assignment (use dx-org-permission-set-assign), generating permission set metadata XML (use platform-permission-set-generate), package installation, or org switching."
|
||||
metadata:
|
||||
version: "2.2"
|
||||
minApiVersion: "67.0"
|
||||
cliTools:
|
||||
- tool: ["sf"]
|
||||
semver: ">=2.0.0"
|
||||
---
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Use when automating post-install configuration for any Salesforce managed package. This skill reads the package's post-install documentation, discovers available execution methods, and automates the configuration steps — including permission sets, object/field permissions, page layouts, Visualforce page access, and tab settings.
|
||||
|
||||
## Input
|
||||
|
||||
- **Required:** Package name (e.g., `LMA`, `FMA`, `work.com`)
|
||||
- **Optional:** Path to post-install doc (PDF, markdown, URL)
|
||||
|
||||
If no doc is provided, ask the user to supply it.
|
||||
|
||||
## Workflow
|
||||
|
||||
Execute phases in order. Each phase must pass before proceeding.
|
||||
|
||||
---
|
||||
|
||||
### Phase 1: Discover Available Execution Methods
|
||||
|
||||
**Priority order:**
|
||||
1. Org-native platform MCP servers (highest — direct org access via Headless 360)
|
||||
2. Claude Code external MCP servers (sf-sobject-all, sf-sobject-all-sb, etc.)
|
||||
3. sf CLI fallback (always available if authenticated)
|
||||
|
||||
#### Step 1A: Resolve org API version
|
||||
|
||||
Discover the org's current API version dynamically — never hardcode a version number:
|
||||
|
||||
```bash
|
||||
sf org display --target-org <alias> --json
|
||||
```
|
||||
|
||||
From the JSON response, read `result.apiVersion` (e.g., `"67.0"`). Store this value and use it as `v<apiVersion>` in all subsequent REST paths. If the command fails, fall back to the `minApiVersion` declared in this skill's metadata (`67.0`).
|
||||
|
||||
#### Step 1B: Check for org-native platform MCP servers
|
||||
|
||||
Query the Tooling API for MCP server availability:
|
||||
|
||||
```bash
|
||||
sf api request rest "/services/data/v<apiVersion>/tooling/query?q=SELECT+Id,DeveloperName,MasterLabel+FROM+McpServerAccess" --target-org <alias>
|
||||
```
|
||||
|
||||
#### Step 1C: Determine execution method
|
||||
|
||||
Check which Claude Code MCP tools are available and authenticated.
|
||||
|
||||
**MCP tool prefixes by org type:**
|
||||
|
||||
| Org Type | Tool Prefix |
|
||||
|---|---|
|
||||
| Production | `mcp__sf-sobject-all__` |
|
||||
| Sandbox | `mcp__sf-sobject-all-sb__` |
|
||||
| Falcon Test (pc-rnd) | `mcp__sf-sobject-all-falcon__` |
|
||||
|
||||
If MCP needs auth, call the authenticate tool. If auth fails, fall back to sf CLI.
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Verify Authentication & Org Identity
|
||||
|
||||
1. Run a lightweight test query (`SELECT Id, Name, IsSandbox FROM Organization`)
|
||||
2. If MCP auth fails, automatically fall back to sf CLI
|
||||
3. Display org info and ask user to confirm before proceeding
|
||||
|
||||
---
|
||||
|
||||
### Phase 3: Verify Package Installation
|
||||
|
||||
1. Determine the package namespace (ask user if unknown)
|
||||
2. Check via Tooling API (`InstalledSubscriberPackage`) — do NOT use `PackageLicense`
|
||||
3. If package not found, stop and inform user
|
||||
|
||||
---
|
||||
|
||||
### Phase 4: Read and Parse Post-Install Document
|
||||
|
||||
Read the provided document and extract discrete configuration steps.
|
||||
|
||||
**Supported formats:** PDF, markdown, URL (via WebFetch), pasted text.
|
||||
|
||||
**Parsing approach:**
|
||||
1. Extract each numbered/bulleted step from the document
|
||||
2. Present the extracted steps to the user for validation before proceeding
|
||||
|
||||
---
|
||||
|
||||
### Phase 5: Classify Steps & Interactive Plan Review
|
||||
|
||||
For each step extracted from the doc, classify as Automated or Manual.
|
||||
|
||||
#### Automation capabilities reference
|
||||
|
||||
**Via MCP (sobject-all) or sf CLI CRUD:**
|
||||
- Record CRUD on any standard or custom object (PermissionSet, ObjectPermissions,
|
||||
FieldPermissions, SetupEntityAccess, PermissionSetTabSetting, PermissionSetAssignment, etc.)
|
||||
|
||||
**Via Metadata API retrieve/deploy (sf CLI):**
|
||||
- Page layout modifications (add related lists, fields, sections)
|
||||
- Profile settings
|
||||
- Custom metadata type records
|
||||
|
||||
**Via sf CLI Tooling API:**
|
||||
- Tooling queries (InstalledSubscriberPackage, ApexPage, ApexClass, etc.)
|
||||
- Any REST-accessible Tooling operation
|
||||
|
||||
**Manual (no API path — requires Setup UI):**
|
||||
- System permissions not exposed via REST
|
||||
- Connected app OAuth configuration
|
||||
- Environment Hub linkage
|
||||
|
||||
#### Interactive approval
|
||||
|
||||
Present the classified plan and let the user choose:
|
||||
- **"Approve all"** — Execute all steps as planned
|
||||
- **"Let me choose"** — Select which steps to approve/skip
|
||||
- **"I have questions"** — Discuss specific steps before deciding
|
||||
|
||||
---
|
||||
|
||||
### Phase 6: Execute Approved Steps
|
||||
|
||||
For each approved step, use the resolved execution method.
|
||||
|
||||
#### Execution method reference
|
||||
|
||||
| Operation | Via MCP | Via sf CLI |
|
||||
|---|---|---|
|
||||
| SOQL query | `soqlQuery` tool | `sf data query --query "<SOQL>" --target-org <alias> --json` |
|
||||
| Create record | `createSobjectRecord` tool | `sf data create record --sobject <Object> --values "..." --target-org <alias> --json` |
|
||||
| Update record | `updateSobjectRecord` tool | `sf data update record --sobject <Object> --record-id <id> --values "..." --target-org <alias> --json` |
|
||||
| Describe object | `getObjectSchema` tool | `sf api request rest "/services/data/v<apiVersion>/sobjects/<Object>/describe" --target-org <alias>` |
|
||||
| Page layout | N/A | Metadata API retrieve/deploy |
|
||||
|
||||
#### Page layout modifications via Metadata API
|
||||
|
||||
Use `sf project retrieve start` → edit the layout XML → `sf project deploy start`.
|
||||
|
||||
#### Execution rules
|
||||
|
||||
- **Idempotency:** Before creating any record, query to check if it already exists. Skip if so.
|
||||
- **Report after each step:** Show success count, skipped items, and reasons.
|
||||
- **Automatic fallback:** If MCP fails mid-execution, retry via sf CLI.
|
||||
- **On failure:** Report error, ask user to retry/skip/stop.
|
||||
|
||||
---
|
||||
|
||||
### Phase 7: Guide Manual Steps (if any)
|
||||
|
||||
If any steps could not be automated, present each with Setup navigation instructions.
|
||||
Wait for user confirmation before proceeding to the next.
|
||||
|
||||
---
|
||||
|
||||
### Phase 8: Summary
|
||||
|
||||
Display final summary with step-by-step status, method used, and any skipped items.
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
- **Auth failure mid-execution:** Stop, ask user to re-auth, offer to resume
|
||||
- **Duplicate record errors:** Treat as "already configured", skip and continue
|
||||
- **Permission errors:** Report which permission is missing, suggest resolution
|
||||
- **Unknown step type:** Ask user to clarify, offer to mark as manual
|
||||
|
||||
## Notes
|
||||
|
||||
- **Priority: org-native MCP > Claude Code MCP > sf CLI > manual**
|
||||
- sf CLI is always a valid fallback for all CRUD and Tooling API operations
|
||||
- Page layout modifications are automated via Metadata API retrieve/deploy
|
||||
- Always verify org identity before making changes
|
||||
- All actions respect the authenticated user's permissions
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
name: experience-cms-brand-apply
|
||||
description: "Extracts, retrieves, and applies CMS brand guidelines (voice, tone, style, colors, typography) to generated content. Use this skill ANY TIME a user request involves branding, brand voice, brand tone, brand guidelines, brand identity, brand styling, or applying a brand to content. Triggers for requests like \"apply my brand\", \"use our brand voice\", \"match our brand guidelines\", \"find my brand\", \"search for brand\", \"get brand instructions\", \"apply brand tone\". Handles the full workflow: searching for brands in Salesforce CMS, extracting brand instructions, and applying brand voice/tone/guidelines to generated content. Does not apply to media/image search (use experience-content-media-search skill), logo search, or creating new brand definitions."
|
||||
compatibility: "Requires get_brand_instructions and/or search_brands MCP tools"
|
||||
compatibility: "Requires get_brand_instructions and/or search_media_cms_channels MCP tools"
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
@ -44,7 +44,7 @@ When a user requests branded content:
|
||||
|
||||
Copy this checklist and track your progress:
|
||||
|
||||
```
|
||||
```text
|
||||
CMS Branding Progress:
|
||||
- [ ] Step 1: Determine if brand is already identified or needs search
|
||||
- [ ] Step 2: Search for brands (if needed) and present options to user
|
||||
@ -63,35 +63,63 @@ Check if the user has already specified which brand to use:
|
||||
|
||||
## Step 2: Search for Brands
|
||||
|
||||
**Tool:** `search_brands`
|
||||
**Tool:** `search_media_cms_channels`
|
||||
|
||||
Brands are stored as CMS content of type `sfdc_cms__brand`. Search for them by
|
||||
querying the CMS channels with the brand content type.
|
||||
|
||||
> **Note:** Brand content search (`contentTypeFqn=sfdc_cms__brand`) is explicitly
|
||||
> excluded from the `experience-content-media-search` skill's scope. Calling
|
||||
> `search_media_cms_channels` directly here is correct and intentional — do not
|
||||
> route brand search through `experience-content-media-search`.
|
||||
|
||||
**Process:**
|
||||
|
||||
1. **Determine search query** — Use the user's description, company name, or a general keyword
|
||||
2. **Build the request:**
|
||||
1. **Determine search query** — Use the user's keyword. Brand search matches on
|
||||
brand title and description.
|
||||
2. **Build the request** with the fixed brand-search input contract:
|
||||
|
||||
```json
|
||||
{
|
||||
"inputs": [{
|
||||
"searchQuery": "keyword or brand name"
|
||||
"searchKeyword": "keyword",
|
||||
"searchLanguage": "<detected_language>",
|
||||
"channelType": "PublicUnauthenticated",
|
||||
"contentTypeFqn": "sfdc_cms__brand",
|
||||
"pageOffset": 0,
|
||||
"searchLimit": 25
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
3. **Call `search_brands`** with the query
|
||||
4. **Parse the response** — Extract brand results:
|
||||
Field rules:
|
||||
- `searchKeyword` — the user's keyword input
|
||||
- `searchLanguage` — auto-detect from the user's input; if unsure, use `en_US`
|
||||
- `channelType` — always `PublicUnauthenticated` (brand content is delivered
|
||||
via the public CMS channel; authenticated-channel brand search is not
|
||||
supported by this tool)
|
||||
- `contentTypeFqn` — always `sfdc_cms__brand`
|
||||
- `pageOffset` — `0`
|
||||
- `searchLimit` — `25`
|
||||
|
||||
3. **Call `search_media_cms_channels`** with the request
|
||||
4. **Parse the response** — A brand result has an ID starting with **`9Ps`**. Extract:
|
||||
- `managedContentId` — Unique ID (use this for extraction in Step 3)
|
||||
- `managedContentKey` — Content key identifier
|
||||
- `title` — Brand display name
|
||||
- `contentUrl` — URL to the brand content
|
||||
- `totalResults` — Number of brands found
|
||||
- `contentUrl` — URL to the brand content, found under
|
||||
`managedContentChannelDeliveryDetails[0].contentUrl`
|
||||
- `pageNumber`, `pageSize`, `totalResults` — pagination summary
|
||||
|
||||
### Presenting Brand Results
|
||||
|
||||
**If multiple brands found**, use `ask_followup_question` to present options:
|
||||
**If brands found**, first show a summary line, then use `ask_followup_question`
|
||||
to present options:
|
||||
|
||||
```
|
||||
I found [N] brands in your CMS. Which one should I apply?
|
||||
```text
|
||||
Showing [N] of [totalResults] total results (page [pageNumber], page size [pageSize]).
|
||||
|
||||
Which brand should I apply?
|
||||
|
||||
1. [Brand Title 1]
|
||||
2. [Brand Title 2]
|
||||
@ -100,15 +128,18 @@ I found [N] brands in your CMS. Which one should I apply?
|
||||
Which brand would you like to use?
|
||||
```
|
||||
|
||||
When the user replies with their selection, do NOT perform another search —
|
||||
proceed immediately to Step 3.
|
||||
|
||||
**If one brand found**, confirm with the user:
|
||||
|
||||
```
|
||||
```text
|
||||
I found the brand "[Brand Title]". Should I apply this brand's guidelines to the content?
|
||||
```
|
||||
|
||||
**If no brands found:**
|
||||
|
||||
```
|
||||
```text
|
||||
No brands found in Salesforce CMS. To use branding:
|
||||
1. Create a brand in Salesforce CMS (Content Type: sfdc_cms__brand)
|
||||
2. Provide brand guidelines directly in this conversation
|
||||
@ -152,7 +183,7 @@ The extracted brand instructions typically include:
|
||||
|
||||
| Error | Response |
|
||||
|---|---|
|
||||
| `search_brands` unavailable | "Brand search is unavailable. Please provide your brand name or guidelines directly." |
|
||||
| `search_media_cms_channels` unavailable | "Brand search is unavailable. Please provide your brand name or guidelines directly." |
|
||||
| `get_brand_instructions` unavailable | "Cannot retrieve brand instructions. Please share your brand guidelines in this conversation and I'll apply them manually." |
|
||||
| Org lacks Vibes branding | "CMS branding is not enabled for this org. Contact your admin to enable the Agentforce Vibes branding feature." |
|
||||
| Permission denied | "You don't have permission to access CMS brands. Ensure you have Managed Content Authoring permission." |
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill is built on official Salesforce LWC platform patterns and established component development practices.
|
||||
|
||||
---
|
||||
@ -15,7 +15,7 @@ Lightning Web Components development skill with PICKLES architecture methodology
|
||||
|
||||
### 1. Invoke the skill
|
||||
|
||||
```
|
||||
```yaml
|
||||
Skill: experience-lwc-generate
|
||||
Request: "Create a data table component for Account records"
|
||||
```
|
||||
@ -39,7 +39,7 @@ The skill generates:
|
||||
|
||||
## PICKLES Framework
|
||||
|
||||
```
|
||||
```text
|
||||
P → Prototype │ Validate ideas with wireframes & mock data
|
||||
I → Integrate │ Choose data source (LDS, Apex, GraphQL, API)
|
||||
C → Composition │ Structure component hierarchy & communication
|
||||
@ -80,6 +80,7 @@ S → Security │ Enforce permissions, FLS, and data protection
|
||||
| generating-metadata | Create Lightning Message Channels |
|
||||
| platform-metadata-deploy | Deploy component to org |
|
||||
|
||||
|
||||
## Spring '26 Features (API 66.0)
|
||||
|
||||
- **lwc:on directive**: Dynamic event binding from JavaScript
|
||||
|
||||
@ -7,7 +7,7 @@ This guide covers real-time notification patterns for Lightning Web Components u
|
||||
|
||||
## Overview
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ ASYNC NOTIFICATION ARCHITECTURE │
|
||||
├─────────────────────────────────────────────────────────────────────────┤
|
||||
|
||||
@ -154,7 +154,7 @@ LWC can interact with Apex in two ways: **@wire** (reactive/declarative) and **i
|
||||
|
||||
#### Quick Comparison
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ WIRE vs IMPERATIVE APEX CALLS │
|
||||
├──────────────────┬──────────────────────────────┬────────────────────────────────────┤
|
||||
@ -254,7 +254,7 @@ export default class ImperativeExample extends LightningElement {
|
||||
|
||||
#### Decision Tree
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────┐
|
||||
│ Need to modify data? │
|
||||
│ (Insert/Update/Delete) │
|
||||
@ -955,7 +955,7 @@ export default class AccountList extends LightningElement {
|
||||
|
||||
When two child components need to communicate but share the same parent, use the **parent as middleware**. This is the recommended pattern for master-detail UIs.
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────┐
|
||||
│ SIBLING COMMUNICATION FLOW │
|
||||
├─────────────────────────────────────────────────────────────────────┤
|
||||
|
||||
@ -7,7 +7,7 @@ This guide covers building Lightning Web Components for use in Salesforce Flow S
|
||||
|
||||
## Overview
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────┐
|
||||
│ FLOW ↔ LWC COMMUNICATION │
|
||||
├─────────────────────────────────────────────────────────────────────┤
|
||||
|
||||
@ -9,7 +9,7 @@ This guide provides comprehensive best practices for building production-ready L
|
||||
|
||||
The PICKLES Framework provides a structured approach to LWC architecture. Use it as a checklist during component design and implementation.
|
||||
|
||||
```
|
||||
```text
|
||||
🥒 P - Prototype → Validate ideas with wireframes & mock data
|
||||
🥒 I - Integrate → Choose data source (LDS, Apex, GraphQL)
|
||||
🥒 C - Composition → Structure component hierarchy & communication
|
||||
@ -29,7 +29,7 @@ The PICKLES Framework provides a structured approach to LWC architecture. Use it
|
||||
|
||||
Each component should do one thing well.
|
||||
|
||||
```
|
||||
```text
|
||||
✅ GOOD: accountCard, accountList, accountForm (separate components)
|
||||
❌ BAD: accountManager (does display, list, and form in one)
|
||||
```
|
||||
@ -52,7 +52,7 @@ Build complex UIs by composing simple components.
|
||||
|
||||
Data flows down (props), events bubble up.
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ DATA FLOW PATTERN │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
@ -268,7 +268,7 @@ this.dispatchEvent(new CustomEvent('change', {
|
||||
|
||||
### Event Naming Conventions
|
||||
|
||||
```
|
||||
```text
|
||||
✅ GOOD ❌ BAD
|
||||
──────────────────────── ────────────────────────
|
||||
onselect onSelectItem
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
| **PICKLES Compliance** | 25 | Architecture methodology adherence (optional) |
|
||||
|
||||
**Scoring Thresholds**:
|
||||
```
|
||||
```text
|
||||
⭐⭐⭐⭐⭐ 150-165 pts → Production-ready, full SLDS 2 + Dark Mode
|
||||
⭐⭐⭐⭐ 125-149 pts → Good component, minor styling issues
|
||||
⭐⭐⭐ 100-124 pts → Functional, needs SLDS cleanup
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
LWC state management has evolved beyond simple reactive properties. This guide covers modern patterns for managing complex state across components, including the `@lwc/state` library and Salesforce Platform State Managers.
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ STATE MANAGEMENT SPECTRUM │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
@ -588,7 +588,7 @@ disconnectedCallback() {
|
||||
|
||||
## Best Practices Summary
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ STATE MANAGEMENT BEST PRACTICES │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
|
||||
@ -7,7 +7,7 @@ The **Triangle Architecture** is a foundational Salesforce pattern where Flow, L
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────┐
|
||||
│ FLOW │
|
||||
│ (Orchestrator) │
|
||||
@ -54,7 +54,7 @@ The **Triangle Architecture** is a foundational Salesforce pattern where Flow, L
|
||||
|
||||
**Use Case**: Custom UI component for user selection within a guided Flow.
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────┐ @api (in) ┌─────────┐
|
||||
│ FLOW │ ────────────────▶ │ LWC │
|
||||
│ Screen │ │ Screen │
|
||||
@ -320,7 +320,7 @@ describe('c-record-selector', () => {
|
||||
|
||||
When deploying integrated triangle solutions:
|
||||
|
||||
```
|
||||
```text
|
||||
1. APEX CLASSES
|
||||
└── @AuraEnabled controllers (LWC depends on these)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Post-Tool Validation Hook for generating-lwc-components plugin.
|
||||
Post-Tool Validation Hook for experience-lwc-generate plugin.
|
||||
|
||||
This hook runs AFTER Write or Edit tool completes and provides SLDS 2
|
||||
validation feedback for LWC files (*.html, *.css, *.js).
|
||||
@ -38,7 +38,7 @@ for _ca_path in _CODE_ANALYZER_CANDIDATES:
|
||||
break
|
||||
|
||||
# Also add shared dir for other shared modules
|
||||
PLUGIN_ROOT = os.path.dirname(os.path.dirname(SCRIPT_DIR)) # generating-lwc-components/
|
||||
PLUGIN_ROOT = os.path.dirname(os.path.dirname(SCRIPT_DIR)) # experience-lwc-generate/
|
||||
SKILLS_ROOT = os.path.dirname(PLUGIN_ROOT)
|
||||
SHARED_DIR = os.path.join(SKILLS_ROOT, "shared")
|
||||
if os.path.isdir(SHARED_DIR):
|
||||
|
||||
@ -282,7 +282,7 @@ def format_output(results: Dict) -> str:
|
||||
output_parts.append(f" ... and {remaining} more issues")
|
||||
|
||||
output_parts.append("─" * 50)
|
||||
output_parts.append("📚 See: generating-lwc-components/references/template-anti-patterns.md")
|
||||
output_parts.append("📚 See: experience-lwc-generate/references/template-anti-patterns.md")
|
||||
|
||||
return "\n".join(output_parts)
|
||||
|
||||
|
||||
@ -3,7 +3,14 @@ name: experience-ui-bundle-app-coordinate
|
||||
description: "MUST activate when the user wants to build, create, or generate a React application, React app, web application, single-page application (SPA), or frontend application — even if no project files exist yet. MUST also activate when the project contains a uiBundles/*/src/ directory or sfdx-project.json and the prompt says create, build, construct, or generate a new app, site, or page from scratch — even if the prompt also describes visual styling. MUST also activate when the task spans more than one ui-bundle skill. Use this skill when building a complete app end-to-end. Do NOT use for Lightning Experience apps with custom objects (use platform-lightning-app-coordinate). Do NOT use for single-concern edits to an existing page (use experience-ui-bundle-frontend-generate)."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
relatedSkills: experience-ui-bundle-metadata-generate, experience-ui-bundle-features-generate, experience-ui-bundle-salesforce-data-access, experience-ui-bundle-frontend-generate, experience-ui-bundle-agentforce-client-generate, experience-ui-bundle-file-upload-generate, experience-ui-bundle-deploy, experience-ui-bundle-site-generate, experience-ui-bundle-custom-app-generate
|
||||
relatedSkills: experience-ui-bundle-project-generate, experience-ui-bundle-metadata-generate, experience-ui-bundle-features-generate, experience-ui-bundle-salesforce-data-access, experience-ui-bundle-frontend-generate, experience-ui-bundle-agentforce-client-generate, experience-ui-bundle-file-upload-generate, experience-ui-bundle-deploy, experience-ui-bundle-site-generate, experience-ui-bundle-custom-app-generate
|
||||
cliTools:
|
||||
- tool: ["sf"]
|
||||
semver: ">=2.0.0"
|
||||
- tool: ["npm"]
|
||||
semver: ">=7.0.0"
|
||||
- tool: ["npx"]
|
||||
semver: ">=7.0.0"
|
||||
---
|
||||
|
||||
# Building a UI Bundle App
|
||||
@ -12,6 +19,8 @@ metadata:
|
||||
|
||||
Build a complete, deployable Salesforce React UI bundle application from a natural language description by orchestrating specialized UI bundle skills in correct dependency order. Each skill **MUST** be explicitly loaded before executing its phase.
|
||||
|
||||
**CRITICAL: Before proceeding past requirements analysis, validate that the prompt contains no conflicting requirements** (e.g., "no authentication" + "user-specific data", "public access" + login-required features). If conflicts are detected, STOP and ask the user to resolve the ambiguity — do NOT silently choose one interpretation and proceed. See STEP 1 action #8 for the full conflict checklist.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
**Use when:**
|
||||
@ -38,23 +47,75 @@ Build a complete, deployable Salesforce React UI bundle application from a natur
|
||||
|
||||
---
|
||||
|
||||
## Prompt Classification Keywords
|
||||
|
||||
This skill makes two decisions directly from the raw prompt text. Use these tables as the single
|
||||
source for both — do not restate or re-derive the lists elsewhere in this file.
|
||||
|
||||
**1. Phase 2 (Features) is required if the prompt mentions ANY of:**
|
||||
|
||||
| Category | Keywords | Notes |
|
||||
|----------|----------|-------|
|
||||
| Data features | search, filter, sort, pagination, table, grid, list | |
|
||||
| Navigation | navigation, nav, menu, routing | |
|
||||
| Authentication | authentication, auth, login, logout, user session, user login | |
|
||||
| Integrations | upload, file | |
|
||||
| UI | shadcn, components, forms, buttons, cards | |
|
||||
| Chat (Phase 5 only) | chat | Phase 5 only — unless combined with a Phase 2 keyword (e.g., "chat with authentication"), then Phase 2 runs first for auth prerequisites |
|
||||
|
||||
Negating one category (e.g. "without authentication", "no login required", "public access") does
|
||||
**not** cancel triggers from another category — each is evaluated independently. Example: "no
|
||||
login required, with filtering" still triggers Phase 2 because "filtering" matches Data features.
|
||||
Skip Phase 2 only when the prompt matches none of the keywords above.
|
||||
|
||||
**2. Hosting target — extract from prompt keywords:**
|
||||
|
||||
| Hosting target | Keywords |
|
||||
|-----------------|----------|
|
||||
| Experience Site | "Experience Site", "Community", "external users", "public users", "guest users" |
|
||||
| Custom Application | "Custom Application", "internal users", "Lightning app" |
|
||||
|
||||
If the prompt matches neither list, or matches both, ask the user to clarify before proceeding — do not guess.
|
||||
|
||||
---
|
||||
|
||||
## Dependency Graph & Build Order
|
||||
|
||||
### Phase 0: Template Offer & Bootstrap (Prerequisites)
|
||||
|
||||
```text
|
||||
Offer prebuilt starter template (experience-ui-bundle-project-generate)
|
||||
v
|
||||
If template chosen: scaffold via sf template generate project -- Phase 1 skipped
|
||||
v
|
||||
If declined: run scripts/check-sfdx-project.sh
|
||||
v
|
||||
If missing: create sfdx-project.json
|
||||
v
|
||||
Verify project directory initialized
|
||||
```
|
||||
|
||||
Offers a faster, less error-prone starting point before building from scratch. If no template is used, ensures an SFDX project exists before attempting to generate a UI bundle — without this, `sf template generate ui-bundle` will fail with a hard error. Always check first — do not assume the project structure exists.
|
||||
|
||||
**Action:** Load `experience-ui-bundle-project-generate` and offer the two starter templates. If declined, run `scripts/check-sfdx-project.sh` and report any errors it returns. If the script reports an error, create the missing `sfdx-project.json` before proceeding.
|
||||
|
||||
### Phase 1: Scaffolding (Foundation)
|
||||
|
||||
```text
|
||||
UI Bundle scaffold (sf template generate ui-bundle)
|
||||
Determine hosting target (Experience Site / Custom Application)
|
||||
v
|
||||
UI Bundle scaffold (sf template generate ui-bundle --template reactbasic)
|
||||
v
|
||||
Install dependencies (npm install)
|
||||
v
|
||||
Bundle metadata (uibundle-meta.xml, ui-bundle.json)
|
||||
Bundle metadata (uibundle-meta.xml with <target>, ui-bundle.json)
|
||||
v
|
||||
CSP Trusted Sites (if external domains needed)
|
||||
```
|
||||
|
||||
Creates the UI bundle directory structure, meta XML, and optional routing/headers config. All subsequent phases require the scaffold to exist.
|
||||
Creates the UI bundle directory structure, meta XML (including hosting target), and optional routing/headers config. **CRITICAL**: Hosting target must be determined FIRST because the metadata skill requires `<target>` in Phase 1. All subsequent phases require the scaffold to exist.
|
||||
|
||||
### Phase 2: Features (Optional)
|
||||
### Phase 2: Features (Required if prompt mentions feature keywords — see "Prompt Classification Keywords" above)
|
||||
|
||||
```text
|
||||
Search project code (src/) for existing implementations
|
||||
@ -68,7 +129,9 @@ Resolve conflicts (two-pass: --on-conflict error, then --conflict-resolution)
|
||||
Integrate __example__ files into target files, then delete them
|
||||
```
|
||||
|
||||
Installs pre-built, tested feature packages. Skip if the app requires no pre-built features. Always check for an existing feature before building from scratch. Features provide the foundation that UI components build on top of.
|
||||
Installs pre-built, tested feature packages. See "Prompt Classification Keywords" above for the full trigger keyword list and negative-phrasing handling — these features provide the foundation that UI components build on top of.
|
||||
|
||||
Only skip this phase if the app is truly a minimal "hello world" with no interactive features (no trigger keywords present at all).
|
||||
|
||||
### Phase 3: Data Access (Backend Wiring)
|
||||
|
||||
@ -123,16 +186,16 @@ Post-deploy configuration (permissions, profiles, named credentials, connected a
|
||||
Import data (if data plan exists)
|
||||
v
|
||||
Fetch GraphQL schema and run codegen
|
||||
*(Re-fetches schema from the deployed org -- required because the remote schema may differ from the local one used in Phase 3)*
|
||||
*(Re-fetches schema from the deployed org -- required because the remote schema may differ from the local one used in Phase 3. Guard against an empty or stale result -- Salesforce Edge caching can briefly serve the pre-deploy schema; re-fetch/retry before trusting it as empty and before running codegen)*
|
||||
v
|
||||
Final UI bundle build (rebuilds with the deployed schema)
|
||||
```
|
||||
|
||||
Follows the canonical 7-step deployment sequence. Must deploy metadata before fetching schema. Must assign permissions before schema fetch.
|
||||
|
||||
### Phase 7: Hosting Target
|
||||
### Phase 7: Hosting Target Infrastructure
|
||||
|
||||
Choose **one** of the following based on the app's audience:
|
||||
Deploy the hosting target infrastructure determined in Phase 1. Choose **one** of the following based on the app's audience:
|
||||
|
||||
#### Phase 7a: Experience Site (External)
|
||||
|
||||
@ -144,7 +207,7 @@ Generate site metadata (Network, CustomSite, DigitalExperience)
|
||||
Deploy site infrastructure
|
||||
```
|
||||
|
||||
Creates the Digital Experience site that hosts the UI bundle. Use when the user wants a public-facing or authenticated site URL for external users.
|
||||
Creates the Digital Experience site that hosts the UI bundle. Use when the user wants a public-facing or authenticated site URL for external users. **Note**: The `<target>ExperienceSite</target>` was already set in meta XML during Phase 1.
|
||||
|
||||
#### Phase 7b: Custom Application (Internal)
|
||||
|
||||
@ -153,17 +216,30 @@ Resolve app properties (appName, appNamespace, appLabel)
|
||||
v
|
||||
Generate CustomApplication metadata (applications/*.app-meta.xml)
|
||||
v
|
||||
Add <target>CustomApplication</target> to .uibundle-meta.xml
|
||||
v
|
||||
Deploy custom application
|
||||
```
|
||||
|
||||
Creates a Custom Application entry in the Lightning App Launcher. Use when the app is for internal users accessing it within Lightning Experience.
|
||||
Creates a Custom Application entry in the Lightning App Launcher. Use when the app is for internal users accessing it within Lightning Experience. **Note**: The `<target>CustomApplication</target>` was already set in meta XML during Phase 1.
|
||||
|
||||
---
|
||||
|
||||
## Execution Workflow
|
||||
|
||||
### STEP 0: Offer a Prebuilt Template (before scaffolding from scratch)
|
||||
|
||||
**Before** analyzing requirements or scaffolding, check whether a prebuilt starter template fits —
|
||||
it is faster and less error-prone than building from scratch.
|
||||
|
||||
- **Load skill: Invoke `experience-ui-bundle-project-generate`.** It offers two minimal React starter
|
||||
projects (internal / employee-facing and external / customer-facing) and, if the user picks one,
|
||||
generates it into the project directory with `sf template generate project`.
|
||||
- **If the user chooses a template:** the scaffolding phase (Phase 1) is effectively done. Skip
|
||||
straight to populating/customizing the project — continue at the phase that matches what they
|
||||
want to change (typically Phase 4 UI, or Phase 3 data access), then Phase 6 deployment.
|
||||
- **If the user declines** (wants to start from scratch, or none fit): proceed normally to STEP 1.
|
||||
|
||||
Do not skip this step silently — always offer the choice at the start of a from-scratch app build.
|
||||
|
||||
### STEP 1: Requirements Analysis & Planning
|
||||
|
||||
**Actions:**
|
||||
@ -173,8 +249,12 @@ Creates a Custom Application entry in the Lightning App Launcher. Use when the a
|
||||
3. Extract pages and navigation structure
|
||||
4. Identify data entities and Salesforce objects needed
|
||||
5. Detect feature requirements (authentication, search, file upload, chat)
|
||||
6. Determine if an Experience Site is needed
|
||||
6. Determine hosting target (Experience Site OR Custom Application) — see "Prompt Classification Keywords" above; if ambiguous, ask user to clarify before proceeding
|
||||
7. Identify external domains for CSP registration
|
||||
8. **Check for conflicting requirements** — STOP and ask user if any of the following conflicts are detected:
|
||||
- "No authentication" OR "public/guest access" AND "user-specific data" OR "show current user's data" OR "My [Entity]" view
|
||||
- "External users" AND "Custom Application" (Custom Apps are internal-only)
|
||||
- "Public access" AND features requiring login (file upload, user profile, personalization)
|
||||
|
||||
> **The plan MUST contain an explicit grounding step before any query authoring.** Do not list
|
||||
> guessed object/field names as settled facts and defer verification to codegen. The data-access
|
||||
@ -183,6 +263,18 @@ Creates a Custom Application entry in the Lightning App Launcher. Use when the a
|
||||
> authors queries first and codegens later is the failure mode that produces guessed fields and
|
||||
> hand-stubbed types — do not emit it.
|
||||
|
||||
**Before proceeding to Output (Build Plan), validate:**
|
||||
|
||||
- [ ] **No conflicting requirements detected** — if conflicts exist (see action #8 above), STOP and report:
|
||||
```text
|
||||
ERROR: Conflicting requirements detected:
|
||||
- [describe the specific conflict, e.g., "The prompt requires 'no authentication' while also requiring a 'My Cases' view scoped to the current user's identity"]
|
||||
|
||||
RESOLUTION NEEDED: Please clarify:
|
||||
- [specific question, e.g., "Should the app require login (removing the 'no authentication' requirement), or should all data be public (removing the user-scoped view)?"]
|
||||
```
|
||||
**Do NOT proceed to build plan generation or any phase execution until this conflict is resolved.**
|
||||
|
||||
**Output: Build Plan**
|
||||
|
||||
```text
|
||||
@ -190,6 +282,7 @@ UI Bundle App Build Plan: [App Name]
|
||||
|
||||
SCAFFOLDING:
|
||||
- App name: [PascalCase name]
|
||||
- Hosting target: [Experience Site / Custom Application] **REQUIRED**
|
||||
- Routing: [SPA rewrites, trailing slash config]
|
||||
- External domains: [domains needing CSP registration]
|
||||
|
||||
@ -214,10 +307,10 @@ INTEGRATIONS (if applicable):
|
||||
|
||||
DEPLOYMENT:
|
||||
- Target org: [org alias if known]
|
||||
- Hosting target: [Experience Site / Custom Application / none]
|
||||
|
||||
SKILL LOAD ORDER:
|
||||
1. experience-ui-bundle-metadata-generate
|
||||
0. experience-ui-bundle-project-generate (offer a prebuilt template first; if chosen, Phase 1 scaffolding is skipped; if declined, run the Bootstrap check for an existing SFDX project -- no skill load required)
|
||||
1. experience-ui-bundle-metadata-generate (determines hosting target FIRST)
|
||||
2. experience-ui-bundle-features-generate (if features needed)
|
||||
3. experience-ui-bundle-salesforce-data-access (if data access needed)
|
||||
4. experience-ui-bundle-frontend-generate
|
||||
@ -239,33 +332,45 @@ Execute each phase sequentially. Complete all steps within a phase before moving
|
||||
| **3. Verify** | Run lint and build from the UI bundle directory | Catch errors before moving to the next phase |
|
||||
| **4. Checkpoint** | Confirm phase completion before proceeding | Ensures dependencies are satisfied for the next phase |
|
||||
|
||||
**Do NOT skip step 1 (loading the skill).** Even if you remember the skill's content, skills evolve. Always load the current version.
|
||||
**CRITICAL: Do NOT skip step 1 (loading the skill).** Even if you remember the skill's content, skills evolve. Always load the current version. **Skipping or reordering phases produces broken, non-deployable apps.** Phase dependencies are strict and cannot be violated.
|
||||
|
||||
---
|
||||
|
||||
**Phase 1 -- Scaffolding**
|
||||
**Phase 0 -- Template Offer & Bootstrap** (always, before scaffolding)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-project-generate`
|
||||
- 2. Execute: Offer the two starter templates; if the user picks one, generate it into the project dir with `sf template generate project`
|
||||
- 3. Decision: If a template was used, the project is scaffolded (including a valid SFDX project structure) — skip Phase 1 and continue at the phase matching the user's customization (usually Phase 4 UI). If declined, proceed to the Bootstrap check below.
|
||||
- 4. Bootstrap (no skill load required, only if no template was used): Run `scripts/check-sfdx-project.sh` and report any errors it returns. If the script reports an error, create the SFDX project structure (`sf project generate` or manually create sfdx-project.json).
|
||||
- 5. Checkpoint: SFDX project ready -- proceed to Phase 1
|
||||
|
||||
**Phase 1 -- Scaffolding** (skip if a template was generated in Phase 0)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-metadata-generate`
|
||||
- 2. Execute: Run `sf template generate ui-bundle`, install dependencies (`npm install`), configure meta XML, ui-bundle.json, and CSP trusted sites
|
||||
- 3. Verify: Confirm directory structure and metadata files exist
|
||||
- 2. Execute: Determine hosting target (Experience Site / Custom Application) FIRST. Run `sf template generate ui-bundle --template reactbasic`, install dependencies (`npm install`), configure meta XML (with `<target>`), ui-bundle.json, and CSP trusted sites.
|
||||
- 3. Verify: Confirm directory structure and metadata files exist with hosting target specified
|
||||
- 4. Checkpoint: UI bundle scaffold is ready -- proceed to Phase 2
|
||||
|
||||
**Phase 2 -- Features** (skip if no pre-built features needed)
|
||||
**Phase 2 -- Features** (Required if prompt mentions feature keywords — see "Prompt Classification Keywords" above)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-features-generate`
|
||||
- 2. Execute: Install dependencies, search and install features, integrate example files
|
||||
- 3. Verify: Run `npm run build` to confirm features integrate cleanly
|
||||
- 4. Checkpoint: Features installed -- proceed to Phase 3
|
||||
- **Trigger conditions**: See "Prompt Classification Keywords" above for the full keyword list (by category) and how negative phrasing is handled -- negating one category does not cancel triggers from another.
|
||||
|
||||
**Phase 3 -- Data Access** (skip if no Salesforce data needed)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-salesforce-data-access`
|
||||
- 2. Execute: **Ground entities/fields against the org first** (per the skill), then author queries/mutations **from the verified names**, run codegen, wire into components. Never guess fields or hand-edit generated types.
|
||||
- 3. Verify: Run `npx eslint` on files with GraphQL queries
|
||||
- 2. Execute: Check preconditions (authenticated org, npm dependencies installed). Fetch schema (`npm run graphql:schema`), guard against empty schema. Look up entities, generate queries/mutations, wire into components.
|
||||
- 3. Verify: Run `npx eslint` on files with GraphQL queries. Verify schema is non-empty.
|
||||
- 4. Checkpoint: Data layer ready -- proceed to Phase 4
|
||||
|
||||
**Phase 4 -- UI**
|
||||
**Phase 4 -- UI** (ALWAYS REQUIRED - CANNOT BE SKIPPED)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-frontend-generate`
|
||||
- 2. Execute: Build layout, pages, components, navigation. Replace all boilerplate.
|
||||
- If Phase 2 was skipped: Generate UI components from scratch without feature templates
|
||||
- If Phase 3 was skipped: Use mock data or static content for display
|
||||
- Phase 4 MUST execute even if prior phases were skipped
|
||||
- 3. Verify: Run lint and build -- 0 errors required
|
||||
- 4. Checkpoint: UI complete -- proceed to Phase 5
|
||||
- 4. Checkpoint: UI complete -- proceed to Phase 5 if integrations needed, or stop here if building only
|
||||
|
||||
⚠️ **CRITICAL**: Phase 4 generates the actual React user interface. Skipping it results in a UI bundle with only metadata and no user-facing pages or components. ALWAYS execute Phase 4 for every UI bundle build.
|
||||
|
||||
**Phase 5 -- Integrations** (skip if not requested)
|
||||
- 1. Load skill(s): Invoke `experience-ui-bundle-agentforce-client-generate` (5a) and/or `experience-ui-bundle-file-upload-generate` (5b). If both are needed, they are independent and can be executed in parallel.
|
||||
@ -275,21 +380,76 @@ Execute each phase sequentially. Complete all steps within a phase before moving
|
||||
|
||||
**Phase 6 -- Deployment**
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-deploy`
|
||||
- 2. Execute: Follow the 7-step deployment sequence (auth, build, deploy, permissions, data, schema, final build)
|
||||
- 3. Verify: Confirm deployment succeeds and app is accessible
|
||||
- 4. Checkpoint: App deployed -- proceed to Phase 7 if needed
|
||||
- 2. Execute: Check preconditions (authenticated org, successful build). Follow the 7-step deployment sequence (auth, build, deploy, permissions, data, schema, final build). When available, prefer using a project-level `scripts/org-setup.mjs` automation script over re-deriving the deployment flow each run. Guard the post-deploy schema re-fetch against an empty/stale result (Edge caching) before running final codegen -- retry rather than trusting an empty schema.
|
||||
- 3. Verify: Confirm deployment succeeds, app is accessible, and the re-fetched schema is non-empty
|
||||
- 4. Checkpoint: App deployed -- proceed to Phase 7 if hosting target deployment is needed
|
||||
|
||||
**Phase 7a -- Experience Site** (skip if not requested or if Custom Application chosen)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-site-generate`
|
||||
- 2. Execute: Resolve properties, generate site metadata, deploy
|
||||
- 3. Verify: Confirm site URL is accessible
|
||||
- 3. Verify: Confirm site URL is accessible (hosting target already verified by `scripts/check-hosting-target.sh` in trigger evaluation)
|
||||
- 4. Checkpoint: Site live -- build complete
|
||||
- **Trigger conditions**: Run `scripts/check-hosting-target.sh` and check output for "ExperienceSite" OR prompt matches an Experience Site keyword in "Prompt Classification Keywords" above
|
||||
- **Note**: The `<target>ExperienceSite</target>` was already set in meta XML during Phase 1 -- do not add it again
|
||||
|
||||
**Phase 7b -- Custom Application** (skip if not requested or if Experience Site chosen)
|
||||
- 1. Load skill: Invoke `experience-ui-bundle-custom-app-generate`
|
||||
- 2. Execute: Resolve app properties, generate CustomApplication metadata, add CustomApplication target to meta XML
|
||||
- 3. Verify: Confirm app appears in App Launcher
|
||||
- 2. Execute: Resolve app properties, generate CustomApplication metadata
|
||||
- 3. Verify: Confirm app appears in App Launcher (hosting target already verified by `scripts/check-hosting-target.sh` in trigger evaluation)
|
||||
- 4. Checkpoint: App registered -- build complete
|
||||
- **Trigger conditions**: Run `scripts/check-hosting-target.sh` and check output for "CustomApplication" OR prompt matches a Custom Application keyword in "Prompt Classification Keywords" above
|
||||
- **Note**: The `<target>CustomApplication</target>` was already set in meta XML during Phase 1 -- do not add it again
|
||||
|
||||
### STEP 2.5: Phase Completion Validation
|
||||
|
||||
Before proceeding to STEP 3 (Final Summary), validate that all required phases were executed:
|
||||
|
||||
**Critical Validation (MUST pass):**
|
||||
- [ ] **Phase 0 (Template Offer & Bootstrap) executed**: If no template was used, run `scripts/check-sfdx-project.sh`. If it returns non-zero, STOP and report error:
|
||||
```text
|
||||
ERROR: No SFDX project detected. Phase 0 (Bootstrap) is REQUIRED before scaffolding.
|
||||
Run `sf project generate` (or create sfdx-project.json) before invoking
|
||||
`sf template generate ui-bundle`.
|
||||
```
|
||||
If a template was used in Phase 0, this check is satisfied by the template's own scaffolding — skip re-running the script.
|
||||
|
||||
- [ ] **Phase 1 hosting target resolved**: Run `scripts/check-hosting-target.sh`. If it returns non-zero, STOP and report error:
|
||||
```text
|
||||
ERROR: Hosting target was not resolved in Phase 1. A UI bundle without a <target> in its
|
||||
meta XML will not be visible in the org. Determine Experience Site vs Custom Application
|
||||
(see "Prompt Classification Keywords" above; ask the user if ambiguous) before proceeding
|
||||
past Phase 1 -- do not defer this to Phase 7 and do not record "none"/"skipped".
|
||||
```
|
||||
|
||||
- [ ] **Phase 4 (Frontend) executed**: If Phase 4 was NOT executed, STOP and report error:
|
||||
```text
|
||||
ERROR: Phase 4 (UI/Frontend generation) is REQUIRED for all UI bundle apps.
|
||||
Cannot complete build without generating the React user interface.
|
||||
Please review the phase execution logic and ensure Phase 4 is always executed.
|
||||
```
|
||||
|
||||
- [ ] **Phase 7 hosting infrastructure deployed**: If neither Phase 7a nor Phase 7b was executed, STOP and report error:
|
||||
```text
|
||||
ERROR: Hosting target infrastructure (Phase 7a Experience Site or Phase 7b Custom
|
||||
Application) was not deployed. The app was built but is not reachable by any user.
|
||||
Exactly one of Phase 7a/7b must run -- it is never optional or "skipped".
|
||||
```
|
||||
|
||||
**Warning Validation (log warnings, but can proceed):**
|
||||
- [ ] **Phase 2 execution**: If Phase 2 was skipped but the prompt matches any keyword in "Prompt Classification Keywords" above (data features, navigation, authentication, integrations, or UI category):
|
||||
```text
|
||||
WARNING: Phase 2 (Features) was skipped but prompt contains feature keywords.
|
||||
This may indicate a trigger detection failure. Generated UI may be missing
|
||||
required feature functionality. Consider re-running with Phase 2 included.
|
||||
```
|
||||
|
||||
- [ ] **Phase 3 execution**: If Phase 3 was skipped but prompt mentions Salesforce objects, "GraphQL", "data", or "query":
|
||||
```text
|
||||
WARNING: Phase 3 (Data Access) was skipped but prompt mentions Salesforce data.
|
||||
Generated UI may not connect to backend correctly. Verify data access is working.
|
||||
```
|
||||
|
||||
**Proceed to STEP 3 only if all Critical Validation checks pass (Phase 0, hosting target, Phase 4, Phase 7).**
|
||||
|
||||
### STEP 3: Final Summary
|
||||
|
||||
@ -299,13 +459,14 @@ After all phases complete, present a build summary:
|
||||
UI Bundle App Build Complete: [App Name]
|
||||
|
||||
PHASES COMPLETED:
|
||||
[x] Phase 1: Scaffolding -- [app name] UI bundle created
|
||||
[x] Phase 0: Template Offer & Bootstrap -- [template used: <name> / declined; SFDX project verified/created]
|
||||
[x] Phase 1: Scaffolding -- [app name] UI bundle created with hosting target [Experience Site / Custom Application]
|
||||
[x] Phase 2: Features -- [list of features installed, or "skipped"]
|
||||
[x] Phase 3: Data Access -- [list of entities wired up]
|
||||
[x] Phase 4: UI -- [count] pages, [count] components
|
||||
[x] Phase 5: Integrations -- [list or "none"]
|
||||
[x] Phase 6: Deployment -- deployed to [org]
|
||||
[x] Phase 7: Hosting Target -- [Experience Site URL / Custom Application name / "skipped"]
|
||||
[x] Phase 7: Hosting Target -- [Experience Site URL / Custom Application name] **(never "skipped" -- Phase 1 requires a target, so exactly one of 7a/7b always runs)**
|
||||
|
||||
FILES GENERATED:
|
||||
[list key files and their paths]
|
||||
@ -321,8 +482,10 @@ NEXT STEPS:
|
||||
Before presenting the build as complete, verify:
|
||||
|
||||
- [ ] **Scaffold exists**: UI bundle directory with valid meta XML and ui-bundle.json
|
||||
- [ ] **Hosting target resolved and deployed**: Meta XML contains `<target>ExperienceSite</target>` or `<target>CustomApplication</target>` (never left unset), and the matching Phase 7a or 7b infrastructure was generated and deployed -- not skipped
|
||||
- [ ] **Dependencies installed**: `node_modules/` exists and `package.json` has expected packages
|
||||
- [ ] **Build passes**: `npm run build` produces `dist/` with no errors
|
||||
- [ ] **Dist content exists**: `dist/` contains index.html, JS/CSS bundles, and assets (not just an empty directory)
|
||||
- [ ] **Lint passes**: `npx eslint src/` reports 0 errors
|
||||
- [ ] **No boilerplate**: All placeholder text, default titles, and template content has been replaced
|
||||
- [ ] **Navigation works**: `appLayout.tsx` has real nav items matching created pages
|
||||
@ -337,6 +500,7 @@ Before presenting the build as complete, verify:
|
||||
|
||||
- App purpose is too vague to determine pages or data needs
|
||||
- User wants features that conflict (e.g., "no authentication" + "show user-specific data")
|
||||
- Hosting target cannot be determined (ask: "Is this for internal users (Custom Application) or external users (Experience Site)?")
|
||||
- Target org is unknown and deployment is requested
|
||||
|
||||
### Category 2: Log Warning, Continue
|
||||
|
||||
26
skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh
Executable file
26
skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Check which hosting target is configured in .uibundle-meta.xml files
|
||||
|
||||
# Find all .uibundle-meta.xml files
|
||||
META_FILES=$(find . -name "*.uibundle-meta.xml" -type f 2>/dev/null)
|
||||
|
||||
if [ -z "$META_FILES" ]; then
|
||||
echo "ERROR: No .uibundle-meta.xml files found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for ExperienceSite target
|
||||
if echo "$META_FILES" | xargs grep -q '<target>ExperienceSite</target>' 2>/dev/null; then
|
||||
echo "ExperienceSite"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check for CustomApplication target
|
||||
if echo "$META_FILES" | xargs grep -q '<target>CustomApplication</target>' 2>/dev/null; then
|
||||
echo "CustomApplication"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# No valid target found
|
||||
echo "ERROR: No valid hosting target found in .uibundle-meta.xml"
|
||||
exit 1
|
||||
15
skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh
Executable file
15
skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Check if sfdx-project.json exists and is valid JSON
|
||||
|
||||
if [ ! -f sfdx-project.json ]; then
|
||||
echo 'ERROR: sfdx-project.json not found'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate JSON format using python (more portable than node)
|
||||
if ! python3 -c "import json; json.load(open('sfdx-project.json'))" 2>/dev/null; then
|
||||
echo 'ERROR: sfdx-project.json is not valid JSON'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 'sfdx-project.json is valid'
|
||||
@ -1,8 +1,18 @@
|
||||
---
|
||||
name: experience-ui-bundle-metadata-generate
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and scaffolding a new UI bundle or app, or when editing ui-bundle.json, .uibundle-meta.xml, or CSP trusted site files. Use this skill when scaffolding with sf template generate ui-bundle, configuring ui-bundle.json (routing, headers, outputDir), or registering CSP Trusted Sites. Activate when the task involves files matching *.uibundle-meta.xml, ui-bundle.json, or cspTrustedSites/*.cspTrustedSite-meta.xml."
|
||||
description: "Use this skill when adding a front-end React UI bundle to an existing project or configuring UI bundle metadata and config files. TRIGGER when: adding or scaffolding a new UI bundle inside a project that already exists; running sf template generate ui-bundle; editing ui-bundle.json routing, headers, or output directory; working with *.uibundle-meta.xml files; or registering CSP Trusted Sites, resolving blocked images or fonts or external API calls, or editing cspTrustedSites/*.cspTrustedSite-meta.xml files. DO NOT TRIGGER when: creating a brand-new Salesforce project from scratch, where the whole SFDX starter project (UI bundle plus Experience Site metadata and toolchain) is generated together (use experience-ui-bundle-project-generate)."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
minApiVersion: "51.0"
|
||||
relatedSkills:
|
||||
- "experience-ui-bundle-frontend-generate"
|
||||
- "experience-ui-bundle-custom-app-generate"
|
||||
- "experience-ui-bundle-site-generate"
|
||||
cliTools:
|
||||
- tool: ["sf"]
|
||||
semver: ">=2.0.0"
|
||||
- tool: ["jq"]
|
||||
semver: ">=1.6"
|
||||
---
|
||||
|
||||
# UI Bundle Metadata
|
||||
@ -11,9 +21,9 @@ metadata:
|
||||
|
||||
Use `sf template generate ui-bundle` to create new apps — not create-react-app, Vite, or other generic scaffolds.
|
||||
|
||||
**Always pass `--template reactbasic`** to scaffold a React-based bundle.
|
||||
|
||||
**UI bundle name (`-n`):** Alphanumerical only — no spaces, hyphens, underscores, or special characters.
|
||||
- **Always pass `--template reactbasic`** to scaffold a React-based bundle.
|
||||
- **UI bundle name (`-n`):** Alphanumerical only — no spaces, hyphens, underscores, or special characters.
|
||||
- Pass `--output-dir` to use a different location for template generation.
|
||||
|
||||
**Example:**
|
||||
```bash
|
||||
@ -21,10 +31,11 @@ sf template generate ui-bundle -n CoffeeBoutique --template reactbasic
|
||||
```
|
||||
|
||||
After generation:
|
||||
1. Replace all default boilerplate — "React App", "Vite + React", default `<title>`, placeholder text
|
||||
2. Populate the home page with real content (landing section, banners, hero, navigation)
|
||||
3. Update navigation and placeholders (see the `experience-ui-bundle-frontend-generate` skill)
|
||||
4. **Configure a hosting target** — a UI bundle without a `<target>` in its meta XML will not be visible in the org. Use `experience-ui-bundle-custom-app-generate` for internal (App Launcher) apps or `experience-ui-bundle-site-generate` for external (Experience Site) apps.
|
||||
1. **Verify API version** — run `bash <skill_dir>/scripts/check-api-version.sh` from the project root to ensure `sourceApiVersion` in `sfdx-project.json` is 67.0 or higher. The script will automatically update it if needed.
|
||||
2. Replace all default boilerplate — "React App", "Vite + React", default `<title>`, placeholder text
|
||||
3. Populate the home page with real content (landing section, banners, hero, navigation)
|
||||
4. Update navigation and placeholders (see the `experience-ui-bundle-frontend-generate` skill)
|
||||
5. **Configure a hosting target** — a UI bundle without a `<target>` in its meta XML will not be visible in the org. Use `experience-ui-bundle-custom-app-generate` for internal (App Launcher) apps or `experience-ui-bundle-site-generate` for external (Experience Site) apps.
|
||||
|
||||
Always install dependencies before running any scripts in the UI bundle directory.
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## File location
|
||||
|
||||
```
|
||||
```text
|
||||
force-app/main/default/cspTrustedSites/{Name}.cspTrustedSite-meta.xml
|
||||
```
|
||||
|
||||
@ -256,7 +256,7 @@ Some services split resources across multiple subdomains. Create one CSP Trusted
|
||||
|
||||
If the browser console shows a CSP error like:
|
||||
|
||||
```
|
||||
```text
|
||||
Refused to load the image 'https://example.com/image.png' because it violates
|
||||
the following Content Security Policy directive: "img-src 'self' ..."
|
||||
```
|
||||
|
||||
30
skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh
Executable file
30
skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# Checks that sourceApiVersion in sfdx-project.json is 67.0 or higher.
|
||||
# If lower, updates it to "67.0".
|
||||
|
||||
set -e
|
||||
|
||||
PROJECT_FILE="sfdx-project.json"
|
||||
|
||||
if [[ ! -f "$PROJECT_FILE" ]]; then
|
||||
echo "ERROR: $PROJECT_FILE not found in current directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract sourceApiVersion and check if it's below 67.0
|
||||
version=$(jq -r '.sourceApiVersion // "0"' "$PROJECT_FILE")
|
||||
is_below=$(jq --arg v "$version" -n '($v | split(".") | .[0] | tonumber) < 67')
|
||||
|
||||
if [[ "$is_below" == "true" ]]; then
|
||||
echo "WARNING: sourceApiVersion is $version (< 67.0)"
|
||||
echo "Updating $PROJECT_FILE to set sourceApiVersion to \"67.0\""
|
||||
|
||||
# Update the file
|
||||
jq '.sourceApiVersion = "67.0"' "$PROJECT_FILE" > "$PROJECT_FILE.tmp"
|
||||
mv "$PROJECT_FILE.tmp" "$PROJECT_FILE"
|
||||
|
||||
echo "OK: Updated sourceApiVersion to 67.0"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "OK: sourceApiVersion is $version (>= 67.0)"
|
||||
@ -1,46 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill was built upon established patterns in technical diagramming and Salesforce data modeling. The following concepts and conventions shaped its design.
|
||||
|
||||
---
|
||||
|
||||
## Diagramming Concepts
|
||||
|
||||
### Text-Based Diagramming
|
||||
The skill uses Mermaid as its primary diagramming syntax, covering Entity Relationship Diagrams, sequence diagrams, and flowcharts. Key capabilities include:
|
||||
|
||||
- Entity Relationship Diagram syntax
|
||||
- Sequence diagram patterns
|
||||
- Flowchart and state diagram support
|
||||
- Live rendering through Mermaid-capable renderers
|
||||
|
||||
An alternative syntax, PlantUML, informed the UML diagram patterns used in sequence and class diagrams.
|
||||
|
||||
---
|
||||
|
||||
## Salesforce Domain Patterns
|
||||
|
||||
### Data Modeling Conventions
|
||||
The ERD conventions follow standard Salesforce object relationship patterns, including Master-Detail, Lookup, and External relationships as documented in the Salesforce platform's object model.
|
||||
|
||||
### Integration Architecture
|
||||
Integration sequence diagrams draw on widely-adopted API documentation patterns adapted for Salesforce's authentication and integration architecture.
|
||||
|
||||
### Schema Reference
|
||||
Object and field relationship information reflects standard Salesforce object reference conventions and relationship type definitions.
|
||||
|
||||
---
|
||||
|
||||
## Key Concepts
|
||||
|
||||
### ERD Notation
|
||||
The Entity Relationship Diagram conventions follow standard database modeling patterns adapted for Salesforce relationships (Master-Detail, Lookup, External).
|
||||
|
||||
### Sequence Diagram Patterns
|
||||
OAuth flow and integration sequence diagrams follow UML 2.0 standards with Salesforce-specific adaptations.
|
||||
|
||||
### Mermaid in Documentation
|
||||
The approach of using Mermaid for inline diagrams in Markdown documentation is a widely-adopted pattern in technical documentation that enables version-controlled diagrams alongside code.
|
||||
|
||||
### Color Accessibility
|
||||
The color palette follows accessibility guidelines for color-blind-friendly design, using a pastel fill with high-contrast stroke approach.
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
## Quick Start
|
||||
|
||||
```
|
||||
```text
|
||||
# Generate an OAuth diagram
|
||||
"Create a JWT Bearer OAuth flow diagram"
|
||||
|
||||
@ -85,7 +85,7 @@ sequenceDiagram
|
||||
```
|
||||
|
||||
### ASCII Fallback
|
||||
```
|
||||
```text
|
||||
┌───────────────┐ ┌───────────────┐
|
||||
│ Server │ │ Salesforce │
|
||||
└───────┬───────┘ └───────┬───────┘
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: external-diagram-mermaid-generate
|
||||
description: "Salesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says \"diagram\", \"visualize\", \"ERD\", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use external-diagram-visual-generate), or asks about non-Salesforce systems."
|
||||
description: "Salesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says \"diagram\", \"visualize\", \"ERD\", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user asks about non-Salesforce systems."
|
||||
compatibility: "Requires Mermaid-capable renderer for diagram previews"
|
||||
metadata:
|
||||
version: "1.0"
|
||||
@ -20,7 +20,6 @@ Use `external-diagram-mermaid-generate` when the user wants:
|
||||
- diagrams that can live directly in docs, READMEs, or issues
|
||||
|
||||
### Out of Scope — Delegate elsewhere when the user wants:
|
||||
- rendered PNG/SVG images or polished mockups → [external-diagram-visual-generate](../external-diagram-visual-generate/SKILL.md)
|
||||
- non-Salesforce systems only → use a more general diagramming skill
|
||||
- object discovery before an ERD → [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) or [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md)
|
||||
|
||||
@ -125,7 +124,6 @@ Call out the key relationships, flow direction, and any assumptions.
|
||||
| Need | Delegate to | Reason |
|
||||
|---|---|---|
|
||||
| real object / field definitions | [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) / [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md) | grounded ERD generation |
|
||||
| rendered diagram / image output | [external-diagram-visual-generate](../external-diagram-visual-generate/SKILL.md) | visual polish beyond Mermaid |
|
||||
| connected-app auth setup context | [integration-connectivity-connected-app-configure](../integration-connectivity-connected-app-configure/SKILL.md) | accurate OAuth flows |
|
||||
| Agentforce logic visualization | [agentforce-generate](../agentforce-generate/SKILL.md) | source-of-truth behavior details |
|
||||
| Flow behavior diagrams | [automation-flow-generate](../automation-flow-generate/SKILL.md) | actual Flow logic grounding |
|
||||
|
||||
@ -202,7 +202,7 @@ flowchart TD
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ 🤖 SERVICE AGENT STRUCTURE │
|
||||
└─────────────────────────────────────────────────────────────────────────────┘
|
||||
@ -283,17 +283,17 @@ flowchart TD
|
||||
## Conversation Flow Patterns
|
||||
|
||||
### 1. Linear Flow
|
||||
```
|
||||
```text
|
||||
Start → Topic → Action → Response → End
|
||||
```
|
||||
|
||||
### 2. Branching Flow
|
||||
```
|
||||
```text
|
||||
Start → Classify → [Topic A | Topic B | Escalate]
|
||||
```
|
||||
|
||||
### 3. Loop Back
|
||||
```
|
||||
```text
|
||||
Start → Topic → Action → Validate → [Success | Retry]
|
||||
```
|
||||
|
||||
|
||||
@ -268,7 +268,7 @@ flowchart TB
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SYSTEM LANDSCAPE │
|
||||
└─────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
@ -107,7 +107,7 @@ flowchart LR
|
||||
## Key Concepts
|
||||
|
||||
### B2B Commerce Flow
|
||||
```
|
||||
```text
|
||||
WebStore → ProductCatalog → Product2
|
||||
↓ ↓
|
||||
BuyerAccount → WebCart → CartItem → Order
|
||||
@ -123,7 +123,7 @@ BuyerGroup → Entitlements (What they can see/buy)
|
||||
| BuyerGroup | Pricing/entitlement grouping |
|
||||
|
||||
### Entitlement Model
|
||||
```
|
||||
```text
|
||||
CommerceEntitlementPolicy
|
||||
├── CommerceEntitlementProduct (What products)
|
||||
└── CommerceEntitlementBuyerGroup (Who can see)
|
||||
@ -223,7 +223,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ B2B COMMERCE DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -130,7 +130,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ CAMPAIGNS DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -114,7 +114,7 @@ flowchart LR
|
||||
Each contact point links to an Individual.
|
||||
|
||||
### Consent Model
|
||||
```
|
||||
```text
|
||||
DataUsePurpose → ContactPointConsent ← ContactPoint
|
||||
(e.g., Marketing) (Opt-In/Out) (Email/Phone)
|
||||
```
|
||||
@ -179,7 +179,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ CONSENT DATA MODEL (GDPR/PRIVACY) (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -86,7 +86,7 @@ flowchart LR
|
||||
## Key Concepts
|
||||
|
||||
### Content Architecture
|
||||
```
|
||||
```text
|
||||
ContentDocument (Container)
|
||||
├── ContentVersion (Current + History)
|
||||
├── ContentDocumentLink (Sharing to Records)
|
||||
@ -177,7 +177,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SALESFORCE FILES DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -114,7 +114,7 @@ flowchart LR
|
||||
| Omitted | Excluded from forecast |
|
||||
|
||||
### Forecast Rollup Hierarchy
|
||||
```
|
||||
```text
|
||||
CEO
|
||||
└── VP Sales
|
||||
├── Regional Manager 1
|
||||
@ -182,7 +182,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ COLLABORATIVE FORECASTS DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -127,7 +127,7 @@ flowchart LR
|
||||
## Key Concepts
|
||||
|
||||
### FSL Object Hierarchy
|
||||
```
|
||||
```text
|
||||
Case/Asset → WorkOrder → WorkOrderLineItem → ServiceAppointment
|
||||
↓ ↓ ↓
|
||||
ProductRequired ProductConsumed AssignedResource
|
||||
@ -245,7 +245,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ FIELD SERVICE LIGHTNING DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -157,7 +157,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ PARTY MODEL (INDUSTRY CLOUD) DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -102,7 +102,7 @@ flowchart LR
|
||||
## Key Concepts
|
||||
|
||||
### Quote-to-Cash Flow
|
||||
```
|
||||
```text
|
||||
Opportunity → Quote → Order → Invoice → Payment
|
||||
↓ ↓ ↓
|
||||
OLI QLI OrderItem
|
||||
@ -121,7 +121,7 @@ Opportunity → Quote → Order → Invoice → Payment
|
||||
| Reduction Orders | Negative quantity adjustments |
|
||||
|
||||
### Pricebook Structure
|
||||
```
|
||||
```text
|
||||
Pricebook2 (Standard + Custom)
|
||||
↓
|
||||
PricebookEntry (Product + Price per Pricebook)
|
||||
@ -176,7 +176,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ QUOTE & ORDER DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -109,7 +109,7 @@ flowchart LR
|
||||
| **Dynamic Revenue Orchestration** | Guided selling |
|
||||
|
||||
### Product Hierarchy
|
||||
```
|
||||
```text
|
||||
ProductCatalog
|
||||
└── ProductCategory (Hierarchy)
|
||||
└── Product2
|
||||
@ -244,7 +244,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ REVENUE CLOUD DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -116,7 +116,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SALES CLOUD DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>), -.-> = converts │
|
||||
|
||||
@ -94,7 +94,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -112,7 +112,7 @@ flowchart LR
|
||||
## Key Concepts
|
||||
|
||||
### Scheduling Flow
|
||||
```
|
||||
```text
|
||||
Customer (Contact) → WorkType → ServiceAppointment ← ServiceResource
|
||||
↓
|
||||
ServiceTerritory
|
||||
@ -184,7 +184,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SALESFORCE SCHEDULER DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -120,7 +120,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SERVICE CLOUD DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
@ -173,14 +173,14 @@ flowchart LR
|
||||
## Service Cloud Patterns
|
||||
|
||||
### Case Flow
|
||||
```
|
||||
```text
|
||||
Customer → Contact → Case → CaseComment
|
||||
↓
|
||||
Entitlement (SLA)
|
||||
```
|
||||
|
||||
### Entitlement Coverage
|
||||
```
|
||||
```text
|
||||
Account → ServiceContract → Entitlement → Case
|
||||
└─────────────────────────────────────┘
|
||||
(direct)
|
||||
|
||||
@ -162,7 +162,7 @@ flowchart LR
|
||||
|
||||
## ASCII Fallback
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ENTERPRISE TERRITORY MANAGEMENT DATA MODEL (L→R) │
|
||||
│ Legend: LK = Lookup (-->), MD = Master-Detail (==>) │
|
||||
|
||||
@ -217,7 +217,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template - Outbound Integration
|
||||
|
||||
```
|
||||
```text
|
||||
┌───────────────┐ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
|
||||
│ Trigger │ │ Queueable │ │ Named │ │ External │
|
||||
│ │ │ │ │ Credential │ │ API │
|
||||
|
||||
@ -80,7 +80,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌──────────┐ ┌───────────────┐ ┌────────────────────┐
|
||||
│ User │ │ Mobile App │ │ Salesforce │
|
||||
│ │ │ or SPA │ │ (Auth Server) │
|
||||
|
||||
@ -83,7 +83,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌──────────┐ ┌───────────────┐ ┌────────────────────┐
|
||||
│ User/ │ │ Application │ │ Salesforce │
|
||||
│ Browser │ │ Server │ │ (Auth Server) │
|
||||
|
||||
@ -71,7 +71,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌───────────────────────┐ ┌────────────────────┐
|
||||
│ Service/Backend │ │ Salesforce │
|
||||
│ (client_id/secret) │ │ (Auth Server) │
|
||||
|
||||
@ -94,7 +94,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌──────────┐ ┌───────────┐ ┌────────────┐ ┌────────────────┐
|
||||
│ User │ │ Browser │ │ Device │ │ Salesforce │
|
||||
│ │ │(phone/PC) │ │ (CLI/TV) │ │ (Auth Server) │
|
||||
@ -166,7 +166,7 @@ curl -X POST https://login.salesforce.com/services/oauth2/device/code \
|
||||
|
||||
## Step 2: Display to User
|
||||
|
||||
```
|
||||
```text
|
||||
═══════════════════════════════════════════════════════════════
|
||||
To authorize this device, please:
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌───────────────────────┐ ┌────────────────────┐
|
||||
│ Server/CI/CD │ │ Salesforce │
|
||||
│ (Private Key) │ │ (Certificate) │
|
||||
@ -145,7 +145,7 @@ sequenceDiagram
|
||||
```
|
||||
|
||||
### Signature
|
||||
```
|
||||
```text
|
||||
RS256(
|
||||
base64URLEncode(header) + "." + base64URLEncode(payload),
|
||||
privateKey
|
||||
|
||||
@ -66,7 +66,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌───────────────────────┐ ┌────────────────────┐
|
||||
│ Application │ │ Salesforce │
|
||||
│ (stored tokens) │ │ (Auth Server) │
|
||||
|
||||
@ -115,7 +115,7 @@ sequenceDiagram
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌────────────────┐ ┌────────────────────┐ ┌─────────────────────┐
|
||||
│ Client │ │ Salesforce │ │ OIDC Provider │
|
||||
│ (Mobile App) │ │ (Auth/RP Server) │ │ (Google/Facebook) │
|
||||
@ -221,7 +221,7 @@ sequenceDiagram
|
||||
|
||||
### Auth. Provider Setup
|
||||
|
||||
```
|
||||
```text
|
||||
Setup → Auth. Providers → New
|
||||
├── Provider Type: OpenID Connect (or specific: Google, Facebook)
|
||||
├── Consumer Key: [From OP Developer Console]
|
||||
|
||||
@ -211,7 +211,7 @@ flowchart TB
|
||||
|
||||
## ASCII Fallback Template
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ROLE HIERARCHY │
|
||||
└─────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
@ -5,7 +5,7 @@ Soft pastel color palette (Tailwind 200-level) with dark borders for clear defin
|
||||
|
||||
## Primary Palette (Tailwind 200 + Dark Borders)
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ COMPONENT │ FILL (200) │ STROKE (700+) │ TEXT COLOR │
|
||||
├───────────────────────────┼──────────────┼────────────────┼────────────────┤
|
||||
@ -24,7 +24,7 @@ Soft pastel color palette (Tailwind 200-level) with dark borders for clear defin
|
||||
|
||||
## Subgraph Background Colors (Tailwind 50-level)
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SUBGRAPH │ FILL (50) │ STROKE (700+) │ STYLE │
|
||||
├───────────────────────────┼──────────────┼────────────────┼────────────────┤
|
||||
@ -45,7 +45,7 @@ Soft pastel color palette (Tailwind 200-level) with dark borders for clear defin
|
||||
|
||||
## Salesforce-Specific Colors
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ SALESFORCE COMPONENT │ FILL (200) │ STROKE (700+) │ TEXT COLOR │
|
||||
├───────────────────────────┼──────────────┼────────────────┼────────────────┤
|
||||
@ -62,7 +62,7 @@ Soft pastel color palette (Tailwind 200-level) with dark borders for clear defin
|
||||
|
||||
Color coding for data model diagrams by object type:
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ OBJECT TYPE │ FILL (200) │ STROKE (700+) │ TEXT COLOR │
|
||||
├───────────────────────────┼──────────────┼────────────────┼────────────────┤
|
||||
@ -114,7 +114,7 @@ style ext fill:#ecfdf5,stroke:#047857,stroke-dasharray:5
|
||||
|
||||
## Status Colors
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ STATUS │ FILL (200) │ STROKE (700+) │ ICON │
|
||||
├───────────────────────────┼──────────────┼────────────────┼────────────────┤
|
||||
@ -132,7 +132,7 @@ style ext fill:#ecfdf5,stroke:#047857,stroke-dasharray:5
|
||||
|
||||
Mermaid supports custom fonts via `%%{init}`:
|
||||
|
||||
```
|
||||
```text
|
||||
%%{init: { "fontFamily": "Inter, sans-serif", "fontSize": "14px" }}%%
|
||||
```
|
||||
|
||||
@ -187,7 +187,7 @@ Control diagram density with `%%{init}` configuration:
|
||||
|
||||
For clean, readable diagrams:
|
||||
|
||||
```
|
||||
```text
|
||||
%%{init: {"flowchart": {"nodeSpacing": 80, "rankSpacing": 70}} }%%
|
||||
```
|
||||
|
||||
@ -248,7 +248,7 @@ flowchart TB
|
||||
|
||||
### Simple Label (Recommended)
|
||||
|
||||
```
|
||||
```json
|
||||
["🤖 agentforce-generate"]
|
||||
```
|
||||
|
||||
@ -256,7 +256,7 @@ Keep labels short for consistent rendering.
|
||||
|
||||
### Database/Cylinder
|
||||
|
||||
```
|
||||
```json
|
||||
[(💾 Database)]
|
||||
```
|
||||
|
||||
@ -344,7 +344,7 @@ flowchart TB
|
||||
### Detailed Guidelines
|
||||
|
||||
#### Node Labels: lowercase (Recommended)
|
||||
```
|
||||
```text
|
||||
["🤖 agentforce-generate"] ✅ Preferred
|
||||
["🤖 agentforce-generate"] ❌ Avoid
|
||||
["🤖 agentforce-generate"] ❌ Avoid
|
||||
@ -357,7 +357,7 @@ flowchart TB
|
||||
- Easier to read in compact diagram nodes
|
||||
|
||||
#### Subgraph Titles: UPPERCASE
|
||||
```
|
||||
```text
|
||||
subgraph ai["🤖 AI & AGENTS"] ✅ UPPERCASE
|
||||
subgraph ai["🤖 ai & agents"] ❌ lowercase
|
||||
subgraph ai["🤖 Ai & Agents"] ❌ Title Case
|
||||
@ -370,7 +370,7 @@ subgraph ai["🤖 Ai & Agents"] ❌ Title Case
|
||||
- Maximum contrast between group titles and contents
|
||||
|
||||
#### Edge Labels: lowercase
|
||||
```
|
||||
```text
|
||||
-->|"schema"| ✅ lowercase
|
||||
-->|"Schema"| ❌ Title Case
|
||||
-->|"SCHEMA"| ❌ ALL CAPS
|
||||
@ -382,7 +382,7 @@ subgraph ai["🤖 Ai & Agents"] ❌ Title Case
|
||||
- Consistent with node label style
|
||||
|
||||
#### ASCII Diagrams: UPPERCASE for Headers
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────┐
|
||||
│ SYSTEM LANDSCAPE │ ✅ UPPERCASE header
|
||||
└─────────────────────────────────────┘
|
||||
|
||||
@ -48,7 +48,7 @@ Consistency guidelines for all sf-diagram generated diagrams.
|
||||
|
||||
### Example Structure
|
||||
|
||||
```
|
||||
```text
|
||||
%%{init: {...}}%%
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
@ -85,7 +85,7 @@ sequenceDiagram
|
||||
|
||||
### Field Representation
|
||||
|
||||
```
|
||||
```text
|
||||
OBJECT {
|
||||
Type FieldName Annotation "Comment"
|
||||
}
|
||||
@ -198,7 +198,7 @@ flowchart LR
|
||||
|
||||
### Box Drawing Characters
|
||||
|
||||
```
|
||||
```text
|
||||
Standard Box:
|
||||
┌─────────────────┐
|
||||
│ │
|
||||
@ -228,7 +228,7 @@ Rounded corners (optional):
|
||||
|
||||
### Arrow Characters
|
||||
|
||||
```
|
||||
```yaml
|
||||
Right: ───> or ──▶ or ────────────────>
|
||||
Left: <─── or ◀──
|
||||
Up: ▲
|
||||
@ -244,7 +244,7 @@ Bidirectional: <──>
|
||||
|
||||
### Example ASCII Sequence
|
||||
|
||||
```
|
||||
```text
|
||||
┌──────────┐ ┌───────────────┐ ┌────────────────┐
|
||||
│ Client │ │ Server │ │ Database │
|
||||
└────┬─────┘ └───────┬───────┘ └───────┬────────┘
|
||||
|
||||
@ -13,7 +13,7 @@ Standardized conventions for Salesforce data model diagrams with object type ind
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
```text
|
||||
Account [STD] → Standard Salesforce object
|
||||
Invoice__c [CUST] → Custom object
|
||||
SAP_Product__x [EXT] → External object via Salesforce Connect
|
||||
|
||||
@ -7,7 +7,7 @@ Use individual `style` declarations with **Tailwind 200-level pastel fills** and
|
||||
|
||||
Add this init directive at the start of every flowchart for optimal readability:
|
||||
|
||||
```
|
||||
```text
|
||||
%%{init: {"flowchart": {"nodeSpacing": 80, "rankSpacing": 70}} }%%
|
||||
```
|
||||
|
||||
@ -74,7 +74,7 @@ flowchart TB
|
||||
## Node Label Pattern
|
||||
|
||||
Keep labels short (icon + name only). Avoid `<br/>` and `<small>` tags:
|
||||
```
|
||||
```json
|
||||
["🔐 integration-connectivity-connected-app-configure"]
|
||||
```
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ After generating the diagram, offer the user a localhost preview for real-time i
|
||||
## Start Preview
|
||||
|
||||
1. Save Mermaid code to temporary file:
|
||||
```
|
||||
```text
|
||||
Write: /tmp/mermaid-preview.mmd
|
||||
[Mermaid code content]
|
||||
```
|
||||
|
||||
@ -8,7 +8,7 @@ Real-world examples of using the sf-diagram skill.
|
||||
## Example 1: OAuth Flow Diagram
|
||||
|
||||
### Request
|
||||
```
|
||||
```text
|
||||
"Create a JWT Bearer OAuth flow diagram for our CI/CD pipeline integration"
|
||||
```
|
||||
|
||||
@ -60,7 +60,7 @@ sequenceDiagram
|
||||
```
|
||||
|
||||
#### ASCII Fallback
|
||||
```
|
||||
```text
|
||||
┌───────────────────────┐ ┌────────────────────┐
|
||||
│ GitHub Actions │ │ Salesforce │
|
||||
│ (Private Key) │ │ (Certificate) │
|
||||
@ -81,7 +81,7 @@ sequenceDiagram
|
||||
```
|
||||
|
||||
### Score
|
||||
```
|
||||
```yaml
|
||||
Score: 72/80 ⭐⭐⭐⭐⭐ Excellent
|
||||
├─ Accuracy: 20/20 ✓ All JWT Bearer steps correct
|
||||
├─ Clarity: 18/20 ✓ Clear labels, good flow
|
||||
@ -95,7 +95,7 @@ Score: 72/80 ⭐⭐⭐⭐⭐ Excellent
|
||||
## Example 2: Data Model ERD
|
||||
|
||||
### Request
|
||||
```
|
||||
```text
|
||||
"Create an ERD for our custom Invoice system with Invoice__c, Invoice_Line_Item__c, and relationships to Account and Product"
|
||||
```
|
||||
|
||||
@ -168,7 +168,7 @@ erDiagram
|
||||
```
|
||||
|
||||
#### ASCII Fallback
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────┐ ┌─────────────────────────┐
|
||||
│ ACCOUNT │ │ CONTACT │
|
||||
├─────────────────────────┤ ├─────────────────────────┤
|
||||
@ -214,7 +214,7 @@ erDiagram
|
||||
```
|
||||
|
||||
### Score
|
||||
```
|
||||
```yaml
|
||||
Score: 74/80 ⭐⭐⭐⭐⭐ Excellent
|
||||
├─ Accuracy: 20/20 ✓ All relationships correct
|
||||
├─ Clarity: 19/20 ✓ Clear field annotations
|
||||
@ -228,7 +228,7 @@ Score: 74/80 ⭐⭐⭐⭐⭐ Excellent
|
||||
## Example 3: Integration Sequence
|
||||
|
||||
### Request
|
||||
```
|
||||
```text
|
||||
"Diagram our real-time Order sync from Salesforce to SAP using Platform Events"
|
||||
```
|
||||
|
||||
@ -302,7 +302,7 @@ sequenceDiagram
|
||||
```
|
||||
|
||||
### Score
|
||||
```
|
||||
```yaml
|
||||
Score: 70/80 ⭐⭐⭐⭐ Very Good
|
||||
├─ Accuracy: 19/20 ✓ Platform Event pattern correct
|
||||
├─ Clarity: 18/20 ✓ Good error handling shown
|
||||
@ -316,7 +316,7 @@ Score: 70/80 ⭐⭐⭐⭐ Very Good
|
||||
## Example 4: Combined Request
|
||||
|
||||
### Request
|
||||
```
|
||||
```text
|
||||
"I need to document our partner portal authentication.
|
||||
Create: 1) The OAuth flow for partner login, 2) The data model showing Partner Account, Portal User, and Opportunities they can see"
|
||||
```
|
||||
|
||||
@ -53,7 +53,7 @@ python mermaid_preview.py status
|
||||
|
||||
## How It Works
|
||||
|
||||
```
|
||||
```text
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Browser Tab │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
# Credits & Acknowledgments
|
||||
|
||||
This skill leverages cutting-edge AI technologies and tools to enable visual content generation in Salesforce development workflows.
|
||||
|
||||
---
|
||||
|
||||
## Technologies & Tools
|
||||
|
||||
### Google Gemini
|
||||
|
||||
Key capabilities:
|
||||
- Gemini 3 Pro multimodal AI model
|
||||
- Image generation via Nano Banana Pro extension
|
||||
- Code review and analysis capabilities
|
||||
- Documentation research and summarization
|
||||
|
||||
### Gemini CLI
|
||||
|
||||
Key features:
|
||||
- Command-line access to Gemini models
|
||||
- Extension support (Nano Banana)
|
||||
- Non-interactive mode with --yolo flag
|
||||
- JSON output for programmatic use
|
||||
|
||||
### Nano Banana Pro
|
||||
|
||||
Gemini image generation extension.
|
||||
|
||||
Key features:
|
||||
- High-quality image generation
|
||||
- ERD and diagram creation
|
||||
- UI/UX mockup generation
|
||||
- Architecture visualization
|
||||
|
||||
---
|
||||
|
||||
## Display Technologies
|
||||
|
||||
### timg
|
||||
|
||||
Terminal image viewer.
|
||||
|
||||
Key features:
|
||||
- Kitty graphics protocol support
|
||||
- Multiple format support (PNG, JPG, GIF)
|
||||
- Inline terminal display
|
||||
|
||||
### Kitty Graphics Protocol
|
||||
|
||||
High-fidelity image rendering protocol for modern terminals.
|
||||
|
||||
Key features:
|
||||
- High-fidelity image display in terminals
|
||||
- Supported by Ghostty, Kitty, WezTerm
|
||||
- Enables visual content in CLI workflows
|
||||
|
||||
### Ghostty Terminal
|
||||
|
||||
Modern GPU-accelerated terminal emulator.
|
||||
|
||||
Key features:
|
||||
- Kitty graphics protocol support
|
||||
- Cross-platform (macOS, Linux)
|
||||
- High performance rendering
|
||||
|
||||
---
|
||||
|
||||
## Salesforce Resources
|
||||
|
||||
### Salesforce Lightning Design System (SLDS)
|
||||
|
||||
- Design patterns for LWC mockups
|
||||
- Color palettes and typography
|
||||
- Component specifications
|
||||
|
||||
### Salesforce Developers Platform
|
||||
|
||||
- API documentation
|
||||
- Best practices guides
|
||||
- Platform architecture references
|
||||
@ -1,83 +0,0 @@
|
||||
# external-diagram-visual-generate
|
||||
|
||||
AI-powered visual content generation for Salesforce development. Generate ERD diagrams, LWC mockups, and architecture visuals using Gemini 3 Pro Image (Nano Banana Pro).
|
||||
|
||||
## Features
|
||||
|
||||
- **Visual ERD Generation**: Create actual rendered ERD diagrams (not just Mermaid code)
|
||||
- **LWC/UI Mockups**: Generate wireframes and component mockups following SLDS
|
||||
- **Gemini Code Review**: Parallel code review while Claude continues working
|
||||
- **Documentation Research**: Parallel Salesforce documentation research via Gemini
|
||||
|
||||
## Prerequisites
|
||||
|
||||
**IMPORTANT**: Run the prerequisites check before using this skill:
|
||||
|
||||
```bash
|
||||
scripts/check-prerequisites.sh
|
||||
```
|
||||
|
||||
| Requirement | Description | How to Install |
|
||||
|-------------|-------------|----------------|
|
||||
| **Ghostty Terminal** | Required for Kitty graphics protocol | Download from the Ghostty website |
|
||||
| **GEMINI_API_KEY** | Personal API key for Nano Banana Pro | Generate via Google AI Studio |
|
||||
| **Gemini CLI** | Command-line interface for Gemini | `npm install -g @google/gemini-cli` |
|
||||
| **Nano Banana Extension** | Image generation extension | `gemini extensions install nanobanana` |
|
||||
| **timg** | Terminal image viewer with Kitty support | `brew install timg` |
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Set up your API key
|
||||
|
||||
Add to `~/.zshrc`:
|
||||
```bash
|
||||
export GEMINI_API_KEY="your-personal-api-key"
|
||||
export NANOBANANA_MODEL=gemini-3-pro-image-preview
|
||||
```
|
||||
|
||||
### 2. Invoke the skill
|
||||
|
||||
```
|
||||
Skill: external-diagram-visual-generate
|
||||
Request: "Generate an ERD diagram showing Account, Contact, and Opportunity relationships"
|
||||
```
|
||||
|
||||
### 3. View the result
|
||||
|
||||
Images are displayed inline using Kitty graphics protocol (Ghostty) or via Claude's multimodal vision using the Read tool.
|
||||
|
||||
## Use Cases
|
||||
|
||||
| Use Case | Example Request |
|
||||
|----------|-----------------|
|
||||
| ERD Diagrams | "Generate a visual ERD for Account, Contact, Opportunity" |
|
||||
| LWC Mockups | "Create a mockup for an Account list datatable component" |
|
||||
| Code Review | "Get Gemini's review of this Apex trigger" |
|
||||
| Doc Research | "Research the Flow best practices in Salesforce docs" |
|
||||
|
||||
## Cross-Skill Integration
|
||||
|
||||
| Related Skill | When to Use |
|
||||
|---------------|-------------|
|
||||
| external-diagram-mermaid-generate | Convert Mermaid to visual rendering |
|
||||
| platform-custom-object-generate | Query object/field data before generating ERDs |
|
||||
| experience-lwc-generate | Generate mockups for LWC components |
|
||||
| platform-apex-generate | Review Apex code via Gemini sub-agent |
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Gemini CLI Setup](references/gemini-cli-setup.md)
|
||||
|
||||
## Security Notes
|
||||
|
||||
**NEVER commit your GEMINI_API_KEY to version control**
|
||||
|
||||
- Store API key in `~/.zshrc` only (not in project files)
|
||||
- The key is personal and tied to your Google account billing
|
||||
|
||||
## Requirements
|
||||
|
||||
- Ghostty terminal (for Kitty graphics)
|
||||
- Gemini CLI with Nano Banana extension
|
||||
- GEMINI_API_KEY environment variable
|
||||
- timg (for terminal image display)
|
||||
@ -1,207 +0,0 @@
|
||||
---
|
||||
name: external-diagram-visual-generate
|
||||
description: "AI-powered image generation for Salesforce visuals via Nano Banana Pro. Use this skill when the user needs rendered PNG/SVG output such as visual ERDs (Entity Relationship Diagrams), UI mockups, wireframes, or architecture illustrations. TRIGGER when: user asks for PNG/SVG output, UI mockups, wireframes, visual ERDs, or says \"generate image\" / \"create mockup\". DO NOT TRIGGER when: text-based Mermaid diagrams (use external-diagram-mermaid-generate), or non-visual documentation tasks."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# external-diagram-visual-generate: Salesforce Visual AI Skill
|
||||
|
||||
Use this skill when the user needs **rendered visuals**, not text diagrams: ERDs, UI mockups, architecture illustrations, slide-ready images, or image edits using Nano Banana Pro.
|
||||
|
||||
## Scope
|
||||
|
||||
**In scope:**
|
||||
- PNG / SVG-style rendered image output
|
||||
- Visual ERDs and architecture diagrams
|
||||
- LWC or Experience Cloud mockups / wireframes
|
||||
- Image edits on previously generated visuals
|
||||
|
||||
**Out of scope — delegate instead:**
|
||||
- Mermaid or text-only diagrams → [external-diagram-mermaid-generate](../external-diagram-mermaid-generate/SKILL.md)
|
||||
- Object / field metadata discovery for ERDs → [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) or [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md)
|
||||
- LWC implementation after the mockup is approved → [experience-lwc-generate](../experience-lwc-generate/SKILL.md)
|
||||
- Apex review / implementation → [platform-apex-generate](../platform-apex-generate/SKILL.md)
|
||||
|
||||
---
|
||||
|
||||
## Hard Gate: Prerequisites First
|
||||
|
||||
Run the prerequisites check before using the skill:
|
||||
|
||||
```bash
|
||||
scripts/check-prerequisites.sh
|
||||
```
|
||||
|
||||
If prerequisites fail, stop and route the user to setup guidance in:
|
||||
- [references/gemini-cli-setup.md](references/gemini-cli-setup.md)
|
||||
|
||||
---
|
||||
|
||||
## Required Inputs
|
||||
|
||||
Ask for or infer before generating:
|
||||
|
||||
| Input | Default if not provided |
|
||||
|---|---|
|
||||
| Image type | ERD |
|
||||
| Subject scope and key entities / systems | Ask the user |
|
||||
| Target quality | Draft (1K) |
|
||||
| Preferred style | architect.salesforce.com aesthetic |
|
||||
| Aspect ratio | Default (no override) |
|
||||
| Quick mode or interview mode | Interview mode |
|
||||
|
||||
---
|
||||
|
||||
## Interview-First Workflow
|
||||
|
||||
Unless the user asks for **quick / simple / just generate**, ask clarifying questions first using the question bank in [references/interview-questions.md](references/interview-questions.md).
|
||||
|
||||
| Request type | Ask about |
|
||||
|---|---|
|
||||
| ERD / schema | objects, visual style, purpose, extras |
|
||||
| UI mockup | component type, object/context, device/layout, style |
|
||||
| architecture image | systems, boundaries, protocols, emphasis |
|
||||
| image edit | what to keep, what to change, output quality |
|
||||
|
||||
**Quick mode defaults** (triggered by "quick", "simple", "just generate", "fast"):
|
||||
- professional style, 1K draft, legend included, one image first then iterate
|
||||
|
||||
---
|
||||
|
||||
## Recommended Workflow
|
||||
|
||||
### 1. Run prerequisites check
|
||||
Run `scripts/check-prerequisites.sh` and confirm all required tools pass before proceeding.
|
||||
|
||||
### 2. Gather inputs
|
||||
- object list / metadata (delegate to `platform-custom-object-generate` / `platform-custom-field-generate` if needed)
|
||||
- purpose: draft vs presentation vs documentation
|
||||
- desired aesthetic — read [references/architect-aesthetic-guide.md](references/architect-aesthetic-guide.md) for ERDs
|
||||
- aspect ratio / resolution
|
||||
|
||||
### 3. Run interview or use quick-mode defaults
|
||||
Load [references/interview-questions.md](references/interview-questions.md) for the matching question set (ERD, LWC, architecture, code review).
|
||||
|
||||
### 4. Build a concrete prompt
|
||||
Good prompts specify subject, composition, color treatment, labels/legends, and output quality goal.
|
||||
|
||||
### 5. Generate a fast draft at 1K
|
||||
```bash
|
||||
gemini --yolo "/generate 'Your prompt here'"
|
||||
```
|
||||
Open the result and review layout before spending on higher resolution.
|
||||
|
||||
### 6. Iterate using edits
|
||||
```bash
|
||||
gemini --yolo "/edit 'Specific change instruction'"
|
||||
```
|
||||
Use `/edit` for small adjustments — cheaper than regenerating. See [references/iteration-workflow.md](references/iteration-workflow.md).
|
||||
|
||||
### 7. Generate final at 2K/4K using the Python script
|
||||
Run `scripts/generate_image.py` when layout is confirmed:
|
||||
```bash
|
||||
uv run scripts/generate_image.py -p "Refined prompt" -f "output.png" -r 4K
|
||||
```
|
||||
|
||||
### 8. Error recovery
|
||||
- If `gemini --yolo` returns no image: re-run once; if it fails again, fall back to the Python script path.
|
||||
- If the Python script fails with `GEMINI_API_KEY not found`: verify the key is exported in your shell profile (`~/.zshrc` on macOS/zsh, `~/.bashrc` on Linux) and the terminal session is refreshed.
|
||||
- If the extension is missing: run `gemini extensions install nanobanana` and re-run the prerequisites check.
|
||||
|
||||
---
|
||||
|
||||
## Default Style Guidance
|
||||
|
||||
For ERDs, default to the **architect.salesforce.com** aesthetic unless the user asks otherwise:
|
||||
- dark border + light fill cards
|
||||
- cloud-specific accent colors
|
||||
- clean labels and relationship lines
|
||||
- presentation-ready whitespace and hierarchy
|
||||
|
||||
Full style specification: [references/architect-aesthetic-guide.md](references/architect-aesthetic-guide.md)
|
||||
|
||||
---
|
||||
|
||||
## Common Patterns
|
||||
|
||||
| Pattern | Default approach |
|
||||
|---|---|
|
||||
| visual ERD | get metadata if available, then render a draft first |
|
||||
| LWC mockup | load [assets/lwc/data-table.md](assets/lwc/data-table.md), [assets/lwc/record-form.md](assets/lwc/record-form.md), or [assets/lwc/dashboard-card.md](assets/lwc/dashboard-card.md) for the matching template |
|
||||
| architecture illustration | load [assets/architecture/integration-flow.md](assets/architecture/integration-flow.md); emphasize systems and flows |
|
||||
| image refinement | use `/edit` for small changes before regenerating |
|
||||
| final production asset | switch to script-driven 2K/4K generation via `scripts/generate_image.py` |
|
||||
| Apex / LWC code review | load [assets/review/apex-review.md](assets/review/apex-review.md) or [assets/review/lwc-review.md](assets/review/lwc-review.md) for the review prompt template |
|
||||
|
||||
---
|
||||
|
||||
## Output Expectations
|
||||
|
||||
Deliverables produced by this skill:
|
||||
|
||||
- **Draft image** (`<name>.png`) — 1K resolution rendered via `gemini --yolo "/generate ..."` for layout review
|
||||
- **Final image** (`<name>.png`) — 2K or 4K resolution rendered via `scripts/generate_image.py` once composition is approved
|
||||
- **Edit iteration** (`<name>.png`) — incremental refinement via `gemini --yolo "/edit ..."` without full regeneration
|
||||
|
||||
After delivering each image:
|
||||
- Open the file in Preview or attach it in the session for multimodal review
|
||||
- Ask the user whether to iterate on layout, labeling, or color before finalizing
|
||||
- Only proceed to high-res output after draft composition is confirmed
|
||||
|
||||
---
|
||||
|
||||
## Rules / Constraints
|
||||
|
||||
| Rule | Rationale |
|
||||
|---|---|
|
||||
| Always run prerequisites check before any generation | Missing tools produce silent failures |
|
||||
| Always draft at 1K before generating at 4K | Cost and time savings; composition changes at high res are wasteful |
|
||||
| Use `/edit` for incremental changes, not full regeneration | Cheaper and faster for small adjustments |
|
||||
| Never commit `GEMINI_API_KEY` to version control | Key is personal and tied to billing |
|
||||
| Delegate text diagrams to `external-diagram-mermaid-generate` | This skill owns rendered images only |
|
||||
|
||||
---
|
||||
|
||||
## Gotchas
|
||||
|
||||
| Issue | Resolution |
|
||||
|---|---|
|
||||
| Edit not applying correctly | Be specific: reference existing elements by name; one change at a time |
|
||||
| 4K output looks different from 1K draft | Use exact same prompt text; minor variations are normal model behavior |
|
||||
| `gemini --yolo` fails silently | Check that the Nano Banana extension is installed: `gemini extensions list` |
|
||||
| Image dimensions wrong | Set `--aspect-ratio` explicitly in `scripts/generate_image.py` using `-a "16:9"` |
|
||||
| RGBA image causes errors in Python script | Script auto-converts RGBA→RGB; ensure Pillow is installed via `uv` |
|
||||
|
||||
---
|
||||
|
||||
## Cross-Skill Integration
|
||||
|
||||
| Need | Delegate to | Reason |
|
||||
|---|---|---|
|
||||
| Mermaid first draft or text diagram | [external-diagram-mermaid-generate](../external-diagram-mermaid-generate/SKILL.md) | faster structural diagramming |
|
||||
| Object / field discovery for ERD | [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) / [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md) | accurate schema grounding |
|
||||
| Turn mockup into real LWC component | [experience-lwc-generate](../experience-lwc-generate/SKILL.md) | implementation after design |
|
||||
| Apex review / implementation | [platform-apex-generate](../platform-apex-generate/SKILL.md) | code-quality follow-up |
|
||||
|
||||
---
|
||||
|
||||
## Reference File Index
|
||||
|
||||
| File | When to read |
|
||||
|---|---|
|
||||
| [references/gemini-cli-setup.md](references/gemini-cli-setup.md) | Prerequisites fail — Gemini CLI / Nano Banana setup guidance |
|
||||
| [references/interview-questions.md](references/interview-questions.md) | Step 3 — load question set matching the request type |
|
||||
| [references/iteration-workflow.md](references/iteration-workflow.md) | Step 6 — draft-to-final iteration patterns and cost tips |
|
||||
| [references/architect-aesthetic-guide.md](references/architect-aesthetic-guide.md) | Step 4 — ERD color palettes, box styles, prompt templates |
|
||||
| [references/examples-index.md](references/examples-index.md) | Step 4 — example prompts for ERD, LWC, architecture, code review |
|
||||
| [assets/erd/core-objects.md](assets/erd/core-objects.md) | Step 4 — prompt template for core CRM objects (Account, Contact, Opportunity, Case) |
|
||||
| [assets/erd/custom-objects.md](assets/erd/custom-objects.md) | Step 4 — prompt template for custom object ERDs |
|
||||
| [assets/lwc/data-table.md](assets/lwc/data-table.md) | Step 4 — prompt template for lightning-datatable mockups |
|
||||
| [assets/lwc/record-form.md](assets/lwc/record-form.md) | Step 4 — prompt template for lightning-record-form mockups |
|
||||
| [assets/lwc/dashboard-card.md](assets/lwc/dashboard-card.md) | Step 4 — prompt template for dashboard card / metric tile mockups |
|
||||
| [assets/architecture/integration-flow.md](assets/architecture/integration-flow.md) | Step 4 — prompt template for integration architecture diagrams |
|
||||
| [assets/review/apex-review.md](assets/review/apex-review.md) | Step 4 — Gemini review prompt template for Apex code |
|
||||
| [assets/review/lwc-review.md](assets/review/lwc-review.md) | Step 4 — Gemini review prompt template for LWC components |
|
||||
| [scripts/check-prerequisites.sh](scripts/check-prerequisites.sh) | Step 1 — run to verify all required tools are installed |
|
||||
| [scripts/generate_image.py](scripts/generate_image.py) | Step 7 — run for 2K/4K resolution output and image editing with resolution control |
|
||||
@ -1,55 +0,0 @@
|
||||
# Architecture Template: Integration Flow
|
||||
|
||||
## Prompt Template
|
||||
|
||||
```
|
||||
Professional Salesforce integration architecture diagram:
|
||||
|
||||
SYSTEMS:
|
||||
[List systems with types and icons]
|
||||
|
||||
INTEGRATION PATTERNS:
|
||||
[List integrations with protocols and directions]
|
||||
|
||||
COMPONENTS:
|
||||
- API Gateway (if applicable)
|
||||
- Authentication layer
|
||||
- Middleware/ESB (if applicable)
|
||||
- Error handling/retry logic
|
||||
|
||||
STYLING:
|
||||
- Cloud icon for Salesforce
|
||||
- Server icons for external systems
|
||||
- Arrows with protocol labels
|
||||
- Color coding by system type
|
||||
- Professional diagram style
|
||||
|
||||
FORMAT:
|
||||
- Landscape orientation
|
||||
- Left-to-right or hub-spoke layout
|
||||
- Include legend
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
gemini "/generate 'Salesforce integration architecture diagram:
|
||||
|
||||
Systems:
|
||||
1. Salesforce (cloud icon, blue)
|
||||
2. MuleSoft (middleware icon, purple)
|
||||
3. SAP ERP (server icon, orange)
|
||||
|
||||
Flows:
|
||||
1. Salesforce --REST--> MuleSoft --BAPI--> SAP
|
||||
- Account/Contact sync (bidirectional)
|
||||
|
||||
2. SAP --Events--> MuleSoft --Platform Events--> Salesforce
|
||||
- Invoice updates
|
||||
|
||||
Include:
|
||||
- OAuth 2.0 authentication badges
|
||||
- Error queue for failed messages
|
||||
|
||||
Style: Professional, clean lines, pastel colors'"
|
||||
```
|
||||
@ -1,131 +0,0 @@
|
||||
# ERD Template: Core Salesforce Objects (Architect.salesforce.com Style)
|
||||
|
||||
## Default Style
|
||||
|
||||
All ERDs now use the **official architect.salesforce.com aesthetic** by default:
|
||||
- Dark border + light translucent fill boxes
|
||||
- Header banner with Salesforce logo
|
||||
- LEGEND bar with ENTITIES and RELATIONSHIPS
|
||||
- Labeled relationship lines
|
||||
- Footer with copyright
|
||||
|
||||
See `references/architect-aesthetic-guide.md` for full specification.
|
||||
|
||||
---
|
||||
|
||||
## Prompt Template (Architect.salesforce.com Style)
|
||||
|
||||
```
|
||||
Create a Salesforce Core CRM ERD in the EXACT architect.salesforce.com style:
|
||||
|
||||
PAGE TITLE (very top, large bold text):
|
||||
'Core CRM Overview Data Model'
|
||||
|
||||
HEADER SECTION (below title):
|
||||
- Left: Salesforce cloud logo + 'SALESFORCE PLATFORM Overview' in dark teal (#0B827C) banner box
|
||||
- Center: LEGEND with 'ENTITIES' section showing:
|
||||
* Cloud Entity box (dark teal #0B827C border, light teal ~25% opacity fill)
|
||||
* Related Entity box (dark teal border, lighter fill)
|
||||
* External Entity box (black border, white fill)
|
||||
- Right: 'RELATIONSHIPS' section showing notation symbols for Parent/Child, Required, Optional, Many-to-Many
|
||||
|
||||
BOX STYLING - CRITICAL:
|
||||
- DARK BORDER: Solid 2px border in dark teal (#0B827C)
|
||||
- LIGHT TRANSLUCENT FILL: Same teal hue at ~25% opacity
|
||||
- Rounded corners (8-12px radius)
|
||||
- Text in dark gray/black on the light fill
|
||||
|
||||
ENTITY BOX FORMAT:
|
||||
┌─────────────────────────┐
|
||||
│ Logical Name │ (Bold, larger)
|
||||
│ APIName │ (Smaller, italic, gray)
|
||||
│ • Field1 │ (Bullet points)
|
||||
│ • Field2 │
|
||||
└─────────────────────────┘
|
||||
|
||||
OBJECTS TO INCLUDE (all with dark teal border + light teal fill):
|
||||
|
||||
- Account (center position):
|
||||
Account
|
||||
Account
|
||||
• Account Number
|
||||
• Name
|
||||
• Industry
|
||||
• Type
|
||||
|
||||
- Contact (linked to Account):
|
||||
Contact
|
||||
Contact
|
||||
• Name
|
||||
• Email
|
||||
• Title
|
||||
• Phone
|
||||
|
||||
- Opportunity (linked to Account):
|
||||
Opportunity
|
||||
Opportunity
|
||||
• Name
|
||||
• Amount
|
||||
• Close Date
|
||||
• StageName
|
||||
|
||||
- Case (linked to Account and Contact):
|
||||
Case
|
||||
Case
|
||||
• CaseNumber
|
||||
• Type
|
||||
• Priority
|
||||
• Status
|
||||
|
||||
RELATIONSHIP LINES:
|
||||
- Thin black lines with text labels ON the lines
|
||||
- Contact → Account: "child of" (crow's foot on Contact side)
|
||||
- Opportunity → Account: "child of" (crow's foot on Opportunity side)
|
||||
- Case → Account: "related to" (crow's foot on Case side)
|
||||
- Case → Contact: "related to" (optional)
|
||||
- STRAIGHT LINES ONLY (horizontal and vertical, no diagonals)
|
||||
|
||||
FOOTER:
|
||||
Left: '©2024 Salesforce - Subject to change without notice'
|
||||
Right: 'Last modified: [current date]'
|
||||
|
||||
CRITICAL: Dark teal borders with LIGHT translucent teal fill - NOT solid filled boxes.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Quick draft at 1K (iterate here)
|
||||
gemini --yolo "/generate '[paste prompt above]'"
|
||||
open ~/nanobanana-output/*.png # Review and refine
|
||||
|
||||
# Final at 4K (when satisfied)
|
||||
uv run scripts/generate_image.py \
|
||||
-p "[your refined prompt]" \
|
||||
-f "core-crm-erd.png" \
|
||||
-r 4K
|
||||
open ~/nanobanana-output/*core-crm*.png
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Cloud Color Reference
|
||||
|
||||
| Cloud | Border Color | Fill (~25% opacity) |
|
||||
|-------|--------------|---------------------|
|
||||
| Sales Cloud | `#0B827C` (Teal) | Light Teal |
|
||||
| Service Cloud | `#9E2A7D` (Magenta) | Light Pink |
|
||||
| Platform | `#5A67D8` (Purple) | Light Purple |
|
||||
|
||||
---
|
||||
|
||||
## Resolution Guide
|
||||
|
||||
| Phase | Resolution | Use Case |
|
||||
|-------|------------|----------|
|
||||
| Draft | 1K (CLI) | Quick iteration, prompt refinement |
|
||||
| Final | 4K (Python) | Documentation, presentations |
|
||||
|
||||
**Tip**: Iterate at 1K until layout is correct, then generate 4K final.
|
||||
@ -1,60 +0,0 @@
|
||||
# ERD Template: Custom Objects
|
||||
|
||||
## Prompt Template
|
||||
|
||||
```
|
||||
Professional Salesforce ERD diagram showing custom objects:
|
||||
|
||||
OBJECTS:
|
||||
[List custom objects with relationships]
|
||||
|
||||
COLOR CODING:
|
||||
- Standard Objects: Blue (#bae6fd fill, #0369a1 border)
|
||||
- Custom Objects: Orange (#fed7aa fill, #c2410c border)
|
||||
- External Objects: Green (#a7f3d0 fill, #047857 border)
|
||||
|
||||
RELATIONSHIPS:
|
||||
- Lookup (LK): Dashed arrow, optional parent
|
||||
- Master-Detail (MD): Solid thick arrow, cascade delete
|
||||
|
||||
STYLING:
|
||||
- Clean white background
|
||||
- Pastel fill colors with dark borders
|
||||
- Relationship labels on arrows
|
||||
- Professional diagram layout
|
||||
- Include color legend
|
||||
|
||||
FORMAT:
|
||||
- Auto-layout based on relationships
|
||||
- Primary objects centered
|
||||
- Child objects positioned below/right of parents
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
# Draft at 1K (iterate here)
|
||||
gemini --yolo "/generate 'Salesforce ERD for real estate app:
|
||||
- Property__c (orange, center): Main custom object
|
||||
- Listing__c (orange, right): Master-Detail to Property__c
|
||||
- Showing__c (orange, below): Lookup to both Property__c and Contact
|
||||
|
||||
Orange boxes for custom objects, blue for standard (Contact).
|
||||
Include legend. Professional style.'"
|
||||
open ~/nanobanana-output/*.png # Review and refine
|
||||
|
||||
# Final at 4K (when satisfied)
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Salesforce ERD for real estate app..." \
|
||||
-f "realestate-erd.png" \
|
||||
-r 4K
|
||||
```
|
||||
|
||||
## Resolution Guide
|
||||
|
||||
| Phase | Resolution | Use Case |
|
||||
|-------|------------|----------|
|
||||
| Draft | 1K (CLI) | Quick iteration, prompt refinement |
|
||||
| Final | 4K (Python) | Documentation, presentations |
|
||||
|
||||
**Tip**: Iterate at 1K until layout is correct, then generate 4K final.
|
||||
@ -1,45 +0,0 @@
|
||||
# LWC Template: Dashboard Card Mockup
|
||||
|
||||
## Prompt Template
|
||||
|
||||
```
|
||||
Salesforce Lightning dashboard card/tile mockup:
|
||||
|
||||
CARD TYPE: [metric/chart/list/progress]
|
||||
|
||||
METRIC CARD:
|
||||
- Large metric value
|
||||
- Label below
|
||||
- Trend indicator: up/down arrow with percentage
|
||||
- Sparkline mini chart (optional)
|
||||
- Icon in corner
|
||||
|
||||
CHART CARD:
|
||||
- Chart type: [bar/line/pie/donut]
|
||||
- Legend position
|
||||
- Data labels on hover
|
||||
|
||||
LIST CARD:
|
||||
- Title with "View All" link
|
||||
- 3-5 list items
|
||||
- Each item: icon, primary text, secondary text
|
||||
|
||||
STYLING:
|
||||
- SLDS card component
|
||||
- White background with subtle shadow
|
||||
- Rounded corners
|
||||
- Header with title and action menu
|
||||
```
|
||||
|
||||
## Example: Metric Card
|
||||
|
||||
```bash
|
||||
gemini "/generate 'Salesforce dashboard metric card:
|
||||
- Large number: $1.2M
|
||||
- Label: Total Pipeline Value
|
||||
- Trend: +12% (green up arrow)
|
||||
- Icon: Opportunity icon (top-right)
|
||||
- Sparkline: Show 7-day trend mini chart
|
||||
|
||||
Style: SLDS card, white background, subtle shadow'"
|
||||
```
|
||||
@ -1,57 +0,0 @@
|
||||
# LWC Template: Data Table Mockup
|
||||
|
||||
## Prompt Template
|
||||
|
||||
```
|
||||
Salesforce Lightning Web Component data table mockup:
|
||||
|
||||
COMPONENT: lightning-datatable style
|
||||
|
||||
HEADER:
|
||||
- Component title: "[Title]"
|
||||
- Search box (right-aligned)
|
||||
- Action buttons: New, Refresh, Export
|
||||
|
||||
COLUMNS:
|
||||
[List columns with types]
|
||||
|
||||
SAMPLE DATA:
|
||||
- Show 5-7 sample rows with realistic data
|
||||
- Include row selection checkboxes
|
||||
- Show sorting arrows on sortable columns
|
||||
|
||||
STYLING:
|
||||
- SLDS (Salesforce Lightning Design System)
|
||||
- Zebra striping on rows
|
||||
- Hover highlight
|
||||
- Blue header bar
|
||||
- White background
|
||||
|
||||
ACTIONS:
|
||||
- Row-level action menu (three dots)
|
||||
- Bulk action buttons when rows selected
|
||||
|
||||
FORMAT:
|
||||
- Desktop view (1200px width)
|
||||
- Full component with card wrapper
|
||||
- Include pagination footer
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
gemini "/generate 'Salesforce LWC data table mockup:
|
||||
Title: Recent Opportunities
|
||||
Columns:
|
||||
1. Opportunity Name (link)
|
||||
2. Account Name (text)
|
||||
3. Amount (currency, right-aligned)
|
||||
4. Stage (picklist badge)
|
||||
5. Close Date (date)
|
||||
6. Owner (user with avatar)
|
||||
|
||||
Sample data: Show 5 realistic opportunities
|
||||
Include: Search, New button, row actions menu
|
||||
Style: SLDS, professional, clean
|
||||
Pagination: 1-5 of 127'"
|
||||
```
|
||||
@ -1,60 +0,0 @@
|
||||
# LWC Template: Record Form Mockup
|
||||
|
||||
## Prompt Template
|
||||
|
||||
```
|
||||
Salesforce Lightning Web Component record form mockup:
|
||||
|
||||
COMPONENT: lightning-record-form style
|
||||
|
||||
HEADER:
|
||||
- Object icon and label
|
||||
- Edit/Save/Cancel buttons (right)
|
||||
- Record name as title
|
||||
|
||||
LAYOUT:
|
||||
- Two-column layout for desktop
|
||||
- Responsive single column for mobile
|
||||
|
||||
SECTIONS:
|
||||
[Define sections with fields]
|
||||
|
||||
FIELD TYPES:
|
||||
- Text inputs with labels above
|
||||
- Picklists as dropdown
|
||||
- Lookups with search icon
|
||||
- Date pickers with calendar
|
||||
- Currency with formatting
|
||||
- Checkboxes for boolean
|
||||
|
||||
STYLING:
|
||||
- SLDS record page styling
|
||||
- Compact spacing
|
||||
- Blue section headers
|
||||
- Required field indicators (*)
|
||||
- Help text icons where applicable
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
gemini "/generate 'Salesforce LWC record form mockup:
|
||||
Object: Opportunity
|
||||
Mode: Edit
|
||||
|
||||
Sections:
|
||||
1. Opportunity Information:
|
||||
- Opportunity Name* (text)
|
||||
- Account Name* (lookup with search)
|
||||
- Type (picklist)
|
||||
- Lead Source (picklist)
|
||||
|
||||
2. Amount & Dates:
|
||||
- Amount (currency)
|
||||
- Close Date* (date picker)
|
||||
- Stage* (picklist)
|
||||
- Probability (percentage)
|
||||
|
||||
Footer: Save and Cancel buttons
|
||||
Style: SLDS, professional, desktop view'"
|
||||
```
|
||||
@ -1,57 +0,0 @@
|
||||
# Apex Code Review Template
|
||||
|
||||
## Gemini Review Prompt
|
||||
|
||||
```
|
||||
Review this Apex code for best practices and issues:
|
||||
|
||||
CODE:
|
||||
[paste code here]
|
||||
|
||||
REVIEW CATEGORIES:
|
||||
|
||||
1. BULKIFICATION
|
||||
- SOQL queries in loops
|
||||
- DML operations in loops
|
||||
- Governor limit risks
|
||||
- Collection usage
|
||||
|
||||
2. SECURITY
|
||||
- CRUD permissions check
|
||||
- FLS enforcement
|
||||
- Sharing model compliance
|
||||
- Injection vulnerabilities
|
||||
|
||||
3. BEST PRACTICES
|
||||
- Trigger handler pattern
|
||||
- One trigger per object
|
||||
- Separation of concerns
|
||||
- Proper exception handling
|
||||
|
||||
4. PERFORMANCE
|
||||
- Selective SOQL queries
|
||||
- Index usage
|
||||
- Unnecessary computation
|
||||
|
||||
5. MAINTAINABILITY
|
||||
- Code comments
|
||||
- Method length
|
||||
- Test coverage considerations
|
||||
|
||||
OUTPUT FORMAT:
|
||||
JSON with summary, issues array, bestPractices array, and score
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
gemini "Review this Apex trigger for issues: [paste code]" -o json
|
||||
```
|
||||
|
||||
## Severity Guidelines
|
||||
|
||||
| Severity | Criteria |
|
||||
|----------|----------|
|
||||
| High | Security, governor limits, data integrity |
|
||||
| Medium | Performance, best practices |
|
||||
| Low | Style, minor improvements |
|
||||
@ -1,48 +0,0 @@
|
||||
# LWC Code Review Template
|
||||
|
||||
## Gemini Review Prompt
|
||||
|
||||
```
|
||||
Review this Lightning Web Component for best practices:
|
||||
|
||||
JAVASCRIPT:
|
||||
[paste JS code]
|
||||
|
||||
HTML TEMPLATE:
|
||||
[paste HTML code]
|
||||
|
||||
REVIEW CATEGORIES:
|
||||
|
||||
1. ACCESSIBILITY (A11Y)
|
||||
- ARIA labels and roles
|
||||
- Keyboard navigation
|
||||
- Screen reader compatibility
|
||||
|
||||
2. PERFORMANCE
|
||||
- Wire service usage
|
||||
- Rendering optimization
|
||||
- Event handling
|
||||
|
||||
3. SECURITY
|
||||
- Locker Service compliance
|
||||
- XSS prevention
|
||||
|
||||
4. BEST PRACTICES
|
||||
- Component lifecycle
|
||||
- Error handling
|
||||
- Data binding
|
||||
|
||||
5. SALESFORCE PATTERNS
|
||||
- Lightning Data Service
|
||||
- Navigation service
|
||||
- Toast notifications
|
||||
|
||||
OUTPUT FORMAT:
|
||||
JSON with summary, issues array, accessibility score, and overall score
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
gemini "Review this LWC component: [paste code]" -o json
|
||||
```
|
||||
@ -1,257 +0,0 @@
|
||||
<!-- Parent: external-diagram-visual-generate/SKILL.md -->
|
||||
# Official Salesforce Architect ERD Aesthetic Guide
|
||||
|
||||
Reference for generating ERDs matching the **architect.salesforce.com** visual style.
|
||||
This is the default style for all ERD diagrams generated by external-diagram-visual-generate.
|
||||
|
||||
---
|
||||
|
||||
## Cloud-Specific Color Palettes
|
||||
|
||||
Each Salesforce cloud has its own brand color. The skill auto-detects which cloud to use based on the objects requested.
|
||||
|
||||
| Cloud | Border Color | Fill (~25% opacity) | Detect By Objects |
|
||||
|-------|--------------|---------------------|-------------------|
|
||||
| **Sales Cloud** | `#0B827C` (Teal) | Light Teal | Lead, Opportunity, Quote, Campaign, Order |
|
||||
| **Service Cloud** | `#9E2A7D` (Magenta) | Light Pink | Case, Knowledge, Entitlement, Swarm, Incident |
|
||||
| **Platform** | `#5A67D8` (Purple) | Light Purple | Account, Contact only (no cloud-specific objects) |
|
||||
| **Industries/Scheduler** | `#BA4383` (Pink) | Light Pink | ServiceTerritory, WorkType, Shift, ServiceResource |
|
||||
| **Nonprofit Cloud** | `#032D60` (Navy) | Light Gray | Survey, Donation, Program objects |
|
||||
|
||||
---
|
||||
|
||||
## The Signature Box Style: "Dark Border + Light Fill"
|
||||
|
||||
This is the defining visual pattern of architect.salesforce.com diagrams:
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| **Border** | Solid 2px in cloud's brand color |
|
||||
| **Fill** | Same hue at ~25% opacity (translucent) |
|
||||
| **Corners** | Rounded (8-12px radius) |
|
||||
| **Text** | Dark gray/black on light fill |
|
||||
|
||||
### Visual Example
|
||||
|
||||
```
|
||||
┌─────────────────────────┐
|
||||
│ ░░░░░░░░░░░░░░░░░░░░░░░ │ ← Light translucent fill
|
||||
│ ░ Opportunity ░ │ ← Bold logical name
|
||||
│ ░ Opportunity ░ │ ← Smaller italic API name
|
||||
│ ░ • Name ░ │ ← Key fields with bullets
|
||||
│ ░ • Amount ░ │
|
||||
│ ░ • Close Date ░ │
|
||||
└─────────────────────────┘
|
||||
↑ Dark solid border
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Page Structure
|
||||
|
||||
### 1. Page Title (Top)
|
||||
|
||||
Large bold text centered at the very top:
|
||||
- Format: `"[Cloud Name] Overview Data Model"`
|
||||
- Example: `"Sales Cloud Overview Data Model"`
|
||||
|
||||
### 2. Header Banner
|
||||
|
||||
Below the title, a horizontal banner containing:
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────────────────┐
|
||||
│ [salesforce] SALES CLOUD │ LEGEND: │
|
||||
│ Overview │ ENTITIES │ RELATIONSHIPS │
|
||||
│ │ [boxes...] │ [symbols...] │
|
||||
└──────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
**Left Section:**
|
||||
- Salesforce cloud logo
|
||||
- "[CLOUD NAME] Overview" in dark background
|
||||
|
||||
**Center Section - ENTITIES:**
|
||||
- Cloud Entity (dark border + light fill)
|
||||
- Related Entity (dark border + light fill)
|
||||
- External Entity (black border + white fill)
|
||||
|
||||
**Right Section - RELATIONSHIPS:**
|
||||
- Parent to Child (Many-to-One)
|
||||
- Required to Required (One-to-One)
|
||||
- Optional to Optional (Zero-or-One to Zero-or-One)
|
||||
- Many-to-Many
|
||||
|
||||
### 3. Main Diagram Area
|
||||
|
||||
The ERD with objects and relationship lines.
|
||||
|
||||
### 4. Footer
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ©2024 Salesforce - Subject to change without notice Last modified: [DATE]│
|
||||
└──────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Entity Box Format
|
||||
|
||||
Each object box contains:
|
||||
|
||||
```
|
||||
┌─────────────────────────┐
|
||||
│ Opportunity │ ← Bold logical name (larger font)
|
||||
│ Opportunity │ ← API name (smaller, italic, gray)
|
||||
│ • Name │ ← Key field 1 with bullet
|
||||
│ • Amount │ ← Key field 2 with bullet
|
||||
│ • Close Date │ ← Key field 3 with bullet
|
||||
│ • StageName │ ← Key field 4 (optional)
|
||||
└─────────────────────────┘
|
||||
```
|
||||
|
||||
### Recommended Fields by Object
|
||||
|
||||
| Object | Key Fields |
|
||||
|--------|------------|
|
||||
| Account | Account Number, Name, Industry, Type |
|
||||
| Contact | Name, Email, Title, Phone |
|
||||
| Lead | Name, Company, Status, Rating |
|
||||
| Opportunity | Name, Amount, Close Date, StageName |
|
||||
| Campaign | Name, Type, Status, StartDate |
|
||||
| Case | CaseNumber, Type, Priority, Status |
|
||||
| Quote | Name, ExpirationDate, Status |
|
||||
| Order | OrderNumber, EffectiveDate, Status |
|
||||
| Product2 | Name, ProductCode, IsActive |
|
||||
|
||||
---
|
||||
|
||||
## Relationship Line Labels
|
||||
|
||||
**Always include descriptive text labels on relationship lines.**
|
||||
|
||||
| Relationship Type | Label Examples |
|
||||
|-------------------|----------------|
|
||||
| Parent-Child | "child of", "parent of" |
|
||||
| Lookup | "related to" |
|
||||
| Junction | "member of", "participant in" |
|
||||
| Conversion | "converts to", "promoted to" |
|
||||
| Association | "assigned to", "owned by" |
|
||||
|
||||
### Line Styling
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| Stroke width | 1-2px |
|
||||
| Color | Black (`#000000`) |
|
||||
| Direction | Straight horizontal or vertical only (NO diagonals) |
|
||||
| Crow's foot | On "many" side of relationship |
|
||||
| Bar | On "one" side (required) |
|
||||
| Circle + Bar | On "one" side (optional) |
|
||||
|
||||
---
|
||||
|
||||
## Master Prompt Template
|
||||
|
||||
Use this template when generating ERDs:
|
||||
|
||||
```
|
||||
Create a Salesforce [CLOUD_NAME] ERD in the EXACT architect.salesforce.com style:
|
||||
|
||||
PAGE TITLE (very top, large bold text):
|
||||
'[Cloud Name] Overview Data Model'
|
||||
|
||||
HEADER SECTION (below title):
|
||||
- Left: Salesforce cloud logo + '[CLOUD_NAME] Overview' in dark [COLOR] (#[HEX]) banner box
|
||||
- Center: LEGEND with 'ENTITIES' section showing:
|
||||
* Cloud Entity box (dark [COLOR] border, light [COLOR] ~25% opacity fill)
|
||||
* Related Entity box (dark border, lighter fill)
|
||||
* External Entity box (black border, white fill)
|
||||
- Right: 'RELATIONSHIPS' section showing notation symbols
|
||||
|
||||
BOX STYLING - CRITICAL:
|
||||
- DARK BORDER: Solid 2px border in dark [COLOR] (#[HEX])
|
||||
- LIGHT TRANSLUCENT FILL: Same [COLOR] hue at ~25% opacity
|
||||
- Rounded corners (8-12px radius)
|
||||
- Text in dark gray/black on the light fill
|
||||
|
||||
ENTITY BOX FORMAT:
|
||||
┌─────────────────────────┐
|
||||
│ Logical Name │ (Bold, larger)
|
||||
│ APIName │ (Smaller, italic, gray)
|
||||
│ • Field1 │ (Bullet points)
|
||||
│ • Field2 │
|
||||
└─────────────────────────┘
|
||||
|
||||
OBJECTS TO INCLUDE:
|
||||
[List objects with their fields]
|
||||
|
||||
RELATIONSHIP LINES:
|
||||
- Thin black lines with text labels ON the lines
|
||||
- 'child of' / 'parent of' / 'related to' labels
|
||||
- Crow's foot on many side, bar on one side
|
||||
- STRAIGHT LINES ONLY (horizontal and vertical)
|
||||
|
||||
FOOTER:
|
||||
Left: '©[YEAR] Salesforce - Subject to change without notice'
|
||||
Right: 'Last modified: [DATE]'
|
||||
|
||||
CRITICAL: Dark [COLOR] borders with LIGHT translucent [COLOR] fill.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Cloud-Specific Templates
|
||||
|
||||
### Sales Cloud
|
||||
|
||||
```
|
||||
COLOR: Teal #0B827C
|
||||
OBJECTS: Lead, Account, Contact, Opportunity, Campaign, CampaignMember,
|
||||
Quote, Order, Product2, PricebookEntry, Territory
|
||||
```
|
||||
|
||||
### Service Cloud
|
||||
|
||||
```
|
||||
COLOR: Magenta #9E2A7D
|
||||
OBJECTS: Case, Knowledge, KnowledgeArticle, Entitlement, Asset,
|
||||
ServiceContract, WorkOrder, Swarm, Incident, Problem
|
||||
```
|
||||
|
||||
### Platform (Generic)
|
||||
|
||||
```
|
||||
COLOR: Purple #5A67D8
|
||||
OBJECTS: Account, Contact, User, Custom Objects
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference Checklist
|
||||
|
||||
```
|
||||
ARCHITECT.SALESFORCE.COM ERD CHECKLIST
|
||||
═══════════════════════════════════════
|
||||
|
||||
☐ Page title at very top ("[Cloud] Overview Data Model")
|
||||
☐ Header banner with Salesforce logo + "[CLOUD] Overview"
|
||||
☐ Legend bar (ENTITIES + RELATIONSHIPS sections)
|
||||
☐ DARK border in cloud's brand color
|
||||
☐ LIGHT translucent fill (~25% opacity)
|
||||
☐ Entity boxes: Name + API Name + bullet fields
|
||||
☐ Labeled relationship lines ("child of", "related to")
|
||||
☐ Crow's foot notation for many-side
|
||||
☐ Straight lines only (no diagonals)
|
||||
☐ Footer with copyright + last modified date
|
||||
☐ Clean white background
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Version History
|
||||
|
||||
| Version | Changes |
|
||||
|---------|---------|
|
||||
| 1.0 | Initial version with Sales Cloud, Service Cloud, Platform styles |
|
||||
@ -1,35 +0,0 @@
|
||||
<!-- Parent: external-diagram-visual-generate/SKILL.md -->
|
||||
# Examples
|
||||
|
||||
Example prompts and outputs for external-diagram-visual-generate.
|
||||
|
||||
## ERD Examples
|
||||
|
||||
```bash
|
||||
# Basic CRM ERD
|
||||
gemini --yolo "/generate 'Salesforce ERD diagram: Account (blue), Contact (green), Opportunity (yellow). Show relationships with arrows. Clean white background.'"
|
||||
|
||||
# Custom Object ERD
|
||||
gemini --yolo "/generate 'ERD diagram for custom objects: Project__c, Task__c, Resource__c. Master-detail and lookup relationships shown.'"
|
||||
```
|
||||
|
||||
## LWC Mockup Examples
|
||||
|
||||
```bash
|
||||
# Data Table Mockup
|
||||
gemini --yolo "/generate 'Lightning datatable mockup showing Account records with columns: Name, Industry, Annual Revenue. Include search bar and pagination.'"
|
||||
|
||||
# Record Form Mockup
|
||||
gemini --yolo "/generate 'Salesforce Lightning record form for Contact object. Show Name, Email, Phone, Account lookup fields.'"
|
||||
```
|
||||
|
||||
## Architecture Examples
|
||||
|
||||
```bash
|
||||
# Integration Flow
|
||||
gemini --yolo "/generate 'Integration architecture diagram: Salesforce to ERP sync via MuleSoft. Show Platform Events, Named Credentials, External Services.'"
|
||||
```
|
||||
|
||||
## Output Location
|
||||
|
||||
Generated images are saved to `~/nanobanana-output/`
|
||||
@ -1,65 +0,0 @@
|
||||
<!-- Parent: external-diagram-visual-generate/SKILL.md -->
|
||||
# Gemini CLI Setup for external-diagram-visual-generate
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### 1. Authenticate with Google
|
||||
|
||||
```bash
|
||||
# Start Gemini CLI - opens browser for OAuth
|
||||
gemini
|
||||
|
||||
# Select "Login with Google" when prompted
|
||||
# Credentials cached at ~/.gemini/oauth_creds.json
|
||||
```
|
||||
|
||||
### 2. Install Nano Banana Extension
|
||||
|
||||
```bash
|
||||
gemini extensions install nanobanana
|
||||
```
|
||||
|
||||
### 3. Install timg for Image Display
|
||||
|
||||
```bash
|
||||
brew install timg
|
||||
```
|
||||
|
||||
### 4. Configure Environment
|
||||
|
||||
Add to `~/.zshrc`:
|
||||
|
||||
```bash
|
||||
export NANOBANANA_MODEL=gemini-3-pro-image-preview
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
# Check Gemini CLI
|
||||
gemini --version
|
||||
|
||||
# Check Nano Banana
|
||||
gemini extensions list
|
||||
|
||||
# Check timg
|
||||
which timg
|
||||
|
||||
# Test image generation
|
||||
gemini "/generate 'A blue circle on white background'"
|
||||
timg ~/gemini-images/*.png
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File Locations
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `~/.gemini/settings.json` | Gemini CLI settings |
|
||||
| `~/.gemini/oauth_creds.json` | OAuth tokens |
|
||||
| `~/.gemini/extensions/nanobanana/` | Nano Banana extension |
|
||||
| `~/gemini-images/` | Generated images |
|
||||
@ -1,529 +0,0 @@
|
||||
<!-- Parent: external-diagram-visual-generate/SKILL.md -->
|
||||
# Interview Questions Reference
|
||||
|
||||
This document defines the questions Claude should ask (via `AskUserQuestion`) before generating images with external-diagram-visual-generate.
|
||||
|
||||
---
|
||||
|
||||
## How to Use This Reference
|
||||
|
||||
When a user requests an image, Claude should:
|
||||
|
||||
1. **Detect image type** from the request
|
||||
2. **Find the matching question set** below
|
||||
3. **Invoke AskUserQuestion** with those questions
|
||||
4. **Build prompt** using the answers
|
||||
5. **Generate image** with optimized parameters
|
||||
|
||||
### Skip Interview Triggers
|
||||
|
||||
Skip questions and use defaults when user says:
|
||||
- "quick" - e.g., "Quick ERD of Account-Contact"
|
||||
- "simple" - e.g., "Simple LWC mockup"
|
||||
- "just generate" - e.g., "Just generate an architecture diagram"
|
||||
- "fast" - e.g., "Fast ERD draft"
|
||||
|
||||
---
|
||||
|
||||
## ERD Diagram Questions
|
||||
|
||||
### When to Use
|
||||
User mentions: ERD, entity relationship, data model, object relationships, schema diagram
|
||||
|
||||
### Questions
|
||||
|
||||
```json
|
||||
{
|
||||
"questions": [
|
||||
{
|
||||
"question": "Which objects should be included in the ERD?",
|
||||
"header": "Objects",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Core CRM (Recommended)",
|
||||
"description": "Account, Contact, Opportunity, Case - standard sales/service objects"
|
||||
},
|
||||
{
|
||||
"label": "Sales Cloud",
|
||||
"description": "Lead, Campaign, Quote, Order, PriceBook, Product"
|
||||
},
|
||||
{
|
||||
"label": "Service Cloud",
|
||||
"description": "Case, Knowledge, Entitlement, Asset, ServiceContract"
|
||||
},
|
||||
{
|
||||
"label": "Custom objects",
|
||||
"description": "I'll specify the custom objects to include"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "What visual style do you prefer?",
|
||||
"header": "Style",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Architect.salesforce.com (Recommended)",
|
||||
"description": "Official Salesforce style: dark border + light fill, header banner, legend bar"
|
||||
},
|
||||
{
|
||||
"label": "Whiteboard",
|
||||
"description": "Hand-drawn look, casual feel for brainstorming"
|
||||
},
|
||||
{
|
||||
"label": "Technical",
|
||||
"description": "Detailed with field names and data types"
|
||||
},
|
||||
{
|
||||
"label": "Minimalist",
|
||||
"description": "Simple boxes, focus on relationships only"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "What's the primary purpose of this ERD?",
|
||||
"header": "Purpose",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Documentation (4K)",
|
||||
"description": "High quality for wikis, docs, long-term reference"
|
||||
},
|
||||
{
|
||||
"label": "Quick draft (1K)",
|
||||
"description": "Fast iteration, refine the prompt first"
|
||||
},
|
||||
{
|
||||
"label": "Presentation",
|
||||
"description": "Slides for stakeholders, clean and simple"
|
||||
},
|
||||
{
|
||||
"label": "Architecture review",
|
||||
"description": "Technical discussion with developers/architects"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "Any special requirements? (Select all that apply)",
|
||||
"header": "Extras",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "Include legend",
|
||||
"description": "Add a legend explaining colors and relationship types"
|
||||
},
|
||||
{
|
||||
"label": "Show field names",
|
||||
"description": "Display key fields inside each object box"
|
||||
},
|
||||
{
|
||||
"label": "Color-code by type",
|
||||
"description": "Standard=blue, Custom=orange, External=green"
|
||||
},
|
||||
{
|
||||
"label": "None",
|
||||
"description": "Use default styling without extras"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Answer-to-Prompt Mapping
|
||||
|
||||
| Answer | Prompt Addition |
|
||||
|--------|-----------------|
|
||||
| Core CRM | "Account, Contact, Opportunity, Case with standard relationships" |
|
||||
| Sales Cloud | "Lead, Campaign, Quote, Order, PriceBook, Product with conversion flows" |
|
||||
| Service Cloud | "Case, Knowledge, Entitlement, Asset, ServiceContract hierarchy" |
|
||||
| Architect.salesforce.com | "Official architect.salesforce.com style: page title, header banner with Salesforce logo, LEGEND bar (ENTITIES + RELATIONSHIPS), dark border + light translucent fill boxes (~25% opacity), labeled relationship lines, footer with copyright" |
|
||||
| Whiteboard | "Hand-drawn sketch style, informal, whiteboard aesthetic" |
|
||||
| Technical | "Include field names, data types, API names in each box" |
|
||||
| Documentation (4K) | Use Python script with `-r 4K`, include full header + legend |
|
||||
| Quick draft (1K) | Use CLI or Python with `-r 1K` |
|
||||
| Include legend | "Include LEGEND bar at top with ENTITIES and RELATIONSHIPS sections" |
|
||||
| Color-code | "Auto-detect cloud color: Sales=Teal #0B827C, Service=Magenta #9E2A7D, Platform=Purple #5A67D8" |
|
||||
|
||||
### Default Values (for Skip Mode)
|
||||
|
||||
- Objects: Core CRM
|
||||
- Style: Architect.salesforce.com
|
||||
- Purpose: Quick draft (1K)
|
||||
- Extras: Include legend
|
||||
|
||||
---
|
||||
|
||||
## LWC Component Mockup Questions
|
||||
|
||||
### When to Use
|
||||
User mentions: LWC, Lightning Web Component, component mockup, wireframe, UI mockup, form, table, card
|
||||
|
||||
### Questions
|
||||
|
||||
```json
|
||||
{
|
||||
"questions": [
|
||||
{
|
||||
"question": "What type of component do you need?",
|
||||
"header": "Component",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Data table (Recommended)",
|
||||
"description": "List view with columns, sorting, row actions"
|
||||
},
|
||||
{
|
||||
"label": "Record form",
|
||||
"description": "Create/edit form with fields and sections"
|
||||
},
|
||||
{
|
||||
"label": "Dashboard card",
|
||||
"description": "Metrics, charts, or KPI tiles"
|
||||
},
|
||||
{
|
||||
"label": "Custom layout",
|
||||
"description": "I'll describe the specific layout needed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "Which Salesforce object is this for?",
|
||||
"header": "Object",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Account",
|
||||
"description": "Customer/company records"
|
||||
},
|
||||
{
|
||||
"label": "Contact",
|
||||
"description": "Individual person records"
|
||||
},
|
||||
{
|
||||
"label": "Opportunity",
|
||||
"description": "Sales deals and pipeline"
|
||||
},
|
||||
{
|
||||
"label": "Custom object",
|
||||
"description": "I'll specify the object name"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "Where will this component be used?",
|
||||
"header": "Context",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Lightning Record Page (Recommended)",
|
||||
"description": "Embedded on Account, Contact, etc. detail pages"
|
||||
},
|
||||
{
|
||||
"label": "Lightning App Page",
|
||||
"description": "Home page, dashboard, or custom app"
|
||||
},
|
||||
{
|
||||
"label": "Experience Cloud",
|
||||
"description": "Customer/partner portal (community)"
|
||||
},
|
||||
{
|
||||
"label": "Standalone app",
|
||||
"description": "Full-page Lightning app or utility bar"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "Style preferences? (Select all that apply)",
|
||||
"header": "Style",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "SLDS standard",
|
||||
"description": "Standard Lightning Design System styling"
|
||||
},
|
||||
{
|
||||
"label": "Dense/compact",
|
||||
"description": "Reduced spacing for data-heavy views"
|
||||
},
|
||||
{
|
||||
"label": "Mobile-responsive",
|
||||
"description": "Adapts to mobile screen sizes"
|
||||
},
|
||||
{
|
||||
"label": "Card-based",
|
||||
"description": "Elevated card container with shadow"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Answer-to-Prompt Mapping
|
||||
|
||||
| Answer | Prompt Addition |
|
||||
|--------|-----------------|
|
||||
| Data table | "Lightning datatable with columns, header with search, row actions menu" |
|
||||
| Record form | "Lightning record form with sections, field labels, Save/Cancel buttons" |
|
||||
| Dashboard card | "SLDS card component with metric value, label, trend indicator" |
|
||||
| Lightning Record Page | "Component sized for record page sidebar or main content" |
|
||||
| Experience Cloud | "Portal-friendly styling, user-facing design" |
|
||||
| Dense/compact | "Compact spacing, reduced padding, data-dense layout" |
|
||||
| Mobile-responsive | "Responsive design, single column on mobile" |
|
||||
|
||||
### Default Values (for Skip Mode)
|
||||
|
||||
- Component: Data table
|
||||
- Object: Account
|
||||
- Context: Lightning Record Page
|
||||
- Style: SLDS standard
|
||||
|
||||
---
|
||||
|
||||
## Architecture/Integration Diagram Questions
|
||||
|
||||
### When to Use
|
||||
User mentions: architecture, integration, system diagram, data flow, API flow, authentication flow
|
||||
|
||||
### Questions
|
||||
|
||||
```json
|
||||
{
|
||||
"questions": [
|
||||
{
|
||||
"question": "What type of diagram do you need?",
|
||||
"header": "Diagram",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Integration flow (Recommended)",
|
||||
"description": "System-to-system data synchronization"
|
||||
},
|
||||
{
|
||||
"label": "Data flow",
|
||||
"description": "Entity movement between systems"
|
||||
},
|
||||
{
|
||||
"label": "Authentication flow",
|
||||
"description": "OAuth, JWT, SSO sequence diagram"
|
||||
},
|
||||
{
|
||||
"label": "Event-driven",
|
||||
"description": "Platform Events, CDC, pub/sub architecture"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "Which systems are involved?",
|
||||
"header": "Systems",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Salesforce + ERP",
|
||||
"description": "SAP, Oracle, NetSuite, Microsoft Dynamics"
|
||||
},
|
||||
{
|
||||
"label": "Salesforce + Marketing",
|
||||
"description": "Marketo, Pardot, HubSpot, Marketing Cloud"
|
||||
},
|
||||
{
|
||||
"label": "Salesforce + Custom APIs",
|
||||
"description": "Internal services, microservices, legacy systems"
|
||||
},
|
||||
{
|
||||
"label": "Multiple systems",
|
||||
"description": "I'll specify the systems involved"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "What protocols/patterns are used? (Select all that apply)",
|
||||
"header": "Protocols",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "REST APIs",
|
||||
"description": "JSON over HTTP, most common pattern"
|
||||
},
|
||||
{
|
||||
"label": "Platform Events / CDC",
|
||||
"description": "Salesforce event-driven integration"
|
||||
},
|
||||
{
|
||||
"label": "MuleSoft / iPaaS",
|
||||
"description": "Integration platform as middleware"
|
||||
},
|
||||
{
|
||||
"label": "SOAP / Legacy",
|
||||
"description": "XML-based, enterprise protocols"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "What elements should be highlighted? (Select all that apply)",
|
||||
"header": "Elements",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "Auth badges",
|
||||
"description": "Show OAuth 2.0, JWT, API Key on connections"
|
||||
},
|
||||
{
|
||||
"label": "Error handling",
|
||||
"description": "Retry logic, dead letter queues, fallbacks"
|
||||
},
|
||||
{
|
||||
"label": "Data transforms",
|
||||
"description": "Mapping, conversion, enrichment steps"
|
||||
},
|
||||
{
|
||||
"label": "Timing/frequency",
|
||||
"description": "Sync intervals, batch schedules"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Answer-to-Prompt Mapping
|
||||
|
||||
| Answer | Prompt Addition |
|
||||
|--------|-----------------|
|
||||
| Integration flow | "System integration diagram with bidirectional data flow arrows" |
|
||||
| Authentication flow | "OAuth 2.0 sequence diagram with token exchange steps" |
|
||||
| Salesforce + ERP | "Salesforce (cloud icon) connected to ERP (server icon)" |
|
||||
| REST APIs | "REST/JSON labels on connection arrows" |
|
||||
| Platform Events | "Platform Events pub/sub with event bus in center" |
|
||||
| Auth badges | "OAuth 2.0 / JWT badges on integration arrows" |
|
||||
| Error handling | "Error queue and retry logic shown as separate path" |
|
||||
|
||||
### Default Values (for Skip Mode)
|
||||
|
||||
- Diagram: Integration flow
|
||||
- Systems: Salesforce + Custom APIs
|
||||
- Protocols: REST APIs
|
||||
- Elements: Auth badges
|
||||
|
||||
---
|
||||
|
||||
## Code Review Questions (Gemini Sub-Agent)
|
||||
|
||||
### When to Use
|
||||
User mentions: review, code review, check my code, analyze, audit, best practices
|
||||
|
||||
### Questions for Apex Review
|
||||
|
||||
```json
|
||||
{
|
||||
"questions": [
|
||||
{
|
||||
"question": "What type of Apex code is this?",
|
||||
"header": "Code Type",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "Trigger",
|
||||
"description": "Before/after trigger on an object"
|
||||
},
|
||||
{
|
||||
"label": "Batch job",
|
||||
"description": "Batch Apex for large data processing"
|
||||
},
|
||||
{
|
||||
"label": "Service class",
|
||||
"description": "Business logic, utility, or helper class"
|
||||
},
|
||||
{
|
||||
"label": "Controller",
|
||||
"description": "Aura/LWC controller or VF controller"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"question": "What should the review focus on?",
|
||||
"header": "Focus",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "Bulkification",
|
||||
"description": "SOQL/DML in loops, governor limits"
|
||||
},
|
||||
{
|
||||
"label": "Security",
|
||||
"description": "CRUD/FLS checks, injection vulnerabilities"
|
||||
},
|
||||
{
|
||||
"label": "Performance",
|
||||
"description": "Query optimization, caching, efficiency"
|
||||
},
|
||||
{
|
||||
"label": "Best practices",
|
||||
"description": "Naming, structure, patterns, testability"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference Card
|
||||
|
||||
| Image Type | Trigger Keywords | Questions |
|
||||
|------------|-----------------|-----------|
|
||||
| ERD | ERD, entity, data model, schema | Objects, Style, Purpose, Extras |
|
||||
| LWC Mockup | LWC, component, mockup, wireframe | Component, Object, Context, Style |
|
||||
| Architecture | architecture, integration, flow | Diagram, Systems, Protocols, Elements |
|
||||
| Code Review | review, analyze, check, audit | Code Type, Focus |
|
||||
|
||||
---
|
||||
|
||||
## Example: Full Interview Flow
|
||||
|
||||
### User Says
|
||||
"I need an ERD for my Service Cloud implementation"
|
||||
|
||||
### Claude Invokes AskUserQuestion
|
||||
```
|
||||
Objects: Core CRM / Sales Cloud / Service Cloud / Custom
|
||||
Style: Professional / Whiteboard / Technical / Minimalist
|
||||
Purpose: Documentation / Quick draft / Presentation / Review
|
||||
Extras: Legend / Field names / Color-code / None
|
||||
```
|
||||
|
||||
### User Selects
|
||||
- Objects: Service Cloud
|
||||
- Style: Professional
|
||||
- Purpose: Documentation
|
||||
- Extras: Legend, Color-code
|
||||
|
||||
### Claude Builds Prompt
|
||||
```
|
||||
Professional Salesforce ERD diagram showing Service Cloud objects:
|
||||
- Case (blue, center): Main service object
|
||||
- Knowledge (green, right): Linked articles
|
||||
- Entitlement (yellow, left): Service level agreements
|
||||
- Asset (orange, below): Customer-owned products
|
||||
- ServiceContract (purple, top): Contract management
|
||||
|
||||
Relationships:
|
||||
- Case → Knowledge (Lookup, dashed arrow)
|
||||
- Case → Asset (Lookup, dashed arrow)
|
||||
- Asset → ServiceContract (Master-Detail, solid arrow)
|
||||
|
||||
Color coding: Standard objects (blue), Service objects (green/yellow)
|
||||
Include legend in bottom-right corner.
|
||||
Clean white background, SLDS styling.
|
||||
```
|
||||
|
||||
### Claude Generates
|
||||
```bash
|
||||
uv run scripts/generate_image.py \
|
||||
-p "[prompt above]" \
|
||||
-f "service-cloud-erd.png" \
|
||||
-r 4K
|
||||
```
|
||||
@ -1,173 +0,0 @@
|
||||
<!-- Parent: external-diagram-visual-generate/SKILL.md -->
|
||||
# Iteration Workflow: Draft → Final
|
||||
|
||||
Best practices for cost-effective image generation with external-diagram-visual-generate.
|
||||
|
||||
## Why Iterate at Low Resolution?
|
||||
|
||||
| Resolution | Time | API Cost | Use Case |
|
||||
|------------|------|----------|----------|
|
||||
| **1K** | ~3s | $ | Drafts, prompt refinement, layout testing |
|
||||
| **2K** | ~5s | $$ | Medium quality, quick presentations |
|
||||
| **4K** | ~10s | $$$ | Production, documentation, final deliverables |
|
||||
|
||||
**Key Insight**: Get the prompt right at 1K before spending on 4K generation.
|
||||
|
||||
---
|
||||
|
||||
## The Workflow
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ DRAFT PHASE (1K) │
|
||||
│ │
|
||||
│ 1. Generate initial image with CLI │
|
||||
│ gemini --yolo "/generate 'Your prompt...'" │
|
||||
│ │
|
||||
│ 2. Review in Preview │
|
||||
│ open ~/nanobanana-output/*.png │
|
||||
│ │
|
||||
│ 3. Is the layout correct? ─────────────────┐ │
|
||||
│ │ │ │
|
||||
│ ▼ No ▼ Yes │
|
||||
│ Refine prompt or use /edit Continue │
|
||||
│ └──────────────────────────────────────►│ │
|
||||
└─────────────────────────────────────────────┼───────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ FINAL PHASE (4K) │
|
||||
│ │
|
||||
│ 4. Generate production quality with Python script │
|
||||
│ uv run scripts/generate_image.py \ │
|
||||
│ -p "Your refined prompt" \ │
|
||||
│ -f "final-output.png" \ │
|
||||
│ -r 4K │
|
||||
│ │
|
||||
│ 5. Open and use │
|
||||
│ open ~/nanobanana-output/*final-output*.png │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Common Iteration Patterns
|
||||
|
||||
### Pattern 1: Prompt Refinement
|
||||
|
||||
```bash
|
||||
# Attempt 1: Too generic
|
||||
gemini --yolo "/generate 'Account ERD'"
|
||||
# Result: Missing relationships, wrong colors
|
||||
|
||||
# Attempt 2: Add specifics
|
||||
gemini --yolo "/generate 'Account ERD with Contact and Opportunity, blue boxes'"
|
||||
# Result: Better, but legend missing
|
||||
|
||||
# Attempt 3: Add styling details
|
||||
gemini --yolo "/generate 'Salesforce ERD: Account (blue, center), Contact (green),
|
||||
Opportunity (yellow). Master-detail = thick arrow. Lookup = dashed. Include legend.'"
|
||||
# Result: Perfect layout!
|
||||
|
||||
# Final: Generate at 4K
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Salesforce ERD: Account (blue, center)..." \
|
||||
-f "crm-erd-final.png" \
|
||||
-r 4K
|
||||
```
|
||||
|
||||
### Pattern 2: Edit-Based Iteration
|
||||
|
||||
```bash
|
||||
# Start with basic ERD
|
||||
gemini --yolo "/generate 'Account-Contact ERD'"
|
||||
|
||||
# Edit to add more objects
|
||||
gemini --yolo "/edit 'Add Opportunity linked to Account with master-detail'"
|
||||
|
||||
# Edit to improve styling
|
||||
gemini --yolo "/edit 'Add legend, use Salesforce Lightning blue (#0176D3)'"
|
||||
|
||||
# Final at 4K
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Account-Contact-Opportunity ERD with legend, SLDS colors" \
|
||||
-f "final-erd.png" \
|
||||
-r 4K
|
||||
```
|
||||
|
||||
### Pattern 3: Python Script for Editing
|
||||
|
||||
```bash
|
||||
# Generate at 1K
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Dashboard mockup with charts" \
|
||||
-f "dashboard-v1.png"
|
||||
|
||||
# Edit with resolution control
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Add a KPI summary bar at the top" \
|
||||
-i ~/nanobanana-output/*dashboard-v1*.png \
|
||||
-f "dashboard-v2.png" \
|
||||
-r 2K
|
||||
|
||||
# Final version
|
||||
uv run scripts/generate_image.py \
|
||||
-p "Polish: add subtle shadows, round corners on cards" \
|
||||
-i ~/nanobanana-output/*dashboard-v2*.png \
|
||||
-f "dashboard-final.png" \
|
||||
-r 4K
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Timestamp Filenames
|
||||
|
||||
The Python script automatically adds timestamps for easy versioning:
|
||||
|
||||
```
|
||||
~/nanobanana-output/
|
||||
├── 2026-01-13-10-30-15-erd-v1.png # First attempt
|
||||
├── 2026-01-13-10-32-45-erd-v2.png # After edit
|
||||
├── 2026-01-13-10-35-00-erd-final.png # Production 4K
|
||||
```
|
||||
|
||||
**Tip**: Use descriptive filenames like `crm-erd.png` - the timestamp is auto-prepended.
|
||||
|
||||
---
|
||||
|
||||
## When to Use Each Method
|
||||
|
||||
| Method | Best For |
|
||||
|--------|----------|
|
||||
| **CLI (`gemini --yolo`)** | Quick drafts, simple edits, style exploration |
|
||||
| **CLI `/edit`** | Iterative refinements of existing images |
|
||||
| **Python script** | 4K output, precise resolution control, automated workflows |
|
||||
|
||||
---
|
||||
|
||||
## Cost Optimization Tips
|
||||
|
||||
1. **Never generate 4K on first attempt** - always draft at 1K first
|
||||
2. **Use `/edit` for small changes** - cheaper than regenerating
|
||||
3. **Batch similar requests** - get all ERDs right before final generation
|
||||
4. **Save working prompts** - reuse successful prompt patterns
|
||||
5. **Use `--seed` for reproducibility** - same seed = similar output
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Image doesn't match prompt
|
||||
- Add more specific details (colors, positions, relationships)
|
||||
- Use SLDS color codes: `#0176D3` (blue), `#04844B` (green), `#FFB75D` (yellow)
|
||||
- Specify layout: "center", "top-right", "below parent"
|
||||
|
||||
### Edit not applying correctly
|
||||
- Be specific about what to change
|
||||
- Reference existing elements: "Move the Account box to center"
|
||||
- One change at a time for precision
|
||||
|
||||
### 4K output looks different from 1K draft
|
||||
- Use exact same prompt text
|
||||
- Consider using `--seed` for consistency
|
||||
- Minor variations are normal due to model behavior
|
||||
@ -1,101 +0,0 @@
|
||||
#!/bin/bash
|
||||
# check-prerequisites.sh - Verify external-diagram-visual-generate requirements before use
|
||||
# Returns 0 if all required checks pass, 1 if any required fail
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
GRAY='\033[0;90m'
|
||||
NC='\033[0m'
|
||||
|
||||
ERRORS=0
|
||||
WARNINGS=0
|
||||
|
||||
echo ""
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo -e "${BLUE} 📸 SF-IMAGEN PREREQUISITES CHECK${NC}"
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
echo -e "${GRAY} REQUIRED:${NC}"
|
||||
|
||||
# Check 1: macOS (required for Preview app)
|
||||
echo -n " Checking macOS (for Preview app)... "
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo -e "${GREEN}✓ macOS detected${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Not macOS${NC}"
|
||||
echo -e " ${YELLOW}→ external-diagram-visual-generate uses macOS Preview app for image display${NC}"
|
||||
echo -e " ${YELLOW}→ Current OS: $OSTYPE${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
# Check 2: Gemini API Key
|
||||
echo -n " Checking GEMINI_API_KEY... "
|
||||
if [[ -n "$GEMINI_API_KEY" ]]; then
|
||||
# Mask the key for display
|
||||
MASKED_KEY="${GEMINI_API_KEY:0:10}...${GEMINI_API_KEY: -4}"
|
||||
echo -e "${GREEN}✓ Set ($MASKED_KEY)${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Not set${NC}"
|
||||
echo -e " ${YELLOW}→ Nano Banana Pro requires a personal API key${NC}"
|
||||
echo -e " ${YELLOW}→ Get one at: https://aistudio.google.com/apikey${NC}"
|
||||
echo -e " ${YELLOW}→ Add to ~/.zshrc: export GEMINI_API_KEY=\"your-key\"${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
# Check 3: Gemini CLI
|
||||
echo -n " Checking Gemini CLI... "
|
||||
if command -v gemini &> /dev/null; then
|
||||
GEMINI_VERSION=$(gemini --version 2>/dev/null | head -1 || echo "installed")
|
||||
echo -e "${GREEN}✓ $GEMINI_VERSION${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Not installed${NC}"
|
||||
echo -e " ${YELLOW}→ Install: npm install -g @google/gemini-cli${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
# Check 4: Nano Banana Extension
|
||||
echo -n " Checking Nano Banana extension... "
|
||||
if gemini extensions list 2>/dev/null | grep -q "nanobanana"; then
|
||||
echo -e "${GREEN}✓ Installed${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Not installed${NC}"
|
||||
echo -e " ${YELLOW}→ Install: gemini extensions install nanobanana${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${GRAY} OPTIONAL (for 4K/editing via Python script):${NC}"
|
||||
|
||||
# Check 5: uv (optional, for Python script)
|
||||
echo -n " Checking uv (Python runner)... "
|
||||
if command -v uv &> /dev/null; then
|
||||
UV_VERSION=$(uv --version 2>&1 | head -1)
|
||||
echo -e "${GREEN}✓ $UV_VERSION${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}○ Not installed (optional)${NC}"
|
||||
echo -e " ${GRAY}→ For 4K resolution/editing: curl -LsSf https://astral.sh/uv/install.sh | sh${NC}"
|
||||
WARNINGS=$((WARNINGS + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
|
||||
if [[ $ERRORS -eq 0 ]]; then
|
||||
if [[ $WARNINGS -gt 0 ]]; then
|
||||
echo -e " ${GREEN}✅ All required prerequisites met!${NC}"
|
||||
echo -e " ${YELLOW}⚠️ $WARNINGS optional feature(s) unavailable${NC}"
|
||||
else
|
||||
echo -e " ${GREEN}✅ All prerequisites met! external-diagram-visual-generate is ready to use.${NC}"
|
||||
fi
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
exit 0
|
||||
else
|
||||
echo -e " ${RED}❌ $ERRORS required prerequisite(s) missing.${NC}"
|
||||
echo -e " ${RED} Please fix before using external-diagram-visual-generate.${NC}"
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user