Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计异常

reveal-3d揭示 3d

Agent Skill

reveal-3d 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,018

周安装

207

GitHub Stars

4

下载量

1,639
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:reveal-3d(揭示 3d)
来源仓库:https://github.com/cognitedata/dune-skills
仓库路径:skills/reveal-3d
安装命令:
npx skills add https://github.com/cognitedata/dune-skills --skill reveal-3d
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cognitedata/dune-skills --skill reveal-3d

简介

reveal-3d 用于查找、检索和筛选三维可视化或数据展示相关的技术实现方案。

  • 适用于数据分析、科学计算或交互式仪表板开发的场景。
  • 通过 GitHub 安装,使用 npx skills add 命令从指定仓库添加技能。
  • 使用前需确认权限范围和维护状态,注意是否涉及图形渲染或外部服务调用。
  • reveal-3d 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Reveal 3D Viewer

Add a Cognite Reveal 3D viewer to a Dune app. Renders CAD models from CDF, with support for FDM-linked assets or direct model/revision IDs.

FDM instance to visualize: $ARGUMENTS


Before you start

Read these files before touching anything:

  • package.json — note react/react-dom versions and existing deps
  • vite.config.ts — you will replace it entirely (new Dune apps have a standalone config, not a shared base config)
  • src/main.tsx — you will prepend two lines to it

Step 1 — Install packages

pnpm add @cognite/reveal three process util assert ajv
pnpm add "@cognite/dune-industrial-components@github:cognitedata/dune-industrial-components#semver:*"
pnpm add -D @types/three
pnpm install --no-frozen-lockfile
If running inside Cursor (sandbox): the GitHub package install requires git init, which the Cursor sandbox blocks. If you see git init... Operation not permitted, the install must be run with full permissions. In a Shell tool call, pass required_permissions: ["all"].

After install — check three version matches what @cognite/reveal requires:

node -e "const r=require('./node_modules/@cognite/reveal/package.json'); console.log(r.peerDependencies?.three)"
node -e "console.log(require('./node_modules/three/package.json').version)"

If the installed three version is lower than @cognite/reveal's peer requirement, update it:

pnpm add three@^<required-version>    # e.g. three@^0.180.0
pnpm install --no-frozen-lockfile

Verify package.json now has all of: @cognite/reveal, three (at the right version), process, util, assert, ajv, @cognite/dune-industrial-components.

Why ajv? @cognite/dune-industrial-components requires ajv@>=8. The monorepo root has ajv@6 as a transitive dep. Without a direct ajv@^8 in the app, pnpm picks up the root's v6 and you get a peer warning that can cause schema validation failures.
Do not install vite-plugin-node-polyfills. It introduces a different set of transitive-dep conflicts. Use explicit process, util, assert package aliases instead.

Step 2 — Vite config

Read vite-config.md for the complete vite.config.ts. Apply it verbatim.

Key points:

  • resolve.dedupe includes react, react-dom, react/jsx-runtime, three — pnpm symlinks can create separate module instances in a monorepo; dedupe forces one copy
  • Manual util/, assert/, process/browser aliases — not a plugin. These handle the top-level imports. The process, util, assert npm packages must be in dependencies (Step 1)
  • optimizeDeps.include lists process, util, assert, three, @cognite/reveal — pre-bundles them so esbuild handles CJS→ESM; Vite cannot auto-discover bare polyfill imports
  • worker.format: 'es' — Reveal spawns ES module web workers; without this they fail silently
  • Never put @cognite/dune-industrial-components in optimizeDeps.exclude — forces raw ESM, re-introduces React duplication even with dedupe

Step 3 — main.tsx

Add the process polyfill as the very first two lines — before any import, before React:

import process from 'process';
(window as unknown as Record<string, unknown>).process = process;

// all other imports below ↓
import { DuneAuthProvider } from '@cognite/dune';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './styles.css';

const queryClient = new QueryClient({
  defaultOptions: { queries: { staleTime: 5 * 60 * 1000, gcTime: 10 * 60 * 1000 } },
});

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <QueryClientProvider client={queryClient}>
      <DuneAuthProvider>
        <App />
      </DuneAuthProvider>
    </QueryClientProvider>
  </React.StrictMode>
);

Keep DuneAuthProvider from @cognite/dune as the auth provider — not CDFAuthenticationProvider.


Step 4 — Provider placement (critical)

Getting this wrong causes ObjectUnsubscribedError: object unsubscribed at model load time.

CacheProvider and RevealKeepAlive must be always mounted at page/app level. RevealProvider is conditional (only renders when a model is selected).

App (always rendered)
  CacheProvider            ← always mounted
    RevealKeepAlive        ← always mounted
      <sidebar>            ← model picker lives here
      {selected && (
        RevealProvider     ← conditional, only when model is ready
          <RevealCanvas>
            <Reveal3DResources />
      )}

Why: React StrictMode double-invokes effects on every component at first mount. If RevealKeepAlive is inside the same conditionally-rendered component as RevealProvider, StrictMode fires *both* cleanup cycles together — RevealKeepAlive disposes the viewer while RevealProvider's async model-loading effect is still in-flight.

When RevealKeepAlive is at App level, its StrictMode cycle completes at startup with no viewer yet (nothing to dispose). By the time RevealProvider conditionally mounts, RevealKeepAlive's viewerRef is stable — and RevealProvider skips viewer disposal when keepAlive context is present.

Pattern that breaks:

{selected && (
  <MyViewerComponent>      ← ❌ RevealKeepAlive co-located with RevealProvider
    <CacheProvider>
      <RevealKeepAlive>
        <RevealProvider>

Step 5 — Implementation

Decide the pattern first — before reading any code.

Use Pattern B (model browser) unless you can answer YES to all three of these:

  1. The app already has a DMInstanceRef in scope — passed in as a prop or route param, not something to be fetched
  2. The user has confirmed that instance has CogniteVisualizable.object3D → CogniteCADNode linkage in their CDF data model
  3. The user explicitly asked for FDM-linked 3D, not just "show a 3D viewer"

If any answer is NO or uncertain — use Pattern B. It works with every CDF project that has 3D models, requires zero FDM setup, and is much easier to debug. Pattern A silently renders nothing when FDM linkage is missing.

Pattern B: Read the "Pattern B (default)" section of references/implementation.md.

Pattern A (only if gate above passed): Read the "Pattern A (fallback)" section of references/implementation.md.

Two files to create: src/components/ViewerContent.tsx (canvas only, no providers) and src/App.tsx (owns all providers + model selection logic).

Critical rules that both patterns share:

  • ViewerContent must contain no providersCacheProvider, RevealKeepAlive, and RevealProvider all live in App.tsx (see Step 5 for why)
  • resources prop for Reveal3DResources must be useMemo'd; onModelsLoaded must be useCallback'd — inline values cause infinite model reload loops
  • onSelect/onLoad callbacks passed into child components must be useCallback'd at the call site, and called from useEffect inside the child — not during render
  • sdk passed to RevealProvider must be useMemo'd keyed on client.project
  • Lazy-load ViewerContent with React.lazy + Suspense to avoid blocking the initial bundle

Step 6 — Container height

RevealCanvas fills its container with width: 100%; height: 100%. The parent must have an explicit height:

<div style={{ width: '100%', height: '70vh', position: 'relative' }}>
  <RevealProvider ...>
    <ViewerContent modelId={...} revisionId={...} />
  </RevealProvider>
</div>

Troubleshooting

SymptomCauseFix
git init... Operation not permitted during pnpm installCursor sandbox blocks git operations needed to clone the GitHub packageRe-run pnpm install --no-frozen-lockfile with required_permissions: ["all"] in the Shell tool call
pnpm install hangs for minutes with no outputSame GitHub package sandbox issue — pnpm is stuck waiting on a blocked syscallKill the process, re-run with required_permissions: ["all"]
unmet peer three@0.180.0: found 0.177.0 (or similar version)@cognite/reveal requires a specific three version; pnpm add three installs latest which may differCheck @cognite/reveal's peerDependencies, then pnpm add three@^<required> + reinstall
unmet peer ajv@>=8: found 6.xMonorepo root has ajv@6; app needs ajv@^8 for @cognite/dune-industrial-componentspnpm add ajv in the app (adds ^8)
ObjectUnsubscribedError: object unsubscribedRevealKeepAlive inside conditional componentMove CacheProvider + RevealKeepAlive to always-mounted App level
Maximum update depth exceededInline onLoad/onSelect callback (t) => setState(t) re-creates every renderuseCallback((t) => setState(t), []) at the call site; model browser must call onSelect from useEffect, not render phase
Maximum update depth exceeded (variant)onSelect/onReady called during render in an if-block instead of a useEffectMove the call into useEffect([revision, pendingId, onSelect])
No QueryClient set@tanstack/react-query resolved to a different copyAdd @tanstack/react-query to resolve.dedupe and optimizeDeps.include
process is not defined at runtimeMissing runtime polyfillFirst two lines of main.tsx: import process from 'process'; window.process = process;
Could not resolve "inherits"Used vite-plugin-node-polyfills or wrong manual aliasesRemove the plugin; use package aliases (util: 'util/', assert: 'assert/') with those packages in dependencies
Multiple instances of Three.jsTwo Three.js copies loadedresolve.alias.threenode_modules/three/build/three.module.js and three in resolve.dedupe
Black screen / workers fail silentlyMissing ES worker formatAdd worker: {format: 'es'} to vite config
Canvas 0px tallContainer has no explicit heightheight: '70vh' (or any fixed/flex height) on the parent div
No model found (FDM mode)Instance not linked via Core DM (CogniteVisualizable.object3DCogniteCADNode)Use model browser (Pattern B) with sdk.models3D.list() as the default instead

API reference

Page-level (always rendered): CacheProvider, RevealKeepAlive

Viewer-level (conditional): RevealProvider, RevealCanvas, Reveal3DResources, InstanceStylingProvider

Hooks: useModelsForInstanceQuery, use3dModels, useFdmAssetMappings, useReveal, useOptionalRevealKeepAlive

Types: AddCadResourceOptions, TaggedAddResourceOptions, ViewerOptions, DMInstanceRef (from @cognite/reveal)

All exports from @cognite/dune-industrial-components/reveal.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.31%
按下载量换算612

Claude

26.36%
按下载量换算432

Cursor

17.78%
按下载量换算291

Gemini CLI

9.47%
按下载量换算155

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills