Token导航 LogoToken导航

Agent Skill · 研究检索

sgds-components(SGDS 组件)

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

sgds-components 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 40,719。

总安装 1,259周安装 53GitHub Stars 12下载 441核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/govtechsg/sgds-web-component --skill sgds-components

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

sgds-components 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。适用于 SGDS 组件相关信息的搜索与整理,可结合任务场景或来源线索进行定向检索。

通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和操作边界。建议安装前核实维护状态,避免触发联网、命令执行或文件读写等敏感操作。具体用法请参考原始 README 和仓库文档,确保符合实际使用环境的安全策略。

来源仓库内路径:skills/sgds-components

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/govtechsg/sgds-web-component --skill sgds-comp…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sgds-components 怎么安装?

在终端执行 npx skills add https://github.com/govtechsg/sgds-web-component --skill sgds-components。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sgds-components 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sgds-components 需要什么权限?

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

sgds-components 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sgds-components 用的人多吗?

公开数据是累计安装 1,259 次,近一周安装 53 次,下载 441 次,GitHub 12 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sgds-components 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
sgds-components

SGDS 组件 · 本页

1,25912操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SGDS Components Setup Skill

Prerequisites and framework integration for using <sgds-*> web components.

Installation

npm install @govtechsg/sgds-web-component
# or
pnpm add @govtechsg/sgds-web-component

Import the library once at your app entry point:

import "@govtechsg/sgds-web-component";

Framework Integration

React

React version determines which import to use.

React 19+ (client-side, e.g. Vite)

React 19 supports native custom elements directly — import once at the app entry point, then use the web component tag anywhere:

import "@govtechsg/sgds-web-component";

function App() {
  return (
    <sgds-button variant="primary" onsgds-blur={(e) => console.log(e)}>
      Click Me
    </sgds-button>
  );
}

Custom event syntax in React 19: prefix the event name with on in lowercase (sgds-blur → onsgds-blur).

Using Next.js? Next.js is SSR-based and requires a different setup — see the Next.js section below.

Complex props (arrays, objects) can be passed declaratively:

import "@govtechsg/sgds-web-component";

const steps = [
  { component: <Step1 />, stepHeader: "Personal details" },
  { component: <Step2 />, stepHeader: "Contact details" },
];

function App() {
  return <sgds-stepper steps={steps}></sgds-stepper>;
}
React 18 and below

React ≤18 does not support custom element events or complex props natively. Use the React wrapper components:

import { SgdsButton } from "@govtechsg/sgds-web-component/react";

function App() {
  return (
    <SgdsButton variant="primary" onSgdsBlur={(e) => console.log(e)}>
      Click Me
    </SgdsButton>
  );
}

React wrapper event naming: sgds-blur → onSgdsBlur, sgds-change → onSgdsChange (prefix on, camelCase applies to every hyphen-separated word).

Accessing component methods in React ≤18 (via useRef):

import { useRef } from "react";
import type { SgdsStepper as SStep } from "@govtechsg/sgds-web-component/components";
import SgdsStepper from "@govtechsg/sgds-web-component/react/stepper/index.js";

function StepperComponent() {
  const stepperRef = useRef<SStep>(null);
  return <SgdsStepper steps={steps} ref={stepperRef} />;
}
Note: The React wrappers will be phased out in a future major version. Migrate to React 19+ native usage when possible.

Official docs: https://webcomponent.designsystem.tech.gov.sg/?path=/docs/frameworks-react--docs


Next.js

Next.js is an SSR framework — web components rely on browser APIs and will error if imported at the module level during server-side rendering.

Step 1 — Create sgds.tsx (library loader)

'use client';

import { useEffect } from 'react';

const SgdsLibraryLoader = () => {
  useEffect(() => {
    (async () => {
      await import('@govtechsg/sgds-web-component');
    })();
  }, []);

  return null;
};

export default SgdsLibraryLoader;

Step 2 — Add to root layout <head>

// src/app/layout.tsx
import SgdsLibraryLoader from './sgds';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <head>
        <SgdsLibraryLoader />
      </head>
      <body>
        {children}
      </body>
    </html>
  );
}

Step 3 — Use components directly with suppressHydrationWarning

<sgds-masthead suppressHydrationWarning></sgds-masthead>

Step 4 — TypeScript support — add a types.d.ts at the project root and reference the SGDS React type definitions. This gives full IntelliSense for props and typed CustomEvent detail payloads on all sgds-* elements:

Use an ES import in any .d.ts file included by your tsconfig:

import "@govtechsg/sgds-web-component/types/react";

Events in Next.js — due to hydration timing, wire custom events via useEffect + addEventListener rather than declarative React props:

'use client';
import { useEffect, useRef } from 'react';

export default function MyInput() {
  const ref = useRef<any>(null);

  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const handler = (e: Event) => console.log((e.target as any).value);
    el.addEventListener('sgds-input', handler);
    return () => el.removeEventListener('sgds-input', handler);
  }, []);

  return <sgds-input ref={ref} suppressHydrationWarning />;
}

Organise into reusable React components — do not inline useEffect / addEventListener alongside business logic. Wrap each SGDS element in a dedicated client component that exposes typed props and forwards events via callbacks:

// components/sgds/SgdsInput.tsx
'use client';
import { useEffect, useRef, useCallback } from 'react';

interface SgdsInputProps {
  label?: string;
  placeholder?: string;
  value?: string;
  onSgdsInput?: (value: string) => void;
  onSgdsChange?: (value: string) => void;
}

export default function SgdsInput({ label, placeholder, value, onSgdsInput, onSgdsChange }: SgdsInputProps) {
  const ref = useRef<any>(null);
  const onSgdsInputRef = useRef(onSgdsInput);
  const onSgdsChangeRef = useRef(onSgdsChange);
  onSgdsInputRef.current = onSgdsInput;
  onSgdsChangeRef.current = onSgdsChange;

  useEffect(() => {
    const el = ref.current;
    if (!el) return;

    const handleInput = (e: Event) => onSgdsInputRef.current?.((e.target as any).value);
    const handleChange = (e: Event) => onSgdsChangeRef.current?.((e.target as any).value);

    el.addEventListener('sgds-input', handleInput);
    el.addEventListener('sgds-change', handleChange);
    return () => {
      el.removeEventListener('sgds-input', handleInput);
      el.removeEventListener('sgds-change', handleChange);
    };
  }, []);

  return (
    <sgds-input
      ref={ref}
      label={label}
      placeholder={placeholder}
      value={value}
      suppressHydrationWarning
    />
  );
}

Then consume it like any React component — no event wiring in the page:

// app/contact/page.tsx
'use client';
import SgdsInput from '@/components/sgds/SgdsInput';

export default function ContactPage() {
  const [name, setName] = useState('');
  return <SgdsInput label="Name" placeholder="Enter name" onSgdsInput={setName} />;
}

Place all SGDS wrappers under a shared directory (e.g. components/sgds/) so they are discoverable and reusable across pages.

See the official Next.js integration docs for more detail.


Vue

Vue 3 supports web components natively — no SGDS-specific wrappers exist. Refer to the Vue + web components documentation for configuration. The SGDS-specific filter for suppressing unknown element warnings is tag.startsWith("sgds-").


Angular

Angular supports web components natively via CUSTOM_ELEMENTS_SCHEMA — no SGDS-specific wrappers exist. Refer to the Angular elements documentation for configuration.


Troubleshooting Component Behaviour

When a component behaves unexpectedly — wrong event fired, property not reflected, slot not rendering — read the compiled source directly. It contains full method bodies, event logic, internal defaults, and edge-case handling that no documentation captures.

Read from node_modules/@govtechsg/sgds-web-component — this directory is present once the package is installed:

node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion.js
node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion-item.js
node_modules/@govtechsg/sgds-web-component/components/Accordion/sgds-accordion.d.ts

Replace Accordion/sgds-accordion with the relevant component folder and file name. The .js file contains the full implementation; the .d.ts file lists all properties, types, events, slots, and JSDoc descriptions.

If node_modules is absent — the package has not been installed. Ask the user to run their normal install step (npm install / pnpm install) before inspecting source files.


For AI agents: The primary decision tree is React version + rendering mode:

  • React 19+ CSR (Vite etc.): native <sgds-*> tag + direct import, event props lowercase with on prefix (onsgds-change)
  • Next.js (SSR): SgdsLibraryLoader + useEffect dynamic import — never a top-level import; wire events via addEventListener in useEffect
  • React ≤18: SGDS React wrapper package, camelCase event props (onSgdsChange)
  • Vue / Angular: standard web component integration; SGDS-specific detail for Vue is tag.startsWith("sgds-") to suppress unknown element warnings

When a user reports unexpected component behaviour (wrong event, property not reflecting, slot not rendering), direct them to read the compiled source before trying anything else — see the Troubleshooting Component Behaviour section above.

Global rule — never set explicit widths on SGDS components. Do not add width, style="width:...", or fixed-width utility classes (e.g. sgds:w-40) directly on any <sgds-*> element. Width is controlled by the parent layout — use flex, grid, or wrapper divs to constrain it. The only exception is when a user explicitly requests a fixed width.


Available Components

CategoryComponentReference
ActionsButton→ reference/button.md
ActionsIcon Button→ reference/icon-button.md
ActionsClose Button→ reference/close-button.md
ActionsLink→ reference/link.md
ActionsDropdown→ reference/dropdown.md
ActionsOverflow Menu→ reference/overflow-menu.md
NavigationMasthead→ reference/masthead.md
NavigationMain Nav→ reference/mainnav.md
NavigationFooter→ reference/footer.md
NavigationBreadcrumb→ reference/breadcrumb.md
NavigationPagination→ reference/pagination.md
NavigationSidenav→ reference/sidenav.md
NavigationSidebar→ reference/sidebar.md
NavigationSubnav→ reference/subnav.md
NavigationTab→ reference/tab.md
NavigationTable of Contents→ reference/table-of-contents.md
LayoutAccordion→ reference/accordion.md
LayoutDivider→ reference/divider.md
LayoutDrawer→ reference/drawer.md
LayoutModal→ reference/modal.md
ContentBadge→ reference/badge.md
ContentCard→ reference/card.md
ContentIcon Card→ reference/icon-card.md
ContentImage Card→ reference/image-card.md
ContentThumbnail Card→ reference/thumbnail-card.md
ContentDescription List→ reference/description-list.md
ContentIcon→ reference/icon.md
ContentIcon List→ reference/icon-list.md
ContentTable→ reference/table.md
ContentTooltip→ reference/tooltip.md
FormsInput→ reference/input.md
FormsTextarea→ reference/textarea.md
FormsSelect→ reference/select.md
FormsCheckbox→ reference/checkbox.md
FormsRadio→ reference/radio.md
FormsCombo Box→ reference/combo-box.md
FormsDatepicker→ reference/datepicker.md
FormsFile Upload→ reference/file-upload.md
FormsQuantity Toggle→ reference/quantity-toggle.md
FeedbackSwitch→ reference/switch.md
WorkflowStepper→ reference/stepper.md

Form Input Components

When building forms, use these 9 form input components to capture user data:

  1. <sgds-input> — text fields
  2. <sgds-textarea> — multi-line text
  3. <sgds-select> — dropdown selection
  4. <sgds-checkbox> / <sgds-checkbox-group> — multiple choice
  5. <sgds-radio> / <sgds-radio-group> — single choice
  6. <sgds-combo-box> — searchable select
  7. <sgds-datepicker> — date input
  8. <sgds-file-upload> — file picker
  9. <sgds-quantity-toggle> — numeric counter

DO NOT use in forms (these are feedback/state, not input):

  • <sgds-switch> — This is a feedback component (displays toggle state), not a form input. Use <sgds-checkbox> or <sgds-radio-group> to collect user choice instead.
  • Other non-input components (Alert, Badge, Button, Card, etc.) — These are layout/feedback, not form controls.

For form layout patterns (field pairing, spacing, width constraints, multi-step forms with <sgds-stepper>, header hierarchy), see the sgds-blocks form layout skill. | Feedback | Alert | → reference/alert.md | | Feedback | Spinner | → reference/spinner.md | | Feedback | Skeleton | → reference/skeleton.md | | Feedback | Progress Bar | → reference/progress-bar.md | | Feedback | Toast | → reference/toast.md | | Feedback | System Banner | → reference/system-banner.md |

平台分布

Codex

36.58%
按下载量换算161

Claude

29.87%
按下载量换算132

Cursor

15.86%
按下载量换算70

Gemini CLI

7.86%
按下载量换算35

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

继续浏览同类 Skills