Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问clear审计通过

shadcn-layoutsshadcn/ui layouts 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

7,007

周安装

301

GitHub Stars

69

下载量

2,456
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shadcn-layouts(shadcn/ui layouts 前端)
来源仓库:https://github.com/jwynia/agent-skills
仓库路径:skills/shadcn-layouts
安装命令:
npx skills add https://github.com/jwynia/agent-skills --skill shadcn-layouts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jwynia/agent-skills --skill shadcn-layouts

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护,支持 React、Next.js 等框架。

  • 适用于生成或审查 shadcn/ui 相关的布局和组件结构,提升开发效率。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 使用时需结合项目现有设计系统和构建方式,避免生成孤立代码片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。

SKILL.md

shadcn/Tailwind Layouts

Help generate shadcn/Tailwind components that render correctly the first time. Most agent-generated UI fails due to missing mental models about how CSS layout works—not syntax errors, but assumption gaps.

When to Use This Skill

Use this skill when:

  • Creating shadcn/Tailwind layouts
  • Debugging height/scroll issues
  • Fixing flex/grid problems
  • Setting up full-page app shells

Do NOT use this skill when:

  • Writing backend code
  • Working on non-Tailwind CSS projects
  • Designing (use frontend-design first)

Core Principle

CSS layout flows from constraints. Height flows down from explicit ancestors. Width flows up from content. Agents fail because they apply classes without understanding the constraint chain.

Critical Mental Models

Model 1: Height Inheritance Chain

h-full means height: 100%. 100% of what? 100% of the parent's computed height.

BROKEN (chain incomplete):
<html>                        <!-- no height -->
  <body>                      <!-- no height -->
    <div class="h-full">      <!-- 100% of nothing = 0 -->

WORKING (chain complete):
<html class="h-full">         <!-- 100% of viewport -->
  <body class="h-full">       <!-- 100% of html -->
    <div class="h-full">      <!-- 100% of body = works -->

Rule: Trace from element up to <html>. Every ancestor needs explicit height, OR use viewport units (h-screen) to break the chain.

Model 2: Flex Overflow Gotcha

Flex children have implicit min-height: auto, preventing shrinking below content size.

// BROKEN (won't scroll)
<div className="flex flex-col h-screen">
  <main className="flex-1 overflow-y-auto">  {/* Can't shrink! */}

// WORKING (scrolls correctly)
<div className="flex flex-col h-screen">
  <main className="flex-1 overflow-y-auto min-h-0">  {/* Can shrink */}

Rule: Flex children that scroll need min-h-0. Children that shouldn't shrink need shrink-0.

Model 3: Grid Parent/Child Separation

Grid is defined on the parent. Children just occupy cells.

// BROKEN
<div className="grid-cols-3">           {/* Missing 'grid'! */}

// WORKING
<div className="grid grid-cols-3">      {/* 'grid' enables grid-cols-* */}

Rule: flex or grid must be declared on parent before direction/template classes work.

Model 4: Scroll Container Dimensions

Scroll containers need explicit dimensions to know when to scroll.

// BROKEN (never scrolls)
<ScrollArea>  {/* No height constraint */}

// WORKING (flex-constrained)
<div className="flex flex-col h-screen">
  <ScrollArea className="flex-1 min-h-0">

Diagnostic States

SL1: Height Chain Broken

Symptoms: Elements collapse, h-full not working Fix: Trace to html, add heights or use h-screen

SL2: Flex Overflow Blocked

Symptoms: Scroll doesn't work, content overflows Fix: Add min-h-0 to flex children that scroll

SL3: Grid Structure Wrong

Symptoms: Items stack vertically instead of columns Fix: Ensure grid grid-cols-* on parent

SL4: Styles Not Applying

Symptoms: Unstyled components, colors wrong Fix: Check Tailwind content paths, CSS variables in globals.css

SL5: Component Dependencies Missing

Symptoms: "Module not found", functionality broken Fix: npx shadcn add [component], install peer deps

Common Layout Patterns

Full-Page App Shell

// layout.tsx
<html lang="en" className="h-full">
  <body className="h-full">{children}</body>
</html>

// page.tsx
<div className="flex h-full">
  <aside className="w-64 shrink-0 border-r overflow-y-auto">
    <nav>...</nav>
  </aside>
  <main className="flex-1 min-w-0 overflow-y-auto">
    {children}
  </main>
</div>

Dashboard with Header

<div className="flex flex-col h-screen">
  <header className="h-16 shrink-0 border-b">...</header>
  <div className="flex flex-1 min-h-0">
    <aside className="w-64 shrink-0 border-r overflow-y-auto">...</aside>
    <main className="flex-1 min-w-0 overflow-y-auto p-6">
      {children}
    </main>
  </div>
</div>

Card Grid

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
  {items.map(item => (
    <Card key={item.id}>
      <CardHeader><CardTitle>{item.title}</CardTitle></CardHeader>
      <CardContent>{item.content}</CardContent>
    </Card>
  ))}
</div>

Anti-Patterns

The Height Assumption

Using h-full without verifying ancestor chain. Fix: Trace to html. Use h-screen to break chain.

The Overflow Ignorance

Adding overflow-y-auto without min-h-0 on flex children. Fix: Flex children need min-h-0 to shrink.

The Import Guess

Guessing import paths like shadcn/ui. Fix: Check components.json for alias. Usually @/components/ui/*.

The Flat Compound

Flattening compound components (Dialog without DialogTrigger/DialogContent). Fix: Maintain required nesting structure.

Pre-Generation Checklist

  • Import alias known (@/components/ui/*)
  • html has h-full
  • body has h-full or min-h-full
  • Scroll containers have explicit height
  • Flex scroll children have min-h-0
  • Fixed elements have shrink-0

Related Skills

  • frontend-design - Design decisions before implementation
  • react-pwa - PWA features for React apps

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.44%
按下载量换算698

OpenCode

23.08%
按下载量换算567

Antigravity

15.29%
按下载量换算376

Codex

10.77%
按下载量换算265

Cursor

7.78%
按下载量换算191

Gemini CLI

3.4%
按下载量换算84

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jwynia/agent-skills --skill shadcn-layouts;npx skills add jwynia/agent-skills --skill "shadcn-layouts" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills