本文へ移動
cccskills
無料GitHub で公開

compact-nav-menus

Sizing tokens for compact sidebars, nav panels, and menu lists. Use when building or refactoring a sidebar, settings menu, category list, filter bar, or expandable nav tree, or when a sidebar looks too wide, too padded, or wastes space.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Compact Navigation & Menu Panels

Canonical sizing and spacing rules for navigation sidebars, list panels, and compact menus across the project. Every value below is a hard default — deviate only with justification.

Sizing Tokens

Sidebar Container

PropertyValueNotes
Widthw-36 to w-44Never wider than w-44 (~176px). Use w-36–w-40 when labels are short.
Backgroundbg-muted/30Subtle tint, not solid bg-card.
Borderborder-r border-border/6060% opacity, not full border-border.
Visibilityhidden md:flexAlways hidden on mobile; use MobileDock or stacked list instead.
ScrollWrap content in <ScrollArea className="h-full w-full">Never overflow-y-auto on the aside itself.

Nav Item — Top-Level (Flat or Parent)

PropertyValue
Fonttext-xs (12px)
Paddingpx-3 py-1.5
Gapgap-2
Iconh-3.5 w-3.5
Active BGbg-accent text-accent-foreground font-medium
Active icontext-primary
Inactivetext-muted-foreground hover:text-foreground
Hover BGhover:bg-muted/80
ShapeNo rounded corners on rows — full-bleed highlight.

Nav Item — Child (Second Tier)

PropertyValue
Fonttext-[11px]
Paddingpl-8 pr-3 py-1
Gapgap-1.5
Iconh-3 w-3
Activetext-primary font-medium (no background)
Inactive icontext-muted-foreground/60

Section Headers (Grouped Lists)

PropertyValue
Fonttext-[10px] font-medium uppercase tracking-wider — the ONE sanctioned 10px use (uppercase overline chrome; see ui-dense data-dense-rules "Absolute minimums")
Colortext-muted-foreground/70
Paddingpx-3 pt-3 pb-1
Separatorborder-t border-border/40 above the header, not <Separator> components.

Filter Bar / Chip Row

PropertyValue
Containerpx-3 py-1.5 flex items-center gap-1.5 flex-wrap
Chip (active)px-2 py-0.5 rounded text-xs bg-primary text-primary-foreground
Chip (inactive)px-2 py-0.5 rounded text-xs bg-muted/60 text-muted-foreground hover:bg-muted
Search inputh-7 text-xs pl-8 with icon at h-3.5 w-3.5
Select dropdownh-6 px-1.5 rounded text-xs bg-muted/60 border-0

Footer / Status Bar

PropertyValue
Paddingpx-4 py-1.5 or px-4 py-2
Fonttext-xs (status text is content — never below 12px)
Backgroundbg-muted/20
Borderborder-t border-border/60
Buttonsh-7 text-xs gap-1 px-2.5

Anti-Patterns

These are the exact mistakes to fix when refactoring existing sidebars:

BadFix
w-52, w-64, or widerReduce to w-36–w-44
text-sm on nav itemsUse text-xs
py-2, py-3 on nav rowsUse py-1.5 (top-level) or py-1 (child)
gap-3 between icon and labelUse gap-2 (top-level) or gap-1.5 (child)
h-4 w-4 icons in navUse h-3.5 w-3.5 (top-level) or h-3 w-3 (child)
rounded-md on nav rowsRemove — use full-bleed row highlights
bg-primary text-primary-foreground activeUse bg-accent text-accent-foreground
p-3, p-4 wrapper padding inside sidebarUse py-1 with no horizontal padding on the wrapper; let rows handle px-3
space-y-6 between groupsUse border-t border-border/40 separator + tight header
<Separator> componentReplace with a border-t on the section header
bg-card sidebar backgroundUse bg-muted/30
border-border (full opacity)Use border-border/60
text-lg sidebar titleRemove header entirely or use text-xs uppercase section label

Two-Tier Expandable Pattern

For sidebars where a top-level item reveals sub-items (like Settings > Preferences):

const isExpanded = isActive && !!item.children;

{/* Parent */}
<Link href={item.children ? `${item.href}?tab=${item.children[0].param}` : item.href}
  className={cn(
    'flex items-center gap-2 px-3 py-1.5 transition-colors text-xs',
    'hover:bg-muted/80',
    isActive ? 'bg-accent text-accent-foreground font-medium'
             : 'text-muted-foreground hover:text-foreground',
  )}
>
  <span className={cn('shrink-0', isActive ? 'text-primary' : 'text-muted-foreground')}>
    {item.icon}
  </span>
  <span className="truncate">{item.title}</span>
</Link>

{/* Children — only when expanded */}
{isExpanded && (
  <div className="py-0.5">
    {item.children.map(child => (
      <Link key={child.param}
        href={`${item.href}?tab=${child.param}`}
        className={cn(
          'flex items-center gap-1.5 pl-8 pr-3 py-1 transition-colors text-[11px]',
          'hover:bg-muted/80',
          isChildActive ? 'text-primary font-medium'
                        : 'text-muted-foreground hover:text-foreground',
        )}
      >
        <span className={cn('shrink-0',
          isChildActive ? 'text-primary' : 'text-muted-foreground/60',
        )}>{child.icon}</span>
        <span className="truncate">{child.title}</span>
      </Link>
    ))}
  </div>
)}

Grouped Sections Pattern

For sidebars with categorized groups (like a file manager):

<aside className="hidden md:flex w-40 shrink-0 border-r border-border/60 bg-muted/30">
  <ScrollArea className="h-full w-full">
    <nav>
      {groups.map((group, i) => (
        <div key={group.label}>
          {/* Section header — acts as separator */}
          <div className={cn(
            'px-3 pt-3 pb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70',
            i > 0 && 'border-t border-border/40',
          )}>
            {group.label}
          </div>
          {group.items.map(item => (
            <Link key={item.href} href={item.href}
              className={cn(
                'flex items-center gap-2 px-3 py-1.5 transition-colors text-xs',
                'hover:bg-muted/80',
                isActive ? 'bg-accent text-accent-foreground font-medium'
                         : 'text-muted-foreground hover:text-foreground',
              )}
            >
              <item.icon className={cn('h-3.5 w-3.5 shrink-0',
                isActive ? 'text-primary' : 'text-muted-foreground',
              )} />
              <span className="truncate">{item.label}</span>
            </Link>
          ))}
        </div>
      ))}
    </nav>
  </ScrollArea>
</aside>

Refactoring Checklist

When converting an existing sidebar to this system:

  1. Container: w-36–w-44, bg-muted/30, border-r border-border/60
  2. Remove wrapper padding: No p-3/p-4 on the scroll content wrapper
  3. Items: text-xs, px-3 py-1.5, gap-2, icons h-3.5 w-3.5
  4. Active state: bg-accent text-accent-foreground font-medium (not bg-primary)
  5. No rounded rows: Remove rounded-md from item classes
  6. Section separators: Replace <Separator> and space-y-6 with border-t border-border/40 on headers
  7. Remove sidebar titles: Drop text-lg font-semibold headers; use section labels if grouping is needed
  8. Icons: Lucide React only, h-3.5 w-3.5 for top-level, h-3 w-3 for children
  9. ScrollArea: Wrap nav content in <ScrollArea>, not overflow-y-auto
  10. Mobile: hidden md:flex on the aside; provide MobileDock or stacked list alternative

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Admin debug system wiring for the floating AdminIndicator's live debug data and Copy Full Context. Use when adding debug visibility to a route or feature, wiring useDebugContext or the debug panel, capturing console errors, or enabling the copy-context workflow for a page.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Compact two-icon Copy / Copy-for-AI controls (components/agent-copy). Use when adding copy buttons to a row, card, list, or record; merging duplicate Copy/JSON/AI controls; continuing the copy rollout; or writing a Copy-for-AI payload. NOT for markdown content actions (use rich-document-actions).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Disclosing a surface's existing fixed AI jobs in the shell's top Agents menu. Use when a page, panel, overlay, or window already runs a mandate behind a button, assist, automatic action, or mode; when the agent-disclosure guard names a file; or during a surface check.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The watch-fix-rerun method for making an existing platform agent or automated process efficient and correct: baseline its ledger, run one unit yourself, fix the class behind every wasted call, rerun, record. Use when asked to improve, optimize, watch, or 'make efficient' an agent, a sandbox session, a sync job, or any recurring automated process.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Redux state for agent execution and firing agent shortcuts. Use when editing features/agents/redux/, building agent UI, creating a conversation, touching assembleRequest or NDJSON stream state, wiring agent-state selectors, adding a per-conversation capability, or triggering a shortcut from a button, menu, or code (useShortcutTrigger, launchAgentExecution).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The provision for a call site: the exhaustive menu of values that place in the code can realistically produce. Use before creating or fixing a mandate or agent that reasons about more than its own input, when deciding whether an agent can answer at all with what it is sent, or when its output 'looks right' but nobody checked it could be. NOT for building the agent (use create-agent).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

armanisadeghi のスキルをすべて見る

このスキルの問題を報告する