원클릭으로
patterns-reference
Golden implementation patterns for each effect type
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Golden implementation patterns for each effect type
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Generate or validate UI with design physics
Slot external knowledge into Rune constructs
Validate data correctness in web3 components
Capture taste preferences for design physics
Hypothesis validation and closed-loop learning
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
| name | patterns-reference |
| description | Golden implementation patterns for each effect type |
| user-invocable | false |
Complete golden patterns for the crafting skill. Loaded on-demand.
Two-phase confirmation. No optimistic updates. Cancel always visible.
function ClaimButton({ amount, onSuccess }) {
const [showConfirm, setShowConfirm] = useState(false)
const { mutate, isPending, isError, error } = useMutation({
mutationFn: () => claimRewards(amount),
onSuccess: () => { setShowConfirm(false); onSuccess?.() },
// NO onMutate - pessimistic
})
if (!showConfirm) {
return <button onClick={() => setShowConfirm(true)}>Claim {amount}</button>
}
return (
<div>
<p>Confirm claiming {amount}?</p>
<button onClick={() => setShowConfirm(false)}>Cancel</button>
<button onClick={() => mutate()} disabled={isPending}>
{isPending ? 'Claiming...' : 'Confirm'}
</button>
{isError && <p>{error.message}</p>}
</div>
)
}
Optimistic update with rollback. No confirmation needed.
function LikeButton({ postId, isLiked }) {
const queryClient = useQueryClient()
const { mutate } = useMutation({
mutationFn: () => toggleLike(postId),
onMutate: async () => {
await queryClient.cancelQueries(['post', postId])
const previous = queryClient.getQueryData(['post', postId])
queryClient.setQueryData(['post', postId], old => ({
...old, isLiked: !old.isLiked
}))
return { previous }
},
onError: (_, __, ctx) => {
queryClient.setQueryData(['post', postId], ctx?.previous)
},
})
return <button onClick={() => mutate()}>{isLiked ? '❤️' : '🤍'}</button>
}
No server. Immediate response. Accessible.
function ThemeToggle() {
const { theme, setTheme } = useTheme()
const isDark = theme === 'dark'
return (
<button
onClick={() => setTheme(isDark ? 'light' : 'dark')}
aria-label={`Switch to ${isDark ? 'light' : 'dark'} mode`}
>
{isDark ? '🌙' : '☀️'}
</button>
)
}
Optimistic with toast and undo.
function ArchiveButton({ itemId }) {
const { mutate } = useMutation({
mutationFn: () => archiveItem(itemId),
onMutate: async () => {
// Optimistically remove from list
},
onSuccess: () => {
toast('Archived', {
action: { label: 'Undo', onClick: () => restoreItem(itemId) },
duration: 5000
})
},
onError: () => {
// Rollback
toast.error('Failed to archive')
},
})
return <button onClick={() => mutate()}>Archive</button>
}