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

layout-debug

Diagnose and fix Flutter layout, overflow, unbounded constraint, scroll, and responsive rendering issues in this repository while preserving the template's existing feature, theme, localization, and shared widget patterns. Use when UI overflows, text clips, widgets disappear, layouts fail on mobile/tablet/desktop, or a feature needs responsive behavior.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.9 KB

SKILL.md(原文)

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

Flutter Template Layout Debug

Use this skill for UI fixes and responsive layout work in this Flutter template.

Read First

  • AGENTS.md
  • docs/PROJECT_OVERVIEW.md
  • docs/PROJECT_GUIDELINES.md
  • The affected *_page.dart and *_page_content.dart
  • Shared widgets in lib/common/component/ or lib/common/composition/ used by the screen

Error Signatures

Map console/stack-trace error strings directly to fixes before broader diagnosis:

  • "Vertical viewport was given unbounded height" — a scrollable (ListView, GridView) sits inside an unconstrained vertical parent (usually a Column). Wrap the scrollable in Expanded, or give it an explicit height via SizedBox/ConstrainedBox.
  • "An InputDecorator...cannot have an unbounded width" — a TextField/TextFormField sits inside an unconstrained horizontal parent (usually a Row). Wrap it in Expanded or Flexible.
  • "RenderFlex overflowed by N pixels" — a Row/Column child requests more space than the parent allows (yellow/black stripes). Wrap the overflowing child in Expanded or Flexible, or let text wrap.
  • "Incorrect use of ParentData widget" — Expanded/Flexible is not a direct child of a Row/Column/Flex, or Positioned is not a direct child of a Stack. Move it so it is.
  • "RenderBox was not laid out" — cascading side effect, not the root cause. Ignore it and look further up the output for the primary constraint violation above.

Diagnosis Checklist

  1. Reproduce or identify the failing viewport, text scale, platform, and state.
  2. Inspect the nearest Row, Column, Stack, ListView, SingleChildScrollView, Expanded, Flexible, and fixed-size widget.
  3. Find whether the problem is:
    • missing constraints
    • conflicting constraints
    • unbounded scrollable content
    • fixed dimensions where content is dynamic
    • text that cannot wrap or scale within its parent
    • a Stack or overlay that visually collides with later content
  4. Fix the closest layout cause instead of papering over the symptom with arbitrary sizes.

Responsive Guidance

  • Prefer LayoutBuilder when a widget must adapt to the actual space its parent gives it.
  • Prefer MediaQuery.sizeOf(context) only when the whole screen size matters.
  • Use constrained widths for readable desktop/tablet content, but keep page sections unframed unless an existing shared composition already frames that content.
  • Use breakpoints only when the UI meaningfully changes. Avoid sprinkling one-off magic numbers through child widgets.
  • Keep page widgets thin; place responsive branching in *_page_content.dart or a small local helper widget.

Constraint Patterns

  • In a Row, wrap long text or flexible content with Expanded or Flexible.
  • In a Column, avoid placing unconstrained scrollables directly inside another unbounded parent.
  • Give grids and fixed-format controls stable dimensions with aspectRatio, SliverGridDelegate, ConstrainedBox, or SizedBox when dynamic content would otherwise shift layout.
  • Use SingleChildScrollView for small form-like pages that can overflow vertically.
  • Use CustomScrollView or slivers for larger composed screens with independently sized sections.
  • Use SafeArea or existing system-bar helpers when content collides with system UI.

Text And Accessibility

  • Let user-facing strings wrap unless truncation is clearly intended.
  • Use maxLines and overflow only when the design has a real truncation rule.
  • Verify button labels, tab labels, and card text at narrow widths.
  • Do not solve text overflow by scaling font size with viewport width.

Workflow

  1. Read the affected widgets and shared components.
  2. Identify the smallest widget that owns the broken constraints.
  3. Patch the layout using existing theme/context extensions and shared widgets.
  4. Add or update a widget test when the issue can be captured deterministically.
  5. Run a narrow test when available:
    fvm flutter test test/path/to/file_test.dart
    
  6. Run fvm flutter analyze when the fix touches source code.

Completion Criteria

  • No overflow or unbounded-constraint failure remains for the reported state.
  • The fix works for narrow mobile and wider tablet/desktop constraints when the screen supports those platforms.
  • Text remains readable, wraps or truncates intentionally, and does not overlap neighboring UI.
  • The solution follows existing feature and shared-widget boundaries.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

Build/test/lint verification pass for this Flutter app — runs codegen, analyze, test, then iOS + Android native builds in parallel, then `dart format`. Does NOT commit anything; leaves the working tree dirty so the user can review and commit on demand. Used at the end of the prd → techspec → tasks → implement-tasks-sequence flow before `pr-review`, and can also be invoked manually when the user says "verify build", "run full verification", or "check everything".

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

strvcom/flutter-template242026年6月18日 更新

create-pr

無料

Create or update a GitHub PR for this Flutter repository using gh CLI. Verifies the work with build-verify and pr-review, generates an inline PR description, commits pending changes when approved, pushes, and opens or updates the PR. Supports stacked PRs by asking for the base branch when detection is ambiguous. Use when the user says "create PR", "open PR", "push PR", or wants to submit their work for review.

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

strvcom/flutter-template242026年6月18日 更新

Build a full feature in this Flutter repository that includes backend or storage data flow: read API schema, create DTOs, map DTOs to entities, add Riverpod use cases, connect feature state, and render UI data. Use when a task goes beyond a screen and needs real data integration.

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

strvcom/flutter-template242026年6月18日 更新

Create a new Flutter screen in this repository using the existing feature structure, AutoRoute setup, Riverpod state pattern, and code generation workflow. Use when adding a new page, route, stateful screen, or feature folder in this template.

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

strvcom/flutter-template242026年6月18日 更新

implement

無料

Implement a single Flutter task following this repository's Riverpod, Freezed, AutoRoute, DTO/entity, codegen, and verification conventions. Reads the task definition, PRD, and tech spec, then executes the implementation. When invoked standalone, verifies the change; when invoked by implement-tasks-sequence, writes code only and leaves verification to start-job/build-verify. Use when the user says "implement task X", "work on task X", or wants to execute a specific task from the task list.

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

strvcom/flutter-template242026年6月18日 更新

Orchestrates implementation of all tasks for a feature using an agent team. Respects task dependencies, runs tasks in correct order, parallelizes independent tasks. Does NOT build, run tests, or commit at any point — verification is delegated to the caller (typically `/start-job`, which runs `build-verify` and `pr-review uncommitted` afterwards). Use when the user says "implement all tasks", "run the task sequence", "implement the feature", or wants to execute multiple tasks from a task list end-to-end.

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

strvcom/flutter-template242026年6月18日 更新

strvcom のスキルをすべて見る

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