Progressive width gated status rows

From ychampion/cskill-agents · View interactive version

Progressive width gated status rows is an AI agent skill from the GitHub repository ychampion/cskill-agents. Show status metadata only when the spinner row has room, shrinking entries as viewport width decreases.

How to use this skill

Skill file

SKILL: Progressive Width Gated Status Rows

Domain: status-rows

Trigger: Apply this when terminal status rows need to show token counters, timers, and thinking text but must drop elements as available width shrinks.

Source Pattern: Distilled from reviewed terminal rendering, layout, animation, and accessibility implementations.

Core Method

Treat the spinner row as three segments (timer, tokens, thinking) and calculate their widths against the current column count every animation frame. Start with the high-priority spinner glyph plus message, then gate the timer/tokens/thinking segments one by one: if there isn’t enough remaining width, drop the lowest-priority segment, and shrink the thinking text to a bare “thinking” label before giving up on showing it. Recompute using memoized string widths and reuse the shared animation clock so the gating logic runs only while the spinner is active.

Key Rules

Example Application

In a CLI showing tool outputs plus spinner, follow this skill by measuring string width for each segment and gating tokens/timers per frame, ensuring the row never wraps or pushes subsequent lines on narrow terminals.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.