بنقرة واحدة
write-api-decision
This rule helps in writing API decisions for new components of blade design system
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
This rule helps in writing API decisions for new components of blade design system
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Add React Native support (.native.tsx files) to Blade components that currently only have web implementations. Use when user says "add native support to {Component}", "migrate {Component} to native", or "/migrate-to-rn".
Resolve PR review comments by pushing code fixes or replying with explanations. Use when a PR has review comments that need to be auto-resolved.
Review blade PRs by fetching diff, checking CI status, and getting Storybook URL. Use when reviewing PRs, checking PR status, or getting preview links for razorpay/blade PRs.
Get agentic metrics for the `razorpay/blade` repo.
Perform a task end-to-end when intent is set to 'perform-task-end-to-end' by checking existence of GITHUB__RZP_SWE_AGENT_APP__APP_ID environment variable in the session.
Heal a Blade PR by fixing CI failures, missing changesets, and sanity issues. Use when a PR has failing CI or other sanity problems that need to be auto-fixed.
| 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.