rebrand-artifact

Swaps brand color tokens in TSX artifacts via AST rewrite and regenerates brand-vars CSS.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/GQAdonis/artifact-refiner-skill --skill rebrand-artifact-gqadonis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebrand-artifact
Source: https://github.com/GQAdonis/artifact-refiner-skill/tree/main/skills/rebrand-artifact
Command: npx skills add https://github.com/GQAdonis/artifact-refiner-skill --skill rebrand-artifact-gqadonis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @babel/parser, @babel/traverse, @iarna/toml, and includes scripts (resource) and assets (resource) components.

What problem does it solve? Applying a new brand's color palette to an existing React TSX artifact normally requires tedious manual find-and-replace of hex values, which risks missing embedded literals or breaking CSS variable references. This Skill automates the token swap while preserving structure, content, and behavior. ## Core Features & Use Cases - AST-Based Hex Swapping: Parses TSX with Babel and rewrites exact-match hex literals, including hex values embedded inside larger strings, while leaving var(--color-*) references untouched. - CSS Regeneration: Regenerates the brand-vars CSS file for the target brand via the template-forge vite-shell-css template. - WCAG Contrast Reporting: Scores key color pairs (ink/ember/muted on backgrounds, white on ember) against WCAG 2.1 levels and reports warnings without blocking output. - Use Case: You have a React component built for the knowme brand and need an identical version styled for prometheus-ags; run the Skill with both brand TOMLs to produce a rebranded TSX plus matching CSS in one step. ## Quick Start Ask the agent to rebrand your TSX file by providing the source path, the from-brand and to-brand names, and the desired output path.

Frequently Asked Questions about rebrand-artifact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebrand a React TSX component with different brand colors?

Run the rebrand script with the source TSX path, the current brand name, the target brand name, and an output path. It parses the file with Babel, swaps matching hex literals for the target brand's tokens, and writes a rebranded TSX plus regenerated CSS.

How to swap hex color codes in TSX without breaking CSS variables?

Use an AST-based rewrite that only touches StringLiteral nodes containing exact hex matches. References like var(--color-*) are left untouched because the canonical values live in the regenerated brand-vars CSS file.

Does the rebrand script work with brands defined in TOML files?

Yes, both the from-brand and to-brand must exist as TOML files under the brand library assets directory. The script loads them with @iarna/toml, flattens hex-valued fields, and builds a value-to-value swap map; a missing brand produces an error.

Does WCAG contrast failure block the rebranded output?

No, the WCAG 2.1 contrast report is informational only and never blocks output. Pairs scoring A or FAIL are flagged as warnings, and you can pass --ignore-contrast to suppress the warning summary in CI pipelines.

What are the limitations of automated hex literal swapping?

The swap only covers exact hex matches in string literals, so dynamically computed colors or non-hex formats are not rewritten. AAA-level contrast conformance is not verified, so users needing AAA must inspect the palette manually.