theme-orphaned-refs
БесплатноЗапускает вложенные скриптыНе проверенFix WordPress theme preset references by scanning the theme sequentially, detecting orphaned var:preset and --wp--preset tokens, and replacing them with the…
от lightspeedwp★ 20 звёзд на GitHubОб этом скилле
Theme Orphaned Refs
Overview
This skill guides an agent to walk a WordPress block theme sequentially, detect preset references that no longer exist in theme.json, and replace them with the closest matching presets from theme.json.
Workflow (sequential)
- Load theme.json and build the preset registry for
color,font-family,font-size,spacing,shadow,border-radius,gradient,duotone. - Scan the theme's own files in path order (root → subfolders), skipping
node_modules,vendor,build,dist,coverage,.git,.agents,.claudeand.github, for:var:preset|<type>|<slug>--wp--preset--<type>--<slug>
- For each reference whose slug is not defined in theme.json, replace it with the closest match.
- If the reference is a block attribute or class (
textColor,backgroundColor,has-*-color), update the class/slug to match the new slug. - If a style variation defines its own palette, rename its palette slugs to the closest theme.json slugs and update all usage inside that file.
- Re-scan until no orphaned references remain.
Closest-match rules
- Exact match: keep as-is.
- Numeric slugs (e.g.,
accent-4): choose the nearest numeric slug with the same prefix from theme.json. - Bare numeric ladders (font sizes
100–900, radius0–700, spacing5–100): choose the nearest step. Check what the old value was for: a pill button radius belongs onRound, even when another step is nearer by size. - Accent/CTA/Brand 1–9: map to
*-100,*-200, etc. when present. - Font sizes by name:
small→300,medium→400,large→500,x-large→600,xx-large→700(fallback to nearest numeric).
- Font families: if specific font slugs are gone and only
heading/bodyremain, map:- headings/site-title/pullquote →
heading - paragraphs/body defaults →
body
- headings/site-title/pullquote →
- Otherwise, use best string similarity against the available slugs.
Suggested tooling
Use the bundled script to find orphaned references and suggested replacements:
npx tsx ${CLAUDE_SKILL_DIR}/scripts/find-orphaned-presets.ts --root <theme-root> --report <path outside the theme>
Add --exclude <folder> (repeatable) to skip another folder. Run npm ci in the .github checkout first. Tests: npm run test:theme-orphaned-refs from the repository root.
Then apply replacements with minimal, localized edits.
Notes
- Update both the preset token and any generated class names (e.g.,
has-accent-4-color→has-accent-400-color). - Keep edits minimal; avoid reformatting unrelated code.
Resources
This skill includes a scanning script and optional references directory.
scripts/
Executable code for scanning orphaned preset references and suggesting replacements.
references/
Optional reference material for mapping conventions.
assets/
Unused in this skill.
Docs signed by 🤖 Copilot for LightSpeedWP – always fresh!
Установить theme-orphaned-refs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл theme-orphaned-refs?
Fix WordPress theme preset references by scanning the theme sequentially, detecting orphaned var:preset and --wp--preset tokens, and replacing them with the closest matching slugs defined in theme.json. Use when theme.json variable names change and existing patterns/styles/templates still reference old slugs.
Как установить скилл theme-orphaned-refs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл theme-orphaned-refs запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic