用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/razorpay/blade --skill write-api-decision命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | write-api-decision |
| description | This rule helps in writing API decisions for new components of blade design system |
| disable-model-invocation | true |
You work in the Design System team of Razorpay. Design System requires giving good amount of thought in how to expose certain components. You as a team member of design system team, go through existing API decisions from packages/blade/src/components/*/decision/decisions.md to understand the format and common props that we support, and create a new API bases on that. Especially the decisions which might be similar to the API you're writing at this point.
packages/blade/src/components/<ComponentName>/_decisions/decisions.mdshowLeading prop might exist on figma but won't be needed on dev as leading prop alone is enough to know whether leading should be added or not.Study these existing decisions.md files for consistent patterns and formatting:
packages/blade/src/components/SideNav/_decisions/decisions.mdpackages/blade/src/components/Modal/_decisions/decisions.mdpackages/blade/src/components/Button/_decisions/decisions.mdpackages/blade/src/components/Typography/_decisions/decisions.mdpackages/blade/src/components/Badge/_decisions/decisions.mdYou can look for similar components in existing design systems on the internet for reference
All API decisions must follow this exact structure:
--------------------------markdown
3-4 lines description of what the component does, its purpose in the design system, and when it should be used. Keep it concise but informative about the component's role and primary use cases.
Overall structure of the API showing the main usage pattern with realistic example:
import { Component, SubComponent } from '@razorpay/blade/components';
<Component prop="value">
<SubComponent title="Example" />
</Component>;
type ComponentNameProps = {
/**
* jsdoc for propName
*/
propName: 'option1' | 'option2';
/**
* jsdoc for optionalProp
* @default -
*/
optionalProp?: string;
/**
* jsdoc for children
*/
children: React.ReactNode;
/**
* jsdoc for onAction
*/
onAction?: (value: string) => void;
};
type SubComponentProps = {
/**
* jsdoc for title
*/
title: string;
/**
* jsdoc for variant
* @default medium
*/
variant?: 'small' | 'medium' | 'large';
/**
* jsdoc for isActive
* @default -
*/
isActive?: boolean;
};
-- 2 lines description --
<Component>
<SubComponent title="Basic Example" />
</Component>
-- 2 lines description --
<Component onAction={(value) => console.log(value)}>
<SubComponent title="Advanced Example" variant="large" isActive />
</Component>
-- 2 lines description --
// Show how the component handles specific scenarios
Follow Existing Patterns: Study the referenced decisions.md files to maintain consistency with established naming conventions and prop patterns used in Blade.
Props Section Requirements:
'small' | 'medium' | 'large')?API Section Requirements:
Examples Section Requirements:
Common Prop Naming Patterns (from existing components):
variant for visual variationssize for sizing options ('small' | 'medium' | 'large')isActive, isDisabled, isOpen for boolean stateschildren for content slotsonDismiss, onClick, onChange for event handlersaccessibilityLabel for accessibilityComponent Structure Patterns:
as prop for polymorphic componentsshowLeading prop might exist on figma but won't be needed on dev as leading prop can be internally used to decide show or hide leading.Remember: Always reference existing decisions.md files before writing new APIs to ensure consistency with the established Blade design system patterns and naming conventions.
Remember: The goal is to create comprehensive, implementable API documentation that serves both current needs and future extensibility while maintaining consistency with the established Blade design system patterns.