Agent skill
token-injector
Automated CSS variable injection from tokens.json. Parses design tokens → generates CSS custom properties → injects into stylesheets → replaces hardcoded values.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/token-injector
SKILL.md
Token-Injector Skill
Function
Input: tokens.json + target CSS files
Output: Updated stylesheets with CSS variables
Process
- Parse
tokens.jsonfrom asset packages - Generate CSS custom properties
- Inject into
:rootor component scope - Replace hardcoded values with
var()references - Validate no broken references
Token Mapping
tokens.json:
{
"background": "#1A1714",
"palette": {
"waratah_crimson": "#C45C4B",
"wattle_gold": "#D4A84B",
"eucalyptus_sage": "#7A9E82"
}
}
Generated CSS:
:root {
--color-specimen-night: #1A1714;
--color-waratah-crimson: #C45C4B;
--color-wattle-gold: #D4A84B;
--color-eucalyptus-sage: #7A9E82;
}
Replacement Logic
Before:
.card {
background: #1A1714;
border: 1px solid #C45C4B;
}
After:
.card {
background: var(--color-specimen-night);
border: 1px solid var(--color-waratah-crimson);
}
Batch Mode
Process all asset tokens.json files:
token-injector --input /assets/*/tokens.json --output /frontend/src/styles/northcote-tokens.css
Integration
Asset-Packager: Generates source tokens.json
Claude Code: Executes injection on target files
Stylelint: Validates output
Efficiency
Before: 30 min manual find-replace per component After: 2 min automated injection Savings: 93% reduction
Tokens → CSS variables → automatic injection. Manual replacement eliminated.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?