Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/holtwood/awesome-cursorrules-zh/chakra-ui-component-compositiongit clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/chakra-ui-component-composition)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/chakra-ui-component-composition"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/chakra-ui-component-composition.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00524 |
| Opus 5 | $0.00000 | $0.00262 |
| Sonnet 5 | $0.00000 | $0.00105 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
chakra-ui---component-composition scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
- 使用 Chakra UI 实现适当的组件组合:
- 利用
asprop:Chakra UI 组件支持asprop,允许将组件渲染为不同的 HTML 元素或 React 组件,这在构建灵活的 UI 时非常有用。 - 扩展现有组件:通过直接传递 Chakra UI 组件的 props 来扩展其样式和行为,而不是重新创建组件。
- 自定义组件的封装:将复杂的 UI 逻辑和样式封装在自定义组件中,并使用
Box、Flex、Stack等布局组件进行组合,保持组件的单一职责和可复用性。 - 使用
forwardRef:当自定义组件需要转发 ref 时,使用forwardRef确保其与 Chakra UI 组件的兼容性。 - 示例:
import { Box, Flex, Text, Button } from '@chakra-ui/react'; function Card({ title, description, buttonText, ...rest }) { return ( <Box p={5} shadow="md" borderWidth="1px" {...rest}> <Flex alignItems="baseline"> <Text fontSize="xl" fontWeight="semibold" lineHeight="short"> {title} </Text> </Flex> <Text mt={2}>{description}</Text> <Button mt={4} colorScheme="teal"> {buttonText} </Button> </Box> ); } // 使用示例 function MyPage() { return ( <Flex direction="column" gap={4}> <Card title="Card Title 1" description="This is a description for card 1." buttonText="Action 1" /> <Card title="Card Title 2" description="This is a description for card 2." buttonText="Action 2" bg="blue.50" /> </Flex> ); } - 避免过度封装:在某些情况下,直接使用 Chakra UI 的原子组件可能比创建新的自定义组件更有效,避免不必要的抽象。
- 利用
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 50 lines · 0 tokens per session scan A dfba7b9dfbbf
chakra-ui---component-composition is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (232 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 524 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
solidity-react-blockchain-apps-cursorrules-prompt-
Cursor rules for Solidity development with React Blockchain apps integration.
cursorrules
You are using StyleSeed, an AI design-method engine for product UI and other visual artifacts.
nextjs
Next.js Application Development Standards.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.