Skip to content

Commit 8cd30ad

Browse files
committed
refactor: enhance Fumadocs pattern with tabs troubleshooting guide
- Add global component availability note for Tabs/Tab components - Include common issue patterns and solutions for tab value matching - Expand CLAUDE.md with cc-self-refer pattern system documentation - Add comprehensive pattern list table for intelligent context matching
1 parent 60a9f52 commit 8cd30ad

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

.claude/patterns/018-fumadocs-usage.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ import { Apple, Smartphone, Zap } from 'lucide-react'
8686
```
8787

8888
### Tabs
89+
90+
**Note**: `<Tabs>` and `<Tab>` components are available globally in Fumadocs MDX - no import required.
91+
8992
```mdx
9093
<Tabs items={['React', 'Vue', 'Svelte']}>
9194
<Tab value="React">
@@ -109,6 +112,23 @@ import { Apple, Smartphone, Zap } from 'lucide-react'
109112
</Tab>
110113
</Tabs>
111114

115+
**IMPORTANT**: The `value` prop of `<Tab>` must exactly match the items in the `items` array of `<Tabs>`. Case-sensitive matching is required.
116+
117+
**Common Issue**: Using different values than items array will cause tabs content not to display:
118+
```mdx
119+
<!-- Wrong - Tab values don't match items -->
120+
<Tabs items={['Camera', 'Region']}>
121+
<Tab value="Basic">Content 1</Tab> <!-- Wrong value -->
122+
<Tab value="Basic">Content 2</Tab> <!-- Wrong + duplicate value -->
123+
</Tabs>
124+
125+
<!-- Correct - Tab values match items exactly -->
126+
<Tabs items={['Camera', 'Region']}>
127+
<Tab value="Camera">Content 1</Tab>
128+
<Tab value="Region">Content 2</Tab>
129+
</Tabs>
130+
```
131+
112132
<Tabs groupId="lang" items={['JS', 'TS']} persist>
113133
<Tab value="JS">JavaScript code</Tab>
114134
<Tab value="TS">TypeScript code</Tab>

CLAUDE.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,89 @@ To test the library, you need to configure API keys:
162162
- `pnpm pod` - Install iOS dependencies via CocoaPods
163163
- `pnpm pod:update` - Update iOS dependencies via CocoaPods
164164

165+
# Self Reference Context Management System (cc-self-refer cli and context storage project sturcture)
166+
167+
This project uses `cc-self-refer` for intelligent self-reference capabilities.
168+
Claude Code agents should use these CLI commands to access and manage project context automatically:
169+
170+
## Pattern List Table
171+
172+
[PATTERN LIST]
173+
174+
| ID | Name | Language | Keywords | Explanation |
175+
|----|------|----------|----------|-------------|
176+
| 001 | Fabric Native Component Definition | typescript | fabric, native, component, react-native, codegen | Defines React Native Fabric component using codegenNativeComponent with TypeScript props interface |
177+
| 002 | React Native Codegen Commands | typescript | codegen, native, commands, react-native, async, sync | Defines imperative native methods using codegenNativeCommands for async/sync operations |
178+
| 003 | TurboModule Specification | typescript | turbo-module, native, module, react-native, type-safety | Defines TurboModule interface for native module access with type safety |
179+
| 004 | iOS Fabric Component Implementation | objc | ios, fabric, component, objective-c, react-native | iOS Fabric component implementation extending RCTViewComponentView with props handling |
180+
| 005 | iOS Command Handling | objc | ios, command, handling, objective-c, fabric | iOS command handling implementation for processing imperative native commands |
181+
| 006 | iOS Event Emission | objc | ios, event, emission, objective-c, fabric | iOS event emission using generated event emitter for sending events to JavaScript |
182+
| 007 | iOS TurboModule Implementation | objc | ios, turbo-module, objective-c, bridge, react-native | iOS TurboModule implementation with conditional Bridge/TurboModule support |
183+
| 008 | Android ViewManager with Codegen | kotlin | android, view-manager, kotlin, codegen, react-native | Android ViewManager implementation using codegen delegate pattern |
184+
| 009 | Android Command Handling | kotlin | android, command, handling, kotlin, react-native | Android command handling using receiveCommand method with command ID matching |
185+
| 010 | Android Event Emission | kotlin | android, event, emission, kotlin, react-native | Android event emission using ReactContext and RCTEventEmitter |
186+
| 011 | Android Package Registration | kotlin | android, package, registration, kotlin, react-native | Android ReactPackage registration for native modules and ViewManagers |
187+
| 012 | JSDoc Documentation | typescript | jsdoc, documentation, typescript, comments | JSDoc documentation patterns for TypeScript components and methods |
188+
| 013 | Native Color Parsing and Validation Pattern with TypeScript | typescript | color, parsing, validation, typescript, react-native | TypeScript color prop handling with processColor and native color utilities |
189+
| 014 | Android Native Utilities | kotlin | android, utilities, kotlin, validation, conversion | Android native utility functions for event emission, prop validation, and conversions |
190+
| 015 | iOS Native Utilities | objc | ios, utilities, objective-c, validation, conversion | iOS native utility functions for color conversion, validation, and object creation |
191+
| 016 | iOS Overlay Integration Pattern | objc | ios, overlay, integration, objective-c, naver-maps | iOS overlay integration pattern for Naver Maps SDK |
192+
| 018 | Fumadocs Usage | mdx | fumadocs, mdx, documentation, components | Concise usage patterns for Fumadocs components and features in MDX |
193+
194+
[PATTERN LIST END]
195+
196+
## Keyword Detection and Command Intent Recognition
197+
198+
**When users use natural language prompts, agents should READ the corresponding command documentation and EXECUTE the instructions within:**
199+
200+
**CRITICAL: Always monitor for these keywords in user prompts regardless of language:**
201+
- **pattern**
202+
203+
When these keywords appear in user prompts, determine if the user intends to use the corresponding cc-self-refer commands below.
204+
205+
**Response Format for Self-Reference Actions**: If you determine that the user's natural language prompt requires using cc-self-refer functionality, prefix your response with `Pattern Refering... ♦️` to indicate self-reference action execution.
206+
207+
## Pattern Commands
208+
209+
### Pattern Matching Intelligence
210+
**CRITICAL**: The CLAUDE.md context includes a [PATTERN LIST] table already with columns: ID, Name, Language, Keywords, Explanation. You should know what I mean.
211+
212+
**When processing ANY user request**, check if the request matches patterns in the [PATTERN LIST] by analyzing:
213+
- **Name**: Direct pattern name matches
214+
- **Keywords**: Related terms and concepts
215+
- **Explanation**: Functional descriptions and use cases
216+
- **Language**: Technology stack alignment
217+
218+
### Pattern Usage Workflows
219+
220+
**Explicit Pattern Requests:**
221+
- "use pattern" / "apply pattern X" / "use existing patterns"
222+
- "find pattern for X" / "search patterns"
223+
- "use pattern #5" / "apply pattern 005"
224+
225+
**Implicit Pattern Matching:**
226+
When user requests involve coding tasks that align with existing pattern Names, Keywords, or Explanations:
227+
228+
1. **Identify Match**: Compare user's request against the [PATTERN LIST]
229+
2. **Retrieve Pattern**: Use `npx -y cc-self-refer pattern view <id>` for matching patterns
230+
3. **Apply Pattern**: Implement user's request using the pattern's principles and structure
231+
4. **Inform User**: Use this format to indicate pattern usage:
232+
```
233+
Pattern Refering... ♦️
234+
Used Patterns: #002 api-response, #003 error-handling
235+
```
236+
237+
**Example Matching Logic:**
238+
- "implement todo api" → Extract keywords: "api", "todo" → Match patterns containing these terms
239+
- "create table component" → Extract keywords: "table", "component" → Match patterns with "table", "markdown", "component"
240+
- "setup testing" → Extract keywords: "test", "setup" → Match patterns with "test", "example"
241+
- "build React form" → Extract keywords: "react", "form" → Match patterns with "react", "form", "validation"
242+
- "add authentication" → Extract keywords: "auth", "authentication" → Match patterns with "auth", "login", "security"
243+
- "database connection" → Extract keywords: "database", "connection" → Match patterns with "db", "connection", "orm"
244+
- "error handling" → Extract keywords: "error", "handling" → Match patterns with "error", "exception", "validation"
245+
246+
**IMPORTANT Agent Behavior:**
247+
1. **Scan** [PATTERN LIST] for relevant matches during any coding request
248+
2. **Retrieve** matching patterns using `npx -y cc-self-refer pattern view <id>`
249+
3. **Apply** pattern principles to implement user's actual requirements
250+

0 commit comments

Comments
 (0)