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

block-authoring

Author a placeable layout block that looks right at ANY pane size. The one hard rule — size to the PANE with container queries (@container), never the viewport — plus list/form playbooks and the sizing contract (minWidth etc.) the viability metric reads. Use when adding/converting a croutonLayoutBlocks block, or when a block overflows/breaks in a narrow pane.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.1 KB

SKILL.md(原文)

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

Author a block that looks good in any pane

A layout block doesn't live in a known screen — it lives in whatever pane the user dragged it to. So it must respond to its container, not the viewport, and it must declare how small it's allowed to get. This skill is the playbook; the contract it fills in is read by the viability metric (checkLayoutViability, #710) and the deterministic layout pass (#709).

Part of the layout engine (epic #703). A block is registered in croutonLayoutBlocks (see crouton-core CLAUDE.md, #704) — this skill is about how to build the component behind that registration.

The one hard rule: container queries, not viewport media queries

A block's width ≠ the viewport width. A list in a 280px sidebar on a 4K monitor is narrow, even though the viewport is huge. So:

  • ✅ Use @container (Tailwind / Nuxt UI 4 container queries) keyed off a container on the block root. Put @container on the root element, then size children with the @-prefixed variants (@sm:, @md:, @lg: …).
  • ❌ Never use viewport media queries (sm:/md:/lg:) or useBreakpoints/window width for a block's internal layout — those track the screen, not the pane. (Rejected in #710 for exactly this reason.)
<template>
  <!-- @container makes the @-variants below resolve against THIS element's width -->
  <div class="@container h-full overflow-auto">
    <div class="grid grid-cols-1 @md:grid-cols-2 gap-4">…</div>
  </div>
</template>

Reference implementations in packages/crouton-core/app/components/: LayoutSpikeList.vue, LayoutSpikeForm.vue, LayoutSpikeStats.vue (each uses @container; throwaway spike blocks, but the responsiveness pattern is the model).

Declare the sizing contract

On the block's CroutonLayoutBlockDefinition (in the package's app.config.ts croutonLayoutBlocks), declare what it needs. All optional; undeclared ⇒ fully fluid (minWidth 0).

FieldUse it for
minWidthThe viability floor (px). Below this the block breaks → the pane refuses to shrink past it, and the viability check flags it. Set it to the smallest width where the block is still legible after its narrowest container-query state kicks in.
minHeightSmallest usable height (px).
maxWidthDon't stretch past this (px).
defaultSizePreferred size (% of its pane group) when first placed.
resize'free' (default) · 'fixed' · 'aspect'.
aspectwidth/height ratio when resize: 'aspect'.
density'compact' | 'comfortable' | 'spacious' hint for the block's own layout.

Pick minWidth after you've authored the narrowest container state — it's the point past which even the collapsed layout stops working, not the desktop width.

List playbook

  • Column priority + collapse order: decide which columns drop first as the container narrows; keep the identifying column (title) longest.
  • Table → cards threshold: below a container width, switch a table to stacked cards (@container variant) — never a broken horizontal scrollbar.
  • Min column widths so columns don't crush; sticky header on scroll.
  • Empty / loading / error states all sized for the pane (no fixed-px blocks that overflow a narrow column).

Form playbook

  • Two-column ⇄ single-column at a container threshold (@md:grid-cols-2 → grid-cols-1), not a viewport one.
  • Label placement: top labels survive narrow panes better than left labels.
  • Field grouping stays intact across the collapse; primary action stays reachable (sticky footer or end of flow), full-width when narrow.

General rules

  • No fixed pixel widths that can overflow a pane — use intrinsic / fluid sizing.
  • Contain overflow: overflow-auto on the scroll root; the block fills its pane (h-full w-full) and scrolls internally rather than pushing the pane.
  • Honour your own minWidth — the declared floor and the narrowest CSS state should agree (don't declare 240 if the layout visibly breaks at 300).
  • SSR-safe: no window/measurement on first render (container queries are pure CSS, so they work in SSR — that's another reason to prefer them).

Check your work

  1. Drop the block into a wide pane, then drag it narrow — it should reflow (columns collapse / table→cards / 2col→1col) via container queries, not scroll sideways or crush.
  2. The pane should refuse to shrink the block below its minWidth.
  3. Run the viability metric over a layout that puts the block in a too-small pane — useCroutonLayoutBlocks().checkViability(tree, [1280, 768, 375]) (or the pure checkLayoutViability) should flag it. See crouton-core CLAUDE.md.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

a11y

無料

Accessibility review for Vue surfaces — the code-cleaning analog of /code-review and /simplify, pointed at WCAG/ARIA. Reviews just your diff (or a package/file), rates findings by severity, and either comments inline on the PR (--comment) or applies the safe fixes for you (--fix). Steers the depth-aware `a11y` subagent. Use when asked to "check accessibility", "a11y this", "audit ARIA/keyboard", or run /a11y.

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

ask-human

無料

Emit a blocking question the owner can read in ~10 seconds and answer in one reply — the scannable, recommendation-first handoff every agent posts when it hits a fork it can't own. Leads with the one decision + a recommendation, carries the 🤖 provenance header, doubles as the

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

audit

無料

Audit packages for documentation completeness, detect drift between code and docs, and maintain documentation quality across the monorepo. Use when checking package docs, running audits, or reviewing documentation health.

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

When a bug or regression is reported, the FIRST step — before fixing — is to research how and when it was introduced (git archaeology), then record that finding on the tracking issue/PR. Use the moment a bug, error, broken build, or "this used to work" is reported, before writing a fix. Produces a first-bad-commit (or "not a code regression") note you paste onto the issue.

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

commit

無料

Smart, granular git commits following monorepo conventions. Analyzes changes, filters to session-relevant files, groups by intent, and uses conventional commit format. Use when committing code changes.

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

The crouton-conformance gate — the SECOND acceptance axis of graduation (the first is the experience side-by-side, /graduate stage C1). Checks a graduated app is a REAL crouton app — CLI-scaffolded, real collections, consumes the correct packages without reinventing them — by composing the existing probes (frontend-review, a11y, e2e-smoke, typecheck) plus crouton-structural checks, then renders a required, signed-off checklist on the graduation PR. Use at /graduate stage C2, or when asked "is this app crouton-native", "run the conformance gate", "check graduation conformance".

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

FriendlyInternet/nuxt-crouton102026年10月6日 更新

FriendlyInternet のスキルをすべて見る

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