leafygreen-authoring

द्वारा mongodb

उन परियोजनाओं में React घटकों (.tsx/.ts) को लिखते या संपादित करते समय स्वतः सक्रिय होता है जिनमें package.json में @leafygreen-ui पैकेज मौजूद होते हैं। घटक मैपिंग प्रदान करता है,…

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/button → Button
Text input, text field@leafygreen-ui/text-input → TextInput
Dropdown, select@leafygreen-ui/select → Select, Option
Searchable dropdown@leafygreen-ui/combobox → Combobox
Search box@leafygreen-ui/search-input → SearchInput
Number field@leafygreen-ui/number-input → NumberInput
Checkbox@leafygreen-ui/checkbox → Checkbox
Radio button@leafygreen-ui/radio-group → RadioGroup, Radio
Toggle, switch@leafygreen-ui/toggle → Toggle
Icon button@leafygreen-ui/icon-button → IconButton
Icon@leafygreen-ui/icon → Icon
Heading, body text, label@leafygreen-ui/typography → H1–H3, Body, Label, Subtitle
Modal, dialog@leafygreen-ui/modal → Modal
Tooltip@leafygreen-ui/tooltip → Tooltip
Tabs@leafygreen-ui/tabs → Tabs, Tab
Table@leafygreen-ui/table → Table, Row, Cell
Badge, tag, chip@leafygreen-ui/badge → Badge
Banner, alert@leafygreen-ui/banner → Banner
Toast, notification@leafygreen-ui/toast → Toast
Menu, context menu@leafygreen-ui/menu → Menu, MenuItem
Card@leafygreen-ui/card → Card
Code block@leafygreen-ui/code → Code
Logo / logomark@leafygreen-ui/logo → MongoDBLogoMark, MongoDBLogo
Stepper, progress steps@leafygreen-ui/stepper → Stepper, Step
Pipeline@leafygreen-ui/pipeline → Pipeline, 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 की और Skills

atlas-stream-processing
mongodb
MongoDB Atlas Stream Processing (ASP) वर्कफ़्लो का प्रबंधन करता है। वर्कस्पेस प्रावधान, डेटा स्रोत/सिंक कनेक्शन, प्रोसेसर जीवनचक्र संचालन को संभालता है,…
mongodb-atlas-stream-processing
mongodb
मोंगोडीबी एटलस स्ट्रीम प्रोसेसिंग (ASP) वर्कफ़्लो प्रबंधित करता है। वर्कस्पेस प्रावधान, डेटा स्रोत/सिंक कनेक्शन, प्रोसेसर जीवनचक्र संचालन को संभालता है,…
mongodb-connection
mongodb
किसी भी समर्थित ड्राइवर भाषा के लिए MongoDB क्लाइंट कनेक्शन कॉन्फ़िगरेशन (पूल, टाइमआउट, पैटर्न) को अनुकूलित करें। काम करते/अपडेट करते/समीक्षा करते समय इस स्किल का उपयोग करें…
mongodb-mcp-setup
mongodb
उपयोगकर्ताओं को MongoDB MCP सर्वर के प्रमुख विकल्पों को कॉन्फ़िगर करने में मार्गदर्शन करें। इस स्किल का उपयोग तब करें जब उपयोगकर्ता के पास MongoDB MCP सर्वर इंस्टॉल हो लेकिन उसने कॉन्फ़िगर नहीं किया हो…
mongodb-natural-language-querying
mongodb
प्राकृतिक भाषा का उपयोग करके केवल-पठनीय MongoDB क्वेरी (find) या aggregation pipelines उत्पन्न करें, जिसमें collection schema संदर्भ और नमूना दस्तावेज़ शामिल हों। इस skill का उपयोग करें…
mongodb-query-optimizer
mongodb
MongoDB क्वेरी अनुकूलन और इंडेक्सिंग में सहायता करें। केवल तब उपयोग करें जब उपयोगकर्ता अनुकूलन या प्रदर्शन के बारे में पूछे: "मैं इस क्वेरी को कैसे अनुकूलित करूं?", "मैं कैसे…
mongodb-schema-design
mongodb
MongoDB स्कीमा डिज़ाइन पैटर्न और एंटी-पैटर्न। डेटा मॉडल डिज़ाइन करते समय, स्कीमा की समीक्षा करते समय, SQL से माइग्रेट करते समय, या प्रदर्शन समस्याओं का समाधान करते समय उपयोग करें…
mongodb-search-and-ai
mongodb
MongoDB उपयोगकर्ताओं को Atlas Search (फुल-टेक्स्ट), Vector Search (सिमेंटिक), और Hybrid Search समाधानों को लागू करने और अनुकूलित करने में मार्गदर्शन करता है। इस स्किल का उपयोग तब करें जब…