Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

axiom-auto-layout-debugging

БесплатноБез исполняемых скриптовНе проверен

Use when encountering "Unable to simultaneously satisfy constraints" errors, constraint conflicts, ambiguous layout warnings, or views positioned incorrectly…

ComeOnOliverот ComeOnOliver★ 67 звёзд на GitHub

Об этом скилле

Auto Layout Debugging

When to Use This Skill

Use when:

  • Seeing "Unable to simultaneously satisfy constraints" errors in console
  • Views positioned incorrectly or not appearing
  • Constraint warnings during app launch or navigation
  • Ambiguous layout errors
  • Views appearing at unexpected sizes
  • Debug View Hierarchy shows misaligned views
  • Storyboard/XIB constraints behaving differently at runtime

Overview

Core Principle: Auto Layout constraint errors follow predictable patterns. Systematic debugging with proper tools identifies issues in minutes instead of hours.

Time Savings: Typical constraint debugging without this workflow: 30-60 minutes. With systematic approach: 5-10 minutes.


Quick Decision Tree

Constraint error in console?
├─ Can't identify which views?
│  └─ Use Symbolic Breakpoint + Memory Address Identification
├─ Constraint conflicts shown?
│  └─ Use Constraint Priority Resolution
├─ Ambiguous layout (multiple solutions)?
│  └─ Use _autolayoutTrace to find missing constraints
└─ Views positioned incorrectly but no errors?
   └─ Use Debug View Hierarchy + Show Constraints

Understanding Constraint Error Messages

Anatomy of Error Message

Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list you don't need.

(
    "<NSLayoutConstraint:0x7f8b9c6...  'UIView-Encapsulated-Layout-Width' ... (active)>",
    "<NSLayoutConstraint:0x7f8b9c5...  UILabel:0x7f8b9c4... .width == 300   (active)>",
    "<NSLayoutConstraint:0x7f8b9c3...  UILabel:0x7f8b9c4... .leading == ... + 20   (active)>",
    "<NSLayoutConstraint:0x7f8b9c2...  ... .trailing == UILabel:0x7f8b9c4... .trailing + 20   (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f8b9c5... UILabel:0x7f8b9c4... .width == 300   (active)>

Key Components:

  1. Memory addresses — 0x7f8b9c4... identifies views and constraints
  2. Visual Format — Human-readable constraint description
  3. (active) status — Constraint is currently enforced
  4. Recovery action — Which constraint system will break (usually lowest priority)

System-Generated Constraints

UIView-Encapsulated-Layout-Width/Height:

  • Created by UIKit for cells, system views
  • Often source of conflicts
  • Usually correct; your constraints are the problem

Autoresizing Mask Constraints:

  • Format: h=--& or v=&--
  • - = fixed dimension
  • & = flexible dimension
  • Example: h=--& = fixed left margin and width, flexible right margin

Debugging Workflow

Step 1: Set Up Symbolic Breakpoint (One-Time Setup)

Purpose: Break when constraint conflict occurs, before system breaks constraint.

Setup:

  1. Open Breakpoint Navigator (⌘+7 or ⌘+8)
  2. Click + → "Symbolic Breakpoint"
  3. Symbol: UIViewAlertForUnsatisfiableConstraints
  4. (Optional) Add Action → "Sound" → select sound
  5. (Optional) Check "Automatically continue after evaluating actions"

Why this works: Pauses execution at exact moment of constraint conflict, giving you debugger access to all views and constraints.


Step 2: Identify Views from Memory Addresses

When breakpoint hits, console shows memory addresses like UILabel:0x7f8b9c4...

Technique 1: Use %rbx Register (When Breakpoint Hits)

# Print all involved views and constraints
po $arg1

# Or on older Xcode versions
po $rbx

Output: NSArray containing all conflicting constraints and affected views.

Technique 2: Set View Background Color

# Set background color on suspected view
expr ((UIView *)0x7f8b9c4...).backgroundColor = [UIColor redColor]

# Continue execution to see which view turned red

Result: Visually identifies which view corresponds to memory address.

Technique 3: Print View Hierarchy

Objective-C projects:

po [[UIWindow keyWindow] _autolayoutTrace]

Swift projects:

expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace]

Output: Entire view hierarchy with * marking ambiguous layouts.

Example:

*<UIView:0x7f8b9c4...>
|   <UILabel:0x7f8b9c3...>

The * indicates this UIView has ambiguous constraints.

Technique 4: Print Constraints for Specific View

# Horizontal constraints (axis: 0)
po [0x7f8b9c4... constraintsAffectingLayoutForAxis:0]

# Vertical constraints (axis: 1)
po [0x7f8b9c4... constraintsAffectingLayoutForAxis:1]

Output: All constraints affecting that view's layout.


Step 3: Use Debug View Hierarchy

When to use: Views positioned incorrectly, constraints not visible in code.

Workflow:

  1. Trigger the issue — Navigate to screen with constraint problems
  2. Pause execution — Click "Debug View Hierarchy" button in debug bar (or Debug → View Debugging → Capture View Hierarchy)
  3. Inspect 3D view — Rotate view hierarchy to see layering
  4. Enable "Show Constraints" — Shows all constraints as lines
  5. **Se
Полный SKILL.md на GitHub

Установить axiom-auto-layout-debugging в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл axiom-auto-layout-debugging?

Use when encountering "Unable to simultaneously satisfy constraints" errors, constraint conflicts, ambiguous layout warnings, or views positioned incorrectly - systematic debugging workflow for Auto Layout issues in iOS

Как установить скилл axiom-auto-layout-debugging?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл axiom-auto-layout-debugging запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить axiom-auto-layout-debugging с