Agent skill

CSS Debug

by majiayu000 in majiayu000/spellbook

A skill your agent uses to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems.

MITAuto-check passedFrontend & Design

Install CSS Debug

skills CLI
$ npx skills add majiayu000/spellbook --skill css-debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/spellbook css-debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/css-debug .claude/skills/css-debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
css-debug
GitHub stars
286
Token cost
~1.1k tokens
SKILL.md length
90 words
Files
1
Skills in repo
96
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems.

  • Works in 5 steps: 收集信息 → 常见问题检查清单 → 浏览器调试命令 → …
  • Diagnose CSS and frontend layout issues such as positioning
  • SKILL.md covers 使用场景, 调试步骤, 输出格式 and 示例对话
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

CSS Debug is an agent skill from majiayu000/spellbook. Use this skill to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering CSS and styling. It works with React and Tailwind CSS. The repository describes itself as: Cross-runtime skills for Claude Code, Codex, and multi-agent workflows. The licence is MIT.

When your agent uses it

  • Diagnose CSS and frontend layout issues such as positioning
  • Overflow clipping
  • Tailwind class conflicts
  • Z-index stacking

Example prompts

  • “/css-debug”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. 收集信息
  2. 常见问题检查清单
  3. 浏览器调试命令
  4. React DevTools 检查
  5. 常用修复模式

What it can do on your machine

Read from SKILL.md and the folder at commit 414b597. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript and typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CSS Debug loads about 1.1k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 90 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit 414b597, republished under its MIT licence (© majiayu000). 90 words, ~1,107 tokens.

Download SKILL.mdSave it as .claude/skills/css-debug/SKILL.md (or your agent's skills folder).
name
css-debug
description
Use this skill to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems.
metadata.command-name
css-debug
metadata.user-invocable
true

CSS Debug Skill

<command-name>css-debug</command-name> <user-invocable>true</user-invocable>

使用场景

当用户遇到以下问题时使用此 skill:

  • CSS 定位问题(元素位置不正确、被裁剪、溢出等)
  • React 组件渲染问题
  • Tailwind CSS 类不生效
  • 绝对定位/相对定位问题
  • Flexbox/Grid 布局问题
  • z-index 层叠问题

调试步骤

1. 收集信息

首先向用户询问或获取:

  • 浏览器开发者工具中的 HTML 结构
  • 相关元素的 computed styles
  • 父容器的 CSS 属性(特别是 position、overflow、display)
  • 截图(如果有的话)
2. 常见问题检查清单
绝对定位内容被裁剪
问题:position: absolute 的元素被父容器裁剪
检查:
- [ ] 父容器是否有 overflow: hidden 或 overflow: auto
- [ ] 祖先容器是否有 overflow: hidden
- [ ] 父容器是否设置了 position: relative
- [ ] 元素的 top/left/right/bottom 值是否超出父容器

解决方案:
1. 将 overflow: hidden 改为 overflow: visible
2. 或将绝对定位元素移到更外层的容器
3. 或使用 fixed 定位(相对于视口)
元素位置偏移
问题:元素位置与预期不符
检查:
- [ ] positionX/positionY 或 left/top 值是否正确
- [ ] 最近的 position: relative 祖先是哪个
- [ ] 是否有 margin/padding 影响
- [ ] transform 是否影响定位上下文

解决方案:
1. 确认定位参考点是正确的祖先元素
2. 检查 CSS 单位(px vs % vs rem)
3. 使用浏览器检查器的"元素选择"功能定位问题
内容不显示
问题:React 组件渲染但内容不可见
检查:
- [ ] 元素是否有 width/height(可能为 0)
- [ ] opacity 是否为 0
- [ ] visibility 是否为 hidden
- [ ] display 是否为 none
- [ ] z-index 是否被其他元素遮挡
- [ ] color 是否与背景色相同

解决方案:
1. 在开发者工具中检查 Computed 面板
2. 临时添加边框或背景色调试:border: 1px solid red
3. 检查条件渲染逻辑
Tailwind 类不生效
问题:Tailwind CSS 类没有应用
检查:
- [ ] 类名拼写是否正确
- [ ] 是否被更高优先级的样式覆盖
- [ ] 动态类名是否正确生成(字符串拼接问题)
- [ ] tailwind.config.js 中 content 配置是否包含该文件

解决方案:
1. 使用 !important 临时测试:!overflow-visible
2. 检查 className 是否正确传递
3. 使用内联 style 作为备选方案
3. 浏览器调试命令

在浏览器控制台运行:

javascript
// 高亮所有绝对定位元素
document.querySelectorAll('[style*="position: absolute"]').forEach(el => {
  el.style.outline = '2px solid red';
  console.log(el, getComputedStyle(el));
});

// 查找 overflow: hidden 的容器
document.querySelectorAll('*').forEach(el => {
  const style = getComputedStyle(el);
  if (style.overflow === 'hidden' || style.overflowX === 'hidden' || style.overflowY === 'hidden') {
    el.style.outline = '2px dashed blue';
    console.log('overflow-hidden:', el);
  }
});

// 检查元素的完整 computed 样式
const el = document.querySelector('.your-selector');
console.table({
  position: getComputedStyle(el).position,
  overflow: getComputedStyle(el).overflow,
  display: getComputedStyle(el).display,
  width: getComputedStyle(el).width,
  height: getComputedStyle(el).height,
  top: getComputedStyle(el).top,
  left: getComputedStyle(el).left,
});

// 查找定位祖先
function findPositionedAncestor(el) {
  let current = el.parentElement;
  while (current) {
    const position = getComputedStyle(current).position;
    if (position !== 'static') {
      console.log('Positioned ancestor:', current, 'position:', position);
      return current;
    }
    current = current.parentElement;
  }
  console.log('No positioned ancestor found, using viewport');
  return null;
}
findPositionedAncestor(document.querySelector('.your-selector'));
4. React DevTools 检查
  1. 打开 React DevTools
  2. 选择问题组件
  3. 检查:
    • props 是否正确传递
    • state 是否包含预期数据
    • 条件渲染的条件是否满足
5. 常用修复模式
修复绝对定位被裁剪
tsx
// 问题代码
<div className="relative overflow-hidden">
  <div style={{ position: 'absolute', top: 200, left: 100 }}>
    被裁剪的内容
  </div>
</div>

// 解决方案 1: 移除 overflow-hidden
<div className="relative overflow-visible">
  ...
</div>

// 解决方案 2: 条件性 overflow
const hasAbsoluteContent = blocks.some(b => b.props?.positionX !== undefined);
<div className={`relative ${hasAbsoluteContent ? '' : 'overflow-hidden'}`}>
  ...
</div>

// 解决方案 3: 分离容器
<div className="relative">
  <div className="overflow-hidden">
    {/* 需要裁剪的内容 */}
  </div>
  <div className="absolute-content-wrapper">
    {/* 绝对定位内容 */}
  </div>
</div>

输出格式

分析完成后,提供:

  1. 问题诊断:明确说明是什么导致了问题
  2. 原因分析:解释 CSS 机制和为什么会发生这种情况
  3. 解决方案:提供具体的代码修改建议
  4. 验证步骤:告诉用户如何验证修复是否有效

示例对话

用户:我的绝对定位元素被裁剪了

Claude:

  1. 请在浏览器中运行以下命令查找 overflow:hidden 的容器:
    javascript
    document.querySelectorAll('*').forEach(el => {
      const style = getComputedStyle(el);
      if (style.overflow === 'hidden') {
        el.style.outline = '2px dashed blue';
        console.log('overflow-hidden:', el);
      }
    });
  2. 请告诉我哪些容器被标记出来了
  3. 同时,请检查绝对定位元素的父容器是否有 position: relative

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/css-debug of majiayu000/spellbook.

Open the folder on GitHubat commit 414b597

Compare with similar skills

CSS Debug next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CSS Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CSS Debug this skillmajiayu000/spellbook286—~1.1kAutomated safety check: PassMIT
Kill AI Slopyetone/kill-ai-slop1.3k—~1.4kAutomated safety check: PassApache-2.0
Cosscrafter-station/petdex4.2k—~1.4kAutomated safety check: PassMIT
Design StyleCastor6/tactus3761 repos~2.1kAutomated safety check: PassApache-2.0
Opensource UIbidyut10/opensourceui717—~1.1kAutomated safety check: PassMIT
Extract DesignManavarya09/design-extract4.2k—~786Automated safety check: NotesMIT

Similar skills

  • Kill AI Slop

    yetone/kill-ai-slop

    Find and remove AI slop — the generic, machine-default visual and copy tics of vibe-coded products — from a web project.

    1.3k GitHub stars~1.4k tokensUpdated 22 days ago
    Frontend & DesignAuto-check passed
  • Coss

    crafter-station/petdex

    Helps implement coss UI components correctly. An agent skill from crafter-station/petdex.

    4.2k GitHub stars~1.4k tokensUpdated 8 days ago
    Frontend & DesignAuto-check passed
  • Design Style

    Castor6/tactus

    A skill your agent uses whenever the user asks to build, create, design, develop, improve, or style any frontend interface or visual element.

    376 GitHub starsUsed in 1 repo~2.1k tokens
    Frontend & DesignAuto-check passed
  • Opensource UI

    bidyut10/opensourceui

    Use Opensource UI patterns and copy-paste React/Next.js components from opensourceui.in.

    717 GitHub stars~1.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Extract Design

    Manavarya09/design-extract

    Extract the full design language from any website URL. An agent skill from Manavarya09/design-extract.

    4.2k GitHub stars~786 tokensUpdated 8 days ago
    Frontend & DesignAuto-check: notes
  • Ask Sonner

    leepokai/Codync

    Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and…

    186 GitHub starsUsed in 4 repos~1.8k tokens
    Frontend & DesignAuto-check: warnings

More from majiayu000/spellbook

All 96 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    286 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    286 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    286 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Flowguard Task Guard

    majiayu000/spellbook

    Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

    286 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    286 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    286 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Questions about CSS Debug

What does CSS Debug do?

A skill your agent uses to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems. CSS Debug is an agent skill from majiayu000/spellbook. Use this skill to diagnose CSS and frontend layout issues such as positioning, overflow clipping, Tailwind class conflicts, z-index stacking, and React rendering visibility problems.

When should I use CSS Debug?

CSS Debug fits situations like: diagnose CSS and frontend layout issues such as positioning; overflow clipping; tailwind class conflicts; Z-index stacking.

How do I install CSS Debug in Claude Code?

Run `npx skills add majiayu000/spellbook --skill css-debug -a claude-code`. Or copy the skill folder (skills/css-debug in majiayu000/spellbook) into .claude/skills/css-debug in your project. Claude Code loads it when a task matches its description.

How do I install CSS Debug in Codex?

Run `npx skills add majiayu000/spellbook --skill css-debug -a codex`. Or copy the skill folder (skills/css-debug in majiayu000/spellbook) into .agents/skills/css-debug in your project. Codex loads it when a task matches its description.

Can I use CSS Debug in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill css-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/css-debug, .gemini/skills/css-debug, .github/skills/css-debug and .opencode/skills/css-debug in your project.

What does CSS Debug need to run?

SKILL.md names no scripts, command-line tools or credentials: CSS Debug is instructions for the agent only.

Does CSS Debug access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is CSS Debug safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CSS Debug use?

CSS Debug is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CSS Debug use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to CSS Debug?

Skills that share tags, products or a category with CSS Debug: Kill AI Slop (yetone/kill-ai-slop, 1.3k stars), Coss (crafter-station/petdex, 4.2k stars), Design Style (Castor6/tactus, 376 stars) and Opensource UI (bidyut10/opensourceui, 717 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CSS Debug?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 286 GitHub stars. The repository holds 96 skills in this directory. The repository was last updated on October 6, 2026.

Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.