developing-data-apps-locally
Skill này làm gì
Skill này hướng dẫn việc chỉnh sửa cục bộ một ứng dụng dữ liệu Lightdash được tạo hoặc tải về bằng CLI. Skill dành cho lập trình viên xây dựng ứng dụng dữ liệu tùy chỉnh trên Lightdash.
Khi nào nên dùng
- ✓Khi bạn muốn chỉnh sửa một ứng dụng dữ liệu Lightdash trên máy tính của mình.
- ✓Khi bạn cần build, xem trước hoặc tải lên một ứng dụng dữ liệu.
- ✓Khi bạn muốn kết nối một API bên ngoài với ứng dụng dữ liệu qua kết nối đã liên kết.
Liên kết skill
https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-data-apps-locally/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập ứng dụng dữ liệu Lightdash đã tải về của tôi trên máy, xem trước và tải lên khi nó hoạt động.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giải thích rằng mọi truy cập dữ liệu chỉ đi qua SDK truy vấn của Lightdash, còn các API bên ngoài dùng kết nối đã liên kết. Sau đó skill hướng dẫn các bước build, xem trước, tải lên và các kiểm tra hiển thị trong kết quả tải lên.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Developing Lightdash Data Apps Locally
You are editing a Lightdash data app that was created or downloaded with the Lightdash CLI.
The only way to reach data is the SDK
- All app data access goes through
@lightdash/query-sdk. Deployed apps use Lightdash's postMessage bridge;lightdash apps previewuses a loopback proxy restricted to the same SDK routes and project. Do not add directfetchor REST calls. - For the SDK surface (query builder,
useLightdash, filters, downloads), read thelightdash-data-appskill in this folder.
External HTTP APIs go through linked connections
- The one sanctioned path to a third-party API is
lightdash.externalFetch('<alias>', ...)against an external connection a project admin configured and linked to this app (see thelightdash-data-appskill). - The app's links are declared in this folder's
lightdash-app.ymlunderexternalConnections(- alias: stripe/connectionSlug: stripe-api). When the key is present, upload reconciles the app's links to match it exactly — so to link a connection that already exists in the project, add its{alias, connectionSlug}entry and upload. Do not remove entries casually: an entry removed from the list (or an empty list) unlinks on upload, and a manifest without the key leaves links unchanged. - Watch the upload output: a
connectionSlugthat doesn't exist in the target project is skipped with a warning (the app uploads, butexternalFetchon that alias fails at runtime). Linking requires either the admin-levelmanage:ExternalConnectionpermission or an admin-enabled connection plus permission to manage the target data app — if a link is skipped or forbidden, report it to the user instead of retrying. - If the app needs an API with no existing connection, stop and say so — do not vendor an HTTP client or try to reach it another way. An admin must create the connection first (in project settings, or as code:
lightdash download --include-external-connections, editlightdash/external-connections/<slug>.yml,lightdash uploadwith the secret inLIGHTDASH_EXTERNAL_CONNECTION_SECRET_<SLUG>); then it can be linked via the manifest as above.
Library boundaries — build with what's preinstalled
- The app builds against a fixed template dependency set — see
package.json(React, Recharts, d3 + d3-cloud/d3-sankey, Radix primitives, Tailwind, lucide-react, date-fns, html-to-image, jspdf, and more). Design within this set; it covers almost all data-app needs. - Adding new npm packages only works when the Lightdash organization has custom dependencies enabled — assume it does not. When disabled, upload rejects new dependency declarations. Do not attempt
pnpm addto find out; ask the user whether their organization has custom dependencies enabled before considering a new library. - Do not work around a missing library by vendoring its source into
src/, inlining minified code, or fetching code at runtime. If the template set genuinely cannot express what's asked, say so and let the user decide.
The edit → build → upload loop
Run these commands from this folder under apps/<slug>/. The upload path ../.. selects the Lightdash content root.
- Edit files under
src/only. - Run
lightdash apps validateto check the source, manifest, dependencies, external-connection aliases, and semantic references against the downloaded context. Uselightdash apps validate --buildto add the Cloud-parity Vite production build; use--liveto check against fresh project explores or--format jsonin CI. A green run reports any call sites it could not fully analyze instead of silently claiming complete coverage. lightdash upload --apps <slug> --path ../..(theslugfrom this folder'slightdash-app.yml) — the server rebuilds and serves the app. The server rebuild remains the final result that ships.
Cloud-parity local builds
lightdash apps validate --buildassemblessrc/in an isolated copy of the CLI's trusted template and invokes barevite build— it deliberately does not typecheck because the Cloud build does not typecheck.- Apps made with
lightdash apps createalready have the standard template dependencies installed. Afterlightdash download, runnpm installbefore requesting--buildifnode_modulesis absent. Validation does not install the standard dependency set implicitly. - Apps with custom dependencies are restored into the isolated build di
Câu hỏi thường gặp
Tôi có thể gọi dữ liệu trực tiếp không?
Không. Skill nêu rõ mọi truy cập dữ liệu đi qua SDK truy vấn, không gửi yêu cầu trực tiếp.
Các API bên ngoài hoạt động thế nào?
Quản trị viên thiết lập một kết nối bên ngoài, và ứng dụng liên kết với nó trong file manifest.
Sau khi tải lên tôi nên kiểm tra gì?
Skill yêu cầu đọc kết quả tải lên, vì kết quả này sẽ cảnh báo nếu tên kết nối không tồn tại.
Chi tiết
Mô tả gốc của tác giả
Use when editing a locally created or downloaded Lightdash data app — how local editing, building, and uploading work, and what is read-only.
repo: lightdash/lightdash
Độ phổ biến
- Sao GitHub
- 6.2k
- Vị trí xếp hạng
- #14403
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
breakup-pr
6.2kGiúp agent của bạn tách một pull request lớn thành các phần nhỏ, xếp chồng lên nhau, để có thể xem xét và gộp từng phần một.
lightdash-agent-slack-messaging
6.2kGiúp agent của bạn viết báo cáo bảo trì và hoạt động cho quản trị viên Lightdash rõ ràng, thân thiện, chỉ dựa trên bằng chứng có sẵn.
developing-in-lightdash
6.2kGiúp agent của bạn đọc, tạo và chỉnh sửa dashboard và biểu đồ Lightdash dưới dạng JSON, kèm cài đặt của từng loại biểu đồ.
filter-expressions
6.2kGiúp agent của bạn viết biểu thức lọc đúng cho truy vấn số liệu Lightdash, kể cả lọc trên các chỉ số tùy chỉnh.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.