Token导航 LogoToken导航TokenDH.com
前端设计权限需确认github未标认证来源可访问许可证需确认审计通过

add-navigation添加导航

Agent Skill

add-navigation 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,399

周安装

102

GitHub Stars

4

下载量

840
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/cognitedata/dune-skills --skill add-navigation

简介

将 Cognite Dune 工业组件导航栏集成到前端应用中,支持明暗主题自适应。

  • 由父组件控制 activeId 与 onNavigate,不内置路由状态逻辑。
  • 需先安装 @cognite/dune-industrial-components 依赖,再注入导航项配置。
  • 修改前请检查现有路由与 dark-mode 实现,避免样式冲突或行为异常。
  • add-navigation 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Add Navigation

Wire Navigation from @cognite/dune-industrial-components/navigation into this Dune app.

Nav items: $ARGUMENTS

The component is fully controlled — the parent owns activeId and onNavigate. No state or routing assumptions live inside it.

The logo prop is optional and defaults to the Cognite vertical logo. It uses currentColor so it automatically renders black in light mode and white in dark mode.

Step 1 — Check dependencies

First, check if @cognite/dune-industrial-components is installed by looking at package.json. If not installed, run:

pnpm install "github:cognitedata/dune-industrial-components#semver:*"

Step 2 — Read the app

Read src/App.tsx (or the main layout file) and package.json before changing anything. Note:

  • Existing routing (react-router-dom?)
  • Existing dark-mode / theme hook
  • Where page content currently lives

Step 3 — Define nav items

Create a typed NavItem[] array using $ARGUMENTS (fall back to the app's existing pages/routes if empty):

import type { NavItem } from '@cognite/dune-industrial-components/navigation';

const NAV_ITEMS: NavItem[] = [
  { id: 'home', label: 'Home' },
  // one entry per argument / page
];

Step 4 — Wire into the layout

The Navigation uses the default Cognite logo and includes a theme toggle by default.

No router (useState)

import { useState } from 'react';
import { Navigation } from '@cognite/dune-industrial-components/navigation';

export function App() {
  const [activeId, setActiveId] = useState(NAV_ITEMS[0].id);

  // If the app has dark mode, use the existing hook
  const { isDark, toggle } = useDarkMode(); // Adjust to match app's theme hook

  return (
    <div className="flex min-h-screen flex-col">
      <Navigation
        items={NAV_ITEMS}
        activeId={activeId}
        onNavigate={setActiveId}
        renderThemeToggle={() => (
          <button
            type="button"
            onClick={toggle}
            aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
          >
            {isDark ? '🌙' : '☀️'}
          </button>
        )}
      />
      <main className="flex flex-1 flex-col">{/* page content */}</main>
    </div>
  );
}

With react-router-dom

import { useLocation, useNavigate } from 'react-router-dom';
import { Navigation } from '@cognite/dune-industrial-components/navigation';

export function App() {
  const location = useLocation();
  const navigate = useNavigate();

  // If the app has dark mode, use the existing hook
  const { isDark, toggle } = useDarkMode(); // Adjust to match app's theme hook

  // Derive activeId from path — adjust to match the app's route structure
  const activeId = location.pathname.split('/')[1] || NAV_ITEMS[0].id;

  return (
    <div className="flex min-h-screen flex-col">
      <Navigation
        items={NAV_ITEMS}
        activeId={activeId}
        onNavigate={(id) => navigate(`/${id === NAV_ITEMS[0].id ? '' : id}`)}
        renderThemeToggle={() => (
          <button
            type="button"
            onClick={toggle}
            aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
          >
            {isDark ? '🌙' : '☀️'}
          </button>
        )}
      />
      <main className="flex flex-1 flex-col">{/* page content */}</main>
    </div>
  );
}

Optional — Custom logo

By default, the Navigation uses the Cognite logo which automatically adapts to light/dark themes. Only add a custom logo if needed.

To use a custom logo, pass the logo prop. If the app has dark/light mode, swap the image based on the theme hook:

import { Navigation } from '@cognite/dune-industrial-components/navigation';
import logoLight from '@/assets/logo-light.svg';
import logoDark from '@/assets/logo-dark.svg';

// Inside the component (whatever hook the app uses):
const { isDark } = useDarkMode();

<Navigation
  items={NAV_ITEMS}
  activeId={activeId}
  onNavigate={setActiveId}
  logo={
    <img
      src={isDark ? logoDark : logoLight}
      alt="App"
      className="h-8 w-auto"
    />
  }
  renderThemeToggle={() => (
    <button
      type="button"
      onClick={toggle}
      aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
    >
      {isDark ? '🌙' : '☀️'}
    </button>
  )}
/>

Done

The app now has a sticky navigation header with:

  • Default Cognite logo that adapts to light/dark themes
  • Theme toggle button (if dark mode hook exists)
  • aria-current="page" on the active item
  • aria-label attributes on the logo button and <nav> element
Package: @cognite/dune-industrial-components/navigation Exports: Navigation, CogniteLogo, NavItem, NavigationProps

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.55%
按下载量换算307

Claude

30.19%
按下载量换算254

Cursor

17.47%
按下载量换算147

Gemini CLI

8.7%
按下载量换算73

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

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

来源信息

继续浏览同类 Skills