NarixHine/uni-chem / .agents/skills/heroui-react
heroui-react
FlaggedHeroUI v3 React component library (Tailwind CSS v4 + React Aria). Use when building UIs with HeroUI — creating Buttons, Modals, Forms, Cards; installing @heroui/react; configuring dark/light themes with oklch variables; or fetching component docs. Keywords: HeroUI, Hero UI, heroui, @heroui/react, @heroui/styles.
| File | Kind | Size |
|---|---|---|
| LICENSE.txt | markdown | 11.0 KB |
| SKILL.md | skill md | 6.4 KB |
| scripts/get_component_docs.mjs | script | 4.2 KB |
| scripts/get_docs.mjs | script | 4.2 KB |
| scripts/get_source.mjs | script | 4.4 KB |
| scripts/get_styles.mjs | script | 4.4 KB |
| scripts/get_theme.mjs | script | 5.4 KB |
| scripts/list_components.mjs | script | 3.9 KB |
scripts/get_docs.mjs
View on GitHub#!/usr/bin/env node
/**
* Get non-component HeroUI documentation (guides, theming, releases).
*
* Usage:
* node get_docs.mjs /docs/react/getting-started/theming
* node get_docs.mjs /docs/react/releases/v3-0-0-beta-3
*
* Output:
* MDX documentation content
*
* Note: For component docs, use get_component_docs.mjs instead.
*/
const API_BASE = process.env.HEROUI_API_BASE || 'https://mcp-api.heroui.com'
const FALLBACK_BASE = 'https://heroui.com'
const APP_PARAM = 'app=react-skills'
/**
* Fetch documentation from HeroUI API.
* Uses v1 endpoint pattern: /v1/docs/:path
*/
async function fetchApi(path) {
// The v1 API expects path without /docs/ prefix
// Input: /docs/react/getting-started/theming
// API expects: react/getting-started/theming (route is /v1/docs/:path(*))
let apiPath = path.startsWith('/docs/')
? path.slice(6) // Remove /docs/ prefix
: path.startsWith('/')
? path.slice(1) // Remove leading /
: path
const separator = '?'
const url = `${API_BASE}/v1/docs/${apiPath}${separator}${APP_PARAM}`
try {
const response = await fetch(url, {
headers: { 'User-Agent': 'HeroUI-Skill/1.0' },
signal: AbortSignal.timeout(30000),
})
if (!response.ok) {
console.error(`# API Error: HTTP ${response.status}`)
return null
}
return await response.json()
} catch (error) {
console.error(`# API Error: ${error.message}`)
return null
}
}
/**
* Fetch MDX directly from v3.heroui.com as fallback.
*/
async function fetchFallback(path) {
// Ensure path starts with /docs and ends with .mdx
let cleanPath = path.replace(/^\//, '')
if (!cleanPath.endsWith('.mdx')) {
cleanPath = `${cleanPath}.mdx`
}
const url = `${FALLBACK_BASE}/${cleanPath}`
try {
const response = await fetch(url, {
headers: { 'User-Agent': 'HeroUI-Skill/1.0' },
signal: AbortSignal.timeout(30000),
})
if (!response.ok) {
return { error: `HTTP ${response.status}: ${response.statusText}`, path }
}
const content = await response.text()
return {
content,
contentType: 'mdx',
path,
source: 'fallback',
url,
}
} catch (error) {
return { error: `Fetch Error: ${error.message}`, path }
}
}
/**
* Main function to get documentation for specified path.
*/
async function main() {
const args = process.argv.slice(2)
if (args.length === 0) {
console.error('Usage: node get_docs.mjs <path>')
console.error('Example: node get_docs.mjs /docs/react/getting-started/theming')
console.error()
console.error('Available paths include:')
console.error(' /docs/react/getting-started/theming')
console.error(' /docs/react/getting-started/colors')
console.error(' /docs/react/getting-started/animations')
console.error(' /docs/react/releases/v3-0-0-beta-3')
console.error()
console.error('Note: For component docs, use get_component_docs.mjs instead.')
process.exit(1)
}
const path = args[0]
// Check if user is trying to get component docs
if (path.includes('/components/')) {
console.error('# Warning: Use get_component_docs.mjs for component documentation.')
const componentName = path.split('/').pop().replace('.mdx', '')
const titleCase = componentName.charAt(0).toUpperCase() + componentName.slice(1)
console.error(`# Example: node get_component_docs.mjs ${titleCase}`)
}
console.error(`# Fetching documentation for ${path}...`)
// Try API first
const data = await fetchApi(path)
if (data && data.content) {
data.source = 'api'
console.log(data.content)
return
}
// Fallback to direct fetch
console.error('# API failed, using fallback...')
const fallbackData = await fetchFallback(path)
if (fallbackData.content) {
console.log(fallbackData.content)
} else {
console.log(JSON.stringify(fallbackData, null, 2))
process.exit(1)
}
}
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |