Claude-skill-registry brand-yml
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/brand-yml" ~/.claude/skills/majiayu000-claude-skill-registry-brand-yml && rm -rf "$T"
skills/data/brand-yml/SKILL.mdbrand.yml Skill
Create and use
_brand.yml files for consistent branding across Shiny applications and Quarto documents.
What is brand.yml?
brand.yml is a YAML-based format that translates brand guidelines into a machine-readable file usable across Shiny and Quarto. A single
_brand.yml file defines:
- Colors - Palette and semantic colors (primary, success, warning, etc.)
- Typography - Fonts, sizes, weights, line heights
- Logos - Multiple sizes and light/dark variants
- Meta - Company name, links, identity information
File Naming Convention
- Standard name:
(auto-discovered by Shiny and Quarto)_brand.yml - Custom names: Any name like
(requires explicit paths)company-brand.yml - Location: Typically at project root, or in
or_brand/
subdirectoriesbrand/
Decision Tree
Determine the user's goal and follow the appropriate workflow:
- Creating a new _brand.yml file? → Follow "Creating brand.yml Files"
- Using brand.yml in Shiny for R? → Read
references/shiny-r.md - Using brand.yml in Shiny for Python? → Read
references/shiny-python.md - Using brand.yml in Quarto? → Read
references/quarto.md - Using brand.yml in R (general)? → Read
(R Markdown, theming functions, programmatic access)references/brand-yml-in-r.md - Modifying existing _brand.yml? → Follow "Modifying Existing Files"
- Troubleshooting integration? → Follow "Troubleshooting"
Creating brand.yml Files
When creating
_brand.yml files from brand guidelines:
Step 1: Gather Information
Collect brand information:
- Colors: Primary, secondary, accent colors with hex values
- Fonts: Font families and where they're sourced (Google Fonts, local files, etc.)
- Logos: Logo file paths or URLs for different sizes
- Company info: Name, website, social links (optional)
Step 2: Read the Specification
Load
references/brand-yml-spec.md to understand the complete brand.yml structure, field options, and syntax.
Step 3: Build the File Incrementally
Start with the essential sections and add optional elements:
Minimum viable _brand.yml:
color: palette: brand-blue: "#0066cc" primary: brand-blue background: "#ffffff" typography: fonts: - family: Inter source: google weight: [400, 600] base: Inter
Add colors as needed:
color: palette: brand-blue: "#0066cc" brand-orange: "#ff6600" brand-gray: "#666666" primary: brand-blue secondary: brand-gray warning: brand-orange foreground: "#333333" background: "#ffffff"
Add typography details:
typography: fonts: - family: Inter source: google weight: [400, 600, 700] style: [normal, italic] - family: Fira Code source: google weight: [400, 500] base: family: Inter size: 16px line-height: 1.5 headings: family: Inter weight: 600 monospace: Fira Code
Add logos:
logo: small: logos/icon.png medium: logos/header.png large: logos/full.svg
Add meta information:
meta: name: Company Name link: https://example.com
Step 4: Apply Best Practices
Follow these rules from
references/brand-yml-spec.md:
- All fields are optional - only include what's needed
- Use hex color format:
"#0066cc" - Prefer simple syntax (strings over objects) when possible
- Use lowercase names with hyphens:
,brand-bluesuccess-green - Include
in all URLshttps:// - Define colors/fonts before referencing them
- For color ranges (shades/tints), choose the midpoint color
Step 5: Validate Structure
Check that:
- YAML syntax is valid (proper indentation, quotes on hex colors)
- Color references match palette names
- Font families are defined before use
- File paths are relative to
location_brand.yml - All URLs include protocol (
)https://
Modifying Existing Files
When modifying existing
_brand.yml files:
- Read the current file to understand existing structure
- Consult brand-yml-spec.md for valid field options
- Maintain consistency with existing naming patterns
- Preserve references - if other colors/elements reference a name, update consistently
- Test integration - verify changes apply correctly in Shiny/Quarto
Common modifications:
- Adding colors: Add to
, then reference in semantic colorscolor.palette - Changing fonts: Update in
, ensure weights/styles are availabletypography.fonts - Adding logo variants: Use
/light
structure for multiple variantsdark - Light/dark mode: Add
andlight
variants to colorsdark
Using with Shiny for R
When the user wants to apply brand.yml to a Shiny for R app:
- Read
for complete integration guidereferences/shiny-r.md - Key function:
orbs_theme(brand = TRUE)bs_theme(brand = "path") - Automatic discovery: Place
at app root_brand.yml - Page functions: Works with
,page_fluid()
, etc.page_sidebar()
Quick example:
library(shiny) library(bslib) ui <- page_fluid( theme = bs_theme(brand = TRUE), # ... UI elements )
Using with Shiny for Python
When the user wants to apply brand.yml to a Shiny for Python app:
- Read
for complete integration guidereferences/shiny-python.md - Key function:
ui.Theme.from_brand(__file__) - Automatic discovery: Place
at app root_brand.yml - Installation: Requires
pip install "shiny[theme]"
Quick example (Shiny Express):
from shiny.express import ui ui.page_opts(theme=ui.Theme.from_brand(__file__))
Quick example (Shiny Core):
from shiny import App, ui app_ui = ui.page_fluid( theme=ui.Theme.from_brand(__file__), # ... UI elements )
Using with Quarto
When the user wants to apply brand.yml to Quarto documents:
- Read
for complete integration guidereferences/quarto.md - Automatic discovery: Place
at project root with_brand.yml_quarto.yml - Supported formats: HTML, dashboards, RevealJS, Typst PDFs
- Theme layering: Use
keyword to control precedencebrand
Quick example (document):
--- title: "My Document" format: html: brand: _brand.yml ---
Quick example (project in
_quarto.yml):
project: brand: _brand.yml format: html: theme: default
Troubleshooting
Brand Not Applying
Shiny:
- Verify file is named
(with underscore)_brand.yml - Check file location (app directory or parent directories)
- Try explicit path:
orbs_theme(brand = "path/to/_brand.yml")ui.Theme.from_brand("path") - For Python: Ensure
is installedlibsass
Quarto:
- Verify
is at project root_brand.yml - Ensure
exists for project-level branding_quarto.yml - Try explicit path in document frontmatter
- Check theme layering order if using custom themes
Colors Not Matching
- Ensure hex colors have quotes:
not"#0066cc"#0066cc - Verify color names match palette definitions exactly
- Check semantic colors (primary, success, etc.) reference valid palette names
- Ensure palette is defined before semantic colors
Fonts Not Loading
- Verify Google Fonts spelling and availability
- Check internet connection (required for Google Fonts)
- Ensure
orsource: google
is specifiedsource: bunny - Verify font family names match exactly in typography elements
- For Typst: Check font cache with
quarto typst fonts
YAML Syntax Errors
- Check indentation (use spaces, not tabs)
- Ensure hex colors have quotes:
"#447099" - Verify colons have space after them:
primary: blue - Check list items have hyphens:
- family: Inter - Use YAML validator if syntax issues persist
Reference Documentation
Load these as needed for detailed information:
: Complete brand.yml specification with all sections, fields, examples, and validation rulesreferences/brand-yml-spec.md
: Using brand.yml with Shiny for R via bslib (bs_theme, automatic discovery, Shiny-specific integration)references/shiny-r.md
: Using brand.yml with Shiny for Python via ui.Theme (from_brand(), installation, performance)references/shiny-python.md
: Using brand.yml with Quarto (formats, light/dark mode, layering, extensions, Typst)references/quarto.md
: General R usage including R Markdown integration, theming functions (ggplot2, gt, flextable, plotly, thematic), and programmatic brand accessreferences/brand-yml-in-r.md
Key Principles
- Start simple: Begin with colors and one font family
- Keep it concise: Only include fields directly relevant to the brand
- Prefer standard names: Use Bootstrap color names when possible (blue, green, red, etc.)
- Use automatic discovery: Name file
for auto-detection_brand.yml - Test across targets: Verify brand applies correctly in all intended formats
- Version control: Include
in git repository_brand.yml
Common Patterns
Light/Dark Mode Colors
color: primary: light: "#0066cc" dark: "#3399ff" background: light: "#ffffff" dark: "#1a1a1a" foreground: light: "#333333" dark: "#e0e0e0"
Light/dark color modes were added in Quarto version 1.8 and currently are not supported in the R or Python brand.yml packages.
Logo Variants
logo: images: logo-dark: logos/logo-dark.svg logo-white: logos/logo-white.svg icon: logos/icon.png small: icon medium: light: logo-dark dark: logo-white
Multiple Font Weights
typography: fonts: - family: Inter source: google weight: [300, 400, 500, 600, 700] style: [normal, italic] base: family: Inter weight: 400 headings: family: Inter weight: 600
Color Aliases
color: palette: navy: "#003366" ocean-blue: "#0066cc" sky-blue: "#3399ff" primary-color: ocean-blue # Alias brand-blue: ocean-blue # Alias blue: sky-blue # Alias for primary colors primary: brand-blue
Include Bootstrap color names when possible, either defined directly or as aliases:
blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, white, black. This is useful for consistency and these colors are picked up automatically by tools that use brand.yml.
Tips
- Read specification first: Always consult
when creating or modifying filesbrand-yml-spec.md - Framework-specific guides: Load the appropriate reference (shiny-r.md, shiny-python.md, quarto.md) for integration details
- Validate incrementally: Start with minimal structure, test, then add complexity
- Use references: Define colors in palette, then reference by name in semantic colors
- Standard file name: Use
for automatic discovery_brand.yml - Explicit paths: Use custom file names only when necessary (shared branding, multiple variants)