{"id":95914,"plugin_id":"plugin_asdk_app_69fb51f9519081919c1f3e44ea9a5a05","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-14T00:15:18.760Z","digest":"c9b790f621667a246939c1bea8399cf2e27f666375c03ab3d4a87beb651d5aa5","against":null,"payload":{"description":"Use when creating, changing, testing, or publishing a Deepnote data app project, a web page in `_deepnote_static/index.html` backed by one notebook.","included_files":[{"relative_path":"scripts/app-dev.mjs","size_in_bytes":8054}],"name":"deepnote-data-apps","skill_md_contents":"---\nname: deepnote-data-apps\ndescription: Use when creating, changing, testing, or publishing a Deepnote data app project, a web page in `_deepnote_static/index.html` backed by one notebook.\n---\n\n# Deepnote Data Apps\n\nTool arguments and the capability boundary are defined in `deepnote-mcp`. Notebook edits follow `deepnote-notebooks`, runs follow `deepnote-runs`, and links follow `deepnote-links`.\n\nA data app project has two parts: the page, a responsive HTML page in `_deepnote_static/index.html` that can load its own CSS, JavaScript, and images from that folder, and one notebook that runs the SQL and Python behind it.\n\n## Creating An App\n\n1. Create the project with `create_project` and `projectType: \"data_app\"`. It starts with its notebook and a placeholder page, with sharing and viewer API access already on; do not change them. Never add a page to a project of another type or publish one with the Deepnote CLI's `deepnote publish`; those are the legacy static sites.\n2. Look for data in the project's integrations and files first, then build a small, polished first version. If nothing fits, use clearly labeled sample data and offer to connect real data, unless the user named specific data: then ask where it is.\n\n## The Notebook\n\n- Keep one short block that computes only the data the page needs and displays it as the notebook's only JSON output:\n\n  ```python\n  import json\n  from IPython.display import display\n  app_data = {'rows': json.loads(df.to_json(orient='records', date_format='iso'))}\n  display({'application/json': app_data}, raw=True)\n  ```\n\n- Queries, heavy computation, credentials, and authenticated calls stay in the notebook. The page only filters, sorts, and charts.\n- The app's controls are the notebook's input blocks. Reuse them by name and add only the missing ones.\n- For AI-written text, such as a summary of the data, keep an agent block as the last block and ask for that text in its prompt. The page reads it as `agentBlockSummary`.\n- The page shows each viewer's own newest successful detached run, or, in a public app without private outputs, the editors' newest one until the viewer runs it, so running blocks in the editor changes nothing. After changing the notebook, start a run with `create_run` and `detachedRunStorageMode: \"readonly\"`, wait until `get_run` with `snapshotDelivery: \"blocks\"` reports success, and check the JSON output's keys, types, and first rows before wiring the page to it. Changes to the page alone need no new run.\n\n## The Page\n\n- `index.html` can load other files from `_deepnote_static/` by relative path, such as `styles.css`, `app.js`, or `logo.svg`. Keep the app client script and the Tailwind setup below in `index.html`, and move the rest into files of their own when that keeps the page easier to change.\n- Keep a local copy of `_deepnote_static/` in a folder of its own. Read each file the page loads or you will change with `read_file` once, unless you wrote it in this conversation; `get_project` lists them. Images that `read_file` cannot read show as broken in the local preview. Edit the files there, and once the page works in the local preview in Testing, push each new or changed file with `write_file` at its path under `_deepnote_static/` and `overwrite: true`. Where you cannot run local commands, write the files with `write_file` directly. When the app existed before this conversation, ask the user before the first push whether to update it in Deepnote, with the preview URL when there is one: pushing overwrites the app for good, and viewers of a published app see the change at once. Once they agree, push later changes they ask for in this conversation without asking again.\n- Start the `<head>` of `index.html` with `<script src=\"https://deepnote.com/static/app-client/v1.js\"></script>`, before any other script, and load CDN scripts with `crossorigin=\"anonymous\"`. The script exposes `Deepnote.connect()`, not React components or `DeepnoteApp`.\n- Style the page with Tailwind CSS 4.3.3. After the app client script, add the Tailwind browser build, Inter, and the default theme below, then use its colors in classes (`bg-surface`, `text-muted`, `border-border`, `bg-accent`, `text-positive`, ...). Its dark values apply on their own, so don't add `dark:` variants for theme colors. Chart code reads series colors with `getComputedStyle(document.documentElement).getPropertyValue('--color-chart-1')`.\n\n  ```html\n  <script src=\"https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.3.3\" crossorigin=\"anonymous\"></script>\n  <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap\">\n  <style type=\"text/tailwindcss\">\n    @theme static {\n      --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;\n      --color-surface: #ffffff; --color-surface-subtle: #f8fafc; --color-surface-muted: #edf2f7;\n      --color-fg: #334052; --color-muted: #606f85; --color-subtle: #8e9db4;\n      --color-border: #dde4ee; --color-border-strong: #c2cddc;\n      --color-accent: #146efe; --color-accent-hover: #0a56d0;\n      --color-positive: #059669; --color-attention: #aa5413; --color-critical: #e11d48;\n      --color-chart-1: #2266d3; --color-chart-2: #cc8bff; --color-chart-3: #0e9384; --color-chart-4: #8dca4c; --color-chart-5: #f9732c;\n      --color-chart-6: #c8338a; --color-chart-7: #eec026; --color-chart-8: #61646c; --color-chart-9: #4e2b89; --color-chart-10: #6e7ba4;\n    }\n    @media (prefers-color-scheme: dark) {\n      :root {\n        --color-surface: #141c2f; --color-surface-subtle: #1a273d; --color-surface-muted: #233149;\n        --color-fg: #c2cddc; --color-muted: #8e9db4; --color-subtle: #606f85;\n        --color-border: #334052; --color-border-strong: #46566d;\n        --color-accent: #498ffe; --color-accent-hover: #79acfe;\n        --color-positive: #10b981; --color-attention: #e69a1a; --color-critical: #f43f5e;\n      }\n    }\n    body { @apply bg-surface text-fg text-sm antialiased; }\n  </style>\n  ```\n\n- By default, make it calm and compact like Deepnote without copying Deepnote's UI: neutral surfaces with one blue accent, 1px borders, `rounded-lg` controls and `rounded-xl` cards, sentence case, solid backgrounds without gradients, no emoji or decorative icons, shadows only on floating elements, and at most one primary button per view. When the user asks for another look or their brand, change the theme and classes freely.\n- Connect with `const notebook = Deepnote.connect().notebook('<notebook ID>')`, using the notebook ID from `get_project`.\n  - On load, render `const {appData, agentBlockSummary, runCreatedAt} = await notebook.appData()` and show `runCreatedAt` as the time of the last update. In a public app without private outputs, a viewer with no run of their own gets the latest results of the app's editors. It throws when the viewer has no run yet, their results expired, or the run has no JSON output: show the message in an empty state with a button that runs the notebook with `{}`.\n  - `const {run} = await notebook.run(values, {onProgress})` runs the whole notebook for this viewer. When `run.status === 'success'`, render `await notebook.appData()` again. Run it on submission, or with `{}` from a refresh button when the app has no inputs. Public visitors with **View** access can't run the app, so the call rejects: show its message.\n  - Build the form from `await notebook.inputs()`, which returns each input's label, value, min, max, step, and options, so input changes in the notebook reach the app. Never overwrite input variables with hardcoded values. Values are keyed by input name and are strings (sliders too), booleans, or string arrays.\n- Show loading, empty, and error states, prevent duplicate submissions, and handle rejected calls, missing results, and `run.error`. When a failed run has no error text, show its status and point to run history.\n- Lay out dashboards as a title with one line of context, filters, a row of key numbers, one to three main charts, then a detail table. Format numbers and dates for reading, and label units.\n- To show another app's data, connect to that app's notebook instead of copying its queries. Find its ID with `search`, check its JSON output with a read-only run, and do not change that notebook. Its keys can change, so show an error state when they are missing.\n- Never put API keys, tokens, `.env` contents, or other secrets in the page or its files.\n\n## Testing\n\nTest a changed-input submission with `create_run`, its `inputs`, and `detachedRunStorageMode: \"readonly\"`, then read it with `get_run` and `snapshotDelivery: \"blocks\"`. When it fails, inspect its status and output and fix the cause; when it is still pending after several checks, point to run history without claiming the flow works. Finish with a run using `{}` and check that it succeeds, since in a public app the latest editor run is what visitors see. Delete scratch blocks when done.\n\nPreview the page locally before pushing it, against the same API and data it gets in Deepnote:\n\n1. Mint a viewer token with `create_data_app_token` for the project. Pass it only on the command line; never write it into files or answers.\n2. Run `node scripts/app-dev.mjs <folder with index.html> --token <token> --api-origin <apiOrigin>` in the background, with the script from this skill's directory. Have the same background command kill it after 15 minutes, for example after `sleep 900`, so previews do not pile up; the token expires then anyway. It needs Node 18 or later. It serves the page embedded the way Deepnote does, prints the preview URL, and logs files the page asks for that do not exist.\n3. With a browser tool, open the preview URL. The bar above the page says whether the app connected to Deepnote and lists its errors. Look at the page and try the inputs; runs started there are real runs. Fix the files and reload until the bar shows no errors. When it stops, mint a new token and start it again.\n4. Without a browser tool, give the user the preview URL, ask them to open it, and say that you did not check the page yourself.\n5. Push the new and changed files, after asking the user first when the app existed before this conversation, and leave the preview running so the user can open it until it is killed after 15 minutes. Stop it sooner when the user asks, or before starting another preview on the same port. When the user still wants it after it stops, mint a new token and start it again.\n\nA client that cannot run local commands, such as ChatGPT or claude.ai, cannot load the page: say the page itself was not checked and ask the user to open it. Do not install browser tools in the notebook to check it.\n\n## Publishing\n\nPublished and public are different settings. Published lets people with access to the project open the app; public lets anyone with its link open it, without a Deepnote account. A new data app is unpublished, so only the project's editors can open it. Publish it only when the user asks, with `update_project` and `dataApp.published: true`; `false` makes it editor-only again and ends public access for good: publishing it again doesn't bring it back. MCP and the API can't make an app public or see whether it is: when the user asks for that, tell them a project admin can turn on **Anyone with a link to this app** in the Share menu in Deepnote, with View to show results or Execute to also let visitors run it. People are invited from the Share menu too, not through MCP.\n\n## Reporting\n\nReport the project and whether the app is published, and describe the work as changes to the app. MCP can't tell whether the app is public, so don't say either way. End with the links as two options, labeled with where each one runs:\n\n1. Deepnote (cloud): the app URL from `dataApp.url` in `get_project`. Never construct it. When the changes were not pushed, say the app in Deepnote is unchanged instead.\n2. Local preview (this computer only): the preview URL and the time it stops, while a preview is running.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}