← TableauCONTENT HISTORY

Update to Tableau

Snapshot Oct 30, 2026 · 00:05 UTC · version 1.1.0

Collection source: downloaded plugin package.

WHAT CHANGED

First saved snapshot

No earlier snapshot is available to establish a change.

Save Tableau and check future changes in Following.

Up to 3 plugins free · no card required.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Build and publish a Tableau data app, a custom viz-extension web app that queries a published datasource live, or a data file embedded in the workbook. Scaffolds the app with the scaffold-data-app MCP tool, writes its query and visualization from the user's criteria or vibe, then packages it as a .twbx and publishes it. Requires scaffold-data-app, which may be unavailable depending on the user's site role, site settings, or Tableau Server version; don't invoke this skill unless it is available. Use to create, build, vibe-code, or publish a data app. Not for native workbooks or dashboards built from marks, Show Me, or the chart catalog (tableau-workbook-authoring), or for opening existing content, including published data apps (tableau-content-viewer).",
  "included_files": [
    {
      "relative_path": "references/build-data-app.md",
      "size_in_bytes": 8084
    },
    {
      "relative_path": "references/design-data-app.md",
      "size_in_bytes": 11080
    },
    {
      "relative_path": "references/external-apis.md",
      "size_in_bytes": 3874
    },
    {
      "relative_path": "scripts/apply_plan.py",
      "size_in_bytes": 4746
    },
    {
      "relative_path": "scripts/declare_origins.py",
      "size_in_bytes": 10150
    },
    {
      "relative_path": "scripts/file_formats.py",
      "size_in_bytes": 1565
    },
    {
      "relative_path": "scripts/package_twbx.py",
      "size_in_bytes": 11237
    },
    {
      "relative_path": "scripts/summarize_publish_access.py",
      "size_in_bytes": 6132
    },
    {
      "relative_path": "scripts/wire_datasource.py",
      "size_in_bytes": 20626
    }
  ],
  "name": "tableau-data-app-authoring",
  "skill_md_contents": "---\nname: tableau-data-app-authoring\ndescription: Build and publish a Tableau data app, a custom viz-extension web app that queries a published datasource live, or a data file embedded in the workbook. Scaffolds the app with the scaffold-data-app MCP tool, writes its query and visualization from the user's criteria or vibe, then packages it as a .twbx and publishes it. Requires scaffold-data-app, which may be unavailable depending on the user's site role, site settings, or Tableau Server version; don't invoke this skill unless it is available. Use to create, build, vibe-code, or publish a data app. Not for native workbooks or dashboards built from marks, Show Me, or the chart catalog (tableau-workbook-authoring), or for opening existing content, including published data apps (tableau-content-viewer).\n---\n\n# Tableau Data App Authoring\n\nBuilds a Tableau data app from nothing to published. Walk the stages top to\nbottom — every request follows all five, in order.\n\n```\nScaffold + finalize  →  Wire datasource*  →  Author (you)  →  Package  →  Publish\n```\n\n\\* Wiring is a prerequisite to a *working* app: the name-only `scaffold-data-app`\nships an empty `<datasources/>`, so a scaffolded app reaches no datasource at\nruntime and renders \"no data source found.\" Wire a datasource into the\n`.twb` before authoring against it — see Wire a datasource in below. (Publishing the\nstarter as-is to prove packaging works does not need it.)\n\n**Already have a built app locally?** Skip straight to whichever applies:\n**Package into a .twbx** (unpacked `<App Name>/` folder) or **Publish**\n(already a `.twbx`) — but first confirm the `.twb`'s `<datasources>` is\nactually wired (not empty) and the package layout is correct, since none of\nthis skill's tooling has run against it.\n\n**Modifying an existing app?** Read every file in its `Resources/.agents/`\nfirst (unzip a `.twbx` to reach it). Those docs hold the app's spec, design,\nand past decisions; if `README.md` is the only file, none have been written yet.\n\n**Division of labor: you write ALL the code, every stage, always — including\n`app.js`.** The human \"vibe codes\" by describing what they want (criteria,\ntheme, vibe, target insights) — they do not write `app.js` themselves. Read\nthe two bundled guides before authoring: [Design a data app](references/design-data-app.md)\n(what to build) and [Build a data app](references/build-data-app.md) (how, using this\nskill's local tools). Only skip authoring `app.js` if the human explicitly says\nthey want to write it themselves for this app (rare) — see the exception at\nthe end of Author `app.js` below.\n\n**External APIs can come up at any point.** If the user asks for a\nthird-party API, remote images, or any other outside host, whether at the\nstart or after the app is already published, run Add external origins\nbelow, then re-package and republish. Read Security best practices first.\n\nThere's no separate validation stage — `publish-workbook` is where errors\nsurface. Get package *layout* right (see Package into a .twbx) or the\nworkbook won't open at all.\n\n## Preflight requirements\n\nComplete this preflight before designing, scaffolding, coding, or creating\napplication files.\n\n### Publishing access\n\nThis workflow requires the connected Tableau user to have:\n\n- a Creator or Explorer (can publish) site role; and\n- permission to publish to the target project.\n\nDo not treat a generic Explorer license as sufficient: the user must have the\nExplorer (can publish) site role or equivalent publishing capability.\n\nUse Tableau metadata or permission information already available in the task\nwhen it conclusively establishes publishing access. If the user's site role or\npublishing access cannot be determined through the available Tableau tools,\nask the user to confirm that they have Creator or Explorer (can publish) and\npermission to publish to the target project.\n\nDo not begin substantive data-app work while this prerequisite remains\nunconfirmed.\n\n### Required Tableau MCP capabilities\n\nBefore beginning substantive work, verify that all of the following are\ncallable:\n\n- `scaffold-data-app`;\n- `publish-workbook`;\n- `request-workbook-upload`\n\nInteractive rendering is not required. It's the recommended way to verify the\npublished app with the user, but never block on it: when it isn't available,\nopen the published app in an embedded browser if you have one available or\nencourage the user to open and verify it in their own browser instead.\n\nWhen the app will use a published datasource, also verify that the tools needed\nto resolve that datasource and inspect its metadata are callable.\n\nA capability is not unavailable merely because it has not yet been loaded.\nPerform one focused availability lookup for a missing capability when\nnecessary.\n\nIf `scaffold-data-app` is unavailable, stop and report the missing capability.\nDo not hand-build or substitute for its scaffold.\n\nIf any other required capability is unavailable, stop before scaffolding or\nauthoring and tell the user exactly which capability is missing and why it\nprevents completion. Do not create an unpublished data app while presenting\nit as completion.\n\n## Scaffold and finalize the workspace\n\nCall the `scaffold-data-app` MCP tool with the app name:\n\n> scaffold-data-app({ datappName: \"Sales Demo\" })\n\nThe preflight must establish that `scaffold-data-app` is callable. If the tool\nis present but the scaffold call fails, report the error and stop. Do not\nhand-build the template or substitute another scaffold.\n\nThe result carries an un-substituted template **zip** plus a `postUnzip` plan.\nThe zip arrives one of three ways — branch on whichever field is present;\npast the fetch step the steps are identical:\n\n- `downloadUrl` — a short-lived blob-storage link (newer servers).\n- `s3URL` — the same thing on older servers.\n- `filePath` — the zip already on local disk (no blob storage); skip the\n  download.\n\nA `downloadUrl`/`s3URL` link expires about 60 seconds after the call, so\ndownload it **immediately**, before doing anything else. If the download fails\nwith an expired-link error, call `scaffold-data-app` again for a fresh link.\n\nThe result also carries:\n\n- `wiring` (newer servers) — `server`, `site`, `channel`, and `port` for the\n  Tableau site this session is signed in to. Keep it: Wire a datasource in\n  copies these into every datasource descriptor. Older servers omit it.\n- `allowedOrigins: string[]` — the external origins the site lets data apps\n  reach. May be empty, in which case the app can't fetch any external origin.\n- `requestedOrigins` — which file declares the origins the app requests\n  (`file`) and how to write them (`instructions`). Every origin you put there\n  must also appear in `allowedOrigins`; see External origins below.\n\nApply the plan deterministically with the bundled script — applying it freehand\nleaves half-replaced `TODO-MANIFEST-ID` / `TODO App Name` / `TODO Sheet Name` tokens or interleaves\nedits and renames in the wrong order.\n\nFinalize the plan (fetch, save, apply). Fetch first — the link expires. Scripts\nreferenced below live under `scripts/`, relative to this skill directory\n(`$SKILL_DIR`):\n\n1. Fetch the template — with `downloadUrl` (or `s3URL` on older servers),\n   download right away, then unzip:\n\n   ```bash\n   SKILL_DIR=\"<absolute path to this skill directory>\"\n   WORK=\"$(mktemp -d -t dataapp)\"\n\n   curl -fsSL \"<downloadUrl or s3URL>\" -o \"$WORK/template.zip\"\n   mkdir -p \"$WORK/unzipped\"\n   unzip -q \"$WORK/template.zip\" -d \"$WORK/unzipped\"\n   ```\n\n   With `filePath`, skip the download and unzip only:\n\n   ```bash\n   SKILL_DIR=\"<absolute path to this skill directory>\"\n   WORK=\"$(mktemp -d -t dataapp)\"\n\n   mkdir -p \"$WORK/unzipped\"\n   unzip -q \"<filePath>\" -d \"$WORK/unzipped\"\n   ```\n\n2. Save the plan:\n\n   ```bash\n   # Save the postUnzip object verbatim (do NOT reformat — find tokens must match byte-for-byte)\n   cat > \"$WORK/plan.json\" <<'PLAN_JSON'\n   { …paste the result's postUnzip object here… }\n   PLAN_JSON\n   ```\n\n3. Apply the plan (edits first, then renames; verifies no placeholders\n   survive):\n\n   ```bash\n   python3 \"$SKILL_DIR/scripts/apply_plan.py\" \"$WORK/unzipped\" \"$WORK/plan.json\"\n   ```\n\n   `scripts/apply_plan.py` prints the finalized workspace root on stdout. See\n   its header comment for the full contract; it hard-fails if a `find` token is\n   missing (the zip is stale / out of sync with the plan) rather than emitting a\n   broken workspace.\n\nAt the end of this stage you have a finalized workspace directory:\n```\n<App Name>/\n  <App Name>.twb\n  Packages/com.tableau.mcp.<slug>/\n    manifest.json           ← requestedOrigins lives here\n    extensions/data-app.trex\n    content/index.html\n    content/src/app.js      ← the authoring surface\n    content/src/styles.css\n    content/src/tableau.extensions.1.latest.min.js\n  Data/.gitkeep             ← placeholder; embedded datasource files go here\n  Resources/.agents/README.md   ← which agent docs travel with the workbook\n```\n\n**Sheet name:** the worksheet is named after the app's display name. It's a\nplain string with no hash/join-key involved, so it's freely hand-editable at\nany point before packaging — edit all 3 matching locations in the `.twb` to\nthe same new value: the `<worksheet name='...'>` tag, the `<window class='worksheet'\nname='...'>` tag, and `<referenced-view ... viewId='...' />`.\n\n### External origins\n\nThe extension sandbox blocks every external origin the package doesn't\ndeclare. To let the app reach one (an API, an image host), run Add external\norigins below: `declare_origins.py` writes it to the file named by the scaffold\nresult's `requestedOrigins.file` (the package's `manifest.json`), in the format\nits `requestedOrigins.instructions` gives, and fails unless the origin is in the\nresult's `allowedOrigins`. If `allowedOrigins` is empty, the app can't fetch any\nexternal origin: tell the user the site admin must allow the origin first, or\ndesign the app without it. Don't request origins the app doesn't use.\n\n## Wire a datasource in\n\nThe scaffolded `.twb` ships an **empty `<datasources/>`** (both at the workbook\nroot and inside the worksheet `<view>`). At runtime the app calls\n`getAllDataSourcesAsync()` and finds nothing → it renders **\"no data source found\nin the workbook.\"** To query live data the workbook must have a real datasource\nwired in — this stage is a prerequisite for a working app.\n\nDo this once the user has told you what to connect to; it is skippable if the\nuser only wants to publish the starter to prove packaging. Only add, remove, or\nswap datasources the user asked for; if you think a different or extra\ndatasource would help, ask first.\n\nThe app queries either kind of datasource, in any mix:\n\n- **Published:** a datasource that already exists on the server (a `sqlproxy`\n  connection, resolved live by VDS). Its identity can come straight from the\n  user, or be reused from a datasource already wired into some other existing\n  workbook (see Reuse an existing workbook's datasource below).\n- **Embedded file:** a data file the user supplies, copied into\n  the workspace's `Data/` folder and packed into the `.twbx` (see Embedded\n  file datasource below).\n\nDo **not** hand-edit the XML — the anchors must be filled atomically with a\nmatching join key across multiple coordinated locations, or the app silently\nreaches no data. Use the bundled wiring script.\n\n**Published datasource:** the wiring spans four coordinated locations (root\ndatasource `name`, root `relation connection`, view `datasource name`,\n`datasource-dependencies datasource`) that must all carry the identical\n`sqlproxy.<hash>` join key. Use `scripts/wire_datasource.py`, which does all\nfour edits atomically and hard-fails rather than emitting a half-wired workbook.\n\n**More than one datasource:** wire them all in **one run** — the script fills\nthe empty anchors once, so it can't add another datasource to an already-wired\n`.twb` (re-scaffold instead). It lists every datasource on the app's sheet,\nwhich is required: the server only connects datasources listed there, so a\ndatasource placed only on some other sheet fails at query time. Don't move\ndatasources onto separate sheets afterward.\n\n1. **Get the datasource's identity** with `list-datasources` (LUID, name/caption,\n   contentUrl) and `get-datasource-metadata({ datasourceLuid })`\n   (field names + datatypes). The published DS **contentUrl** is the\n   `repositoryId`. (To reuse an existing workbook's datasource instead, see\n   Reuse an existing workbook's datasource below — it gets you here, then\n   continues at step 2.)\n\n   **Server, site, channel, and port come from the scaffold result's\n   `wiring`.** Copy `wiring.server`, `wiring.site`, `wiring.channel`, and\n   `wiring.port` verbatim into every descriptor. Don't guess them, parse them\n   out of a URL, or ask the user. `wiring.site` is `\"\"` for the Default site —\n   keep it empty, don't substitute a name.\n\n   **Older servers return no `wiring`.** Then use the server host and site from\n   `list-datasources` as before, with `\"channel\": \"https\", \"port\": 443`. If they\n   aren't there either, ask the user for the server host and site. Never invent\n   them.\n2. **Write a descriptor** listing *only the fields the app will query* (name +\n   datatype + role). One datasource:\n\n   ```bash\n   cat > \"$WORK/descriptor.json\" <<'DS_JSON'\n   {\n     \"caption\": \"<Friendly Name>\",\n     \"repositoryId\": \"<published DS contentUrl>\",\n     \"site\": \"<wiring.site>\",\n     \"server\": \"<wiring.server>\",\n     \"channel\": \"<wiring.channel>\", \"port\": <wiring.port>,\n     \"fields\": [\n       { \"name\": \"Profit\", \"datatype\": \"real\",   \"role\": \"measure\"   },\n       { \"name\": \"Region\", \"datatype\": \"string\", \"role\": \"dimension\" }\n     ]\n   }\n   DS_JSON\n   ```\n\n   Several datasources (any number) go in a `datasources` array, **primary\n   first**, with nothing else at the top level; each entry has the same shape\n   as the single-datasource object:\n\n   ```json\n   { \"datasources\": [ { \"caption\": \"Orders\", \"...\": \"...\" },\n                      { \"caption\": \"People\", \"...\": \"...\" } ] }\n   ```\n\n   The primary is the sheet's main datasource. The app reaches every one by\n   caption via `getAllDataSourcesAsync()` — look each up by `name`, never by\n   position (the list isn't returned in wiring order).\n\n   Captions must be distinct. A caption is only this workbook's display name;\n   the server matches the published datasource by `repositoryId`, so if two\n   published datasources share a name, give them different captions here\n   (e.g. \"Sales Orders\" / \"Finance Orders\") rather than renaming them on the\n   server.\n\n3. **Run the wiring script** (it prints the wired `.twb` path, and generates a\n   consistent `sqlproxy.<hash>` unless you supply `connectionName`):\n\n   ```bash\n   python3 \"$SKILL_DIR/scripts/wire_datasource.py\" \"<App Name>/<App Name>.twb\" \"$WORK/descriptor.json\"\n   ```\n\nThe script hard-fails if the `.twb` is already wired (re-scaffold, keep your `app.js`),\nif an anchor is missing (template drifted),\nif any empty `<datasources />` survives, if a join key is missing from where the server\nreads it (including the host sheet's view listing every datasource), or\nif a `repositoryId`, `caption`, or `connectionName` repeats across datasources.\nTrust that failure over patching the XML by hand. `datatype` maps to the column\n`type` (`real`/`integer` → quantitative, `date`/`datetime` → ordinal, else\nnominal); `role: \"measure\"` gets a `Sum` aggregation, `dimension` a `Count`.\n\n**Embedded file datasource:** use this when the user hands you a data file\ninstead of naming a published datasource. The same script wires it (and rejects\nfile types it can't); the descriptor just has `\"type\": \"file\"`.\n\n1. **Copy the file into the workspace** under `Data/`, conventionally\n   `Data/Datasources/<file>`. The script fails if the file isn't there, or if\n   its path is outside `Data/`.\n2. **Write a descriptor.** `file` is the path relative to the `.twb`. `table`\n   picks the table in a file that holds several (an Excel sheet); the script\n   says when it's needed. Field names must match the column names Tableau reads\n   from the file, usually its header row. No server, site, or `repositoryId`:\n\n   ```bash\n   cat > \"$WORK/descriptor.json\" <<'DS_JSON'\n   {\n     \"type\": \"file\",\n     \"caption\": \"Sample - Superstore\",\n     \"file\": \"Data/Datasources/Sample - Superstore.xls\",\n     \"table\": \"Orders\",\n     \"fields\": [\n       { \"name\": \"Sales\",  \"datatype\": \"real\",   \"role\": \"measure\"   },\n       { \"name\": \"Region\", \"datatype\": \"string\", \"role\": \"dimension\" }\n     ]\n   }\n   DS_JSON\n   ```\n\n   To mix it with published datasources, put every entry in one\n   `datasources` array (primary first) as above.\n3. **Run the wiring script** the same way as for a published datasource.\n\n**Reuse an existing workbook's datasource:** point the Published path above\nat a datasource already wired into some *other* already-published workbook,\ninstead of a fresh published DS. Only applies when that datasource actually\nresolves as published — resolve it, then continue in Published datasource\nabove, picking up at its step 2 (you already have what its own step 1 would\nhave produced).\n\n1. Find the workbook (`list-workbooks`/`search-content`; ask the user which\n   if ambiguous), then call `get-workbook({ workbookId })` and read\n   `upstreamDatasources[]` — ask which entry if it lists more than one.\n2. Check the matched entry's `datasourceType`:\n   - **`\"embedded\"`**: its data lives inside that workbook, so it can't be\n     reused by reference. Ask the user for either a published datasource or\n     the source data file, and wire the file as an Embedded file\n     datasource above.\n   - **`\"published\"`** — still run the rest of Published datasource step 1\n     (`list-datasources` filtered by this LUID, for `contentUrl` — and\n     site/server only when the scaffold result had no `wiring`;\n     `get-workbook` doesn't carry those — plus\n     `get-datasource-metadata({ datasourceLuid })` for fields, whose\n     top-level `datasourceType` should also read `\"published\"` when present),\n     then continue at step 2. Filter candidate fields to `columnClass: \"COLUMN\"`\n     (drop `CALCULATION`/`TABLE_CALCULATION`/`BIN`/`GROUP` — those are\n     Tableau-computed groupings with no matching raw column). This metadata\n     response often includes an explicit `role` (`\"DIMENSION\"`/`\"MEASURE\"`)\n     per field — when present, lowercase and use it directly instead of\n     inferring from `defaultAggregation`; fall back to that heuristic when\n     `role` is absent.\n\n## Author `app.js`\n\n**Always author `app.js` yourself — this is the fixed default, not a\nfallback.** The human vibe-codes: they describe what they want (criteria,\ntheme, target insights, audience) and you turn that into the actual\n`ds.queryAsync(...)` → chart implementation.\n\nRead [Design a data app](references/design-data-app.md) (what to build) and\n[Build a data app](references/build-data-app.md) (how — introspect the\ndatasource, design the chart, edit `content/src/app.js`, follow the sandbox\nrules in its `AUTHOR YOUR APP HERE` comment) and follow that workflow; it is\nnot restated here. There is no local preview — the visual review happens live\nin Tableau, after publish.\n\n**Record context in `Resources/.agents/`** when it would help whoever edits the\napp next: `spec.md` (what it does, for whom), `design.md` (datasources, queries,\nchart choices), `memories.md` (decisions, gotchas, the user's preferences).\nUpdate them when you change the app. Follow the folder's `README.md`: no\nsecrets, tokens, or personal data (anyone who can download the workbook can\nread them), and never put these docs under `Packages/<id>/content/`.\n\n**Exception — the human wants to write `app.js` themselves:** only skip\nauthoring if the human explicitly says they want to write `app.js` themselves\nfor this app — an override of the default, not the norm. Stop and hand off:\ntell them the workspace path\n(`Packages/com.tableau.mcp.<slug>/content/src/app.js`) and point them at\n[Design a data app](references/design-data-app.md) and\n[Build a data app](references/build-data-app.md) as their own reference.\nResume at Package into a .twbx once they say it's authored.\n\n## Add external origins (any time)\n\nRun this whenever the app needs to reach a host outside its package: the user\nasks for an external API (at the start of the session or after the app is\npublished), or `app.js` calls one. The rules behind these steps (two-part\nallowlisting, origin format, CORS) live in\n[Calling external APIs](references/external-apis.md).\n\n1. **Get a fresh site allow-list.** Call `scaffold-data-app` again with the\n   app's name and use only its `allowedOrigins`; ignore the zip and plan. The\n   list from the start of the session may be stale. Save it:\n\n   ```bash\n   cat > \"$WORK/allowed.json\" <<'ALLOWED_JSON'\n   [ …paste the allowedOrigins array here… ]\n   ALLOWED_JSON\n   ```\n\n2. **Check every origin you need is on it.** If one isn't, stop and tell the\n   user: a site admin has to add it under Settings > Extensions > Extension\n   Package Allowed Origins. Don't work around it.\n\n3. **Declare the origins in the package:**\n\n   ```bash\n   python3 \"$SKILL_DIR/scripts/declare_origins.py\" \"<App Name>\" --allowed \"$WORK/allowed.json\" \\\n     --add https://api.example.com https://auth.example.com\n   ```\n\n   It writes `requestedOrigins` into `Packages/<package id>/manifest.json`,\n   merges with origins already declared, and fails if an origin isn't on the\n   allow-list or isn't a plain `https` origin. Use `--list` to see what's\n   declared and `--remove` to drop an origin the app no longer uses.\n\n4. **Re-package and republish** (Package into a .twbx, then Publish with\n   `overwrite: true` if the app is already published). The new policy takes\n   effect only after republishing.\n\n## Package into a .twbx\n\nA `.twbx` is a zip of the workspace **contents** with the `.twb` and `Packages/`\nat the **archive root** — never nested inside the `<App Name>/` folder. Nesting\nis the #1 cause of `NativeException: An unexpected error occurred opening the\npackaged workbook` and `PackageValidationException: Package directory contains no\nextension .trex files under extensions/`.\n\nPackage with `scripts/package_twbx.py`. It hard-fails with a `✗` message if\nthe workspace isn't packageable; fix what it reports rather than zipping by\nhand:\n\n```bash\npython3 \"$SKILL_DIR/scripts/package_twbx.py\" \"<App Name>\"   # the finalized workspace dir\n```\n\nIt also packs `Data/` and `Resources/.agents/` at the archive root. Under\n`Data/`, only the files the `.twb` references are packed. Hidden files are\nnever packed.\n\nIt writes `<App Name>.twbx` next to the workspace dir (pass a second arg to\noverride), overwriting any existing file, and prints the path for Publish.\nIt also prints `⚠` warnings for problems that only show up at runtime:\nundeclared external origins, package-relative `fetch()`, and secret-looking\nkeys. They don't stop packaging, but fix them or tell the user\nabout them before publishing.\n\n> The template these workspaces come from is already publish-valid (`.twb`\n> extension wired into a pane, `.trex` with `author email`, `<resources>` block,\n> `<icon>`, `min-api-version`). Packaging is the only structural step you own.\n\n## Publish\n\nUses the MCP publish tools (not available to Slack clients).\n\n1. **Pick the destination.** Omit `projectId` to publish to the caller's\n   Personal Space. Include it only if the user names a project, or if the\n   tool requires `projectId` or errors that Personal Space is unavailable or\n   read-only — then ask the user for a project from\n   > list-projects({ capability: \"Write\" })\n   and retry with its `projectId`. If the error says the workbook landed in a\n   project instead of Personal Space, tell the user where it went.\n\n2. **Publish.** Pass the `.twbx` path directly:\n   > publish-workbook({ workbookFilePath: \"<abs path to .twbx>\", name: \"<App Name>\", overwrite: false })\n\n   If the tool errors that `workbookFilePath` isn't supported (staged uploads\n   configured), stage the bytes and publish by id:\n   > request-workbook-upload({ fileName: \"<App Name>.twbx\" })   → { workbookUploadId, uploadUrl, requiredHeaders, maxSizeBytes, expiresAt }\n\n   ```bash\n   # send every header in requiredHeaders\n   curl -fsS -X PUT -H 'Content-Type: <from requiredHeaders>' --data-binary @\"<App Name>.twbx\" \"<uploadUrl>\"\n   ```\n\n   > publish-workbook({ workbookUploadId: \"<id>\", name: \"<App Name>\", overwrite: false })\n\n   Add `projectId` to either call when publishing to a project.\n\n3. **Report the outcome.** On `status: \"published\"`, save the result JSON\n   verbatim to `$WORK/publish.json` and run:\n\n   ```bash\n   cat > \"$WORK/publish.json\" <<'PUBLISH_JSON'\n   { …paste the publish-workbook result here… }\n   PUBLISH_JSON\n\n   python3 \"$SKILL_DIR/scripts/summarize_publish_access.py\" \"$WORK/publish.json\" [--published-datasource [\"<name>\"]]...\n   ```\n\n   Pass `--published-datasource` when the app is wired to a published data\n   source (the normal case after `wire_datasource.py`, or when reusing one),\n   with its published name from `list-datasources` as `<name>` (not the\n   descriptor's caption, which can differ). Repeat it once per wired data\n   source. Omit it for embedded file datasources and when no data source was\n   wired. Do no extra permission lookups. Relay its stdout to the user\n   verbatim.\n\n   If `publish-workbook` returns `status: \"invalid\"` (or an error), surface the\n   `errors`/`warnings` verbatim; common causes trace back to `.twb`/`.trex`\n   wiring, not packaging. Set `overwrite: true` only if the user wants to replace\n   an existing workbook of the same name.\n\n4. **Promote (optional).** To move a published app into a shared project:\n   > move-workbook({ workbookId: \"<publish result data.id>\", projectId: \"<LUID>\" })   → { id, name, projectId }\n\n   If `move-workbook` isn't available, tell the user.\n\n## Limitations and gotchas\n\n### Multiple datasources\n\n`wire_datasource.py` wires any number of published datasources, with these\nconstraints:\n\n- **One run, all at once.** List every datasource in the descriptor's\n  `datasources` array, primary first. The script refuses an already-wired\n  `.twb`, so adding a datasource later means re-scaffolding, copying\n  `content/src/app.js` into the new workspace, and wiring the full set again.\n- **What gets wired.** Each datasource gets its own root `<datasource>` and its\n  own `sqlproxy.<hash>` join key (unique across the set), and all of them are\n  listed on the host sheet's `<view>` — the server only connects datasources\n  listed there. Only the primary gets `datasource-dependencies`; the others are\n  reached through `getAllDataSourcesAsync()`.\n- **Distinct identities.** `caption`, `repositoryId`, and `connectionName` must\n  each be unique across the set, or the script hard-fails. Captions matter\n  most: they are how `app.js` finds each datasource.\n- **Find by name in `app.js`, never by position.** `getAllDataSourcesAsync()`\n  doesn't return datasources in wiring order. The starter's `pickDataSource()`\n  takes `list[0]`, so a multi-datasource app must replace it with a lookup by\n  `ds.name` (the caption).\n- **No blending or joins.** Query each datasource separately with its own\n  `queryAsync()` and combine the rows in `app.js`. Don't add blend or\n  relationship XML.\n\n### External origins and package hosting\n\nRead [Calling external APIs](references/external-apis.md) before building\nanything that leaves the package: it covers what the sandbox blocks no matter\nwhat, allowlisting, CORS, and how to debug a blocked call. What the package\nhost serves is in [Build a data app](references/build-data-app.md), Sandbox and\nlifecycle rules. `package_twbx.py` warns about undeclared origins and\npackage-relative `fetch()`.\n\n## Security best practices\n\n- **Prefer network-isolated apps.** Build the app so it talks only to Tableau\n  through the Extensions API. Every external origin needs a site admin's\n  approval and gives data a path out of Tableau. Before adding one, ask whether\n  the feature needs it, and tell the user what data would leave Tableau.\n- **Keep secrets and credentials out of the package.** Anything in `content/`\n  (API keys, client secrets, refresh tokens) can be read by anyone who can\n  open or download the workbook. If the user still wants one embedded (e.g. a\n  personal demo), tell them that first, keep the workbook out of shared\n  projects, and keep the secret out of git. Expect the agent's safety checks\n  to ask for explicit approval before publishing or downloading a workbook\n  that contains credentials. `package_twbx.py` warns about secret-looking keys.\n- **Avoid hardcoding data where possible.** Query the datasource live with\n  `queryAsync()` instead of copying rows into `app.js` or a bundled file. If\n  data must be hardcoded, tell the user the implications first: it's a\n  snapshot that won't refresh, and Tableau's query-time protections, such as\n  row-level security policies and user filters, don't apply to it, so every\n  viewer sees all of it.\n\n## Non-negotiable limits\n\n- Don't zip the `.twbx` freehand. Use `scripts/package_twbx.py` — it keeps\n  `.twb`, `Packages/`, and any `Data/`/`Resources/.agents/` at the archive root, never\n  nested under `<App Name>/`.\n- Don't apply a postUnzip plan freehand. Use `scripts/apply_plan.py` — edits\n  before renames, renames deepest-first, verified; see its header comment for\n  the full contract.\n- Don't hand-edit the `<datasources/>` wiring. Use `scripts/wire_datasource.py` —\n  freehand edits mismatch the join key across its coordinated locations or\n  leave an empty `<datasources />` anchor, and the app silently reaches no data.\n- Don't hand-edit `manifest.json` to allow external origins. Use\n  `scripts/declare_origins.py` — Tableau ignores an array or an\n  `allowedOrigins` key without any error, and the app stays blocked.\n- Don't interpret `publish-workbook` permissions freehand. Use\n  `scripts/summarize_publish_access.py` and relay its stdout verbatim.\n- Don't assume the scaffold result's zip is already substituted, or skip\n  unzip. Whether it arrives as `downloadUrl`, `s3URL`, or `filePath`, it's the\n  same static, un-substituted template **zip** — unzip it and apply the plan\n  before authoring.\n- Don't guess a descriptor's `server`, `site`, `channel`, or `port`. Copy them\n  from the scaffold result's `wiring`; without `wiring`, use `list-datasources`\n  or ask the user.\n- Don't hand off `app.js` to the human unprompted. Authoring `app.js` yourself\n  is the fixed default — always write it from the human's stated\n  criteria/vibe. Only hand off when the human explicitly says they want to\n  write it themselves.\n"
}

SHA-256 of public snapshot: b95e7f5281663e73005e9a76c22cc26ec6723c54f06c1e4dd649a0b54546b221