leafygreen-authoring

작성자: mongodb

@leafygreen-ui 패키지가 package.json에 있는 프로젝트에서 React 컴포넌트(.tsx/.ts)를 작성하거나 편집할 때 자동으로 호출됩니다. 컴포넌트 매핑을 제공하며, …

npx skills add https://github.com/mongodb/leafygreen-ui --skill leafygreen-authoring

LeafyGreen Authoring Conventions

Apply these conventions whenever writing or editing React components in a project that uses @leafygreen-ui/* packages.

Always prefer LeafyGreen components over plain HTML

When a user asks to add any UI element — in plain language, from a Figma design, or anywhere else — always check if a LeafyGreen component exists for it first. Never use a plain HTML element (<button>, <input>, <select>, etc.) when an @leafygreen-ui equivalent is available.

Common mappings:

User asks for…Use
Button, CTA@leafygreen-ui/buttonButton
Text input, text field@leafygreen-ui/text-inputTextInput
Dropdown, select@leafygreen-ui/selectSelect, Option
Searchable dropdown@leafygreen-ui/comboboxCombobox
Search box@leafygreen-ui/search-inputSearchInput
Number field@leafygreen-ui/number-inputNumberInput
Checkbox@leafygreen-ui/checkboxCheckbox
Radio button@leafygreen-ui/radio-groupRadioGroup, Radio
Toggle, switch@leafygreen-ui/toggleToggle
Icon button@leafygreen-ui/icon-buttonIconButton
Icon@leafygreen-ui/iconIcon
Heading, body text, label@leafygreen-ui/typographyH1H3, Body, Label, Subtitle
Modal, dialog@leafygreen-ui/modalModal
Tooltip@leafygreen-ui/tooltipTooltip
Tabs@leafygreen-ui/tabsTabs, Tab
Table@leafygreen-ui/tableTable, Row, Cell
Badge, tag, chip@leafygreen-ui/badgeBadge
Banner, alert@leafygreen-ui/bannerBanner
Toast, notification@leafygreen-ui/toastToast
Menu, context menu@leafygreen-ui/menuMenu, MenuItem
Card@leafygreen-ui/cardCard
Code block@leafygreen-ui/codeCode
Logo / logomark@leafygreen-ui/logoMongoDBLogoMark, MongoDBLogo
Stepper, progress steps@leafygreen-ui/stepperStepper, Step
Pipeline@leafygreen-ui/pipelinePipeline, Stage

If a package is not yet installed, install it before writing the component code:

npm install @leafygreen-ui/[package-name]

Component imports

Always use named imports for LG components:

import { H1, Body, Subtitle } from '@leafygreen-ui/typography'
import { Button } from '@leafygreen-ui/button'
import Icon from '@leafygreen-ui/icon'           // default import
import { MongoDBLogoMark } from '@leafygreen-ui/logo'

Styling approach

Always use design tokens from @leafygreen-ui/tokens for colors — never hard-coded hex values. Tokens are the single source of truth for color in the design system and automatically resolve to the correct value for dark or light mode.

import { palette } from '@leafygreen-ui/tokens'

// Correct: use a token
color: palette.gray.dark2

// Avoid: hard-coded hex
color: '#3D4F58'

Figma MCP → auto-install missing packages

When implementing a design from the Figma MCP, the component descriptions include the LeafyGreen package name, e.g.:

⚛️ React name: @leafygreen-ui/text-input
⚛️ React name: @leafygreen-ui/select

Before writing any component code:

  1. Scan all ⚛️ React name: entries in the Figma design context
  2. Cross-check each @leafygreen-ui/* package against package.json
  3. Install any that are missing: npm install @leafygreen-ui/[package-name]
  4. Never substitute plain HTML for a LeafyGreen component that is called out in the design spec

File structure

  • New components go in src/components/[ComponentName].tsx
  • One component per file
  • Name files and components in PascalCase: ProjectCard.tsx, not project-card.tsx
  • Ask before creating new folders outside of src/components/

TypeScript

  • Always define prop types explicitly using TypeScript interfaces
  • Do not use any as a type

General

  • Keep components focused. If a component is doing more than one thing, split it.

mongodb의 다른 스킬

atlas-stream-processing
mongodb
MongoDB Atlas Stream Processing(ASP) 워크플로우를 관리합니다. 워크스페이스 프로비저닝, 데이터 소스/싱크 연결, 프로세서 수명 주기 작업을 처리합니다.
official
mongodb-atlas-stream-processing
mongodb
MongoDB Atlas Stream Processing(ASP) 워크플로우를 관리합니다. 워크스페이스 프로비저닝, 데이터 소스/싱크 연결, 프로세서 수명 주기 작업을 처리합니다.…
official
mongodb-connection
mongodb
지원되는 모든 드라이버 언어에 대해 MongoDB 클라이언트 연결 구성(연결 풀, 시간 초과, 패턴)을 최적화합니다. 작업/업데이트/검토 시 이 스킬을 사용하세요…
official
mongodb-mcp-setup
mongodb
사용자가 MongoDB MCP 서버 옵션을 구성하는 과정을 안내합니다. MongoDB MCP 서버는 설치했지만 아직 구성하지 않은 경우 이 스킬을 사용하세요.
official
mongodb-natural-language-querying
mongodb
자연어를 사용하여 컬렉션 스키마 컨텍스트와 샘플 문서를 바탕으로 읽기 전용 MongoDB 쿼리(find) 또는 집계 파이프라인을 생성합니다. 이 스킬을 사용하여…
official
mongodb-query-optimizer
mongodb
MongoDB 쿼리 최적화 및 인덱싱에 도움을 줍니다. 사용자가 "이 쿼리를 어떻게 최적화하나요?", "어떻게…"와 같이 최적화 또는 성능에 대해 질문할 때만 사용하세요.
official
mongodb-schema-design
mongodb
MongoDB 스키마 설계 패턴 및 안티패턴. 데이터 모델 설계, 스키마 검토, SQL에서 마이그레이션, 또는 성능 문제 해결 시 사용하세요…
official
mongodb-search-and-ai
mongodb
MongoDB 사용자가 Atlas Search(전체 텍스트), Vector Search(의미론적), Hybrid Search 솔루션을 구현하고 최적화하는 방법을 안내합니다. 이 스킬은 다음 상황에서 사용하세요…
official